|
@@ -260,7 +260,7 @@
|
|
<a-form-model-item label="产品范围">
|
|
<a-form-model-item label="产品范围">
|
|
<div id="setPromotion-productRange" style="position:relative;">
|
|
<div id="setPromotion-productRange" style="position:relative;">
|
|
<a-tree-select
|
|
<a-tree-select
|
|
- v-model="form.promoRule.productRangeList"
|
|
|
|
|
|
+ v-model="productRangeList"
|
|
:maxTagCount="12"
|
|
:maxTagCount="12"
|
|
:tree-data="productTypeList"
|
|
:tree-data="productTypeList"
|
|
tree-checkable
|
|
tree-checkable
|
|
@@ -375,6 +375,7 @@ export default {
|
|
labelCol: { span: 2 },
|
|
labelCol: { span: 2 },
|
|
wrapperCol: { span: 20 }
|
|
wrapperCol: { span: 20 }
|
|
},
|
|
},
|
|
|
|
+ productRangeList: [], // 产品范围列表
|
|
// 链接配置内容
|
|
// 链接配置内容
|
|
form: {
|
|
form: {
|
|
promoActiveSn: undefined, // 促销活动sn
|
|
promoActiveSn: undefined, // 促销活动sn
|
|
@@ -389,7 +390,7 @@ export default {
|
|
dealerEditFlag: '0', // 加盟商编辑 1是 0否
|
|
dealerEditFlag: '0', // 加盟商编辑 1是 0否
|
|
promoRule: {
|
|
promoRule: {
|
|
ruleType: 'ticket', // 基本规则类型
|
|
ruleType: 'ticket', // 基本规则类型
|
|
- productRangeList: [], // 产品范围列表
|
|
|
|
|
|
+
|
|
ruleName: '', // 券名称
|
|
ruleName: '', // 券名称
|
|
ruleTitle: '', // 副标题
|
|
ruleTitle: '', // 副标题
|
|
ruleBaseType: 'category', // 券生成方式
|
|
ruleBaseType: 'category', // 券生成方式
|
|
@@ -447,8 +448,6 @@ export default {
|
|
insterProduct (obj) {
|
|
insterProduct (obj) {
|
|
if (obj && Object.keys(obj).length > 0) {
|
|
if (obj && Object.keys(obj).length > 0) {
|
|
this.chooseTypeList = obj.typeArr
|
|
this.chooseTypeList = obj.typeArr
|
|
- this.chooseDataList = obj.productArr
|
|
|
|
- this.chooseProductList = obj.chooseProductArr
|
|
|
|
}
|
|
}
|
|
this.showProModal = true
|
|
this.showProModal = true
|
|
},
|
|
},
|
|
@@ -500,11 +499,11 @@ export default {
|
|
_this.isShowNextStep = true
|
|
_this.isShowNextStep = true
|
|
_this.form.promoRule.range = '1'
|
|
_this.form.promoRule.range = '1'
|
|
_this.time = [res.data.promoRule.validStartDate, res.data.promoRule.validEndDate]
|
|
_this.time = [res.data.promoRule.validStartDate, res.data.promoRule.validEndDate]
|
|
- 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 })
|
|
|
|
|
|
+ if (res.data.promoRule.productRangeList && res.data.promoRule.productRangeList.length > 0) {
|
|
|
|
+ _this.productRangeList = res.data.promoRule.productRangeList.map(item => { return item.productTypeSn })
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- this.form.promoRule = { ...this.form.promoRule, ...res.data.promoRule }
|
|
|
|
|
|
+ _this.form.promoRule = { ..._this.form.promoRule, ...res.data.promoRule }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
})
|
|
})
|
|
@@ -538,10 +537,10 @@ export default {
|
|
_this.form.promoActiveSn = this.$route.params.sn
|
|
_this.form.promoActiveSn = this.$route.params.sn
|
|
var formData = JSON.parse(JSON.stringify(_this.form))
|
|
var formData = JSON.parse(JSON.stringify(_this.form))
|
|
formData.imageSet = formData.imageSet ? formData.imageSet.split(',') : []
|
|
formData.imageSet = formData.imageSet ? formData.imageSet.split(',') : []
|
|
-
|
|
|
|
// 跳转链接
|
|
// 跳转链接
|
|
if (formData.contentType == 'LINK') {
|
|
if (formData.contentType == 'LINK') {
|
|
delete formData.contentLink
|
|
delete formData.contentLink
|
|
|
|
+
|
|
if (formData.promoRule.productRangeList && formData.promoRule.productRangeList.length > 0) {
|
|
if (formData.promoRule.productRangeList && formData.promoRule.productRangeList.length > 0) {
|
|
formData.promoRule.productRangeList = formData.promoRule.productRangeList.map(item => { return { productTypeSn: item } })
|
|
formData.promoRule.productRangeList = formData.promoRule.productRangeList.map(item => { return { productTypeSn: item } })
|
|
}
|
|
}
|
|
@@ -564,10 +563,8 @@ export default {
|
|
if (_this.$refs.chooseProductList) {
|
|
if (_this.$refs.chooseProductList) {
|
|
const numInfo = _this.$refs.chooseProductList.getDataNum()
|
|
const numInfo = _this.$refs.chooseProductList.getDataNum()
|
|
if (numInfo == 0) {
|
|
if (numInfo == 0) {
|
|
- if (!_this.form.promoRule.validDays) {
|
|
|
|
- _this.$message.warning('请选择返券产品!')
|
|
|
|
- return false
|
|
|
|
- }
|
|
|
|
|
|
+ _this.$message.warning('请选择返券产品!')
|
|
|
|
+ return
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
@@ -628,9 +625,9 @@ export default {
|
|
publishFlag: '0', // 是否发布
|
|
publishFlag: '0', // 是否发布
|
|
dealerEditFlag: '0', // 加盟商编辑 1是 0否
|
|
dealerEditFlag: '0', // 加盟商编辑 1是 0否
|
|
ruleEnableFlag: '1',
|
|
ruleEnableFlag: '1',
|
|
|
|
+ productRangeList: [], // 产品范围列表
|
|
promoRule: {
|
|
promoRule: {
|
|
ruleType: 'ticket', // 基本规则类型
|
|
ruleType: 'ticket', // 基本规则类型
|
|
- productRangeList: [], // 产品范围列表
|
|
|
|
ruleName: '', // 券名称
|
|
ruleName: '', // 券名称
|
|
ruleTitle: '', // 副标题
|
|
ruleTitle: '', // 副标题
|
|
ruleBaseType: 'category', // 券生成方式
|
|
ruleBaseType: 'category', // 券生成方式
|
|
@@ -723,13 +720,13 @@ export default {
|
|
})
|
|
})
|
|
},
|
|
},
|
|
onChangeTree (e) {
|
|
onChangeTree (e) {
|
|
- deleteByProductType({ promoActiveSn: this.$route.params.sn, productTypeSnList: this.form.promoRule.productRangeList || [] }).then(res => {
|
|
|
|
|
|
+ deleteByProductType({ promoActiveSn: this.$route.params.sn, productTypeSnList: this.productRangeList || [] }).then(res => {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
this.$refs.chooseProductList.pageInit()
|
|
this.$refs.chooseProductList.pageInit()
|
|
}
|
|
}
|
|
})
|
|
})
|
|
// 保存产品范围
|
|
// 保存产品范围
|
|
- const newArr = this.form.promoRule.productRangeList.map(item => {
|
|
|
|
|
|
+ const newArr = this.productRangeList.map(item => {
|
|
return {
|
|
return {
|
|
promoActiveSn: this.$route.params.sn,
|
|
promoActiveSn: this.$route.params.sn,
|
|
promoRuleSn: this.form.promoRule.promoRuleSn,
|
|
promoRuleSn: this.form.promoRule.promoRuleSn,
|