feat(销售时间线): 添加待填表单和待到课阶段的特殊筛选逻辑
为待填表单阶段添加筛选客户职业或子女教育为'未知'的逻辑 为待到课阶段添加筛选没有有效课程数据的客户逻辑
This commit is contained in:
@@ -332,6 +332,50 @@ const getStageCount = (stageType) => {
|
|||||||
}
|
}
|
||||||
return 0;
|
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中筛选
|
// 前6个阶段从customersList中筛选
|
||||||
if (props.customersList?.length) {
|
if (props.customersList?.length) {
|
||||||
return props.customersList.filter(customer => customer.type === stageType).length;
|
return props.customersList.filter(customer => customer.type === stageType).length;
|
||||||
|
|||||||
Reference in New Issue
Block a user