lilei 6 months ago
parent
commit
6886e13753

+ 1 - 1
src/api/salesNew.js

@@ -157,7 +157,7 @@ export const salesPromoDiscountSort = (params) => {
 // 保存特价排序-新
 // 保存特价排序-新
 export const salesPromoSaveSort = (params) => {
 export const salesPromoSaveSort = (params) => {
   return axios({
   return axios({
-    url: `/salesPromo/updateBatchById`,
+    url: `/sales/detail/sortPromoList`,
     data: params,
     data: params,
     method: 'post',
     method: 'post',
     headers: {
     headers: {

+ 0 - 1
src/views/salesManagement/salesQueryNew/comps/activeQueryPart.vue

@@ -271,7 +271,6 @@ export default {
       // 阶梯
       // 阶梯
       const hasScopeLevel = this.promoRuleData && this.promoRuleData.giveRuleList && this.promoRuleData.giveRuleList[0]
       const hasScopeLevel = this.promoRuleData && this.promoRuleData.giveRuleList && this.promoRuleData.giveRuleList[0]
       // 选项卡数据
       // 选项卡数据
-      // 选项卡数据
       const tabList = []
       const tabList = []
       if (this.promoRuleData) {
       if (this.promoRuleData) {
         if (this.promoRuleData.gateFlag === '1') {
         if (this.promoRuleData.gateFlag === '1') {

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

@@ -581,7 +581,7 @@ export default {
         }
         }
       })
       })
       this.spinning = true
       this.spinning = true
-      salesPromoSaveSort(data).then(res => {
+      salesPromoSaveSort({ salesBillSn: this.salesBillSn, salePromoList: data }).then(res => {
         this.spinning = false
         this.spinning = false
         if (res.status == 200) {
         if (res.status == 200) {
           this.tableData = this.tableData.sort((a, b) => a.sort - b.sort)
           this.tableData = this.tableData.sort((a, b) => a.sort - b.sort)

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

@@ -70,7 +70,7 @@ export default {
       this.$emit('close')
       this.$emit('close')
     },
     },
     // 添加产品,
     // 添加产品,
-    // row 产品信息, promoProductClz 促销产品类型
+    // row 产品信息, promoProductClz 促销产品类型, 0 正常产品
     insterProduct (row, promoProductClz) {
     insterProduct (row, promoProductClz) {
       this.$emit('addProduct', row, this.promoData, promoProductClz, this.cptype)
       this.$emit('addProduct', row, this.promoData, promoProductClz, this.cptype)
     },
     },

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

@@ -408,7 +408,7 @@ export default {
             if (res.status == 200) {
             if (res.status == 200) {
               _this.$refs.table.refresh(false)
               _this.$refs.table.refresh(false)
               // 触发事件给父级组件
               // 触发事件给父级组件
-              _this.$emit('refash', 'normal')
+              _this.$emit('refash', 'normal', 'batchDel')
               _this.$message.success(res.message)
               _this.$message.success(res.message)
             }
             }
             _this.spinning = false
             _this.spinning = false
@@ -440,7 +440,7 @@ export default {
             if (res.status == 200) {
             if (res.status == 200) {
               _this.$refs.table.refresh(false)
               _this.$refs.table.refresh(false)
               // 触发事件给父级组件
               // 触发事件给父级组件
-              _this.$emit('refash', 'normal')
+              _this.$emit('refash', 'normal', 'batchDel')
               _this.$message.success(res.message)
               _this.$message.success(res.message)
             }
             }
             _this.spinning = false
             _this.spinning = false
@@ -480,7 +480,7 @@ export default {
       updateWarehouse(data).then(res => {
       updateWarehouse(data).then(res => {
         if (res.status == 200) {
         if (res.status == 200) {
           _this.$message.success(res.message)
           _this.$message.success(res.message)
-          _this.$emit('refash', 'promo')
+          _this.$emit('refash', 'promo', 'update')
         }
         }
         _this.$refs.table.refresh(false)
         _this.$refs.table.refresh(false)
         _this.openWarehouseModal = false
         _this.openWarehouseModal = false
@@ -525,7 +525,7 @@ export default {
           salesBillSn: _this.salesBillSn
           salesBillSn: _this.salesBillSn
         }).then(res => {
         }).then(res => {
           if (res.status == 200) {
           if (res.status == 200) {
-            _this.$emit('refash', 'normal')
+            _this.$emit('refash', 'normal', 'update')
             _this.$message.success(res.message)
             _this.$message.success(res.message)
           }
           }
           _this.$refs.table.refresh(false)
           _this.$refs.table.refresh(false)
@@ -591,7 +591,7 @@ export default {
             if (res.status == 200) {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$message.success(res.message)
               _this.$refs.table.refresh(false)
               _this.$refs.table.refresh(false)
-              _this.$emit('refash', 'normal')
+              _this.$emit('refash', 'normal', 'del')
             }
             }
             _this.delLoading = false
             _this.delLoading = false
             _this.spinning = false
             _this.spinning = false
@@ -629,7 +629,7 @@ export default {
           this.$message.success('产品添加成功', 2.5)
           this.$message.success('产品添加成功', 2.5)
           this.resetSearchForm(true)
           this.resetSearchForm(true)
           // 触发事件给父级组件
           // 触发事件给父级组件
-          this.$emit('refash', 'normal')
+          this.$emit('refash', 'normal', 'add')
         }
         }
         this.spinning = false
         this.spinning = false
         this.isInster = false
         this.isInster = false
@@ -653,7 +653,7 @@ export default {
           this.$message.success('产品导入成功', 2.5)
           this.$message.success('产品导入成功', 2.5)
           this.resetSearchForm(true)
           this.resetSearchForm(true)
           // 触发事件给父级组件
           // 触发事件给父级组件
-          this.$emit('refash', 'normal')
+          this.$emit('refash', 'normal', 'import')
         }
         }
       })
       })
     }
     }

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

@@ -201,7 +201,7 @@ export default {
         on: {
         on: {
           dblclick: (event) => {
           dblclick: (event) => {
             event.stopPropagation()
             event.stopPropagation()
-            this.$emit('add', record, 0, 0)
+            this.$emit('add', record, 0)
           }
           }
         }
         }
       }
       }

+ 1 - 1
src/views/salesManagement/salesQueryNew/discountSortModal.vue

@@ -80,7 +80,7 @@ export default {
           sort: item.sort
           sort: item.sort
         }
         }
       })
       })
-      salesPromoSaveSort(data).then(res => {
+      salesPromoSaveSort({ salesBillSn: this.salesBillSn, salePromoList: data }).then(res => {
         if (res.status == 200) {
         if (res.status == 200) {
           _this.$emit('ok')
           _this.$emit('ok')
         }
         }

+ 14 - 6
src/views/salesManagement/salesQueryNew/edit.vue

@@ -45,7 +45,8 @@
             :hasActive="activeList.length>0"
             :hasActive="activeList.length>0"
             :detailData="detailData"
             :detailData="detailData"
             :warehouseSn="warehouseSn"
             :warehouseSn="warehouseSn"
-            :salesBillSn="salesBillSn"></productNormalList>
+            :salesBillSn="salesBillSn">
+          </productNormalList>
         </div>
         </div>
       </a-card>
       </a-card>
       <!-- 活动统计列表 -->
       <!-- 活动统计列表 -->
@@ -153,8 +154,13 @@
       :newActiveList="newActiveList"
       :newActiveList="newActiveList"
       @ok="showNewActiveOk"
       @ok="showNewActiveOk"
     ></newPromoModal>
     ></newPromoModal>
-    <!-- 特价活动排序 -->
-    <discountSortModal :show="showDiscountSortModal" :activeList="discountActiveList" @ok="showDiscountSortOk"></discountSortModal>
+    <!-- 特价活动排序弹框 -->
+    <discountSortModal
+      :show="showDiscountSortModal"
+      :salesBillSn="salesBillSn"
+      :activeList="discountActiveList"
+      @ok="showDiscountSortOk">
+    </discountSortModal>
     <!-- 提交时校验销售价低于成本价提示 -->
     <!-- 提交时校验销售价低于成本价提示 -->
     <vaildPriceModal
     <vaildPriceModal
       ref="vaildPriceModal"
       ref="vaildPriceModal"
@@ -360,12 +366,13 @@ export default {
       this.salesPromoSnSet = active
       this.salesPromoSnSet = active
     },
     },
     // 添加活动产品成功的回调,刷新产品列表
     // 添加活动产品成功的回调,刷新产品列表
-    refashTableData (type) {
+    // type:normal 正常列表 ,active 活动列表
+    // action:add 添加,del 删除,batchDel 批量删除,update 更新数据
+    refashTableData (type, action) {
       // 如果是活动产品
       // 如果是活动产品
       if (type == 'promo') {
       if (type == 'promo') {
         // 刷新正常产品列表
         // 刷新正常产品列表
         this.$refs.productNormalList.resetSearchForm()
         this.$refs.productNormalList.resetSearchForm()
-        this.$refs.chooseProduct.onClose()
       } else if (type == 'normal') { // 如果是正常产品
       } else if (type == 'normal') { // 如果是正常产品
         // 刷新活动产品列表
         // 刷新活动产品列表
         if (this.activeList.length) this.$refs.productActiveList.resetSearchForm()
         if (this.activeList.length) this.$refs.productActiveList.resetSearchForm()
@@ -375,10 +382,11 @@ export default {
         // 刷新活动产品列表
         // 刷新活动产品列表
         if (this.activeList.length) this.$refs.productActiveList.resetSearchForm()
         if (this.activeList.length) this.$refs.productActiveList.resetSearchForm()
       }
       }
-      // 重新获取详情信息
+      // 重新获取详情信息和活动统计列表
       this.getOrderDetail(true)
       this.getOrderDetail(true)
     },
     },
     // 确定新增产品到列表,
     // 确定新增产品到列表,
+    // row 产品信息,promo 活动规则信息,promoProductClz 规则类型,cptype 1 添加活动产品,2 累计产品
     insterProduct (row, promo, promoProductClz, cptype) {
     insterProduct (row, promo, promoProductClz, cptype) {
       // 正常产品
       // 正常产品
       if (promoProductClz == 0) {
       if (promoProductClz == 0) {