dev
parent
daf1864ba8
commit
94eb782211
|
@ -29,7 +29,7 @@ export function addAttrInfo(data) {
|
||||||
// 修改品牌信息
|
// 修改品牌信息
|
||||||
export function updateAttrInfo(data) {
|
export function updateAttrInfo(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/product/attrInfo/'+data.id,
|
url: '/product/attrInfo/',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-card>
|
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
|
||||||
<el-form-item label="品牌名称" prop="name">
|
<el-form-item label="品牌名称" prop="name">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.name"
|
v-model="queryParams.name"
|
||||||
placeholder="请输入品牌名称"
|
placeholder="请输入品牌名称"
|
||||||
clearable
|
clearable
|
||||||
|
size="small"
|
||||||
@keyup.enter.native="handleQuery"
|
@keyup.enter.native="handleQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
@ -24,8 +24,9 @@
|
||||||
icon="el-icon-plus"
|
icon="el-icon-plus"
|
||||||
size="mini"
|
size="mini"
|
||||||
@click="handleAdd"
|
@click="handleAdd"
|
||||||
v-hasPermi="['brand:brand:add']"
|
v-hasPermi="['product:brand:add']"
|
||||||
>新增</el-button>
|
>新增
|
||||||
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
|
@ -35,8 +36,9 @@
|
||||||
size="mini"
|
size="mini"
|
||||||
:disabled="single"
|
:disabled="single"
|
||||||
@click="handleUpdate"
|
@click="handleUpdate"
|
||||||
v-hasPermi="['brand:brand:edit']"
|
v-hasPermi="['product:brand:edit']"
|
||||||
>修改</el-button>
|
>修改
|
||||||
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
|
@ -46,8 +48,9 @@
|
||||||
size="mini"
|
size="mini"
|
||||||
:disabled="multiple"
|
:disabled="multiple"
|
||||||
@click="handleDelete"
|
@click="handleDelete"
|
||||||
v-hasPermi="['brand:brand:remove']"
|
v-hasPermi="['product:brand:remove']"
|
||||||
>删除</el-button>
|
>删除
|
||||||
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
|
@ -56,35 +59,30 @@
|
||||||
icon="el-icon-download"
|
icon="el-icon-download"
|
||||||
size="mini"
|
size="mini"
|
||||||
@click="handleExport"
|
@click="handleExport"
|
||||||
v-hasPermi="['brand:brand:export']"
|
v-hasPermi="['product:brand:export']"
|
||||||
>导出</el-button>
|
>导出
|
||||||
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-card>
|
|
||||||
|
|
||||||
<el-card>
|
<el-table v-loading="loading" :data="infoList" @selection-change="handleSelectionChange">
|
||||||
<i class="el-icon-tickets">品牌数据列表</i>
|
<el-table-column type="selection" width="55" align="center"/>
|
||||||
</el-card>
|
<el-table-column label="ID" align="center" prop="id"/>
|
||||||
|
<el-table-column label="品牌名称" align="center" prop="name"/>
|
||||||
<el-card>
|
<el-table-column label="品牌描述" align="center" prop="productDesc"/>
|
||||||
<el-table v-loading="loading" :data="brandList" @selection-change="handleSelectionChange">
|
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
|
||||||
<el-table-column label="编号" align="center" prop="id" />
|
|
||||||
<el-table-column label="品牌名称" align="center" prop="name" />
|
|
||||||
<el-table-column label="品牌描述" align="center" prop="productDesc" />
|
|
||||||
<el-table-column label="品牌介绍" align="center" prop="content">
|
<el-table-column label="品牌介绍" align="center" prop="content">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<img :src="scope.row.content" alt="品牌介绍" width="80px" height="80px"/>
|
<img :src="scope.row.content">
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="品牌logo" align="center" prop="logo">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<img :src="scope.row.logo" alt="品牌logo" width="50px" height="50px" />
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="品牌状态" align="center" prop="status" >
|
|
||||||
|
|
||||||
|
<el-table-column label="品牌logo" align="center" prop="logo" style="height: 50px">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<img :src="scope.row.logo">
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="品牌状态" align="center" prop="status">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-switch
|
<el-switch
|
||||||
v-model="scope.row.status"
|
v-model="scope.row.status"
|
||||||
|
@ -101,6 +99,7 @@
|
||||||
|
|
||||||
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
|
@ -108,15 +107,17 @@
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-edit"
|
icon="el-icon-edit"
|
||||||
@click="handleUpdate(scope.row)"
|
@click="handleUpdate(scope.row)"
|
||||||
v-hasPermi="['brand:brand:edit']"
|
v-hasPermi="['product:brand:edit']"
|
||||||
>修改</el-button>
|
>修改
|
||||||
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-delete"
|
icon="el-icon-delete"
|
||||||
@click="handleDelete(scope.row)"
|
@click="handleDelete(scope.row)"
|
||||||
v-hasPermi="['brand:brand:remove']"
|
v-hasPermi="['product:brand:remove']"
|
||||||
>删除</el-button>
|
>删除
|
||||||
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
@ -133,38 +134,35 @@
|
||||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
<el-form-item label="品牌名称" prop="name">
|
<el-form-item label="品牌名称" prop="name">
|
||||||
<el-input v-model="form.name" placeholder="请输入品牌名称" />
|
<el-input v-model="form.name" placeholder="请输入品牌名称"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="品牌描述" prop="productDesc">
|
<el-form-item label="品牌描述" prop="productDesc">
|
||||||
<el-input v-model="form.productDesc" placeholder="请输入品牌描述" />
|
<el-input v-model="form.productDesc" placeholder="请输入品牌描述"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="品牌介绍">
|
<el-form-item label="品牌介绍">
|
||||||
<image-upload v-model="form.content" placeholder="请输入品牌logo" :limit="1" :is-show-tip="false"/>
|
<editor v-model="form.content" :min-height="192"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="品牌logo" prop="logo">
|
||||||
|
<ImageUpload v-model="form.logo" placeholder="请输入品牌logo"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-col>
|
|
||||||
<el-form-item label="品牌logo" prop="image">
|
|
||||||
<image-upload v-model="form.logo" placeholder="请输入品牌logo" :limit="1" :is-show-tip="false"/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
<el-button @click="cancel">取 消</el-button>
|
<el-button @click="cancel">取 消</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</el-card>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listBrand, getBrand, delBrand, addBrand, updateBrand } from "@/api/product/brand";
|
import {listBrand, getBrand, delBrand, addBrand, updateBrand} from "@/api/product/brand";
|
||||||
|
import {updateInfo} from "@/api/product/info";
|
||||||
import ImageUpload from "@/components/ImageUpload"
|
import ImageUpload from "@/components/ImageUpload"
|
||||||
export default {
|
export default {
|
||||||
components: {ImageUpload},
|
components:{ImageUpload},
|
||||||
name: "Brand",
|
name: "Info",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
value: true,
|
|
||||||
// 遮罩层
|
// 遮罩层
|
||||||
loading: true,
|
loading: true,
|
||||||
// 选中数组
|
// 选中数组
|
||||||
|
@ -178,7 +176,7 @@ export default {
|
||||||
// 总条数
|
// 总条数
|
||||||
total: 0,
|
total: 0,
|
||||||
// 商品品牌表格数据
|
// 商品品牌表格数据
|
||||||
brandList: [],
|
infoList: [],
|
||||||
// 弹出层标题
|
// 弹出层标题
|
||||||
title: "",
|
title: "",
|
||||||
// 是否显示弹出层
|
// 是否显示弹出层
|
||||||
|
@ -194,13 +192,10 @@ export default {
|
||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {
|
rules: {
|
||||||
createBy: [
|
createBy: [
|
||||||
{ required: true, message: "创建人不能为空", trigger: "blur" }
|
{required: true, message: "创建人不能为空", trigger: "blur"}
|
||||||
],
|
],
|
||||||
createTime: [
|
createTime: [
|
||||||
{ required: true, message: "创建时间不能为空", trigger: "blur" }
|
{required: true, message: "创建时间不能为空", trigger: "blur"}
|
||||||
],
|
|
||||||
name: [
|
|
||||||
{ required: true, message: "请输入品牌名称", trigger: "blur" }
|
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -209,16 +204,15 @@ export default {
|
||||||
this.getList();
|
this.getList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
updateBrandStatus(params){
|
updateBrandStatus(params) {
|
||||||
console.log(params);
|
const {id, status} = params
|
||||||
const {id,status} = params;
|
this.updateInfoById({id, status})
|
||||||
this.handleUpdate(id,status);
|
|
||||||
},
|
},
|
||||||
/** 查询商品品牌列表 */
|
/** 查询商品品牌列表 */
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
listBrand(this.queryParams).then(response => {
|
listBrand(this.queryParams).then(response => {
|
||||||
this.brandList = response.data.list;
|
this.infoList = response.data.list;
|
||||||
this.total = response.data.total;
|
this.total = response.data.total;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
});
|
});
|
||||||
|
@ -236,7 +230,7 @@ export default {
|
||||||
productDesc: null,
|
productDesc: null,
|
||||||
content: null,
|
content: null,
|
||||||
logo: null,
|
logo: null,
|
||||||
status: null,
|
status: "0",
|
||||||
revision: null,
|
revision: null,
|
||||||
createBy: null,
|
createBy: null,
|
||||||
createTime: null,
|
createTime: null,
|
||||||
|
@ -258,7 +252,7 @@ export default {
|
||||||
// 多选框选中数据
|
// 多选框选中数据
|
||||||
handleSelectionChange(selection) {
|
handleSelectionChange(selection) {
|
||||||
this.ids = selection.map(item => item.id)
|
this.ids = selection.map(item => item.id)
|
||||||
this.single = selection.length!==1
|
this.single = selection.length !== 1
|
||||||
this.multiple = !selection.length
|
this.multiple = !selection.length
|
||||||
},
|
},
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
|
@ -282,7 +276,7 @@ export default {
|
||||||
this.$refs["form"].validate(valid => {
|
this.$refs["form"].validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (this.form.id != null) {
|
if (this.form.id != null) {
|
||||||
this.updateBrandInfoById(this.form)
|
this.updateInfoById(this.form)
|
||||||
} else {
|
} else {
|
||||||
addBrand(this.form).then(response => {
|
addBrand(this.form).then(response => {
|
||||||
this.$modal.msgSuccess("新增成功");
|
this.$modal.msgSuccess("新增成功");
|
||||||
|
@ -293,28 +287,31 @@ export default {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
updateBrandInfoById(data){
|
|
||||||
|
updateInfoById(data) {
|
||||||
updateBrand(data).then(response => {
|
updateBrand(data).then(response => {
|
||||||
this.$modal.msgSuccess("修改成功");
|
this.$modal.msgSuccess("修改成功");
|
||||||
this.open = false;
|
this.open = false;
|
||||||
this.getList();
|
this.getList();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
const ids = row.id || this.ids;
|
const ids = row.id || this.ids;
|
||||||
this.$modal.confirm('是否确认删除商品品牌编号为"' + ids + '"的数据项?').then(function() {
|
this.$modal.confirm('是否确认删除商品品牌编号为"' + ids + '"的数据项?').then(function () {
|
||||||
return delBrand(ids);
|
return delBrand(ids);
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.getList();
|
this.getList();
|
||||||
this.$modal.msgSuccess("删除成功");
|
this.$modal.msgSuccess("删除成功");
|
||||||
}).catch(() => {});
|
}).catch(() => {
|
||||||
|
});
|
||||||
},
|
},
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
handleExport() {
|
handleExport() {
|
||||||
this.download('product/brand/export', {
|
this.download('product/brand/export', {
|
||||||
...this.queryParams
|
...this.queryParams
|
||||||
}, `brand_${new Date().getTime()}.xlsx`)
|
}, `info_${new Date().getTime()}.xlsx`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -66,7 +66,11 @@
|
||||||
<el-table-column label="ID" align="center" prop="id" />
|
<el-table-column label="ID" align="center" prop="id" />
|
||||||
<el-table-column label="商品名称" align="center" prop="productId" />
|
<el-table-column label="商品名称" align="center" prop="productId" />
|
||||||
<el-table-column label="商品SKU" align="center" prop="productRuleCententId" />
|
<el-table-column label="商品SKU" align="center" prop="productRuleCententId" />
|
||||||
<el-table-column label="商品评价图片" align="center" prop="reviewImages" />
|
<el-table-column label="商品评价图片" align="center" prop="reviewImages" >
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<img :src="scope.row.reviewImages" alt="加载失败" width="80px" height="80px"/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="商品评价信息" align="center" prop="content" />
|
<el-table-column label="商品评价信息" align="center" prop="content" />
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
|
<el-card class="box-card">
|
||||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
<el-form-item label="商品名称" prop="name">
|
<el-form-item label="商品名称" prop="name">
|
||||||
<el-input
|
<el-input
|
||||||
|
@ -60,12 +61,13 @@
|
||||||
</el-col>
|
</el-col>
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
<el-card>
|
<el-card>
|
||||||
<i class="el-icon-tickets">商品信息数据列表</i>
|
<i class="el-icon-tickets">商品信息数据列表</i>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<el-card>
|
<el-card class="box-card">
|
||||||
<el-table v-loading="loading" :data="infoList" @selection-change="handleSelectionChange">
|
<el-table v-loading="loading" :data="infoList" @selection-change="handleSelectionChange">
|
||||||
<el-table-column type="selection" width="60" align="center" />
|
<el-table-column type="selection" width="60" align="center" />
|
||||||
<el-table-column label="ID" align="center" prop="id" />
|
<el-table-column label="ID" align="center" prop="id" />
|
||||||
|
@ -97,7 +99,23 @@
|
||||||
<el-table-column label="商品评论数" align="center" prop="commentCount" />
|
<el-table-column label="商品评论数" align="center" prop="commentCount" />
|
||||||
<el-table-column label="商品收藏人气" align="center" prop="collectCount" />
|
<el-table-column label="商品收藏人气" align="center" prop="collectCount" />
|
||||||
<el-table-column label="品牌信息" align="center" prop="brand" />
|
<el-table-column label="品牌信息" align="center" prop="brand" />
|
||||||
<el-table-column label="商品状态" align="center" prop="status" />
|
|
||||||
|
<el-table-column label="品牌状态" align="center" prop="status">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-switch
|
||||||
|
v-model="scope.row.status"
|
||||||
|
active-color="#13ce66"
|
||||||
|
inactive-color="#ff4949"
|
||||||
|
active-text="上架"
|
||||||
|
inactive-text="下架"
|
||||||
|
inactive-value="0"
|
||||||
|
active-value="1"
|
||||||
|
@change="updateInfoStatus(scope.row)"
|
||||||
|
>
|
||||||
|
</el-switch>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column label="单位" align="center" prop="unit" />
|
<el-table-column label="单位" align="center" prop="unit" />
|
||||||
<el-table-column label="搜索关键字" align="center" prop="keywords" />
|
<el-table-column label="搜索关键字" align="center" prop="keywords" />
|
||||||
<el-table-column label="规格信息" align="center" prop="ruleId" />
|
<el-table-column label="规格信息" align="center" prop="ruleId" />
|
||||||
|
@ -179,11 +197,10 @@
|
||||||
|
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<div class="grid-content bg-purple">
|
<div class="grid-content bg-purple">
|
||||||
<el-form-item label="分类" prop="brand">
|
<el-form-item label="分类" prop="type">
|
||||||
|
|
||||||
<el-cascader
|
<el-cascader
|
||||||
v-model="form.type"
|
v-model="form.type"
|
||||||
:options="categoryList"
|
:options="typeList"
|
||||||
:props="{ expandTrigger: 'hover' ,value:'catId',label:'name',children:'childrenList'}"
|
:props="{ expandTrigger: 'hover' ,value:'catId',label:'name',children:'childrenList'}"
|
||||||
@change="handleChange"></el-cascader>
|
@change="handleChange"></el-cascader>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
@ -256,9 +273,9 @@
|
||||||
|
|
||||||
<el-col :span="5">
|
<el-col :span="5">
|
||||||
<el-button type="primary" @click="onSubmit">立即同步</el-button>
|
<el-button type="primary" @click="onSubmit">立即同步</el-button>
|
||||||
<el-button type="primary" @click="onClear">取消</el-button>
|
<el-button type="warning" @click="onClear">取消</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
|
|
||||||
|
@ -267,20 +284,14 @@
|
||||||
<el-table
|
<el-table
|
||||||
:data="tableBodyTemplate"
|
:data="tableBodyTemplate"
|
||||||
style="width: 100%">
|
style="width: 100%">
|
||||||
<!-- <el-table-column label="商品轮播图" align="center" prop="carouselImages" >-->
|
|
||||||
<!-- <template slot-scope="scope">-->
|
|
||||||
<!-- <img :src="scope.row.carouselImages" alt="加载失败" width="80px" height="80px"/>-->
|
|
||||||
<!-- </template>-->
|
|
||||||
<!-- </el-table-column>-->
|
|
||||||
|
|
||||||
<el-table-column v-for="column in tableColumnHeaderTemplate"
|
<el-table-column v-for="column in tableColumnHeaderTemplate"
|
||||||
:prop="column.prop"
|
:prop="column.prop"
|
||||||
:label="column.label">
|
:label="column.label">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{scope.row[column.prop]}}
|
|
||||||
<el-input-number v-if="column.prop.indexOf('image') == -1 && column.prop.indexOf('xxx') == -1"
|
<el-input-number v-if="column.prop.indexOf('image') == -1 && column.prop.indexOf('xxx') == -1"
|
||||||
v-model="scope.row[column.prop]" :min="1" :max="9999999999" label="描述" style="width: 120px" ></el-input-number>
|
v-model="scope.row[column.prop]" :min="1" :max="9999999999" label="描述" style="width: 120px" ></el-input-number>
|
||||||
<ImageUpload v-else-if="column.prop.indexOf('image') > -1 " v-model="scope.row[column.prop]" :limit="1" style="width: 120px "></ImageUpload>
|
<ImageUpload v-else-if="column.prop.indexOf('image') > -1 " v-model="scope.row[column.prop]" :limit="1" style="width: 120px "></ImageUpload>
|
||||||
|
<span v-else>{{scope.row[column.prop]}}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
|
@ -290,9 +301,8 @@
|
||||||
|
|
||||||
|
|
||||||
<div v-show="active==2">
|
<div v-show="active==2">
|
||||||
<el-form-item label="商品描述" prop="productDesc">
|
<el-button @click="pc = true; move =false">商品描述</el-button>
|
||||||
<el-input v-model="form.productDesc" type="textarea" placeholder="请输入内容" />
|
<editor v-if="pc" v-model="form.productDesc" :min-height="150"/>
|
||||||
</el-form-item>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
@ -310,36 +320,34 @@
|
||||||
<script>
|
<script>
|
||||||
import { listInfo, getInfo, delInfo, addInfo, updateInfo } from "@/api/product/info";
|
import { listInfo, getInfo, delInfo, addInfo, updateInfo } from "@/api/product/info";
|
||||||
import ImageUpload from "@/components/ImageUpload"
|
import ImageUpload from "@/components/ImageUpload"
|
||||||
import { listBrand } from "@/api/product/brand"
|
import {listBrand, updateBrand} from "@/api/product/brand"
|
||||||
import { listRule } from "@/api/product/rule"
|
import { listRule } from "@/api/product/rule"
|
||||||
import { listType } from "@/api/product/type"
|
import { listType } from "@/api/product/type"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components:{ImageUpload},
|
components:{ImageUpload},
|
||||||
name: "Info",
|
name: "Info",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
categoryList: [],
|
//富文本
|
||||||
|
pc:true,
|
||||||
|
move:false,
|
||||||
|
typeList: [],
|
||||||
tableColumnHeaderTemplate:[],
|
tableColumnHeaderTemplate:[],
|
||||||
tableBodyTemplate:[
|
tableBodyTemplate:[],
|
||||||
// {'stock':'商品库存1',price: "1",purchasePrice:"1",sellingPrice:"1",image:"1",number:"1",weight:"1",volume:"1"},
|
|
||||||
// {'stock':'商品库存2',price: "1",purchasePrice:"1",sellingPrice:"1",image:"1",number:"1",weight:"1",volume:"1"},
|
|
||||||
// {'stock':'商品库存3',price: "1",purchasePrice:"1",sellingPrice:"1",image:"1",number:"1",weight:"1",volume:"1"},
|
|
||||||
// {'stock':'商品库存4',price: "1",purchasePrice:"1",sellingPrice:"1",image:"1",number:"1",weight:"1",volume:"1"},
|
|
||||||
// {'stock':'商品库存5',price: "1",purchasePrice:"1",sellingPrice:"1",image:"1",number:"1",weight:"1",volume:"1"},
|
|
||||||
// {'stock':'商品库存6',price: "1",purchasePrice:"1",sellingPrice:"1",image:"1",number:"1",weight:"1",volume:"1"},
|
|
||||||
// {'stock':'商品库存7',price: "1",purchasePrice:"1",sellingPrice:"1",image:"1",number:"1",weight:"1",volume:"1"},
|
|
||||||
// {'stock':'商品库存8',price: "1",purchasePrice:"1",sellingPrice:"1",image:"1",number:"1",weight:"1",volume:"1"},
|
|
||||||
// {'stock':'商品库存9',price: "1",purchasePrice:"1",sellingPrice:"1",image:"1",number:"1",weight:"1",volume:"1"},
|
|
||||||
],
|
|
||||||
active: 0,
|
active: 0,
|
||||||
rule: [],
|
rule: [],
|
||||||
ruleAttrList:[],
|
ruleAttrList:[],
|
||||||
brandList:[],
|
brandList:[],
|
||||||
ruleList:[],
|
ruleList:[],
|
||||||
tableData:[],
|
tableData:[],
|
||||||
|
MallProductInfoList: [],
|
||||||
|
stepsMap: {
|
||||||
|
0: '添加商品信息',
|
||||||
|
1: '添加规格信息',
|
||||||
|
2: '添加描述信息',
|
||||||
|
},
|
||||||
skuFormTemplate:{
|
skuFormTemplate:{
|
||||||
'stock': '0',
|
'stock': '0',
|
||||||
'price': '0',
|
'price': '0',
|
||||||
|
@ -394,11 +402,20 @@ export default {
|
||||||
this.getList();
|
this.getList();
|
||||||
this.initBrandListInfo();
|
this.initBrandListInfo();
|
||||||
this.initRuleListInfo();
|
this.initRuleListInfo();
|
||||||
|
this.initTypeListInfo();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleChange() {
|
|
||||||
|
handleChange(){
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
updateInfoStatus(params) {
|
||||||
|
const {id, status} = params
|
||||||
|
this.updateInfoById({id, status})
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
onSubmit() {
|
onSubmit() {
|
||||||
this.settingsOrnClear(true)
|
this.settingsOrnClear(true)
|
||||||
},
|
},
|
||||||
|
@ -411,7 +428,7 @@ export default {
|
||||||
for (let skuFormTemplateKey in this.skuFormTemplate) {
|
for (let skuFormTemplateKey in this.skuFormTemplate) {
|
||||||
this.tableBodyTemplate.forEach(item=>{
|
this.tableBodyTemplate.forEach(item=>{
|
||||||
for (let itemKey in item) {
|
for (let itemKey in item) {
|
||||||
if(skuFormTemplateKey==itemKey){
|
if(skuFormTemplateKey===itemKey){
|
||||||
if(flag){
|
if(flag){
|
||||||
item[itemKey]=this.skuFormTemplate[skuFormTemplateKey]
|
item[itemKey]=this.skuFormTemplate[skuFormTemplateKey]
|
||||||
}else{
|
}else{
|
||||||
|
@ -451,6 +468,7 @@ export default {
|
||||||
for (let i = 0; i < ruleAttrJson[index].ruleAttrList.length; i++) {
|
for (let i = 0; i < ruleAttrJson[index].ruleAttrList.length; i++) {
|
||||||
const updatedCurrent = {...current}; // Create a copy of current object
|
const updatedCurrent = {...current}; // Create a copy of current object
|
||||||
updatedCurrent[`xxx${index}`] = ruleAttrJson[index].ruleAttrList[i];
|
updatedCurrent[`xxx${index}`] = ruleAttrJson[index].ruleAttrList[i];
|
||||||
|
current['image'] = '';
|
||||||
cartesian(ruleAttrJson, index + 1, updatedCurrent);
|
cartesian(ruleAttrJson, index + 1, updatedCurrent);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -468,6 +486,17 @@ export default {
|
||||||
{prop:'volume',label:'体积'},
|
{prop:'volume',label:'体积'},
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
/** 查询商品类型**/
|
||||||
|
initTypeListInfo() {
|
||||||
|
let prams = {
|
||||||
|
status : 0
|
||||||
|
};
|
||||||
|
listType(prams).then(res => {
|
||||||
|
if(200 == res.code){
|
||||||
|
this.typeList = res.data.list;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
/**查询商品规格**/
|
/**查询商品规格**/
|
||||||
initRuleListInfo() {
|
initRuleListInfo() {
|
||||||
let params = {
|
let params = {
|
||||||
|
@ -490,22 +519,45 @@ export default {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
// 上一步
|
||||||
step() {
|
step() {
|
||||||
this.active--;
|
this.active--;
|
||||||
},
|
},
|
||||||
|
// 下一步
|
||||||
next() {
|
next() {
|
||||||
this.active++;
|
this.active++;
|
||||||
},
|
},
|
||||||
|
|
||||||
/** 查询商品信息列表 */
|
/** 查询商品信息列表 */
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
listInfo(this.queryParams).then(response => {
|
listInfo(this.queryParams).then(response => {
|
||||||
this.infoList = response.data.list;
|
let productInfoList = response.data.list;
|
||||||
|
productInfoList.forEach(item => {
|
||||||
|
let num = item.step;
|
||||||
|
item.step = this.switchStepByNum(num)
|
||||||
|
})
|
||||||
|
this.infoList = productInfoList;
|
||||||
this.total = response.data.total;
|
this.total = response.data.total;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 取消按钮
|
|
||||||
|
// 根据num切换step
|
||||||
|
switchStepByNum(num) {
|
||||||
|
if (num == null || num == '' || num == undefined) {
|
||||||
|
this.$modal.msgError("num is NULL");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let stepsMapKey in this.stepsMap) {
|
||||||
|
|
||||||
|
if (num == stepsMapKey) {
|
||||||
|
return this.stepsMap[stepsMapKey];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// * 取消按钮
|
||||||
cancel() {
|
cancel() {
|
||||||
this.open = false;
|
this.open = false;
|
||||||
this.reset();
|
this.reset();
|
||||||
|
@ -574,11 +626,7 @@ export default {
|
||||||
this.$refs["form"].validate(valid => {
|
this.$refs["form"].validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (this.form.id != null) {
|
if (this.form.id != null) {
|
||||||
updateInfo(this.form).then(response => {
|
this.updateInfoById(this.form)
|
||||||
this.$modal.msgSuccess("修改成功");
|
|
||||||
this.open = false;
|
|
||||||
this.getList();
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
addInfo(this.form).then(response => {
|
addInfo(this.form).then(response => {
|
||||||
this.$modal.msgSuccess("新增成功");
|
this.$modal.msgSuccess("新增成功");
|
||||||
|
@ -589,6 +637,15 @@ export default {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
updateInfoById(data) {
|
||||||
|
updateInfo(data).then(response => {
|
||||||
|
this.$modal.msgSuccess("修改成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
const ids = row.id || this.ids;
|
const ids = row.id || this.ids;
|
||||||
|
|
|
@ -14,7 +14,6 @@
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
|
@ -67,7 +66,6 @@
|
||||||
<el-table-column label="商品" align="center" prop="productId" />
|
<el-table-column label="商品" align="center" prop="productId" />
|
||||||
<el-table-column label="商品SKU" align="center" prop="productRuleCententId" />
|
<el-table-column label="商品SKU" align="center" prop="productRuleCententId" />
|
||||||
<el-table-column label="录入库存数量" align="center" prop="stockNum" />
|
<el-table-column label="录入库存数量" align="center" prop="stockNum" />
|
||||||
<el-table-column label="乐观锁" align="center" prop="revision" />
|
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
|
|
|
@ -80,8 +80,7 @@
|
||||||
<span style="margin-left: 10px" v-if="scope.row.catLevel==3">三级</span>
|
<span style="margin-left: 10px" v-if="scope.row.catLevel==3">三级</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" prop="showStatus" >
|
<el-table-column label="是否显示" align="center" prop="showStatus" >
|
||||||
|
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-switch
|
<el-switch
|
||||||
v-model="scope.row.showStatus"
|
v-model="scope.row.showStatus"
|
||||||
|
@ -89,8 +88,8 @@
|
||||||
inactive-color="#ff4949"
|
inactive-color="#ff4949"
|
||||||
active-text="显式"
|
active-text="显式"
|
||||||
inactive-text="不显示"
|
inactive-text="不显示"
|
||||||
inactive-value="1"
|
inactive-value="0"
|
||||||
active-value="0"
|
active-value="1"
|
||||||
@change="updateShowStatus(scope.row)"
|
@change="updateShowStatus(scope.row)"
|
||||||
>
|
>
|
||||||
</el-switch>
|
</el-switch>
|
||||||
|
@ -98,14 +97,9 @@
|
||||||
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="排序" align="center" prop="sort" />
|
<el-table-column label="排序" align="center" prop="sort" />
|
||||||
<el-table-column label="图标地址" align="center" prop="icon">
|
<el-table-column label="图标地址" align="center" prop="icon" style="width: 35px" />
|
||||||
<template slot-scope="scope">
|
|
||||||
<img :src="scope.row.icon">
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="计量单位" align="center" prop="productUnit" />
|
<el-table-column label="计量单位" align="center" prop="productUnit" />
|
||||||
<el-table-column label="商品数量" align="center" prop="productCount" />
|
<el-table-column label="商品数量" align="center" prop="productCount" />
|
||||||
|
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
|
@ -151,7 +145,7 @@
|
||||||
<el-input v-model="form.sort" placeholder="请输入排序" />
|
<el-input v-model="form.sort" placeholder="请输入排序" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="图标地址" prop="icon">
|
<el-form-item label="图标地址" prop="icon">
|
||||||
<el-input v-model="form.icon" placeholder="请输入图标地址" />
|
<ImageUpload v-model="form.icon" placeholder="请输入图标地址" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="计量单位" prop="productUnit">
|
<el-form-item label="计量单位" prop="productUnit">
|
||||||
<el-input v-model="form.productUnit" placeholder="请输入计量单位" />
|
<el-input v-model="form.productUnit" placeholder="请输入计量单位" />
|
||||||
|
@ -171,9 +165,10 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {listType, getType, delType, addType, updateType} from "@/api/product/type";
|
import {listType, getType, delType, addType, updateType} from "@/api/product/type";
|
||||||
|
import ImageUpload from "@/components/ImageUpload/index.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
components:{ImageUpload},
|
||||||
name: "Category",
|
name: "Category",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -213,7 +208,6 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
|
|
||||||
updateShowStatus(params){
|
updateShowStatus(params){
|
||||||
const {catId,showStatus}=params
|
const {catId,showStatus}=params
|
||||||
this.updateInfoByCategoryId({catId,showStatus})
|
this.updateInfoByCategoryId({catId,showStatus})
|
||||||
|
@ -317,7 +311,6 @@ export default {
|
||||||
updateType(data).then(response => {
|
updateType(data).then(response => {
|
||||||
this.$modal.msgSuccess("修改成功");
|
this.$modal.msgSuccess("修改成功");
|
||||||
this.open = false;
|
this.open = false;
|
||||||
this.getList();
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue