feat(销售时间线): 添加待填表单和待到课阶段的特殊筛选逻辑

为待填表单阶段添加筛选客户职业或子女教育为'未知'的逻辑
为待到课阶段添加筛选没有有效课程数据的客户逻辑
This commit is contained in:
2025-08-28 22:00:04 +08:00
parent 2f380b1fe5
commit 2827d70f65

View File

@@ -332,6 +332,50 @@ const getStageCount = (stageType) => {
}
return 0;
}
// 待填表单阶段特殊处理筛选customer_occupation或customer_child_education字段为'未知'的客户
if (stageType === '待填表单') {
if (props.customersList?.length) {
return props.customersList.filter(customer => {
return (customer.customer_occupation === '未知' || !customer.customer_occupation) ||
(customer.customer_child_education === '未知' || !customer.customer_child_education);
}).length;
}
return 0;
}
// 待到课阶段特殊处理:筛选没有到课数据的客户
if (stageType === '待到课') {
if (props.customersList?.length) {
return props.customersList.filter(customer => {
const classNum = customer.class_num;
const classSituation = customer.class_situation;
// 优先检查class_num字段
if (classNum && Array.isArray(classNum) && classNum.length > 0) {
return false; // 有class_num数据不是待到课
}
// 检查class_situation字段
if (!classSituation) return true; // 没有class_situation是待到课
if (Array.isArray(classSituation)) {
return classSituation.length === 0; // 空数组,是待到课
}
if (typeof classSituation === 'object') {
const lessonNumbers = Object.keys(classSituation)
.map(key => parseInt(key))
.filter(num => !isNaN(num));
return lessonNumbers.length === 0; // 没有有效的课程数据,是待到课
}
return true; // 其他情况默认为待到课
}).length;
}
return 0;
}
// 前6个阶段从customersList中筛选
if (props.customersList?.length) {
return props.customersList.filter(customer => customer.type === stageType).length;