chenrui 4 месяцев назад
Родитель
Сommit
58aa214bb9

+ 1 - 9
src/views/salesManagement/salesQueryNew/comps/productActiveList.vue

@@ -818,15 +818,9 @@ export default {
     // 选择仓库确认
     chooseWarehouseOk (sn) {
       const _this = this
-      const snArr = []
-      if (_this.rowSelectionInfo && _this.rowSelectionInfo.selectedRows && _this.rowSelectionInfo.selectedRows.length > 0) {
-        _this.rowSelectionInfo.selectedRows.forEach(item => {
-          snArr.push(item.salesBillDetailSn)
-        })
-      }
       const ajaxData = {
         warehouseSn: sn,
-        salesBillDetailSnList: snArr,
+        salesBillDetailSnList: _this.selectedRowKeys,
         salesBillSn: _this.salesBillSn,
         allFlag: _this.warehouseTit ? true : undefined
       }
@@ -876,7 +870,6 @@ export default {
     },
     // 打开换促销活动列表选项
     handleUpdateActive (record) {
-      console.log('22222222:', this.promo)
       this.$refs.updateActive.getActiveList({
         productSn: record.productSn,
         salesBillSn: this.salesBillSn,
@@ -931,7 +924,6 @@ export default {
     },
     // 确定更换促销活动
     async upActiveOk (salesPromoSnList, editRow) {
-      this.spinning = true
       const params = {
         salesBillDetailSn: editRow.salesBillDetailSn,
         salesBillSn: this.salesBillSn,

+ 13 - 0
src/views/salesManagement/salesQueryNew/comps/updateActiveModal.vue

@@ -105,9 +105,22 @@ export default {
       this.spinning = true
       salesPromoMatchProduct(data).then(res => {
         this.activeList = res.data || []
+        // 回显选中
+        if (record.promoRuleSnList) {
+
+        } else {
+          this.upActiveVal = '-1'
+        }
         this.spinning = false
       })
     },
+    getSnArrayById (arr1, arr2) {
+      // 使用 map 遍历 arr1,对每个 id 使用 filter 从 arr2 中提取 sn
+      return arr1.filter(id => {
+        // filter 返回的是一个数组,但我们想要的是数组中的 sn 值
+        return arr2.filter(item => item.promoRuleSn === id).map(item => item.salesPromoSn)
+      })
+    },
     //  保存
     handleSubmit (e) {
       e.preventDefault()

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

@@ -319,6 +319,7 @@ export default {
     },
     // type 1 更换活动,0 参与活动
     upActive (params, type) {
+      this.spinning = true
       salesChangePromo(params).then(res => {
         if (res.status == 200) {
           // 刷新活动统计
@@ -326,11 +327,14 @@ export default {
           if (type == 1) {
             // 刷新正常产品列表
             this.$refs.productNormalList.resetSearchForm()
+            // 关闭活动产品页面弹窗加载状态等
+            this.$refs.productActiveList.upAcitveSuccess()
           } else {
             // 刷新活动产品列表
             if (this.activeList.length) this.$refs.productActiveList.resetSearchForm()
           }
         }
+        this.spinning = false
       })
     },
     // 提交销售单