|
|
@@ -38,7 +38,7 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="商品种类" prop="productKind">
|
|
|
- <el-select v-model="queryParams.productKind" placeholder="请选择商品种类" clearable size="small" >
|
|
|
+ <el-select v-model="queryParams.productKind" placeholder="请选择商品种类" clearable multiple size="small" >
|
|
|
<el-option
|
|
|
v-for="item in productKindOptions"
|
|
|
:key="item.dictValue"
|
|
|
@@ -183,7 +183,7 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column label="种类" align="center" prop="productKind" >
|
|
|
<template slot-scope="scope">
|
|
|
- <el-tag prop="productKind" v-for="(item, index) in productKindOptions" v-if="scope.row.productKind==item.dictValue">{{item.dictLabel}}</el-tag>
|
|
|
+ <el-tag v-for="(kind, idx) in getProductKindArr(scope.row.productKind)" :key="idx" style="margin: 2px;">{{ getProductKindLabel(kind) }}</el-tag>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="状态" align="center" prop="isShow" >
|
|
|
@@ -551,7 +551,7 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="商品种类" prop="productKind">
|
|
|
- <el-select style="width: 240px" v-model="form.productKind" placeholder="请选择商品种类" clearable size="small" >
|
|
|
+ <el-select style="width: 240px" v-model="form.productKind" placeholder="请选择商品种类" clearable multiple size="small" >
|
|
|
<el-option
|
|
|
v-for="item in productKindOptions"
|
|
|
:key="item.dictValue"
|
|
|
@@ -736,7 +736,7 @@ export default {
|
|
|
productType: null,
|
|
|
isShow: "1",
|
|
|
barCode:null,
|
|
|
- productKind:null,
|
|
|
+ productKind:[],
|
|
|
|
|
|
},
|
|
|
// 表单参数
|
|
|
@@ -1013,7 +1013,13 @@ export default {
|
|
|
/** 查询商品列表 */
|
|
|
getList() {
|
|
|
this.loading = true;
|
|
|
- listStoreProduct(this.queryParams).then(response => {
|
|
|
+ const params = {
|
|
|
+ ...this.queryParams,
|
|
|
+ productKind: Array.isArray(this.queryParams.productKind) && this.queryParams.productKind.length > 0
|
|
|
+ ? this.queryParams.productKind.join(',')
|
|
|
+ : null
|
|
|
+ };
|
|
|
+ listStoreProduct(params).then(response => {
|
|
|
this.storeProductList = response.rows;
|
|
|
this.total = response.total;
|
|
|
this.loading = false;
|
|
|
@@ -1034,7 +1040,7 @@ export default {
|
|
|
productInfo: null,
|
|
|
keyword: null,
|
|
|
barCode: null,
|
|
|
- productKind: "1",
|
|
|
+ productKind: [],
|
|
|
cateId: null,
|
|
|
price: null,
|
|
|
vipPrice: null,
|
|
|
@@ -1137,7 +1143,9 @@ export default {
|
|
|
this.form.productType = response.data.productType.toString();
|
|
|
this.form.isDisplay = response.data.isDisplay.toString();
|
|
|
this.form.specialProducts = response.data.specialProducts || 0;
|
|
|
- this.form.productKind = response.data.productKind.toString();
|
|
|
+ this.form.productKind = response.data.productKind
|
|
|
+ ? response.data.productKind.toString().split(',').filter(item => item !== '')
|
|
|
+ : [];
|
|
|
|
|
|
this.warehouseModel = response.data.warehouseId
|
|
|
|
|
|
@@ -1209,7 +1217,13 @@ export default {
|
|
|
if(this.form.specType === 1 && this.manyFormValidate.length===0){
|
|
|
return this.$message.warning('请点击生成规格!');
|
|
|
}
|
|
|
- addOrEdit(this.form).then(response => {
|
|
|
+ const submitData = {
|
|
|
+ ...this.form,
|
|
|
+ productKind: Array.isArray(this.form.productKind) && this.form.productKind.length > 0
|
|
|
+ ? this.form.productKind.join(',')
|
|
|
+ : null
|
|
|
+ };
|
|
|
+ addOrEdit(submitData).then(response => {
|
|
|
if (response.code === 200) {
|
|
|
this.msgSuccess("修改成功");
|
|
|
this.open = false;
|
|
|
@@ -1278,6 +1292,14 @@ export default {
|
|
|
}).then(response => {
|
|
|
this.download(response.msg);
|
|
|
}).catch(function() {});
|
|
|
+ },
|
|
|
+ getProductKindArr(kind) {
|
|
|
+ if (!kind) return [];
|
|
|
+ return kind.toString().split(',').filter(item => item !== '');
|
|
|
+ },
|
|
|
+ getProductKindLabel(kind) {
|
|
|
+ const item = this.productKindOptions.find(opt => opt.dictValue === kind);
|
|
|
+ return item ? item.dictLabel : kind;
|
|
|
}
|
|
|
}
|
|
|
};
|