|
@@ -10,22 +10,36 @@
|
|
|
>
|
|
|
<a-spin :spinning="spinning" tip="Loading...">
|
|
|
<div style="padding: 0 30px;" v-if="total">
|
|
|
- <aRadio :style="radioStyle" value="0" v-if="pageType">
|
|
|
- 不参加促销
|
|
|
- </aRadio>
|
|
|
- <!-- 非叠加 -->
|
|
|
- <div v-for="(item,idx) in activeList" :key="idx">
|
|
|
- <div>
|
|
|
- <strong >{{ item.title }}</strong>
|
|
|
- </div>
|
|
|
- <aRadioGroup v-model="upActiveVal" v-if="!pageType">
|
|
|
- <aRadio :style="radioStyle" v-for="(sitem,sindex) in item.promotionRule" :key="sindex" :value="item.promotionSn+'-'+sitem.promotionRuleSn+'-'+sitem.promotionProductType">
|
|
|
- {{ sindex+1 }}、{{ sitem.description }}
|
|
|
+ <!-- 非叠加活动 -->
|
|
|
+ <div>
|
|
|
+ <aRadioGroup v-model="upActiveVal" @change="(e)=>{upActiveValArr=[]}">
|
|
|
+ <aRadio :style="radioStyle" value="-1" v-if="pageType">
|
|
|
+ 不参加促销
|
|
|
+ </aRadio>
|
|
|
+ <div>
|
|
|
+ <strong >非叠加活动</strong>
|
|
|
+ </div>
|
|
|
+ <aRadio
|
|
|
+ :style="radioStyle"
|
|
|
+ v-for="(item,sindex) in noStackActiveList"
|
|
|
+ :key="item.id"
|
|
|
+ :value="item.salesPromoSn">
|
|
|
+ {{ sindex+1 }}、{{ item.description }}
|
|
|
</aRadio>
|
|
|
</aRadioGroup>
|
|
|
- <a-checkbox-group @change="onChange" v-else>
|
|
|
- <a-checkbox value="A" v-for="(sitem,sindex) in item.promotionRule" :key="sindex">
|
|
|
- {{ sindex+1 }}、{{ sitem.description }}
|
|
|
+ </div>
|
|
|
+ <!-- 叠加活动 -->
|
|
|
+ <div>
|
|
|
+ <div>
|
|
|
+ <strong >叠加活动</strong>
|
|
|
+ </div>
|
|
|
+ <a-checkbox-group v-model="upActiveValArr" @change="(e)=>{upActiveVal=null}">
|
|
|
+ <a-checkbox
|
|
|
+ :style="radioStyle"
|
|
|
+ v-for="(item,sindex) in stackActiveList"
|
|
|
+ :value="item.salesPromoSn"
|
|
|
+ :key="item.id">
|
|
|
+ {{ sindex+1 }}、{{ item.description }}
|
|
|
</a-checkbox>
|
|
|
</a-checkbox-group>
|
|
|
</div>
|
|
@@ -60,7 +74,8 @@ export default {
|
|
|
spinning: false,
|
|
|
confirmLoading: false,
|
|
|
upActiveVal: null,
|
|
|
- radioStyle: "display:block;height: '30px';lineHeight: '30px';padding:5px 0;",
|
|
|
+ upActiveValArr: [],
|
|
|
+ radioStyle: "display:block;height: '30px';lineHeight: '30px';padding:5px 0;margin:0;",
|
|
|
activeList: [],
|
|
|
editRow: null
|
|
|
}
|
|
@@ -77,11 +92,11 @@ export default {
|
|
|
},
|
|
|
// 叠加活动
|
|
|
stackActiveList () {
|
|
|
- return this.activeList.filter(item => item.promotion.stackFlag == 1)
|
|
|
+ return this.activeList.filter(item => item.stackFlag == 1)
|
|
|
},
|
|
|
// 非叠加活动
|
|
|
noStackActiveList () {
|
|
|
- return this.activeList.filter(item => item.promotion.stackFlag !== 1)
|
|
|
+ return this.activeList.filter(item => item.stackFlag == 0)
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -97,9 +112,16 @@ export default {
|
|
|
handleSubmit (e) {
|
|
|
e.preventDefault()
|
|
|
const _this = this
|
|
|
- if (_this.upActiveVal) {
|
|
|
+ if (_this.upActiveVal || this.upActiveValArr.length) {
|
|
|
+ let salesPromoSnList = []
|
|
|
+ // 不参与
|
|
|
+ if (this.upActiveVal == '-1') {
|
|
|
+ salesPromoSnList = []
|
|
|
+ } else {
|
|
|
+ salesPromoSnList = this.upActiveVal ? [this.upActiveVal] : this.upActiveValArr
|
|
|
+ }
|
|
|
_this.confirmLoading = true
|
|
|
- _this.$emit('ok', _this.upActiveVal, _this.editRow)
|
|
|
+ _this.$emit('ok', salesPromoSnList, _this.editRow)
|
|
|
} else {
|
|
|
_this.$message.info('请选择活动规则!')
|
|
|
}
|
|
@@ -108,6 +130,7 @@ export default {
|
|
|
if (!this.confirmLoading) {
|
|
|
this.opened = false
|
|
|
this.upActiveVal = null
|
|
|
+ this.upActiveValArr = []
|
|
|
this.$emit('cancel')
|
|
|
} else {
|
|
|
this.$message.info('正在更换促销,请勿关闭!')
|