From b63b71bf68862520cc3fb5274e0d77ec9b6f12f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=85=E5=BF=B5?= Date: Thu, 6 Aug 2026 17:47:02 +0800 Subject: [PATCH] =?UTF-8?q?feat(staff):=20=E5=BE=AE=E4=BF=A1=E5=91=98?= =?UTF-8?q?=E5=B7=A5=E6=98=8E=E7=BB=86=20modal=20=E5=86=85=E5=AE=A2?= =?UTF-8?q?=E6=88=B7=E5=BE=AE=E4=BF=A1=20=E2=86=92=20=E8=81=8A=E5=A4=A9?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=EF=BC=88=E4=BA=8C=E7=BA=A7=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude --- yunkes/src/views/StaffList.vue | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/yunkes/src/views/StaffList.vue b/yunkes/src/views/StaffList.vue index 6117d31..ee51155 100644 --- a/yunkes/src/views/StaffList.vue +++ b/yunkes/src/views/StaffList.vue @@ -3,7 +3,7 @@ import { computed, onMounted, reactive, ref } from 'vue' import { useRouter } from 'vue-router' import { ElMessage } from 'element-plus' import { getAccounts, getCustomers, getMessages } from '@/api' -import type { Account, Channel } from '@/api/types' +import type { Account, Channel, Customer } from '@/api/types' import YkStaffDetailModal from '@/components/YkStaffDetailModal.vue' import { useChannelStore } from '@/stores/channel' import { channelLabel, formatTime } from '@/utils/format' @@ -274,13 +274,26 @@ function openTalkedModal(row: Account) { /** 微信员工「沟通数」3 数字 → 明细 modal(数据源:该员工客户列表,度量精确区分见 plan 数据源说明)。 */ function openWechatCommModal(row: Account, title: string, withMsgCols: boolean): void { detailTitle.value = `${title} · ${row.user_name ?? row.account_id}` + // 客户微信列可点 → 跳该客户聊天记录(ChatTimeline,name:'chat' 路由同 CustomerList.viewChat)。 + // modal 列数据是 Customer,goChat 守卫 owner/friend 存在;缺失则静默 no-op(与 onClick?: 一致)。 + const goChat = (r: Customer) => { + if (!r.owner_account_id || !r.friend_id) return + router.push({ + name: 'chat', + params: { + channel: r.channel, + ownerId: r.owner_account_id, + talkerId: r.friend_id, + }, + }) + } detailCols.value = withMsgCols ? [ - { prop: 'friend_nickname', label: '客户微信', minWidth: 160 }, + { prop: 'friend_nickname', label: '客户微信', minWidth: 160, onClick: goChat }, { prop: 'send_num', label: '发送消息数', width: 110, align: 'center' }, { prop: 'receive_num', label: '接收消息数', width: 110, align: 'center' }, ] - : [{ prop: 'friend_nickname', label: '客户微信', minWidth: 160 }] + : [{ prop: 'friend_nickname', label: '客户微信', minWidth: 160, onClick: goChat }] detailFetcher.value = async (page: number, page_size: number) => getCustomers({ channel: 'wechat', owner_account_id: row.account_id, page, page_size }) detailOpen.value = true