ソースを参照

fix: 账户管理解经销商接口限制最大获取300条数据

Signed-off-by: Howie <zhouhao@zfire.com>
Howie 1 年間 前
コミット
631537b1ca
1 ファイル変更27 行追加9 行削除
  1. 27 9
      src/views/setting/account.vue

+ 27 - 9
src/views/setting/account.vue

@@ -259,7 +259,10 @@
           />
         </el-form-item>
         <el-form-item v-show="roleObj.type === 0 && roleObj.name === '经销商'" label="经销商" prop="dealer">
-          <el-select v-model="AccountForm.dealer" placeholder="请选择经销商" style="width: 100%" filterable>
+          <el-select v-model="AccountForm.dealer" placeholder="请选择经销商" style="width: 100%" filterable     remote
+            reserve-keyword
+            :remote-method="remoteMethod"
+            :loading="loading">
             <el-option v-for="(item, index) in dealerList" :key="index" :label="item.name" :value="item.id" />
           </el-select>
         </el-form-item>
@@ -284,7 +287,10 @@
           label="所属集团"
           prop="company"
         >
-          <el-select v-model="AccountForm.company" placeholder="请选择所属集团" style="width: 100%" filterable>
+          <el-select v-model="AccountForm.company" placeholder="请选择所属集团" style="width: 100%" filterable     remote
+            reserve-keyword
+            :remote-method="remoteMethod2"
+            :loading="loading2">
             <el-option v-for="(item, index) in groupList" :key="index" :label="item.name" :value="item.id" />
           </el-select>
         </el-form-item>
@@ -470,6 +476,8 @@ export default {
       }
     }
     return {
+      loading: false,
+      loading2: false,
       stockList: [], // 仓库列表
       baseURL: process.env.VUE_APP_BASE_API,
       dataList: null, // 列表数据
@@ -638,18 +646,23 @@ export default {
       })
       return result
     },
-
+    remoteMethod(e) {
+      this.loading = true
+      this.getDealerList(null, e)
+    },
     // 获取经销商列表
-    async getDealerList(id) {
+    async getDealerList(id, e) {
       const result = await new Promise((resolve, reject) => {
         getDealerList({
           pageNum: 1,
-          pageSize: -1,
+          pageSize: 300,
           bindUser: false,
-          adminUserId: id || ''
+          adminUserId: id || '',
+          keyword: e
         })
           .then(res => {
             this.dealerList = res.data.records
+            this.loading = false
             resolve(res.data.records)
           })
           .catch(res => {
@@ -658,16 +671,21 @@ export default {
       })
       return result
     },
-
+    remoteMethod2(e) {
+      this.loading2 = true
+      this.getGroupList(null, e)
+    },
     // 获取集团列表
-    async getGroupList(id) {
+    async getGroupList(id, e) {
       const result = await new Promise((resolve, reject) => {
         getDealerList({
           pageNum: 1,
-          pageSize: -1
+          pageSize: 300,
+          keyword: e
         })
           .then(res => {
             this.groupList = res.data.records
+            this.loading2 = false
             resolve(res.data.records)
           })
           .catch(res => {