|
@@ -247,7 +247,9 @@ export default {
|
|
restrictCategory: '',
|
|
restrictCategory: '',
|
|
accrualFlag: '1', // 数量叠加
|
|
accrualFlag: '1', // 数量叠加
|
|
regularPromotionSameFlag: '1',
|
|
regularPromotionSameFlag: '1',
|
|
- giftProductMap: {}
|
|
|
|
|
|
+ giftProductMap: {},
|
|
|
|
+ gateInfo: undefined,
|
|
|
|
+ ruleInfo: undefined
|
|
},
|
|
},
|
|
rules: {
|
|
rules: {
|
|
description: [ { required: true, message: '请输入规则简称', trigger: 'blur' } ],
|
|
description: [ { required: true, message: '请输入规则简称', trigger: 'blur' } ],
|
|
@@ -430,6 +432,21 @@ export default {
|
|
})
|
|
})
|
|
form.promotionSn = _this.promotionSn
|
|
form.promotionSn = _this.promotionSn
|
|
form.giveRuleList = _this.fullGiftRuleList
|
|
form.giveRuleList = _this.fullGiftRuleList
|
|
|
|
+ if (form.gateFlag == '1') {
|
|
|
|
+ if (form.gateType === 'RATIO_AMOUNT') {
|
|
|
|
+ form.gateInfo = '购买门槛产品金额' + form.gateValue + '作为配额'
|
|
|
|
+ } else if (form.gateType === 'MIN_AMOUNT') {
|
|
|
|
+ form.gateInfo = '购买门槛产品满最低金额' + form.gateValue + '不限制配额'
|
|
|
|
+ } else {
|
|
|
|
+ form.gateInfo = '购买满' + form.gateValue + '元门槛产品,可使用' + form.quotaAmount + '元配额,采购规则中的正价商品(配额算销售额)'
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ var newInfo = `<div>${form.accrualFlag == '1' ? '数量叠加;' : ''}${form.convertExpenseFlag == '1' ? '可转费用报销单;' : ''}</div>`
|
|
|
|
+ _this.fullGiftRuleList.forEach(item => {
|
|
|
|
+ newInfo += `<div>${form.regularSameFlag == '1' ? '同款' : '不同款'}产品购买满${item.regularValue}${form.regularUnit == 'YUAN' ? '元' : '个'}正价产品,送${item.promotionValue}个促销产品</div>`
|
|
|
|
+ })
|
|
|
|
+ newInfo += form.restrictFlag == '1' ? `<div>限制正价产品${form.restrictCategory}款</div>` : ''
|
|
|
|
+ form.ruleInfo = newInfo
|
|
_this.spinning = true
|
|
_this.spinning = true
|
|
promotionSave(form).then(res => {
|
|
promotionSave(form).then(res => {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
@@ -491,7 +508,9 @@ export default {
|
|
regularPromotionSameFlag: '1',
|
|
regularPromotionSameFlag: '1',
|
|
giftProductMap: {},
|
|
giftProductMap: {},
|
|
gateProductList: undefined,
|
|
gateProductList: undefined,
|
|
- regularProductList: undefined
|
|
|
|
|
|
+ regularProductList: undefined,
|
|
|
|
+ gateInfo: undefined,
|
|
|
|
+ ruleInfo: undefined
|
|
}
|
|
}
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
this.$refs.ruleForm.resetFields()
|
|
this.$refs.ruleForm.resetFields()
|
|
@@ -516,11 +535,11 @@ export default {
|
|
if (resultObj.gateFlag == '1') {
|
|
if (resultObj.gateFlag == '1') {
|
|
resultObj.gateValue = resultObj.gateType === 'RATIO_AMOUNT' ? resultObj.gateValue * 100 : resultObj.gateValue
|
|
resultObj.gateValue = resultObj.gateType === 'RATIO_AMOUNT' ? resultObj.gateValue * 100 : resultObj.gateValue
|
|
}
|
|
}
|
|
- if(resultObj.giveRuleList &&resultObj.giveRuleList.length>0){
|
|
|
|
|
|
+ if (resultObj.giveRuleList && resultObj.giveRuleList.length > 0) {
|
|
_this.fullGiftRuleList = resultObj.giveRuleList
|
|
_this.fullGiftRuleList = resultObj.giveRuleList
|
|
- _this.$nextTick(()=>{
|
|
|
|
- resultObj.giveRuleList.forEach((item,i)=>{
|
|
|
|
- _this.$refs['offerProduct' + i][0].setTabVal(_this.newData(resultObj.giftProductMap['GIFT'+(i*1+1)]))
|
|
|
|
|
|
+ _this.$nextTick(() => {
|
|
|
|
+ resultObj.giveRuleList.forEach((item, i) => {
|
|
|
|
+ _this.$refs['offerProduct' + i][0].setTabVal(_this.newData(resultObj.giftProductMap['GIFT' + (i * 1 + 1)]))
|
|
})
|
|
})
|
|
})
|
|
})
|
|
}
|
|
}
|