lilei 1 year ago
parent
commit
44a0868cfc

+ 3 - 1
src/views/salesManagement/salesQueryNew/comps/activeQueryPart.vue

@@ -139,6 +139,7 @@ export default {
       defaultWarehouseSn: undefined, // 默认仓库sn
       tableHeight: 300,
       disabled: false, //  查询、重置按钮是否可操作
+      promoProductClz: null,
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -202,6 +203,7 @@ export default {
     // 切换tab
     changeTab(e){
       console.log(e)
+      this.promoProductClz = e.key
     },
     // 双击列表
     handleClickRow (record) {
@@ -213,7 +215,7 @@ export default {
               _this.$message.info('该产品暂时不能添加')
             } else {
               event.stopPropagation()
-              _this.$emit('add', record, 0)
+              _this.$emit('add', record, this.promoProductClz)
             }
           }
         }

+ 2 - 2
src/views/salesManagement/salesQueryNew/comps/chooseProduct.vue

@@ -68,8 +68,8 @@ export default {
       this.$emit('close')
     },
     // 添加产品
-    insterProduct (row, promotionFlag) {
-      this.$emit('addProduct', row, promotionFlag, this.type)
+    insterProduct (row, promotionFlag, promoProductClz) {
+      this.$emit('addProduct', row, promotionFlag, promoProductClz)
     }
   },
   watch: {

+ 11 - 10
src/views/salesManagement/salesQueryNew/comps/productList.vue

@@ -334,7 +334,8 @@
         rowSelectionInfo: null,
         warehouseDataList: [],
         openUpActiveModal: false,
-        descDetail: null
+        descDetail: null,
+        promoProductClz: null, // 活动产品分类
       }
     },
     computed: {
@@ -566,15 +567,15 @@
         })
       },
       // 添加产品
-      insterProduct (row, promotionFlag) {
+      insterProduct (row, promotionFlag, promoProductClz) {
         console.log(row, promotionFlag)
         // 防止多次添加产品
         if (this.isInster) { return }
         const _this = this
-        _this.saveNewProduct(row, promotionFlag)
+        _this.saveNewProduct(row, promotionFlag, promoProductClz)
       },
       // 保存添加的产品到销售列表
-      saveNewProduct (row, promotionFlag) {
+      saveNewProduct (row, promotionFlag, promoProductClz) {
         this.$message.loading('正在添加产品...', 1)
         this.isInster = true
         this.spinning = true
@@ -582,7 +583,8 @@
           salesPromoDetailDTO:{
             salesPromoSn: this.promo.salesPromoSn,
             promoRuleSn: this.promo.promoRuleSn,
-            promoSn: this.promo.promoSn
+            promoSn: this.promo.promoSn,
+            promoProductClz: promoProductClz
           },
           packQty: row.productPackQty,
           productSn: row.productSn,
@@ -615,6 +617,7 @@
       // 导入产品
       handleImportClick(e){
         this.openGuideModal = true
+        this.promoProductClz = e.key
       },
       closeGuideModel () {
         this.openGuideModal = false
@@ -627,11 +630,9 @@
         }
         // 活动导入
         if(salesPromoSn){
-          params.salesPromoDetailDTO = {
-            salesPromoSn: salesPromoSn,
-            promoRuleSn: this.promo.promoRuleSn,
-            promoSn: this.promo.promoSn
-          }
+          params.salesPromoSn = salesPromoSn
+          params.promoRuleSn = this.promo.promoRuleSn
+          params.promoProductClz = this.promoProductClz
         }
         
         salesBatchInsert(params).then(res => {

+ 1 - 1
src/views/salesManagement/salesQueryNew/edit.vue

@@ -226,7 +226,7 @@ export default {
         this.$refs.productNormalList.insterProduct(row, promotionFlag)
       }else{
         // 活动产品
-        this.$refs[this.cpCurRefId][0].insterProduct(row, promotionFlag)
+        this.$refs[this.cpCurRefId][0].insterProduct(row, promotionFlag, type)
       }
     },
     // 选择价格类型  并更新