diff --git a/my-vue-app/src/views/person/components/SalesTimelineWithTaskList.vue b/my-vue-app/src/views/person/components/SalesTimelineWithTaskList.vue index ee5dfc1..946b6f3 100644 --- a/my-vue-app/src/views/person/components/SalesTimelineWithTaskList.vue +++ b/my-vue-app/src/views/person/components/SalesTimelineWithTaskList.vue @@ -6,7 +6,8 @@ 客户转化全流程跟踪
- + +
@@ -432,7 +433,66 @@ const handleUnassignedRecordingsClick = async () => { // 优先使用路由参数,其次是 Pinia store 中的用户信息,最后是备用值 const user_name = routeParams.user_name || userStore.userInfo?.username || 'example_user'; - const response = await axios.post('http://192.168.15.121:8890/api/v1/sales_timeline/get_sale_unassigned_call_info', { + const response = await axios.post('https://mldash.nycjy.cn/api/v1/sales_timeline/get_sale_unassigned_call_info', { + user_name: user_name + }); + + console.log('API Response:', response.data.data); + + // --- 数据处理逻辑,以支持分类 --- + const apiData = response.data.data; + const tempCategorizedData = {}; // 临时对象 + let uniqueId = 0; + + for (const category in apiData) { + if (Object.prototype.hasOwnProperty.call(apiData, category)) { + const categoryData = apiData[category]; + tempCategorizedData[category] = []; // 为每个分类创建一个空数组 + + if (categoryData && Array.isArray(categoryData.records)) { + categoryData.records.forEach(record => { + tempCategorizedData[category].push({ // 将记录添加到对应的分类数组中 + id: uniqueId++, + name: `录音 ${uniqueId}`, + time: new Date(record.record_create_time).toLocaleString('zh-CN'), + type: record.record_tag, + downloadUrl: record.record_file_addr, + duration: record.call_duration ? `${record.call_duration} 分钟` : '未知', + score: record.score || '暂无', + details: record.report_content || '暂无详细报告内容。' + }); + }); + } + } + } + + // 更新状态 + categorizedRecordings.value = tempCategorizedData; + recordingCategories.value = Object.keys(tempCategorizedData); + // 默认选中第一个Tab + if (recordingCategories.value.length > 0) { + selectedCategory.value = recordingCategories.value[0]; + } else { + selectedCategory.value = null; + } + + showUnassignedRecordingsModal.value = true; + } catch (error) { + console.error('API请求失败:', error); + alert('获取录音列表失败,请稍后再试。'); + } +}; + +// --- 新增:处理全部录音按钮点击事件 --- +const handleAllRecordingsClick = async () => { + try { + const userStore = useUserStore(); + const routeParams = getRequestParams(); // 获取路由参数 + + // 优先使用路由参数,其次是 Pinia store 中的用户信息,最后是备用值 + const user_name = routeParams.user_name || userStore.userInfo?.username || 'example_user'; + + const response = await axios.post('https://mldash.nycjy.cn/api/v1/sales_timeline/get_sale_all_call_info', { user_name: user_name });