lilei 4 月之前
父节点
当前提交
5cff75420d

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

@@ -75,6 +75,7 @@ export default {
     // row 产品信息, promoProductClz 促销产品类型, 0 正常产品
     insterProduct (row, promoProductClz) {
       this.hasRefash = true // 添加时不刷新,关闭弹框再刷新
+      this.spinning = true
       this.$emit('addProduct', row, this.promoData, promoProductClz, this.cptype)
     },
     // 初始化数据,

+ 3 - 0
src/views/salesManagement/salesQueryNew/comps/productActiveList.vue

@@ -660,10 +660,13 @@ export default {
           this.$message.success('产品添加成功', 2.5)
           this.resetSearchForm(true)
           this.$emit('refash', 'promo', 'add')
+        } else {
+          this.$emit('error', 'normal', 'add')
         }
         this.spinning = false
         this.isInster = false
       }).catch(err => {
+        this.$emit('error', 'normal', 'add')
         this.isInster = false
         this.spinning = false
       })

+ 3 - 0
src/views/salesManagement/salesQueryNew/comps/productNormalList.vue

@@ -650,10 +650,13 @@ export default {
           this.resetSearchForm()
           // 触发事件给父级组件
           this.$emit('refash', 'normal', 'add')
+        } else {
+          this.$emit('error', 'normal', 'add')
         }
         this.spinning = false
         this.isInster = false
       }).catch(err => {
+        this.$emit('error', 'normal', 'add')
         this.spinning = false
         this.isInster = false
       })

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

@@ -41,6 +41,7 @@
             @openCpModal="openProductModal"
             @allThreeStock="searchAllThreeStock"
             @addActive="upActive"
+            @error="tableErrorData"
             :showTotal="showTotal"
             :hasActive="activeList.length>0"
             :detailData="detailData"
@@ -80,6 +81,7 @@
             :salesPromoSnSet="salesPromoSnSet"
             @showRuleDetail="showRuleDetail"
             @refash="refashTableData"
+            @error="tableErrorData"
             @upActive="upActive">
           </productActiveList>
         </div>
@@ -435,11 +437,16 @@ export default {
       // 刷新活动产品列表
       if (this.activeList.length) this.$refs.productActiveList.resetSearchForm()
     },
+    // 添加产品出错时
+    tableErrorData (type, action) {
+      this.$refs.chooseProduct.spinning = false
+    },
     // 添加活动产品成功的回调,刷新产品列表
     // type:normal 正常列表 ,active 活动列表
     // action:add 添加,del 删除,batchDel 批量删除,update 更新数据, enable 启用禁用,sort 排序
     // 如果添加操作,不实时刷新列表,关闭后再刷新
     refashTableData (type, action) {
+      this.$refs.chooseProduct.spinning = false
       // 重新获取详情信息
       this.getOrderDetail(false)
       // 如果是活动产品,刷新正常产品列表