From bef3d94968fc70667f3123cb23ee69550e08a5ca Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期四, 15 十月 2026 14:03:17 +0800
Subject: [PATCH] feat(crm): 优化合同管理及待办功能

---
 src/views/crm/backlog/index.vue |   40 +++++++++++++++++++++++++++++-----------
 1 files changed, 29 insertions(+), 11 deletions(-)

diff --git a/src/views/crm/backlog/index.vue b/src/views/crm/backlog/index.vue
index a183a22..432531f 100644
--- a/src/views/crm/backlog/index.vue
+++ b/src/views/crm/backlog/index.vue
@@ -1,4 +1,6 @@
 <script lang="ts" setup>
+import type { Ref } from 'vue';
+
 import { computed, onActivated, onMounted, ref, watch } from 'vue';
 
 import { Page } from '@vben/common-ui';
@@ -78,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();
-  if (!automaticApproval.value) contractAuditCount.value = await getAuditContractCount();
-  contractRemindCount.value = await getRemindContractCount();
-  if (!automaticApproval.value) 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;
 }
 
 /** 婵�娲绘椂 */
@@ -126,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