|
@@ -595,6 +595,21 @@
|
|
|
<!-- </el-form-item>-->
|
|
<!-- </el-form-item>-->
|
|
|
<!-- </el-col>-->
|
|
<!-- </el-col>-->
|
|
|
<!-- </el-row>-->
|
|
<!-- </el-row>-->
|
|
|
|
|
+ <el-form-item label="标签类型" prop="tagType">
|
|
|
|
|
+ <el-select v-model="tagType" 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-date-picker
|
|
|
|
|
+ v-model="presaleShippingTime"
|
|
|
|
|
+ type="datetime"
|
|
|
|
|
+ placeholder="请选择最晚发货时间"
|
|
|
|
|
+ value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
|
|
+ style="width: 100%"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="商品图片" prop="image">
|
|
<el-form-item label="商品图片" prop="image">
|
|
|
<Material v-model="imageArr" type="image" :num="1" :width="150" :height="150" />
|
|
<Material v-model="imageArr" type="image" :num="1" :width="150" :height="150" />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -1218,6 +1233,8 @@ export default {
|
|
|
],
|
|
],
|
|
|
photoArr:[],
|
|
photoArr:[],
|
|
|
imageArr:[],
|
|
imageArr:[],
|
|
|
|
|
+ tagType: null,
|
|
|
|
|
+ presaleShippingTime: null,
|
|
|
activeName:"1",
|
|
activeName:"1",
|
|
|
productTypeOptions:[],
|
|
productTypeOptions:[],
|
|
|
isDisplayOptions:[],
|
|
isDisplayOptions:[],
|
|
@@ -1821,6 +1838,12 @@ export default {
|
|
|
this.open = false;
|
|
this.open = false;
|
|
|
this.reset();
|
|
this.reset();
|
|
|
},
|
|
},
|
|
|
|
|
+ // 标签类型变更
|
|
|
|
|
+ onTagTypeChange(val) {
|
|
|
|
|
+ if (val !== 'presale') {
|
|
|
|
|
+ this.presaleShippingTime = null;
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
// 表单重置
|
|
// 表单重置
|
|
|
reset() {
|
|
reset() {
|
|
|
this.form = {
|
|
this.form = {
|
|
@@ -1893,8 +1916,12 @@ export default {
|
|
|
purchaseLimit: null, // 限购数量
|
|
purchaseLimit: null, // 限购数量
|
|
|
singlePurchaseLimit: null, // 单次购买数量上限
|
|
singlePurchaseLimit: null, // 单次购买数量上限
|
|
|
userEndCategoryIds: [],
|
|
userEndCategoryIds: [],
|
|
|
- tagIds: []
|
|
|
|
|
|
|
+ tagIds: [],
|
|
|
|
|
+ tagInfo: null // 标签信息
|
|
|
};
|
|
};
|
|
|
|
|
+ // 重置标签类型和预售发货时间
|
|
|
|
|
+ this.tagType = null;
|
|
|
|
|
+ this.presaleShippingTime = null;
|
|
|
// 重置药品展示图
|
|
// 重置药品展示图
|
|
|
this.drugImageArr = [];
|
|
this.drugImageArr = [];
|
|
|
this.resetForm("form");
|
|
this.resetForm("form");
|
|
@@ -1996,6 +2023,20 @@ export default {
|
|
|
if (response.data.companyIds != null && response.data.companyIds != undefined && response.data.companyIds.length > 0) {
|
|
if (response.data.companyIds != null && response.data.companyIds != undefined && response.data.companyIds.length > 0) {
|
|
|
this.form.companyIds = response.data.companyIds.split(',').map(Number);
|
|
this.form.companyIds = response.data.companyIds.split(',').map(Number);
|
|
|
}
|
|
}
|
|
|
|
|
+ // 解析标签信息
|
|
|
|
|
+ if (this.form.tagInfo) {
|
|
|
|
|
+ try {
|
|
|
|
|
+ const tagObj = JSON.parse(this.form.tagInfo);
|
|
|
|
|
+ this.tagType = tagObj.type || null;
|
|
|
|
|
+ this.presaleShippingTime = tagObj.shippingTime || null;
|
|
|
|
|
+ } catch (e) {
|
|
|
|
|
+ this.tagType = null;
|
|
|
|
|
+ this.presaleShippingTime = null;
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.tagType = null;
|
|
|
|
|
+ this.presaleShippingTime = null;
|
|
|
|
|
+ }
|
|
|
this.$set(this.form, 'userEndCategoryIds', (response.userEndCategoryIds || []).map(id => Number(id)).filter(id => !Number.isNaN(id)));
|
|
this.$set(this.form, 'userEndCategoryIds', (response.userEndCategoryIds || []).map(id => Number(id)).filter(id => !Number.isNaN(id)));
|
|
|
this.$set(this.form, 'tagIds', (response.tagIds || []).map(id => Number(id)).filter(id => !Number.isNaN(id)));
|
|
this.$set(this.form, 'tagIds', (response.tagIds || []).map(id => Number(id)).filter(id => !Number.isNaN(id)));
|
|
|
Promise.all([
|
|
Promise.all([
|
|
@@ -2084,6 +2125,16 @@ export default {
|
|
|
if (this.form.companyIds != null && this.form.companyIds != undefined) {
|
|
if (this.form.companyIds != null && this.form.companyIds != undefined) {
|
|
|
this.form.companyIds = this.form.companyIds.join(',');
|
|
this.form.companyIds = this.form.companyIds.join(',');
|
|
|
}
|
|
}
|
|
|
|
|
+ // 组装标签信息 tagInfo
|
|
|
|
|
+ if (this.tagType) {
|
|
|
|
|
+ const tagObj = { type: this.tagType };
|
|
|
|
|
+ if (this.tagType === 'presale' && this.presaleShippingTime) {
|
|
|
|
|
+ tagObj.shippingTime = this.presaleShippingTime;
|
|
|
|
|
+ }
|
|
|
|
|
+ this.form.tagInfo = JSON.stringify(tagObj);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.form.tagInfo = null;
|
|
|
|
|
+ }
|
|
|
addOrEdit(this.form).then(response => {
|
|
addOrEdit(this.form).then(response => {
|
|
|
if (response.code === 200) {
|
|
if (response.code === 200) {
|
|
|
this.msgSuccess("修改成功");
|
|
this.msgSuccess("修改成功");
|