lilei 2 weeks ago
parent
commit
3f6662aa8c

+ 5 - 0
src/views/salesManagement/salesQueryNew/comps/chooseProduct.vue

@@ -88,6 +88,11 @@ export default {
       this.$nextTick(() => {
       this.$nextTick(() => {
         this.$refs.partQuery.pageInit(data, promo)
         this.$refs.partQuery.pageInit(data, promo)
       })
       })
+    },
+    clear () {
+      if (this.cptype == 2) {
+        this.$refs.partQuery.clear()
+      }
     }
     }
   },
   },
   watch: {
   watch: {

+ 4 - 0
src/views/salesManagement/salesQueryNew/comps/cumulativeQueryPart.vue

@@ -203,6 +203,10 @@ export default {
       this.$refs.table.clearSelected()
       this.$refs.table.clearSelected()
       // this.rowSelectionInfo = null
       // this.rowSelectionInfo = null
     },
     },
+    clear () {
+      this.$refs.table.clearSelected()
+      this.rowSelectionInfo = null
+    },
     // 查询
     // 查询
     searchForm () {
     searchForm () {
       this.$refs.table.refresh(true)
       this.$refs.table.refresh(true)

+ 6 - 5
src/views/salesManagement/salesQueryNew/comps/productActiveList.vue

@@ -689,7 +689,8 @@ export default {
       const params = {
       const params = {
         salesPromoSn: promo.salesPromoSn,
         salesPromoSn: promo.salesPromoSn,
         salesBillSn: promo.salesBillSn,
         salesBillSn: promo.salesBillSn,
-        salesBillDetailList: chooseData
+        salesBillDetailList: chooseData,
+        promoProductClz
       }
       }
       salesDetailInsertBatchBorrow(params).then(res => {
       salesDetailInsertBatchBorrow(params).then(res => {
         this.spinning = false
         this.spinning = false
@@ -703,17 +704,17 @@ export default {
               centered: true,
               centered: true,
               okText: '知道了'
               okText: '知道了'
             })
             })
-            this.$emit('error', 'promo', 'add')
+            this.$emit('error', 'borrow', 'add')
           } else {
           } else {
             this.$message.success('累计产品添加成功', 2.5)
             this.$message.success('累计产品添加成功', 2.5)
             this.resetSearchForm(true)
             this.resetSearchForm(true)
-            this.$emit('refash', 'promo', 'add')
+            this.$emit('refash', 'borrow', 'add')
           }
           }
         } else {
         } else {
-          this.$emit('error', 'promo', 'add')
+          this.$emit('error', 'borrow', 'add')
         }
         }
       }).catch(err => {
       }).catch(err => {
-        this.$emit('error', 'promo', 'add')
+        this.$emit('error', 'borrow', 'add')
         this.isInster = false
         this.isInster = false
         this.spinning = false
         this.spinning = false
       })
       })

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

@@ -500,7 +500,7 @@ export default {
       this.$refs.chooseProduct.spinning = false
       this.$refs.chooseProduct.spinning = false
     },
     },
     // 添加活动产品成功的回调,刷新产品列表
     // 添加活动产品成功的回调,刷新产品列表
-    // type:normal 正常列表 ,promo 活动列表
+    // type:normal 正常列表 ,promo 活动列表, borrow 累计产品
     // action:add 添加,del 删除,batchDel 批量删除,update 更新数据, enable 启用禁用,sort 排序,import 导入
     // action:add 添加,del 删除,batchDel 批量删除,update 更新数据, enable 启用禁用,sort 排序,import 导入
     // 如果添加操作,不实时刷新列表,关闭后再刷新
     // 如果添加操作,不实时刷新列表,关闭后再刷新
     refashTableData (type, action) {
     refashTableData (type, action) {
@@ -515,6 +515,12 @@ export default {
         if (this.activeList.length) {
         if (this.activeList.length) {
           this.$refs.productActiveList.resetSearchForm()
           this.$refs.productActiveList.resetSearchForm()
         }
         }
+      } else if (type == 'borrow') { // 累计
+        this.$refs.chooseProduct.clear()
+        // 刷新活动产品列表
+        if (this.activeList.length) {
+          this.$refs.productActiveList.resetSearchForm()
+        }
       } else {
       } else {
         // 正常和活动列表都刷新
         // 正常和活动列表都刷新
         this.getTableListData()
         this.getTableListData()