Browse Source

修改bug

chenrui 1 năm trước cách đây
mục cha
commit
f882714df0

+ 14 - 4
src/views/promotionRulesManagement/dealerPromotions/addModal.vue

@@ -39,15 +39,15 @@
         <a-form-model-item label="参与客户" prop="dealerScope">
           <a-row :gutter="15">
             <a-col :md="12" :sm="24">
-              <a-select v-model="form.dealerScope" placeholder="请选择参与客户">
+              <a-select v-model="form.dealerScope" placeholder="请选择参与客户" @change="changeDealerScope" allowClear>
                 <a-select-option value="ALL_DEALER">全部客户</a-select-option>
                 <a-select-option value="SOME_DEALER">部分客户</a-select-option>
               </a-select>
             </a-col>
-            <a-col :md="3" :sm="24" v-show="form.dealerScope &&form.dealerScope!='ALL_DEALER' ">
+            <a-col :md="3" :sm="24" v-show="form.dealerScope && form.dealerScope!='ALL_DEALER' ">
               <a-button type="primary" :loading="spinning" @click="handleDealerModal">选择</a-button>
             </a-col>
-            <a-col :md="4" :sm="24" v-show="form.dealerScope &&form.dealerScope!='ALL_DEALER' ">
+            <a-col :md="4" :sm="24" v-show="form.dealerScope && form.dealerScope!='ALL_DEALER' ">
               <a-button type="primary" :loading="spinning" @click="openGuideModal=true" ghost>导入客户</a-button>
             </a-col>
             <a-col :md="5" :sm="24" v-show="chooseDealerList && chooseDealerList.length>0">
@@ -247,6 +247,11 @@ export default {
         }
       })
     },
+    changeDealerScope (val) {
+      if (val === 'ALL_DEALER') {
+        this.chooseDealerList = []
+      }
+    },
     // 重置
     resetSearchForm () {
       this.form = {
@@ -290,7 +295,12 @@ export default {
     },
     // 导入参与客户
     hanldeOk (arr) {
-      this.chooseDealerList = this.chooseDealerList.concat(arr)
+      const list = [...this.chooseDealerList,...arr]
+      let obj={}
+      this.chooseDealerList = list.reduce((cur,next)=>{
+        obj[next.dealerSn]?"":obj[next.dealerSn] = true && cur.push(next)
+        return cur
+      },[])
     }
   },
   watch: {

+ 2 - 2
src/views/salesManagement/salesQueryNew/comps/productList.vue

@@ -103,7 +103,7 @@
           <a-dropdown>
             <a-menu slot="overlay" @click="handleMenuClick">
               <a-menu-item key="3" :disabled="disablePromo">
-                全部出库仓库设置
+                全部仓库设置
               </a-menu-item>
               <a-menu-item key="0" :disabled="disablePromo">
                 部分仓库设置
@@ -620,7 +620,7 @@ export default {
         this.handleBatchDel()
       } else if (e.key == 3) {
         _this.$refs.table.clearSelected()
-        _this.warehouseTit = '全部出库仓库设置'
+        _this.warehouseTit = '全部仓库设置'
         _this.openWarehouseModal = true
       } else {
         this.handleBatchDelAll()

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

@@ -46,7 +46,7 @@
           <a-dropdown>
             <a-menu slot="overlay" @click="handleMenuClick">
               <a-menu-item key="3">
-                全部出库仓库设置
+                全部仓库设置
               </a-menu-item>
               <a-menu-item key="0">
                 部分仓库设置
@@ -435,7 +435,7 @@ export default {
         this.handleBatchDel()
       } else if (e.key == 3) {
         _this.$refs.table.clearSelected()
-        _this.warehouseTit = '全部出库仓库设置'
+        _this.warehouseTit = '全部仓库设置'
         _this.openWarehouseModal = true
       } else {
         this.handleBatchDelAll()