Explorar o código

feature:选择经销商代理商增加查询中状态

liuzl %!s(int64=2) %!d(string=hai) anos
pai
achega
d679a5c707
Modificáronse 1 ficheiros con 13 adicións e 1 borrados
  1. 13 1
      components/SelectDealer.vue

+ 13 - 1
components/SelectDealer.vue

@@ -29,7 +29,13 @@
         </view>
       </view>
       <view class="tit">{{ distrLabel }}/助记名/所在省份/归属销售/负责人</view>
-      <u-empty mode="list" v-if="userList.length == 0"></u-empty>
+      <u-loading-icon
+        text="数据加载中"
+        color="green"
+        :vertical="true"
+        v-if="loading"
+        :customStyle="{ padding: '20px' }"></u-loading-icon>
+      <u-empty mode="list" v-else-if="!loading && userList.length == 0"></u-empty>
       <view class="concat-list" v-else>
         <u-radio-group v-model="userValue" placement="column">
           <view class="radio-item" v-for="item in userList" :key="item.id">
@@ -61,6 +67,7 @@
           pageNum: 1,
           pageSize: 999,
         },
+        loading: false,
         // u-radio-group的v-model绑定的值如果设置为某个radio的name,就会被默认选中
         userValue: null,
         selected: null,
@@ -77,13 +84,18 @@
         return str
       },
     },
+    onHide() {
+      this.userList = []
+    },
     methods: {
       async getList() {
+        this.loading = true
         let params = this.queryForm
         if (this.distrId) {
           params.distType = parseInt(this.distrId) - 20 + ''
         }
         const [err, res] = await to(distrApi.getList(params))
+        this.loading = false
         if (err) return
         if (res.code == 200) {
           if (res.data.list && res.data.list.length > 0) {