lilei 6 달 전
부모
커밋
fcb400f758

+ 1 - 1
src/views/salesManagement/salesQueryNew/comps/productList.vue

@@ -872,7 +872,7 @@ export default {
         salesPromoSnList: salesPromoSnList
       }
       // 更换活动
-      this.$emit('upActive', params)
+      this.$emit('upActive', params, 1)
     },
     // 更换活动成功
     upAcitveSuccess () {

+ 1 - 1
src/views/salesManagement/salesQueryNew/comps/productNormalList.vue

@@ -559,7 +559,7 @@ export default {
         salesPromoSnList: salesPromoSnList
       }
       // 参与促销活动
-      this.$emit('addActive', params)
+      this.$emit('addActive', params, 0)
     },
     // 参与促销活动成功
     addAcitveSuccess () {

+ 18 - 29
src/views/salesManagement/salesQueryNew/edit.vue

@@ -40,7 +40,7 @@
             @spinning="e=>spinning=e"
             @openCpModal="openProductModal"
             @allThreeStock="searchAllThreeStock"
-            @addActive="addActive"
+            @addActive="upActive"
             :showTotal="showTotal"
             :hasActive="activeList.length>0"
             :detailData="detailData"
@@ -389,36 +389,25 @@ export default {
         }
       }
     },
-    // 正常产品参与活动
-    addActive (data, params) {
-      const promo = data.split('-')
-      const newSn = this.activeList.find(item => item.promoRuleSn == promo[1])
-      const newSalesPromoSn = newSn && newSn.salesPromoSn || ''
-      salesChangePromo({
-        salesPromoSn: newSalesPromoSn,
-        promoRuleSn: promo[1],
-        ...params
-      }).then(res => {
-        if (res.status == 200) {
-          // 刷新正常活动
-          this.$refs.productNormalList.addAcitveSuccess()
-          // 刷新活动统计
-          this.$refs.activeTjList.refashRow(newSn, 1)
-          // 刷新详情统计
-          this.refashTableData('normal')
-        }
-      })
-    },
-    // 更换活动
-    upActive (params) {
+    // 更换活动,type 1 促销活动,0 正常活动
+    upActive (params, type) {
       salesChangePromo(params).then(res => {
         if (res.status == 200) {
-          // 刷新活动产品
-          this.$refs.productActiveList.upAcitveSuccess()
-          // 刷新活动统计
-          this.$refs.activeTjList.refashRow('', 1)
-          // 刷新详情统计
-          this.refashTableData('promo')
+          if (type == 1) {
+            // 刷新活动产品
+            this.$refs.productActiveList.upAcitveSuccess()
+            // 刷新活动统计
+            this.$refs.activeTjList.getDataList()
+            // 刷新详情统计
+            this.refashTableData('promo')
+          } else {
+            // 刷新正常活动
+            this.$refs.productNormalList.addAcitveSuccess()
+            // 刷新活动统计
+            this.$refs.activeTjList.getDataList()
+            // 刷新详情统计
+            this.refashTableData('normal')
+          }
         }
       })
     },