feat(calls): CallList 微信语音 客户/员工/姓名 单元格可点(复用聊天导航,对齐云客)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted, ref } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { ElMessage, type TabPaneName } from 'element-plus'
|
||||
import { getCalls } from '@/api'
|
||||
import type { CallChannel, PhoneCall } from '@/api/types'
|
||||
@@ -29,6 +30,8 @@ const recordDialogVisible = ref(false)
|
||||
const recordSrc = ref<string | null>(null)
|
||||
const recordTitle = ref('')
|
||||
|
||||
const router = useRouter()
|
||||
|
||||
// All-fields drawer state.
|
||||
const drawerOpen = ref(false)
|
||||
const drawerCall = ref<PhoneCall | null>(null)
|
||||
@@ -111,6 +114,24 @@ function openDrawer(row: PhoneCall): void {
|
||||
drawerOpen.value = true
|
||||
}
|
||||
|
||||
/** 客户昵称 → 该员工×客户 1:1 聊天(复用 Phase B 导航)。 */
|
||||
function viewCallCustomer(row: PhoneCall): void {
|
||||
const owner = cell(row, 'weChatId')
|
||||
const talker = cell(row, 'talker')
|
||||
if (!owner || !talker) return
|
||||
router.push({
|
||||
name: 'chat',
|
||||
params: { channel: 'wechat', ownerId: String(owner), talkerId: String(talker) },
|
||||
})
|
||||
}
|
||||
|
||||
/** 员工微信昵称 → 账号级聊天窗(复用 step 5 导航)。 */
|
||||
function viewCallStaff(row: PhoneCall): void {
|
||||
const owner = cell(row, 'weChatId')
|
||||
if (!owner) return
|
||||
router.push({ name: 'chat', params: { channel: 'wechat', ownerId: String(owner) } })
|
||||
}
|
||||
|
||||
const drawerSections = computed(() =>
|
||||
drawerCall.value ? buildCallSections(drawerCall.value) : [],
|
||||
)
|
||||
@@ -168,19 +189,22 @@ onMounted(load)
|
||||
</el-table-column>
|
||||
<el-table-column label="客户信息" min-width="150">
|
||||
<template #default="{ row }">
|
||||
<div>{{ cell(row, 'talkerNickName') || '--' }}</div>
|
||||
<el-button v-if="cell(row, 'talkerNickName')" link type="primary" size="small" @click.stop="viewCallCustomer(row)">{{ cell(row, 'talkerNickName') }}</el-button>
|
||||
<span v-else>--</span>
|
||||
<div class="yk-cell__sub">{{ row.call_number || cell(row, 'talker') || '--' }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="员工微信" min-width="150">
|
||||
<template #default="{ row }">
|
||||
<div>{{ cell(row, 'userWeChatNickName') || '--' }}</div>
|
||||
<el-button v-if="cell(row, 'userWeChatNickName')" link type="primary" size="small" @click.stop="viewCallStaff(row)">{{ cell(row, 'userWeChatNickName') }}</el-button>
|
||||
<span v-else>--</span>
|
||||
<div class="yk-cell__sub">{{ cell(row, 'userWeChatAlias') || cell(row, 'weChatId') || '--' }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="员工信息" min-width="130">
|
||||
<template #default="{ row }">
|
||||
<div>{{ row.user_id_name || '--' }}</div>
|
||||
<el-button v-if="row.user_id_name" link type="primary" size="small" @click.stop="openDrawer(row)">{{ row.user_id_name }}</el-button>
|
||||
<span v-else>--</span>
|
||||
<div class="yk-cell__sub">{{ cell(row, 'userPhone') || '--' }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
Reference in New Issue
Block a user