|
@@ -77,7 +77,7 @@
|
|
|
</a-form-model>
|
|
|
<a-card size="small" :bordered="false" class="pages-wrap">
|
|
|
<div class="flex">
|
|
|
- <a-radio-group v-model="chooseVal" button-style="solid">
|
|
|
+ <a-radio-group v-model="chooseVal" button-style="solid" @change="onChange">
|
|
|
<a-radio-button value="a" v-show="form.gateFlag==='1'">
|
|
|
门槛产品
|
|
|
</a-radio-button>
|
|
@@ -94,7 +94,7 @@
|
|
|
特价产品
|
|
|
</a-radio-button>
|
|
|
</a-radio-group>
|
|
|
- <a-button type="primary" v-show="isShowPreview" class="button-info" @click="handlePreview">预览</a-button>
|
|
|
+ <a-button type="link" v-show="isShowPreview" class="button-info" @click="handlePreview">预览</a-button>
|
|
|
</div>
|
|
|
<!-- 列表 -->
|
|
|
<div v-show="chooseVal==='a'||chooseVal==='b'||chooseVal==='c'">
|
|
@@ -276,7 +276,7 @@ export default {
|
|
|
productBrandList: [],
|
|
|
productThisList: []
|
|
|
},
|
|
|
- isShowPreview: false,
|
|
|
+
|
|
|
chooseVal: 'a',
|
|
|
columns: [
|
|
|
{ title: '产品分类', width: '30%', scopedSlots: { customRender: 'productType' }, align: 'center' },
|
|
@@ -284,8 +284,9 @@ export default {
|
|
|
{ title: '产品', width: '35%', scopedSlots: { customRender: 'product' }, align: 'center' },
|
|
|
{ title: '设置起订量', width: '20%', scopedSlots: { customRender: 'setNum' }, align: 'center' }
|
|
|
],
|
|
|
- previewList: [],
|
|
|
- openProductModal: false // 产品预览弹窗
|
|
|
+ isShowPreview: false, // 是否显示预览按钮
|
|
|
+ openProductModal: false, // 预览弹窗
|
|
|
+ previewList: []// 预览值
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -380,7 +381,7 @@ export default {
|
|
|
this.isShowPreview = this.judgeBtnShow(res.data.regularProductList)
|
|
|
} else {
|
|
|
this.chooseVal = 'd'
|
|
|
- // this.isShowPreview = this.judgeBtnShow(res.data.giftProductList)
|
|
|
+ this.isShowPreview = this.judgeBtnShow(res.data.specialProductList)
|
|
|
}
|
|
|
}
|
|
|
this.form = { ...this.form, ...resultObj }
|
|
@@ -394,7 +395,7 @@ export default {
|
|
|
},
|
|
|
// 判断预览按钮是否显示
|
|
|
judgeBtnShow (conData) {
|
|
|
- const hasData = conData.some(item => item.productTypeList)
|
|
|
+ const hasData = conData.some(item => item.productThisList)
|
|
|
return hasData
|
|
|
},
|
|
|
getPreviewList (dataList) {
|
|
@@ -403,7 +404,6 @@ export default {
|
|
|
if (con.productThisList) {
|
|
|
con.productThisList.forEach((item, i) => {
|
|
|
item.unitTypeInfo = con.unitTypeDictValue + con.unitQty
|
|
|
- item.no = i * 1 + 1
|
|
|
item.productTypeInfo = con.promotionProductType
|
|
|
})
|
|
|
newList = [ ...newList, ...con.productThisList ]
|
|
@@ -414,12 +414,13 @@ export default {
|
|
|
// 预览
|
|
|
handlePreview () {
|
|
|
const dataName = this.chooseVal === 'a' ? 'gate' : this.chooseVal === 'b' ? 'regular' : this.chooseVal === 'c' ? 'gift' : this.chooseVal === 'd' ? 'special' : 'giftGroup'
|
|
|
+ const titName = this.chooseVal === 'a' ? '门槛产品' : this.chooseVal === 'b' ? '正价产品' : this.chooseVal === 'd' ? '特价产品' : '促销产品'
|
|
|
if (dataName != 'giftGroup') {
|
|
|
const newPreviewList = this.getPreviewList(this.form[dataName + 'ProductList'])
|
|
|
if (newPreviewList && newPreviewList.length > 0) {
|
|
|
this.previewList = newPreviewList
|
|
|
const resuleObj = {
|
|
|
- tit: '门槛产品',
|
|
|
+ tit: titName,
|
|
|
promotionRuleSn: this.itemSn,
|
|
|
promotionProductType: newPreviewList[0].productTypeInfo
|
|
|
}
|
|
@@ -432,9 +433,10 @@ export default {
|
|
|
const stepPreviewList = this.getPreviewList(this.form.giftProductMap['GIFT' + (stepIndex * 1 + 1)])
|
|
|
this.previewList = stepPreviewList
|
|
|
const resuleObj = {
|
|
|
- tit: '促销产品(阶梯' + stepIndex * 1 + 1 + ')',
|
|
|
+ tit: '促销产品(阶梯' + (stepIndex * 1 + 1) + ')',
|
|
|
promotionRuleSn: this.itemSn,
|
|
|
- promotionProductType: stepPreviewList[0].productTypeInfo
|
|
|
+ promotionProductType: stepPreviewList[0].productTypeInfo,
|
|
|
+ scopeLevel: (stepIndex * 1 + 1)
|
|
|
}
|
|
|
this.$refs.previewModal.pageInit(resuleObj)
|
|
|
}
|
|
@@ -444,6 +446,18 @@ export default {
|
|
|
closeProductModal () {
|
|
|
this.previewList = []
|
|
|
this.openProductModal = false
|
|
|
+ },
|
|
|
+ onChange (e) {
|
|
|
+ const dataName = this.chooseVal === 'a' ? 'gate' : this.chooseVal === 'b' ? 'regular' : this.chooseVal === 'c' ? 'gift' : this.chooseVal === 'd' ? 'special' : 'giftGroup'
|
|
|
+ if (dataName != 'giftGroup') {
|
|
|
+ this.isShowPreview = this.judgeBtnShow(this.form[dataName + 'ProductList'])
|
|
|
+ } else {
|
|
|
+ // 阶梯数据处理
|
|
|
+ const pos = e.split('')[1]
|
|
|
+ if (this.form.giftProductMap && Object.keys(this.form.giftProductMap).length > 0) {
|
|
|
+ this.isShowPreview = this.judgeBtnShow(this.form.giftProductMap['GIFT' + (pos * 1 + 1)])
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
watch: {
|