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"