|
|
@@ -595,6 +595,21 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</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">
|
|
|
<Material v-model="imageArr" type="image" :num="1" :width="150" :height="150" />
|
|
|
</el-form-item>
|
|
|
@@ -1253,6 +1268,8 @@ export default {
|
|
|
],
|
|
|
photoArr:[],
|
|
|
imageArr:[],
|
|
|
+ tagType: null,
|
|
|
+ presaleShippingTime: null,
|
|
|
activeName:"1",
|
|
|
productTypeOptions:[],
|
|
|
isDisplayOptions:[],
|
|
|
@@ -1743,6 +1760,12 @@ export default {
|
|
|
this.open = false;
|
|
|
this.reset();
|
|
|
},
|
|
|
+ // 标签类型变更
|
|
|
+ onTagTypeChange(val) {
|
|
|
+ if (val !== 'presale') {
|
|
|
+ this.presaleShippingTime = null;
|
|
|
+ }
|
|
|
+ },
|
|
|
// 表单重置
|
|
|
reset() {
|
|
|
this.form = {
|
|
|
@@ -1808,8 +1831,12 @@ export default {
|
|
|
adverseReactions: null, // 不良反应
|
|
|
contraindications: null, // 禁忌
|
|
|
precautions: null, // 注意事项
|
|
|
- purchaseLimit: null // 限购数量
|
|
|
+ purchaseLimit: null, // 限购数量
|
|
|
+ tagInfo: null // 标签信息
|
|
|
};
|
|
|
+ // 重置标签类型和预售发货时间
|
|
|
+ this.tagType = null;
|
|
|
+ this.presaleShippingTime = null;
|
|
|
// 重置药品展示图
|
|
|
this.drugImageArr = [];
|
|
|
this.resetForm("form");
|
|
|
@@ -1903,9 +1930,23 @@ export default {
|
|
|
});
|
|
|
}
|
|
|
// 组装companyIds
|
|
|
- if (response.data.companyIds != null && response.data.companyIds != undefined && response.data.companyIds.length > 0) {
|
|
|
+ if (this.form.companyIds != null && this.form.companyIds != undefined && response.data.companyIds.length > 0) {
|
|
|
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.appIds = this.form.appIds ? this.form.appIds.split(',') : [];
|
|
|
setTimeout(() => {
|
|
|
that.generate();
|
|
|
@@ -1967,6 +2008,16 @@ export default {
|
|
|
if (this.form.companyIds != null && this.form.companyIds != undefined) {
|
|
|
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;
|
|
|
+ }
|
|
|
// 小程序
|
|
|
const params = {
|
|
|
...this.form,
|