From dfa4fdd420dbaa2c891634c20541d73e685d130d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=85=E5=BF=B5?= Date: Tue, 8 Sep 2026 14:27:25 +0800 Subject: [PATCH] =?UTF-8?q?fix(customers):=20=E5=A5=BD=E5=8F=8B=E6=95=B0?= =?UTF-8?q?=E8=B7=B3=E8=BD=AC=E5=88=86=E9=A1=B5=E7=94=A8=E7=9C=9F=E5=AE=9E?= =?UTF-8?q?=E8=BF=87=E6=BB=A4=E6=95=B0=E2=80=94=E2=80=94=E5=A3=B0=E6=98=8E?= =?UTF-8?q?=E5=8F=A3=E5=BE=84=E4=BB=85=E6=97=A0=E8=BF=87=E6=BB=A4=E6=97=B6?= =?UTF-8?q?=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 员工列表点「好友数」跳 /customers?owner_account_id=x 后,头部计数与 el-pagination 的 :total 都绑 declaredTotals(云客口径全局声明值,Σ员工 好友数,不吃任何过滤)——列表只有该员工 9 条,分页却按全部客户 8956 条/ 1792 页展示,用户报「不是员工下面的好友列表」。 修:新增 displayTotal()——无过滤时保持声明口径(页脚对齐云客的产品 定调不变),department/owner 任一过滤生效时回到 tabState 真实 total。 头部计数与微信/WA 两处分页器三处统一走它。 Co-Authored-By: Claude Code --- yunkes/src/views/CustomerList.vue | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/yunkes/src/views/CustomerList.vue b/yunkes/src/views/CustomerList.vue index 0ef03d7..3fe7964 100644 --- a/yunkes/src/views/CustomerList.vue +++ b/yunkes/src/views/CustomerList.vue @@ -43,6 +43,20 @@ function freshTabState(pageSize = 5): TabState { /** 云客口径客户合计(分渠道,Σ员工好友数声明值,含云客索引重复;页脚对齐云客)。 */ const declaredTotals = ref<{ wechat: number | null; whatsapp: number | null }>({ wechat: null, whatsapp: null }) +/** 列表过滤是否生效(部门/员工)——生效时计数与分页必须用真实 total,声明口径是 + * 全局值不吃过滤:员工列表点「好友数」跳入时曾把 8956 当分页总数,列表却只有 + * 该员工的 9 条,翻页按全部客户算(2026-09-08 用户报「不是员工下面的好友列表」)。 */ +const filtered = computed( + () => departmentId.value !== null || ownerId.value !== null, +) + +/** 展示用总数:无过滤时对齐云客声明口径(产品定调),有过滤时回到真实结果数。 */ +function displayTotal(tab: TabKey): number { + return !filtered.value && declaredTotals.value[tab] !== null + ? (declaredTotals.value[tab] as number) + : tabState[tab].total +} + async function loadDeclaredTotal(): Promise { try { const r = await getCustomerDeclaredTotal() @@ -440,7 +454,7 @@ onMounted(() => {

{{ activeTab === 'wechat' ? '微信' : 'WhatsApp' }}客户列表

- 共 {{ declaredTotals[activeTab] !== null ? declaredTotals[activeTab] : tabState[activeTab].total }} 条 + 共 {{ displayTotal(activeTab) }} 条 @@ -589,7 +603,7 @@ onMounted(() => { :current-page="tabState.wechat.page" :page-size="tabState.wechat.pageSize" :page-sizes="[5, 10, 20, 50, 100]" - :total="declaredTotals.wechat ?? tabState.wechat.total" + :total="displayTotal('wechat')" layout="total, sizes, prev, pager, next, jumper" background @current-change="onWechatPageChange" @@ -726,7 +740,7 @@ onMounted(() => { :current-page="tabState.whatsapp.page" :page-size="tabState.whatsapp.pageSize" :page-sizes="[5, 10, 20, 50, 100]" - :total="declaredTotals.whatsapp ?? tabState.whatsapp.total" + :total="displayTotal('whatsapp')" layout="total, sizes, prev, pager, next, jumper" background @current-change="onWhatsappPageChange"