莫绍宝 преди 2 години
родител
ревизия
954e9ba7e4
променени са 1 файла, в които са добавени 21 реда и са изтрити 1 реда
  1. 21 1
      src/views/setting/account.vue

+ 21 - 1
src/views/setting/account.vue

@@ -266,7 +266,7 @@
           v-show="roleObj.type === 0 && roleObj.name === '经销商' && !AccountForm.isGroup"
         >
           <el-select v-model="AccountForm.company" placeholder="请选择所属集团" style="width: 100%" filterable>
-            <el-option :label="item.name" :value="item.id" v-for="(item, index) in dealerList" :key="index"></el-option>
+            <el-option :label="item.name" :value="item.id" v-for="(item, index) in groupList" :key="index"></el-option>
           </el-select>
         </el-form-item>
         <el-form-item label="是否折让" prop="isDiscount" v-show="roleObj.type === 0 && roleObj.name === '经销商'">
@@ -512,6 +512,7 @@ export default {
       roleObj: {}, // 选中的角色
       merchantList: [],
       dealerList: [],
+      groupList: [],
 
       passwordType1: 'password',
       passwordType2: 'password'
@@ -624,6 +625,24 @@ export default {
       return result
     },
 
+    // 获取集团列表
+    async getGroupList(id) {
+      const result = await new Promise((resolve, reject) => {
+        getDealerList({
+          pageNum: 1,
+          pageSize: -1
+        })
+          .then(res => {
+            this.groupList = res.data.records
+            resolve(res.data.records)
+          })
+          .catch(res => {
+            resolve([])
+          })
+      })
+      return result
+    },
+
     // 获取部门列表
     getTree() {
       getDepartmentList().then(res => {
@@ -711,6 +730,7 @@ export default {
       this.AccountFormVisible = true
       await this.getMerchantList()
       await this.getDealerList(id)
+      await this.getGroupList(id)
       await this.getRoleList()
       await this.getCategoryList()