|
|
@@ -27,13 +27,13 @@
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
- <el-form-item label="商品类型" prop="productType">
|
|
|
- <el-select v-model="queryParams.productType" placeholder="请选择商品类型" clearable size="small" >
|
|
|
+ <el-form-item label="商品类型" prop="productTypes">
|
|
|
+ <el-select v-model="queryParams.productTypes" multiple placeholder="请选择商品类型" clearable size="small" >
|
|
|
<el-option
|
|
|
v-for="item in productTypeOptions"
|
|
|
:key="item.dictValue"
|
|
|
:label="item.dictLabel"
|
|
|
- :value="item.dictValue"
|
|
|
+ :value="Number(item.dictValue)"
|
|
|
/>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
@@ -596,12 +596,12 @@
|
|
|
<!-- </el-col>-->
|
|
|
<!-- </el-row>-->
|
|
|
<el-form-item label="标签类型" prop="tagType">
|
|
|
- <el-select v-model="tagType" placeholder="请选择标签类型" clearable style="width: 100%" @change="onTagTypeChange">
|
|
|
+ <el-select v-model="tagType" multiple placeholder="请选择标签类型" clearable style="width: 100%" @change="onTagTypeChange">
|
|
|
<el-option label="不分润商品" value="no_commission" />
|
|
|
<el-option label="预售商品" value="presale" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="最晚发货时间" prop="presaleShippingTime" v-if="tagType === 'presale'">
|
|
|
+ <el-form-item label="最晚发货时间" prop="presaleShippingTime" v-if="tagType && tagType.includes('presale')">
|
|
|
<el-date-picker
|
|
|
v-model="presaleShippingTime"
|
|
|
type="datetime"
|
|
|
@@ -941,6 +941,11 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item label="所属公司">
|
|
|
<el-select style="width: 240px" v-model="form.companyIds" multiple placeholder="请选择企业" clearable size="small" >
|
|
|
+ <div style="padding: 0 20px; display: flex; justify-content: space-between; line-height: 34px;">
|
|
|
+ <el-button type="text" size="mini" @click="form.companyIds = companyOptions.map(item => item.companyId)">全选</el-button>
|
|
|
+ <el-button type="text" size="mini" @click="form.companyIds = companyOptions.map(item => item.companyId).filter(id => !form.companyIds.includes(id))">反选</el-button>
|
|
|
+ <el-button type="text" size="mini" @click="form.companyIds = []">清空</el-button>
|
|
|
+ </div>
|
|
|
<el-option
|
|
|
v-for="item in companyOptions"
|
|
|
:key="item.companyId"
|
|
|
@@ -1233,7 +1238,7 @@ export default {
|
|
|
],
|
|
|
photoArr:[],
|
|
|
imageArr:[],
|
|
|
- tagType: null,
|
|
|
+ tagType: [],
|
|
|
presaleShippingTime: null,
|
|
|
activeName:"1",
|
|
|
productTypeOptions:[],
|
|
|
@@ -1273,6 +1278,7 @@ export default {
|
|
|
pageSize: 10,
|
|
|
productName: null,
|
|
|
productType: null,
|
|
|
+ productTypes: [],
|
|
|
isShow: "1",
|
|
|
barCode:null,
|
|
|
companyIds: null,
|
|
|
@@ -1840,7 +1846,7 @@ export default {
|
|
|
},
|
|
|
// 标签类型变更
|
|
|
onTagTypeChange(val) {
|
|
|
- if (val !== 'presale') {
|
|
|
+ if (!val || !val.includes('presale')) {
|
|
|
this.presaleShippingTime = null;
|
|
|
}
|
|
|
},
|
|
|
@@ -1920,7 +1926,7 @@ export default {
|
|
|
tagInfo: null // 标签信息
|
|
|
};
|
|
|
// 重置标签类型和预售发货时间
|
|
|
- this.tagType = null;
|
|
|
+ this.tagType = [];
|
|
|
this.presaleShippingTime = null;
|
|
|
// 重置药品展示图
|
|
|
this.drugImageArr = [];
|
|
|
@@ -2027,14 +2033,21 @@ export default {
|
|
|
if (this.form.tagInfo) {
|
|
|
try {
|
|
|
const tagObj = JSON.parse(this.form.tagInfo);
|
|
|
- this.tagType = tagObj.type || null;
|
|
|
+ // type 兼容单值(旧)和数组(新)
|
|
|
+ if (Array.isArray(tagObj.type)) {
|
|
|
+ this.tagType = tagObj.type;
|
|
|
+ } else if (tagObj.type) {
|
|
|
+ this.tagType = [tagObj.type];
|
|
|
+ } else {
|
|
|
+ this.tagType = [];
|
|
|
+ }
|
|
|
this.presaleShippingTime = tagObj.shippingTime || null;
|
|
|
} catch (e) {
|
|
|
- this.tagType = null;
|
|
|
+ this.tagType = [];
|
|
|
this.presaleShippingTime = null;
|
|
|
}
|
|
|
} else {
|
|
|
- this.tagType = null;
|
|
|
+ this.tagType = [];
|
|
|
this.presaleShippingTime = null;
|
|
|
}
|
|
|
this.$set(this.form, 'userEndCategoryIds', (response.userEndCategoryIds || []).map(id => Number(id)).filter(id => !Number.isNaN(id)));
|
|
|
@@ -2126,9 +2139,9 @@ export default {
|
|
|
this.form.companyIds = this.form.companyIds.join(',');
|
|
|
}
|
|
|
// 组装标签信息 tagInfo
|
|
|
- if (this.tagType) {
|
|
|
+ if (this.tagType && this.tagType.length > 0) {
|
|
|
const tagObj = { type: this.tagType };
|
|
|
- if (this.tagType === 'presale' && this.presaleShippingTime) {
|
|
|
+ if (this.tagType.includes('presale') && this.presaleShippingTime) {
|
|
|
tagObj.shippingTime = this.presaleShippingTime;
|
|
|
}
|
|
|
this.form.tagInfo = JSON.stringify(tagObj);
|