|
@@ -174,7 +174,7 @@
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
|
|
|
- <a-form-model-item label="券名称" :label-col="{span:4}" :wrapper-col="{span:16}" prop="ruleName">
|
|
|
+ <a-form-model-item label="券名称" :label-col="{span:4}" :wrapper-col="{span:16}" prop="promoRule.ruleName">
|
|
|
<a-input
|
|
|
:disabled="isDisabled"
|
|
|
id="promotionEdit-ruleName"
|
|
@@ -196,7 +196,7 @@
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
|
|
|
- <a-form-model-item label="生成方式" prop="ruleBaseType">
|
|
|
+ <a-form-model-item label="生成方式" prop="promoRule.ruleBaseType">
|
|
|
<v-select
|
|
|
style="width:40%;"
|
|
|
v-model="form.promoRule.ruleBaseType"
|
|
@@ -207,7 +207,7 @@
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
|
|
|
- <a-form-model-item label="券有效期" prop="validType">
|
|
|
+ <a-form-model-item label="券有效期" prop="promoRule.validType">
|
|
|
<v-select
|
|
|
style="width:40%;"
|
|
|
v-model="form.promoRule.validType"
|
|
@@ -239,12 +239,12 @@
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
|
|
|
- <a-form-model-item class="productName" label="券适用范围" prop="range">
|
|
|
+ <a-form-model-item class="productName" label="券适用范围" prop="promoRule.range">
|
|
|
全部产品
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
|
|
|
- <a-form-model-item label="使用说明" prop="ruleExplain">
|
|
|
+ <a-form-model-item label="使用说明" prop="promoRule.ruleExplain">
|
|
|
<a-input
|
|
|
v-model="form.promoRule.ruleExplain"
|
|
|
:disabled="isDisabled"
|
|
@@ -273,7 +273,7 @@
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
|
|
|
- <a-form-model-item label="返券产品" prop="range">
|
|
|
+ <a-form-model-item label="返券产品" prop="promoRule.range">
|
|
|
<div class="productInfo flex-center">
|
|
|
<div>
|
|
|
返券金额<a-input-number
|
|
@@ -302,7 +302,7 @@
|
|
|
:md="24"
|
|
|
:lg="24"
|
|
|
:xl="24">
|
|
|
- <a-form-model-item label="加盟商编辑" prop="dealerEditFlag">
|
|
|
+ <a-form-model-item label="加盟商编辑" prop="promoRule.dealerEditFlag">
|
|
|
<a-radio-group button-style="solid" :disabled="isDisabled" v-model="form.promoRule.dealerEditFlag">
|
|
|
<a-radio-button value="1">
|
|
|
是
|
|
@@ -314,7 +314,7 @@
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
|
|
|
- <a-form-model-item label="是否发布" prop="publishFlag">
|
|
|
+ <a-form-model-item label="是否发布" prop="promoRule.publishFlag">
|
|
|
<a-radio-group button-style="solid" v-model="form.promoRule.publishFlag">
|
|
|
<a-radio-button value="1">
|
|
|
是
|
|
@@ -375,6 +375,7 @@ export default {
|
|
|
labelCol: { span: 2 },
|
|
|
wrapperCol: { span: 20 }
|
|
|
},
|
|
|
+ // 链接配置内容
|
|
|
form: {
|
|
|
promoActiveSn: undefined, // 促销活动sn
|
|
|
title: '', // 标题
|
|
@@ -398,9 +399,8 @@ export default {
|
|
|
validEndDate: undefined, // 券失效时间
|
|
|
validDays: undefined, // 券有效期天数
|
|
|
dealerEditFlag: '0', // 加盟商编辑 1是 0否
|
|
|
- publishFlag: '0', // 是否发布
|
|
|
- range: '1'
|
|
|
- } // 链接配置内容
|
|
|
+ publishFlag: '0' // 是否发布
|
|
|
+ }
|
|
|
},
|
|
|
time: [], // 有效期
|
|
|
dateFormat: 'YYYY-MM-DD', // 有效期时间格式
|
|
@@ -503,7 +503,6 @@ export default {
|
|
|
if (res.data.promoRule.productRangeList && res.data.promoRule.productRangeList.productRangeList.length > 0) {
|
|
|
_this.form.promoRule.productRangeList = res.data.promoRule.productRangeList.map(item => { return item.productTypeSn })
|
|
|
}
|
|
|
- _this.form.promoRule = res.data.promoRule
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -524,13 +523,13 @@ export default {
|
|
|
},
|
|
|
// 券有效期 change
|
|
|
handleValidType (con) {
|
|
|
- this.sellForm.validType = con
|
|
|
+ this.form.promoRule.validType = con
|
|
|
if (con === 'FIXED') {
|
|
|
- this.sellForm.validDays = undefined
|
|
|
+ this.form.promoRule.validDays = undefined
|
|
|
} else {
|
|
|
this.time = []
|
|
|
- this.sellForm.validStartDate = undefined
|
|
|
- this.sellForm.validEndDate = undefined
|
|
|
+ this.form.promoRule.validStartDate = undefined
|
|
|
+ this.form.promoRule.validEndDate = undefined
|
|
|
}
|
|
|
},
|
|
|
savePartInfo (type) {
|
|
@@ -561,11 +560,13 @@ export default {
|
|
|
} else {
|
|
|
formData.promoRule = undefined
|
|
|
}
|
|
|
- const numInfo = _this.$refs.chooseProductList.getDataNum()
|
|
|
- if (numInfo == 0) {
|
|
|
- if (!_this.form.promoRule.validDays) {
|
|
|
- _this.$message.warning('请选择返券产品!')
|
|
|
- return false
|
|
|
+ if (_this.$refs.chooseProductList) {
|
|
|
+ const numInfo = _this.$refs.chooseProductList.getDataNum()
|
|
|
+ if (numInfo == 0) {
|
|
|
+ if (!_this.form.promoRule.validDays) {
|
|
|
+ _this.$message.warning('请选择返券产品!')
|
|
|
+ return false
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
@@ -694,11 +695,11 @@ export default {
|
|
|
},
|
|
|
// 批量添加
|
|
|
handleBatchAdd () {
|
|
|
- if (!this.sellForm.ruleValue) {
|
|
|
+ if (!this.form.promoRule.ruleValue) {
|
|
|
this.$message.warning('请输入返券金额(需大于0)!')
|
|
|
return
|
|
|
}
|
|
|
- this.$refs.chooseProductList.editMorePrice(this.sellForm.ruleValue)
|
|
|
+ this.$refs.chooseProductList.editMorePrice(this.form.promoRule.ruleValue)
|
|
|
},
|
|
|
// 添加产品成功
|
|
|
addProductSuccess (list) {
|
|
@@ -727,10 +728,10 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
// 保存产品范围
|
|
|
- const newArr = this.sellForm.productRangeList.map(item => {
|
|
|
+ const newArr = this.form.promoRule.productRangeList.map(item => {
|
|
|
return {
|
|
|
promoActiveSn: this.$route.params.sn,
|
|
|
- promoRuleSn: this.sellForm.promoRuleSn,
|
|
|
+ promoRuleSn: this.form.promoRule.promoRuleSn,
|
|
|
productTypeSn: item
|
|
|
}
|
|
|
})
|