feat(销售阶段): 拆分课1-4阶段为单独课程阶段并优化逻辑

- 将课1-4阶段拆分为课1、课2、课3、课4四个独立阶段
- 修改客户类型和销售阶段处理逻辑,使用当前选中阶段作为默认值
- 添加课程阶段筛选功能,支持按具体课程筛选客户
- 更新销售时间线组件以支持新的课程阶段显示
This commit is contained in:
2025-08-25 21:05:07 +08:00
parent 41058a7ab9
commit 87cc0e4976
2 changed files with 40 additions and 10 deletions

View File

@@ -77,7 +77,7 @@
</div>
<!-- 到课详情区域 -->
<div v-if="selectedContactId && selectedContactDetails && selectedStage === '课1-4'" class="course-details">
<div v-if="selectedContactId && selectedContactDetails && (['课1-4', '课1', '课2', '课3', '课4'].includes(selectedStage))" class="course-details">
<div class="course-details-header">
<h4>{{ selectedContactDetails.name }} - 到课详情</h4>
</div>
@@ -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) {