|
@@ -628,6 +628,7 @@ export default {
|
|
|
const brandList = []
|
|
|
con.productBrandList.forEach(item => {
|
|
|
item.brandName = item.productBrandName
|
|
|
+ item.brandSn = item.productBrandSn
|
|
|
const brandObj = {
|
|
|
productBrandSn: item.productBrandSn
|
|
|
}
|
|
@@ -694,7 +695,7 @@ export default {
|
|
|
dataList.forEach(con => {
|
|
|
if (con.productThisList) {
|
|
|
con.productThisList.forEach((item, i) => {
|
|
|
- item.unitTypeInfo = con.unitTypeDictValue + con.unitQty
|
|
|
+ item.unitTypeInfo = (con.unitType === 'SL' ? '按数量设置' : '按整箱设置') + con.unitQty
|
|
|
item.productTypeInfo = con.promotionProductType
|
|
|
})
|
|
|
newList = [ ...newList, ...con.productThisList ]
|
|
@@ -707,38 +708,49 @@ export default {
|
|
|
},
|
|
|
// 预览
|
|
|
handlePreview () {
|
|
|
- const dataName = this.chooseVal === 'a' ? 'gate' : this.chooseVal === 'b' ? 'regular' : this.chooseVal === 'c' ? 'gift' : 'giftGroup'
|
|
|
+ const dataName = this.chooseVal === 'a' ? 'gate' : this.chooseVal === 'b' ? 'regular' : 'giftGroup'
|
|
|
const titName = this.chooseVal === 'a' ? '门槛产品' : this.chooseVal === 'b' ? '正价产品' : '促销产品'
|
|
|
if (dataName != 'giftGroup') {
|
|
|
- const newPreviewList = this.getPreviewList(this.form[dataName + 'ProductList'])
|
|
|
- if (newPreviewList && newPreviewList.length > 0) {
|
|
|
- this.previewList = newPreviewList
|
|
|
- const resuleObj = {
|
|
|
- tit: titName
|
|
|
+ if (!this.itemSn) {
|
|
|
+ if (this.chooseVal === 'a') {
|
|
|
+ this.form.gateProductList = this.$refs.cillProduct.getResultVal()
|
|
|
+ } else if (this.chooseVal === 'b') {
|
|
|
+ this.form.regularProductList = this.$refs.normalPriceProduct.getResultVal()
|
|
|
}
|
|
|
- this.$refs.previewModal.pageInit(resuleObj)
|
|
|
- } else {
|
|
|
- this.$message.warning('暂时没有可预览的产品')
|
|
|
- return
|
|
|
}
|
|
|
- } else {
|
|
|
- // 阶梯数据处理
|
|
|
- const idInfo = this.chooseVal.split('c')[1]
|
|
|
- const stepIndex = this.fullGiftRuleList.findIndex(item => item.id === idInfo)
|
|
|
- if (this.form.giftProductMap && Object.keys(this.form.giftProductMap).length > 0 && stepIndex > -1) {
|
|
|
- const stepPreviewList = this.getPreviewList(this.form.giftProductMap['GIFT' + (stepIndex * 1 + 1)])
|
|
|
-
|
|
|
- if (stepPreviewList && stepPreviewList.length > 0) {
|
|
|
- this.previewList = stepPreviewList
|
|
|
+ this.$nextTick(() => {
|
|
|
+ const newPreviewList = this.getPreviewList(this.form[dataName + 'ProductList'])
|
|
|
+ if (newPreviewList && newPreviewList.length > 0) {
|
|
|
+ this.previewList = newPreviewList
|
|
|
const resuleObj = {
|
|
|
- tit: '促销产品(阶梯' + (stepIndex * 1 + 1) + ')'
|
|
|
+ tit: titName
|
|
|
}
|
|
|
this.$refs.previewModal.pageInit(resuleObj)
|
|
|
} else {
|
|
|
this.$message.warning('暂时没有可预览的产品')
|
|
|
- return
|
|
|
}
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ // 阶梯数据处理
|
|
|
+ const idInfo = this.chooseVal.split('c')[1]
|
|
|
+ const stepIndex = this.fullGiftRuleList.findIndex(item => item.id === idInfo)
|
|
|
+ if (stepIndex > -1 && !this.itemSn) {
|
|
|
+ this.form.giftProductMap['GIFT' + (stepIndex * 1 + 1)] = this.$refs['offerProduct' + stepIndex][0].getResultVal()
|
|
|
}
|
|
|
+ this.$nextTick(() => {
|
|
|
+ if (this.form.giftProductMap && Object.keys(this.form.giftProductMap).length > 0) {
|
|
|
+ const stepPreviewList = this.getPreviewList(this.form.giftProductMap['GIFT' + (stepIndex * 1 + 1)])
|
|
|
+ if (stepPreviewList && stepPreviewList.length > 0) {
|
|
|
+ this.previewList = stepPreviewList
|
|
|
+ const resuleObj = {
|
|
|
+ tit: '促销产品(阶梯' + (stepIndex * 1 + 1) + ')'
|
|
|
+ }
|
|
|
+ this.$refs.previewModal.pageInit(resuleObj)
|
|
|
+ } else {
|
|
|
+ this.$message.warning('暂时没有可预览的产品')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
this.openProductModal = true
|
|
|
},
|