lilei 1 年之前
父节点
当前提交
5d35876c20

+ 20 - 8
src/views/salesManagement/salesQueryNew/comps/productList.vue

@@ -617,9 +617,20 @@
           salesPromoSn: this.promo.salesPromoSn 
         })
         // 当删除成功且不是”不参与活动“时
-        if(delRet.status == 200 && data != 0){
+        if(delRet.status == 200){
+          // 刷下当前活动列表
+          this.resetSearchForm()
           // 再添加到其它活动
-          this.$emit("upActive",editRow, data)
+          if(data != 0){
+            editRow.productPackQty = editRow.packQty
+            editRow.lastStockCost = editRow.showCost
+            editRow.productPrice = editRow.price
+            editRow.salesNums = editRow.qty
+            this.$emit("upActive",editRow, data)
+          }else{
+            // 刷下正常产品列表
+            this.$emit('insterOk')
+          }
         }
         this.openUpActiveModal = false
         this.spinning = false
@@ -629,15 +640,15 @@
         console.log(row, promotionFlag, promoProductClz)
         // 防止多次添加产品
         if (this.isInster) { return }
-        const _this = this
-        _this.saveNewProduct(row, promotionFlag, promoProductClz)
+        this.saveNewProduct(row, promotionFlag, promoProductClz)
       },
       // 保存添加的产品到销售列表
-      saveNewProduct (row, promo, promoProductClz) {
+      saveNewProduct (row, promotionFlag, promoProductClz) {
         this.$message.loading('正在添加产品...', 1)
         this.isInster = true
         this.spinning = true
-        salesDetailInsert({
+        console.log(row)
+        const params = {
           salesPromoSn: this.promo.salesPromoSn,
           promoRuleSn: this.promo.promoRuleSn,
           promoSn: this.promo.promoSn,
@@ -646,7 +657,7 @@
           productSn: row.productSn,
           showCost: row.lastStockCost,
           price: row.productPrice,
-          origPrice: row.productPrice,
+          origPrice: row.origPrice,
           promotionGiftsAmount: 0,
           usePromotionGiftsAmount: 0,
           qty: row.salesNums,
@@ -658,7 +669,8 @@
           promotableFlag: row.isJoinActivityProduct || 0, // 可促销标记 有活动的传1,没活动的传0
           promotionFlag: promotionFlag, // 促销标记 正品传0,促销品传1
           warehouseSn: row.warehouseSn
-        }).then(res => {
+        }
+        salesDetailInsert(params).then(res => {
           if (res.status == 200) {
             this.resetSearchForm()
             this.$message.success('产品添加成功', 2.5)

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

@@ -272,9 +272,11 @@ export default {
         this.$refs[this.cpCurRefId][0].insterProduct(row, promotionFlag, type)
       }
     },
-    // 更换活动
+    // 更换活动promoRuleSn
     upActive(row,data){
       console.log(row,data)
+      const promo = data.split('-')
+      this.$refs['productList-'+promo[1]][0].insterProduct(row, 0, promo[2])
     },
     // 选择价格类型  并更新
     updatePrice (type) {