chenrui пре 1 година
родитељ
комит
23ddc07468

+ 22 - 12
src/views/promotionRulesManagement/dealerPromotions/sendAmountModal.vue

@@ -660,8 +660,7 @@ export default {
         dataList.forEach(con => {
           if (con.productThisList) {
             con.productThisList.forEach((item, i) => {
-              item.unitTypeInfo = con.unitTypeDictValue + con.unitQty
-              item.no = i * 1 + 1
+              item.unitTypeInfo = (con.unitType === 'SL' ? '按数量设置' : '按整箱设置') + con.unitQty
               item.productTypeInfo = con.promotionProductType
             })
             newList = [ ...newList, ...con.productThisList ]
@@ -676,17 +675,28 @@ export default {
     handlePreview () {
       const dataName = this.chooseVal === 'a' ? 'gate' : this.chooseVal === 'b' ? 'regular' : 'gift'
       const titName = this.chooseVal === 'a' ? '门槛产品' : this.chooseVal === 'b' ? '正价产品' : '促销产品'
-      const newPreviewList = this.getPreviewList(this.form[dataName + 'ProductList'])
-      if (newPreviewList && newPreviewList.length === 0) {
-        this.$message.warning('暂时没有可预览的产品')
-        return
-      }
-      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()
+        }else{
+          this.form.giftProductList = this.$refs.offerProduct.getResultVal()
+        }
       }
-      this.$refs.previewModal.pageInit(resuleObj)
-      this.openProductModal = true
+      this.$nextTick(()=>{
+        const newPreviewList = this.getPreviewList(this.form[dataName + 'ProductList'])
+        if (newPreviewList && newPreviewList.length === 0) {
+          this.$message.warning('暂时没有可预览的产品')
+          return
+        }
+        this.previewList = newPreviewList
+        const resuleObj = {
+          tit: titName
+        }
+        this.$refs.previewModal.pageInit(resuleObj)
+        this.openProductModal = true
+      }) 
     },
     closeProductModal () {
       this.previewList = []

+ 20 - 12
src/views/promotionRulesManagement/dealerPromotions/specialOfferModal.vue

@@ -827,8 +827,7 @@ export default {
         dataList.forEach(con => {
           if (con.productThisList) {
             con.productThisList.forEach((item, i) => {
-              item.unitTypeInfo = con.unitTypeDictValue + con.unitQty
-              item.no = i * 1 + 1
+              item.unitTypeInfo = (con.unitType === 'SL' ? '按数量设置' : '按整箱设置') + con.unitQty
               item.productTypeInfo = con.promotionProductType
             })
             newList = [ ...newList, ...con.productThisList ]
@@ -843,17 +842,26 @@ export default {
     handlePreview () {
       const dataName = this.chooseVal === 'a' ? 'gate' : 'special'
       const titName = this.chooseVal === 'a' ? '门槛产品' : '特价产品'
-      const newPreviewList = this.getPreviewList(this.form[dataName + 'ProductList'])
-      if (newPreviewList.length === 0) {
-        this.$message.warning('暂时没有可预览的产品')
-        return
-      }
-      this.previewList = newPreviewList
-      const resuleObj = {
-        tit: titName
+      if (!this.itemSn) {
+        if (this.chooseVal === 'a') {
+          this.form.gateProductList = this.$refs.cillProduct.getResultVal()
+        } else {
+          this.form.specialProductList = this.$refs.specialProduct.getResultVal()
+        }
       }
-      this.$refs.previewModal.pageInit(resuleObj)
-      this.openProductModal = true
+      this.$nextTick(() => {
+        const newPreviewList = this.getPreviewList(this.form[dataName + 'ProductList'])
+        if (newPreviewList.length === 0) {
+          this.$message.warning('暂时没有可预览的产品')
+          return
+        }
+        this.previewList = newPreviewList
+        const resuleObj = {
+          tit: titName
+        }
+        this.$refs.previewModal.pageInit(resuleObj)
+        this.openProductModal = true
+      })
     },
     closeProductModal () {
       this.previewList = []