shish 2 月之前
父節點
當前提交
10fe7b3e5b
共有 1 個文件被更改,包括 28 次插入6 次删除
  1. 28 6
      ghsApp/src/pagesPurchase/supplier.vue

+ 28 - 6
ghsApp/src/pagesPurchase/supplier.vue

@@ -58,12 +58,12 @@
           <view class="item-action-row">
           <view class="item-action-row">
             <!-- 操作按钮区(正常状态) -->
             <!-- 操作按钮区(正常状态) -->
             <view class="action-buttons" v-if="tabs[tabIndex].delStatus === 0">
             <view class="action-buttons" v-if="tabs[tabIndex].delStatus === 0">
-              <view class="action-btn search-btn" @click.stop="goToSearchDebt(item)">搜索</view>
-              <view class="action-btn cg-btn" @click="goToCg(item)">采购</view>
+              <view class="action-btn search-btn" hover-class="none" @click.stop="goToSearchDebt(item)">搜索</view>
+              <view class="action-btn cg-btn" hover-class="none" @click="goToCg(item)">采购</view>
             </view>
             </view>
             <!-- 操作按钮区(已删除状态) -->
             <!-- 操作按钮区(已删除状态) -->
             <view class="action-buttons" v-else>
             <view class="action-buttons" v-else>
-              <view class="action-btn recover-btn" @click.stop="handleRecover(item)">恢复</view>
+              <view class="action-btn recover-btn" hover-class="none" @click.stop="handleRecover(item)">恢复</view>
             </view>
             </view>
           </view>
           </view>
 
 
@@ -238,6 +238,7 @@ export default {
     },
     },
     init() {
     init() {
       this.getGhsList()
       this.getGhsList()
+      this.loadTabCounts() // 页面初始化时先加载 Tab 数量(比主列表更快出现)
     },
     },
     searchFn(e) {
     searchFn(e) {
       let that = this
       let that = this
@@ -262,11 +263,31 @@ export default {
       return getList(params).then(res => {
       return getList(params).then(res => {
         this.info = res.data
         this.info = res.data
         this.completes(res);
         this.completes(res);
+        this.loadTabCounts(); // 刷新顶部 Tab 的数量统计
         if (this.$util.isEmpty(res.data)){
         if (this.$util.isEmpty(res.data)){
           return false
           return false
         }
         }
       })
       })
     },
     },
+
+    // 加载 4 个 Tab 的供货商数量(不受搜索关键词影响,始终显示全量分类统计)
+    loadTabCounts() {
+      const that = this
+      const baseParams = { page: 1, pageSize: 1, name: '' }
+      Promise.all([
+        getList({ ...baseParams, delStatus: 0 }).then(res => (res.data && res.data.totalNum) || 0), // 全部(正常)
+        getList({ ...baseParams, delStatus: 0, location: 0 }).then(res => (res.data && res.data.totalNum) || 0), // 上游
+        getList({ ...baseParams, delStatus: 0, location: 1 }).then(res => (res.data && res.data.totalNum) || 0), // 本地
+        getList({ ...baseParams, delStatus: 1 }).then(res => (res.data && res.data.totalNum) || 0), // 已删除
+      ]).then(([allCount, upstreamCount, localCount, deletedCount]) => {
+        that.tabs[0].value = allCount
+        that.tabs[1].value = upstreamCount
+        that.tabs[2].value = localCount
+        that.tabs[3].value = deletedCount
+      }).catch(() => {
+        // 统计失败不影响主流程
+      })
+    },
     toggleMenu(item) {
     toggleMenu(item) {
       this.activeMenuId = this.activeMenuId === item.id ? null : item.id;
       this.activeMenuId = this.activeMenuId === item.id ? null : item.id;
     },
     },
@@ -363,7 +384,7 @@ export default {
       width: 100%;
       width: 100%;
     }  
     }  
     z-index: 9;
     z-index: 9;
-    margin-top: 4upx; // 顶部 Tabs 整体跟上边(输入框/添加按钮栏)增加 4upx 距离
+    margin-top: 6upx; // 顶部 Tabs 整体跟上边(输入框/添加按钮栏)增加 4upx 距离
   }
   }
 }
 }
 
 
@@ -592,12 +613,13 @@ export default {
             justify-content: center;
             justify-content: center;
             font-size: 30upx;          // 搜索采购按钮字增大 4upx (26upx -> 30upx)
             font-size: 30upx;          // 搜索采购按钮字增大 4upx (26upx -> 30upx)
             color: white;
             color: white;
-            border-radius: 38upx;
-            padding: 20upx 39upx;      // 再高 6upx(上下各+3upx)、再长 10upx(左右各+5upx)
+            border-radius: 40upx;
+            padding: 22upx 41upx;      // 再高 4upx(上下各+2upx)、再长 4upx(左右各+2upx)
             cursor: pointer;
             cursor: pointer;
             margin-left: 50upx;        // 增加按钮间距,设为 20upx(搜索按钮离采购远 20upx)
             margin-left: 50upx;        // 增加按钮间距,设为 20upx(搜索按钮离采购远 20upx)
             font-weight: bold;         // 加粗字重
             font-weight: bold;         // 加粗字重
             transition: all 0.2s ease;
             transition: all 0.2s ease;
+            -webkit-tap-highlight-color: transparent; // 额外保险,彻底禁用任何平台默认的矩形高亮/阴影闪现
 
 
             &:first-child {
             &:first-child {
               margin-left: 0;
               margin-left: 0;