lilei 1 ano atrás
pai
commit
d5edd17f20

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

@@ -551,25 +551,7 @@
           this.handleBatchDelAll()
         }
       },
-      // 换促销
-      async upActiveOk(data, editRow){
-        console.log(data)
-        console.log(editRow)
-        this.spinning = true
-        // 先删除当前活动
-        const delRet = await salesDetailDel({ 
-          salesBillDetailSn: editRow.salesBillDetailSn, 
-          salesBillSn: this.salesBillSn, 
-          salesPromoSn: this.promo.salesPromoSn 
-        })
-        // 当删除成功且不是”不参与活动“时
-        if(delRet.status == 200 && data != 0){
-          // 再添加到其它活动
-          this.$emit()
-        }
-        this.openUpActiveModal = false
-        this.spinning = false
-      },
+      // 打开换促销活动列表选项
       handleUpdateActive(record){
         this.$refs.updateActive.getActiveList({
           productSn: record.productSn, 
@@ -623,6 +605,25 @@
           }
         })
       },
+      // 确定更换促销活动
+      async upActiveOk(data, editRow){
+        console.log(data)
+        console.log(editRow)
+        this.spinning = true
+        // 先删除当前活动
+        const delRet = await salesDetailDel({ 
+          salesBillDetailSn: editRow.salesBillDetailSn, 
+          salesBillSn: this.salesBillSn, 
+          salesPromoSn: this.promo.salesPromoSn 
+        })
+        // 当删除成功且不是”不参与活动“时
+        if(delRet.status == 200 && data != 0){
+          // 再添加到其它活动
+          this.$emit("upActive",editRow, data)
+        }
+        this.openUpActiveModal = false
+        this.spinning = false
+      },
       // 添加产品
       insterProduct (row, promotionFlag, promoProductClz) {
         console.log(row, promotionFlag, promoProductClz)
@@ -632,7 +633,7 @@
         _this.saveNewProduct(row, promotionFlag, promoProductClz)
       },
       // 保存添加的产品到销售列表
-      saveNewProduct (row, promotionFlag, promoProductClz) {
+      saveNewProduct (row, promo, promoProductClz) {
         this.$message.loading('正在添加产品...', 1)
         this.isInster = true
         this.spinning = true

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

@@ -32,7 +32,7 @@
                 <a-button type="link">详情</a-button>
               </a-popover> -->
             </div>
-            <aRadio :style="radioStyle" v-for="(sitem,sindex) in item.promotionRuleList" :key="sindex" :value="item.promotionSn+'-'+sitem.promotionRuleSn">
+            <aRadio :style="radioStyle" v-for="(sitem,sindex) in item.promotionRuleList" :key="sindex" :value="item.promotionSn+'-'+sitem.promotionRuleSn+'-'+sitem.promotionProductType">
               {{sindex+1}}、{{ sitem.description }}
             </aRadio>
           </div>

+ 5 - 0
src/views/salesManagement/salesQueryNew/edit.vue

@@ -63,6 +63,7 @@
           :id="item.promoRuleSn" 
           @openCpModal="openProductModal" 
           @insterOk="insterActiveOk"
+          @upActive="upActive"
           :promo="item"
           :detailData="detailData" 
           :warehouseSn="warehouseSn" 
@@ -271,6 +272,10 @@ export default {
         this.$refs[this.cpCurRefId][0].insterProduct(row, promotionFlag, type)
       }
     },
+    // 更换活动
+    upActive(row,data){
+      console.log(row,data)
+    },
     // 选择价格类型  并更新
     updatePrice (type) {
       const _this = this

+ 1 - 1
vue.config.js

@@ -108,7 +108,7 @@ const vueConfig = {
     // If you want to turn on the proxy, please remosve the mockjs /src/main.jsL11
     proxy: {
       '/api': {
-        target: 'http://192.168.2.113:8660/ocs-admin',
+        target: 'http://192.168.2.111/ocs-admin',
         // target: 'https://t.ocs.360arrow.com/ocs-admin', //  练习
         // target: 'https://p.ocs.360arrow.com/ocs-admin', //  预发布
         ws: false,