diff --git a/my-vue-app/src/views/person/components/SalesTimelineWithTaskList.vue b/my-vue-app/src/views/person/components/SalesTimelineWithTaskList.vue index 7cbf3c0..4e2a187 100644 --- a/my-vue-app/src/views/person/components/SalesTimelineWithTaskList.vue +++ b/my-vue-app/src/views/person/components/SalesTimelineWithTaskList.vue @@ -36,7 +36,7 @@ - +
@@ -46,14 +46,14 @@ 转化率: {{ getCourseConversionRate(1) }}%
-
+
课1 {{ getCourseStageCount(1, '课1') }}
-
+
付定金 @@ -69,35 +69,35 @@ 课2
-
+
课2 {{ getCourseStageCount(2, '课2') }}
-
+
点击支付 {{ getCourseStageCount(2, '点击未支付') }}
-
+
付定金 {{ getCourseStageCount(2, '付定金') }}
-
+
定金转化 {{ getCourseStageCount(2, '定金转化') }}
-
+
成交 @@ -113,35 +113,35 @@ 课3
-
+
课3 {{ getCourseStageCount(3, '课3') }}
-
+
点击未支付 {{ getCourseStageCount(3, '点击未支付') }}
-
+
付定金 {{ getCourseStageCount(3, '付定金') }}
-
+
定金转化 {{ getCourseStageCount(3, '定金转化') }}
-
+
成交 @@ -157,35 +157,35 @@ 课4
-
+
课4 {{ getCourseStageCount(4, '课4') }}
-
+
点击未付 {{ getCourseStageCount(4, '点击未支付') }}
-
+
付定金 {{ getCourseStageCount(4, '付定金') }}
-
+
定金转化 {{ getCourseStageCount(4, '定金转化') }}
-
+
成交 @@ -195,7 +195,7 @@
-
+
@@ -768,6 +768,55 @@ const getHealthClass = (health) => { return 'health-danger'; } }; + +// 选择课程阶段 +const selectCourseStage = (courseNumber, stageType) => { + let filteredCustomers = []; + + if (stageType === `课${courseNumber}`) { + // 课程阶段:从customersList中筛选 + filteredCustomers = props.customersList.filter(customer => { + const classNum = customer.class_num; + const classSituation = customer.class_situation; + + // 检查class_num字段 + if (classNum && Array.isArray(classNum)) { + return classNum.includes(courseNumber); + } + + // 检查class_situation字段 + if (classSituation) { + if (Array.isArray(classSituation)) { + return classSituation.includes(courseNumber); + } + if (typeof classSituation === 'object') { + return classSituation.hasOwnProperty(courseNumber.toString()); + } + } + + return false; + }); + } else { + // 其他阶段:从courseCustomers中筛选 + if (props.courseCustomers?.['课1-4']) { + filteredCustomers = props.courseCustomers['课1-4'].filter(customer => { + // 检查客户是否参加了指定课程并且类型匹配 + const hasAttendedCourse = customer.class_num && customer.class_num.includes(courseNumber); + return hasAttendedCourse && customer.type === stageType; + }); + } + } + + // 发送子时间轴选择事件给父组件,使用不同的事件名称避免与主轴冲突 + emit('sub-stage-select', { + filteredCustomers, + stageType: `课${courseNumber}-${stageType}`, + customerCount: filteredCustomers.length, + courseNumber, + originalStageType: stageType, + keepSubTimeline: true // 标识保持子时间轴显示 + }); +};