From 2827d70f65212b801350a69c05f8c2eefa56fd68 Mon Sep 17 00:00:00 2001 From: chenpanliang <3245129380@qq.com> Date: Thu, 28 Aug 2025 22:00:04 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E9=94=80=E5=94=AE=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E7=BA=BF):=20=E6=B7=BB=E5=8A=A0=E5=BE=85=E5=A1=AB=E8=A1=A8?= =?UTF-8?q?=E5=8D=95=E5=92=8C=E5=BE=85=E5=88=B0=E8=AF=BE=E9=98=B6=E6=AE=B5?= =?UTF-8?q?=E7=9A=84=E7=89=B9=E6=AE=8A=E7=AD=9B=E9=80=89=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 为待填表单阶段添加筛选客户职业或子女教育为'未知'的逻辑 为待到课阶段添加筛选没有有效课程数据的客户逻辑 --- .../components/SalesTimelineWithTaskList.vue | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) 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;