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>
<!-- 到课详情区域 --> <!-- 到课详情区域 -->
<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"> <div class="course-details-header">
<h4>{{ selectedContactDetails.name }} - 到课详情</h4> <h4>{{ selectedContactDetails.name }} - 到课详情</h4>
</div> </div>
@@ -222,6 +222,18 @@ const getStageCount = (stageType) => {
return props.courseCustomers['课1-4'].length; 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中筛选 // 后3个阶段从courseCustomers中筛选
if (['点击未支付', '付定金', '定金转化'].includes(stageType)) { if (['点击未支付', '付定金', '定金转化'].includes(stageType)) {
if (props.courseCustomers?.['课1-4']) { if (props.courseCustomers?.['课1-4']) {
@@ -251,11 +263,14 @@ const stages = computed(() => {
{ id: 3, name: '待入群', displayName: '待入群', count: getStageCount('待入群'), color: '#bbdefb' }, { id: 3, name: '待入群', displayName: '待入群', count: getStageCount('待入群'), color: '#bbdefb' },
{ id: 4, name: '待联系', displayName: '待联系', count: getStageCount('待联系'), color: '#bbdefb' }, { id: 4, name: '待联系', displayName: '待联系', count: getStageCount('待联系'), color: '#bbdefb' },
{ id: 5, 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: 6, name: '课1', displayName: '课1', count: getStageCount('课1'), color: '#81c784' },
{ id: 7, name: '点击未支付', displayName: '点击未支付', count: getStageCount('点击未支付'), color: '#42a5f5' }, { id: 7, name: '课2', displayName: '课2', count: getStageCount('课2'), color: '#64b5f6' },
{ id: 8, name: '付定金', displayName: '付定金', count: getStageCount('付定金'), color: '#2196f3' }, { id: 8, name: '课3', displayName: '课3', count: getStageCount('课3'), color: '#ffb74d' },
{ id: 9, name: '定金转化', displayName: '定金转化', count: getStageCount('定金转化'), color: '#1e88e5' }, { id: 9, name: '课4', displayName: '课4', count: getStageCount('课4'), color: '#f06292' },
{ id: 10, name: '成交', displayName: '成交', count: getStageCount('成交'), color: '#1976d2' } { 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; return stageList;
@@ -281,6 +296,20 @@ const selectStage = (stageName) => {
filteredCustomers: props.courseCustomers['课1-4'] filteredCustomers: props.courseCustomers['课1-4']
}); });
return; 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 === '成交') { } else if (stageName === '成交') {
// 成交阶段使用payMoneyCustomersList数据 // 成交阶段使用payMoneyCustomersList数据
if (props.payMoneyCustomersList && props.payMoneyCustomersList.length > 0) { if (props.payMoneyCustomersList && props.payMoneyCustomersList.length > 0) {

View File

@@ -366,9 +366,10 @@ async function getTimeline() {
if(classRes.code === 200) { if(classRes.code === 200) {
// 处理课1-4阶段的客户数据 // 处理课1-4阶段的客户数据
if (classRes.data.class_customers_list) { if (classRes.data.class_customers_list) {
console.log(8888999,courseCustomers.value)
// 存储课1-4阶段的原始数据根据pay_status设置正确的type // 存储课1-4阶段的原始数据根据pay_status设置正确的type
courseCustomers.value['课1-4'] = classRes.data.class_customers_list.map(customer => { courseCustomers.value['课1-4'] = classRes.data.class_customers_list.map(customer => {
let customerType = '课1-4'; // 默认类型 let customerType = ''; // 默认类型
// 根据pay_status设置具体的type // 根据pay_status设置具体的type
if (customer.pay_status === '点击未支付') { if (customer.pay_status === '点击未支付') {
@@ -677,7 +678,7 @@ const handleStageSelect = (stage, extraData = null) => {
} else if (extraData && extraData.isCourseStage) { } else if (extraData && extraData.isCourseStage) {
// 处理课1-4阶段的课程数据(保持原有逻辑 // 处理课阶段的数据(课1-4、课1、课2、课3、课4
const courseContacts = extraData.courseData.map(customer => ({ const courseContacts = extraData.courseData.map(customer => ({
@@ -687,8 +688,8 @@ const handleStageSelect = (stage, extraData = null) => {
profession: customer.profession, profession: customer.profession,
education: customer.education, education: customer.education,
avatar: customer.avatar, avatar: customer.avatar,
type: customer.type || '课1-4', // 保持原有type字段如果没有则默认为课1-4 type: customer.type || stage, // 使用当前选中的阶段作为type
salesStage: customer.type || '课1-4', // 使用customer.type作为salesStage salesStage: customer.type || stage, // 使用customer.type或当前阶段作为salesStage
health: customer.health, health: customer.health,
customer_name: customer.customer_name, customer_name: customer.customer_name,
customer_occupation: customer.customer_occupation, customer_occupation: customer.customer_occupation,