diff --git a/my-vue-app/src/views/person/components/SalesTimelineWithTaskList.vue b/my-vue-app/src/views/person/components/SalesTimelineWithTaskList.vue index 8323625..5a2b9e0 100644 --- a/my-vue-app/src/views/person/components/SalesTimelineWithTaskList.vue +++ b/my-vue-app/src/views/person/components/SalesTimelineWithTaskList.vue @@ -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;