贺智杰 5 дней назад
Родитель
Сommit
b9bc71c2ae

+ 16 - 7
traceCodePackages/traceabilityReport/pages/customerScanningRate/detail/index.vue

@@ -28,13 +28,18 @@
           @input="onInputChange" />
         <view class="selector-arrow" :class="{ open: dropdownOpen }" @click="toggleDropdown"></view>
         <view class="dropdown" v-show="dropdownOpen" @click.stop>
-          <scroll-view scroll-y :style="{ maxHeight: '300rpx' }" lower-threshold="20" @scrolltolower="getCustomerInfo">
+          <scroll-view v-if="customers.length && !customerLoading" scroll-y :style="{ maxHeight: '300rpx' }"
+            lower-threshold="20" @scrolltolower="getCustomerInfo">
             <view class="dropdown-item" v-for="(c, i) in customers" :key="i" @click="selectCustomer(c)">{{
               c.customerName || "--" }}</view>
             <view v-if="customerHasMore" class="customer-loading-wrap">
               <image src="../../../../static/images/loading.png" mode="scaleToFill" class="loading-icon" />
             </view>
           </scroll-view>
+          <view v-else-if="customerLoading" class="customer-loading-wrap">
+            <image src="../../../../static/images/loading.png" mode="scaleToFill" class="loading-icon" />
+          </view>
+          <view v-else class="dropdown-item">暂无数据</view>
         </view>
       </view>
     </view>
@@ -69,7 +74,7 @@ export default {
       customerHasMore: true,
       customerLoading: false,
       customers: [],
-      customerInput: "",
+      customerInput: { customerName: '' },
       customerDebounceTimer: null,
       selectedCustomer: "",
       dropdownOpen: false,
@@ -89,18 +94,21 @@ export default {
           title: "出库扫码率",
           fixed: false,
           width: "",
+          unit: '%'
         },
         {
           key: "inScanRate",
           title: "入库扫码率",
           fixed: false,
           width: "",
+          unit: '%'
         },
         {
           key: "selfExaminationRate",
           title: "自验证率",
           fixed: false,
           width: "",
+          unit: '%'
         },
       ],
     };
@@ -121,11 +129,11 @@ export default {
     this.getCustomerInfo();
   },
   watch: {
-    customerInput: {
+    'customerInput.customerName': {
       handler(newVal, oldVal) {
         if (
-          !newVal?.customerName ||
-          newVal?.customerName !== oldVal?.customerName
+          !newVal ||
+          newVal !== oldVal
         ) {
           if (this.customerDebounceTimer)
             clearTimeout(this.customerDebounceTimer);
@@ -202,7 +210,6 @@ export default {
           this.customerTotal = _data.total;
           if (this.customerTotal <= this.customers.length) {
             this.customerHasMore = false;
-            this.customerLoading = false;
             return;
           } else {
             const list = Array.isArray(_data.list) ? _data.list : [];
@@ -215,9 +222,11 @@ export default {
               this.customerHasMore = true;
             }
             // }
-            this.customerLoading = false;
           }
         }
+        setTimeout(() => {
+          this.customerLoading = false;
+        }, 200)
       })
     },
     openDropdown() {

+ 1 - 1
traceCodePackages/traceabilityReport/pages/customerScanningRate/wigets/ScanRateTable.vue

@@ -53,7 +53,7 @@
             </view>
             <scroll-view scroll-y="true" class="dropdown-scroll-view" lower-threshold="80"
               @scrolltolower="loadMoreProducts">
-              <view class="dropdown-item" v-for="(p, i) in productList" :key="getUid()" :style="p.drugEntBaseInfoId === product?.drugEntBaseInfoId || (!product?.drugEntBaseInfoId && i == 0)
+              <view class="dropdown-item" v-for="(p, i) in productList" :key="p.drugEntBaseInfoId || i" :style="p.drugEntBaseInfoId === product?.drugEntBaseInfoId || (!product?.drugEntBaseInfoId && i == 0)
                 ? {
                   backgroundColor: '#2c69ff',
                   color: '#fff',