From cd8b52bdf89a4d1101f72e0ece9f4df22a3d3f7a Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期四, 15 十月 2026 16:03:32 +0800
Subject: [PATCH] feat(mdm): 物料列表隐藏辅单位与销售价列

---
 src/views/crm/backlog/index.vue |   55 +++++++++++++++++++++++++++++++++++++++++--------------
 1 files changed, 41 insertions(+), 14 deletions(-)

diff --git a/src/views/crm/backlog/index.vue b/src/views/crm/backlog/index.vue
index 14828e0..432531f 100644
--- a/src/views/crm/backlog/index.vue
+++ b/src/views/crm/backlog/index.vue
@@ -1,9 +1,12 @@
 <script lang="ts" setup>
-import { computed, onActivated, onMounted, ref } from 'vue';
+import type { Ref } from 'vue';
 
-import { Page } from '../../../packages/effects/common-ui/src';
+import { computed, onActivated, onMounted, ref, watch } from 'vue';
+
+import { Page } from '@vben/common-ui';
 
 import { Badge, Card, List } from 'ant-design-vue';
+import { automaticApproval } from '#/store/audit-policy';
 
 import { getFollowClueCount } from '#/api/crm/clue';
 import {
@@ -49,6 +52,14 @@
   receivableAuditCount,
   receivablePlanRemindCount,
 );
+const visibleLeftSides = computed(() => leftSides.filter((item) =>
+  !automaticApproval.value || !['contractAudit', 'receivableAudit'].includes(item.menu),
+));
+watch(automaticApproval, (automatic) => {
+  if (automatic && ['contractAudit', 'receivableAudit'].includes(leftMenu.value)) {
+    leftMenu.value = 'customerTodayContact';
+  }
+});
 
 const currentComponent = computed(() => {
   const components = {
@@ -69,16 +80,32 @@
   leftMenu.value = item.menu;
 }
 
-/** 鑾峰彇鏁伴噺 */
-async function getCount() {
-  customerTodayContactCount.value = await getTodayContactCustomerCount();
-  customerPutPoolRemindCount.value = await getPutPoolRemindCustomerCount();
-  customerFollowCount.value = await getFollowCustomerCount();
-  clueFollowCount.value = await getFollowClueCount();
-  contractAuditCount.value = await getAuditContractCount();
-  contractRemindCount.value = await getRemindContractCount();
-  receivableAuditCount.value = await getAuditReceivableCount();
-  receivablePlanRemindCount.value = await getReceivablePlanRemindCount();
+/** 鐙珛鍔犺浇鍚勭被鏁伴噺锛屽崟涓帴鍙eけ璐ヤ笉闃绘柇鍏朵粬寰呭姙銆� */
+let countRequest: Promise<void> | undefined;
+function getCount() {
+  if (countRequest) return countRequest;
+  const requests: [Ref<number>, () => Promise<number>][] = [
+    [customerTodayContactCount, getTodayContactCustomerCount],
+    [customerPutPoolRemindCount, getPutPoolRemindCustomerCount],
+    [customerFollowCount, getFollowCustomerCount],
+    [clueFollowCount, getFollowClueCount],
+    [contractRemindCount, getRemindContractCount],
+    [receivablePlanRemindCount, getReceivablePlanRemindCount],
+  ];
+  if (!automaticApproval.value) {
+    requests.push(
+      [contractAuditCount, getAuditContractCount],
+      [receivableAuditCount, getAuditReceivableCount],
+    );
+  }
+  countRequest = Promise.allSettled(
+    requests.map(async ([count, request]) => {
+      count.value = await request();
+    }),
+  ).then(() => undefined).finally(() => {
+    countRequest = undefined;
+  });
+  return countRequest;
 }
 
 /** 婵�娲绘椂 */
@@ -95,7 +122,7 @@
   <Page auto-content-height>
     <div class="flex h-full w-full">
       <Card class="w-1/5">
-        <List item-layout="horizontal" :data-source="leftSides">
+        <List item-layout="horizontal" :data-source="visibleLeftSides">
           <template #renderItem="{ item }">
             <List.Item
               @click="sideClick(item)"
@@ -117,7 +144,7 @@
           </template>
         </List>
       </Card>
-      <component class="ml-4 w-4/5" :is="currentComponent" />
+      <component class="ml-4 w-4/5" :is="currentComponent" @refresh="getCount" />
     </div>
   </Page>
 </template>

--
Gitblit v1.9.3