feat(api): 新增销售漏斗和黄金联络时段API接口

feat(views): 添加销售漏斗和黄金联络时段数据展示功能
refactor(views): 优化客户详情组件的数据处理逻辑
fix(views): 修复业绩数据显示字段不一致问题
style(views): 调整路由导航顶栏样式
This commit is contained in:
2025-08-19 21:45:15 +08:00
parent 182130ba6a
commit 2b75f1b568
8 changed files with 326 additions and 138 deletions

View File

@@ -93,7 +93,16 @@
<span class="call-duration">{{ call.duration }}</span>
<span class="call-time">{{ call.time }}</span>
</div>
<div class="call-summary">{{ call.summary }}</div>
<div class="call-actions">
<button class="action-btn download-btn" @click="downloadRecording(call)">
<i class="icon-download"></i>
录音下载
</button>
<button class="action-btn view-btn" @click="viewTranscript(call)">
<i class="icon-view"></i>
查看原文
</button>
</div>
</div>
</div>
</div>
@@ -230,6 +239,43 @@ const callRecords = computed(() => {
}
]
})
// 录音下载方法
const downloadRecording = (call) => {
console.log('下载录音:', call)
// 检查是否有录音文件地址
if (call.record_file_addr_list && call.record_file_addr_list.length > 0) {
const recordingUrl = call.record_file_addr_list[0]
// 从URL中提取文件名
const urlParts = recordingUrl.split('/')
const fileName = urlParts[urlParts.length - 1]
// 创建下载链接
const link = document.createElement('a')
link.href = recordingUrl
link.download = fileName
link.target = '_blank'
// 触发下载
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
console.log(`正在下载录音文件: ${fileName}`)
} else {
alert('该通话记录暂无录音文件')
}
}
// 查看原文方法
const viewTranscript = (call) => {
// 这里可以根据实际需求实现查看原文逻辑
console.log('查看原文:', call)
// 示例:打开模态框显示通话原文
alert(`查看 ${call.time} 的通话原文:\n\n${call.summary}`)
}
</script>
<style lang="scss" scoped>
@@ -481,10 +527,56 @@ const callRecords = computed(() => {
}
}
.call-summary {
font-size: 14px;
color: #374151;
line-height: 1.5;
.call-actions {
display: flex;
gap: 12px;
margin-top: 12px;
.action-btn {
display: flex;
align-items: center;
gap: 6px;
padding: 8px 12px;
border: none;
border-radius: 6px;
font-size: 12px;
font-weight: 500;
cursor: pointer;
transition: all 0.2s ease;
&.download-btn {
background: #dbeafe;
color: #3b82f6;
&:hover {
background: #bfdbfe;
transform: translateY(-1px);
}
}
&.view-btn {
background: #d1fae5;
color: #059669;
&:hover {
background: #a7f3d0;
transform: translateY(-1px);
}
}
i {
width: 14px;
height: 14px;
&.icon-download::before {
content: '⬇';
}
&.icon-view::before {
content: '👁';
}
}
}
}
}
}