diff --git a/my-vue-app/src/views/person/components/SalesTimelineWithTaskList.vue b/my-vue-app/src/views/person/components/SalesTimelineWithTaskList.vue index cecb41e..7e67c50 100644 --- a/my-vue-app/src/views/person/components/SalesTimelineWithTaskList.vue +++ b/my-vue-app/src/views/person/components/SalesTimelineWithTaskList.vue @@ -77,7 +77,7 @@ -
+

{{ selectedContactDetails.name }} - 到课详情

@@ -222,6 +222,18 @@ const getStageCount = (stageType) => { return props.courseCustomers['课1-4'].length; } + // 单独的课程阶段(课1、课2、课3、课4) + if (['课1', '课2', '课3', '课4'].includes(stageType)) { + if (props.courseCustomers?.['课1-4']) { + const courseNumber = stageType.replace('课', ''); + return props.courseCustomers['课1-4'].filter(customer => { + // 检查客户是否参加了指定课程 + return customer.class_num && customer.class_num.includes(courseNumber); + }).length; + } + return 0; + } + // 后3个阶段从courseCustomers中筛选 if (['点击未支付', '付定金', '定金转化'].includes(stageType)) { if (props.courseCustomers?.['课1-4']) { @@ -251,11 +263,14 @@ const stages = computed(() => { { id: 3, name: '待入群', displayName: '待入群', count: getStageCount('待入群'), color: '#bbdefb' }, { id: 4, name: '待联系', displayName: '待联系', count: getStageCount('待联系'), color: '#bbdefb' }, { id: 5, name: '待到课', displayName: '待到课', count: getStageCount('待到课'), color: '#bbdefb' }, - { id: 6, name: '课1-4', displayName: '课1-4', count: getStageCount('课1-4'), color: '#64b5f6' }, - { id: 7, name: '点击未支付', displayName: '点击未支付', count: getStageCount('点击未支付'), color: '#42a5f5' }, - { id: 8, name: '付定金', displayName: '付定金', count: getStageCount('付定金'), color: '#2196f3' }, - { id: 9, name: '定金转化', displayName: '定金转化', count: getStageCount('定金转化'), color: '#1e88e5' }, - { id: 10, name: '成交', displayName: '成交', count: getStageCount('成交'), color: '#1976d2' } + { id: 6, name: '课1', displayName: '课1', count: getStageCount('课1'), color: '#81c784' }, + { id: 7, name: '课2', displayName: '课2', count: getStageCount('课2'), color: '#64b5f6' }, + { id: 8, name: '课3', displayName: '课3', count: getStageCount('课3'), color: '#ffb74d' }, + { id: 9, name: '课4', displayName: '课4', count: getStageCount('课4'), color: '#f06292' }, + { id: 10, name: '点击未支付', displayName: '点击未支付', count: getStageCount('点击未支付'), color: '#42a5f5' }, + { id: 11, name: '付定金', displayName: '付定金', count: getStageCount('付定金'), color: '#2196f3' }, + { id: 12, name: '定金转化', displayName: '定金转化', count: getStageCount('定金转化'), color: '#1e88e5' }, + { id: 13, name: '成交', displayName: '成交', count: getStageCount('成交'), color: '#1976d2' } ]; return stageList; @@ -281,6 +296,20 @@ const selectStage = (stageName) => { filteredCustomers: props.courseCustomers['课1-4'] }); return; + } else if (['课1', '课2', '课3', '课4'].includes(stageName)) { + // 单独的课程阶段 + if (props.courseCustomers?.['课1-4']) { + const courseNumber = stageName.replace('课', ''); + filteredCustomers = props.courseCustomers['课1-4'].filter(customer => { + return customer.class_num && customer.class_num.includes(courseNumber); + }); + } + emit('stage-select', stageName, { + isCourseStage: true, + courseData: filteredCustomers, + filteredCustomers: filteredCustomers + }); + return; } else if (stageName === '成交') { // 成交阶段使用payMoneyCustomersList数据 if (props.payMoneyCustomersList && props.payMoneyCustomersList.length > 0) { diff --git a/my-vue-app/src/views/person/sale.vue b/my-vue-app/src/views/person/sale.vue index fdf5a38..a6f48c8 100644 --- a/my-vue-app/src/views/person/sale.vue +++ b/my-vue-app/src/views/person/sale.vue @@ -366,9 +366,10 @@ async function getTimeline() { if(classRes.code === 200) { // 处理课1-4阶段的客户数据 if (classRes.data.class_customers_list) { + console.log(8888999,courseCustomers.value) // 存储课1-4阶段的原始数据,根据pay_status设置正确的type courseCustomers.value['课1-4'] = classRes.data.class_customers_list.map(customer => { - let customerType = '课1-4'; // 默认类型 + let customerType = ''; // 默认类型 // 根据pay_status设置具体的type if (customer.pay_status === '点击未支付') { @@ -677,7 +678,7 @@ const handleStageSelect = (stage, extraData = null) => { } else if (extraData && extraData.isCourseStage) { - // 处理课1-4阶段的课程数据(保持原有逻辑) + // 处理课程阶段的数据(课1-4、课1、课2、课3、课4) const courseContacts = extraData.courseData.map(customer => ({ @@ -687,8 +688,8 @@ const handleStageSelect = (stage, extraData = null) => { profession: customer.profession, education: customer.education, avatar: customer.avatar, - type: customer.type || '课1-4', // 保持原有type字段,如果没有则默认为课1-4 - salesStage: customer.type || '课1-4', // 使用customer.type作为salesStage + type: customer.type || stage, // 使用当前选中的阶段作为type + salesStage: customer.type || stage, // 使用customer.type或当前阶段作为salesStage health: customer.health, customer_name: customer.customer_name, customer_occupation: customer.customer_occupation,