Jelajahi Sumber

同城分销店拆分、分销店对应多个经销商

zhujindu 11 bulan lalu
induk
melakukan
b46d07004d
2 mengubah file dengan 10 tambahan dan 3 penghapusan
  1. 2 1
      src/api/store.js
  2. 8 2
      src/views/storeManagement/storeEdit.vue

+ 2 - 1
src/api/store.js

@@ -2,9 +2,10 @@
 import request from '@/utils/request';
 
 // 获取经销商分类
-export function listChainsByCategory() {
+export function listChainsByCategory(query) {
   return request({
     url: 'mobile/store/listChainsByCategory',
     method: 'get',
+    params: query,
   });
 }

+ 8 - 2
src/views/storeManagement/storeEdit.vue

@@ -811,6 +811,7 @@ export default {
   },
   activated() {
     this.tabVal = 'insidePlan';
+    this.treeSelect = [];
     // 授权
     getTicketFun(['getLocation', 'chooseImage', 'uploadImage']).then(() => {
       this.getTCFXList();
@@ -1463,13 +1464,14 @@ export default {
         this.$toast('部门未选择');
         return;
       } else {
-        this.showPickerChainsList = true;
         // 分销店
         if (
           this.verifyStoreType(this.fromValue.storeCategory) &&
           this.verifyStoreType(this.fromValue.storeCategory).type == 'fxd'
         ) {
           this.getStoreChainsContact();
+        } else {
+          this.showPickerChainsList = true;
         }
       }
     },
@@ -1879,15 +1881,19 @@ export default {
       // 打开select,上次选中确认数据赋值给选中待确认,回显使用
       this.activatedTCFXList = JSON.parse(JSON.stringify(this.sfaStoreChainsContactList));
       if (!this.treeSelect.length) {
-        listChainsByCategory().then((res) => {
+        this.toastLoading(0, '加载中...', true);
+        listChainsByCategory({ id: this.$route.query.id }).then((res) => {
+          this.toastLoading().clear();
           // 初始化数据
           res.data.forEach((val) => {
             val.dot = false;
           });
+          this.showPickerChainsList = true;
           this.treeSelect = res.data;
           this.setCheckData();
         });
       } else {
+        this.showPickerChainsList = true;
         this.setCheckData();
       }
     },