From 87cc0e49760bbd7ea9ffaf416a8f9f0d2b062afc Mon Sep 17 00:00:00 2001
From: lbw_9527443 <780139497@qq.com>
Date: Mon, 25 Aug 2025 21:05:07 +0800
Subject: [PATCH] =?UTF-8?q?feat(=E9=94=80=E5=94=AE=E9=98=B6=E6=AE=B5):=20?=
=?UTF-8?q?=E6=8B=86=E5=88=86=E8=AF=BE1-4=E9=98=B6=E6=AE=B5=E4=B8=BA?=
=?UTF-8?q?=E5=8D=95=E7=8B=AC=E8=AF=BE=E7=A8=8B=E9=98=B6=E6=AE=B5=E5=B9=B6?=
=?UTF-8?q?=E4=BC=98=E5=8C=96=E9=80=BB=E8=BE=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 将课1-4阶段拆分为课1、课2、课3、课4四个独立阶段
- 修改客户类型和销售阶段处理逻辑,使用当前选中阶段作为默认值
- 添加课程阶段筛选功能,支持按具体课程筛选客户
- 更新销售时间线组件以支持新的课程阶段显示
---
.../components/SalesTimelineWithTaskList.vue | 41 ++++++++++++++++---
my-vue-app/src/views/person/sale.vue | 9 ++--
2 files changed, 40 insertions(+), 10 deletions(-)
diff --git a/my-vue-app/src/views/person/components/SalesTimelineWithTaskList.vue b/my-vue-app/src/views/person/components/SalesTimelineWithTaskList.vue
index cecb41e..7e67c50 100644
--- a/my-vue-app/src/views/person/components/SalesTimelineWithTaskList.vue
+++ b/my-vue-app/src/views/person/components/SalesTimelineWithTaskList.vue
@@ -77,7 +77,7 @@
-
+
@@ -222,6 +222,18 @@ const getStageCount = (stageType) => {
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中筛选
if (['点击未支付', '付定金', '定金转化'].includes(stageType)) {
if (props.courseCustomers?.['课1-4']) {
@@ -251,11 +263,14 @@ const stages = computed(() => {
{ id: 3, name: '待入群', displayName: '待入群', count: getStageCount('待入群'), color: '#bbdefb' },
{ id: 4, 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: 7, name: '点击未支付', displayName: '点击未支付', count: getStageCount('点击未支付'), color: '#42a5f5' },
- { id: 8, name: '付定金', displayName: '付定金', count: getStageCount('付定金'), color: '#2196f3' },
- { id: 9, name: '定金转化', displayName: '定金转化', count: getStageCount('定金转化'), color: '#1e88e5' },
- { id: 10, name: '成交', displayName: '成交', count: getStageCount('成交'), color: '#1976d2' }
+ { id: 6, name: '课1', displayName: '课1', count: getStageCount('课1'), color: '#81c784' },
+ { id: 7, name: '课2', displayName: '课2', count: getStageCount('课2'), color: '#64b5f6' },
+ { id: 8, name: '课3', displayName: '课3', count: getStageCount('课3'), color: '#ffb74d' },
+ { id: 9, name: '课4', displayName: '课4', count: getStageCount('课4'), color: '#f06292' },
+ { 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;
@@ -281,6 +296,20 @@ const selectStage = (stageName) => {
filteredCustomers: props.courseCustomers['课1-4']
});
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 === '成交') {
// 成交阶段使用payMoneyCustomersList数据
if (props.payMoneyCustomersList && props.payMoneyCustomersList.length > 0) {
diff --git a/my-vue-app/src/views/person/sale.vue b/my-vue-app/src/views/person/sale.vue
index fdf5a38..a6f48c8 100644
--- a/my-vue-app/src/views/person/sale.vue
+++ b/my-vue-app/src/views/person/sale.vue
@@ -366,9 +366,10 @@ async function getTimeline() {
if(classRes.code === 200) {
// 处理课1-4阶段的客户数据
if (classRes.data.class_customers_list) {
+ console.log(8888999,courseCustomers.value)
// 存储课1-4阶段的原始数据,根据pay_status设置正确的type
courseCustomers.value['课1-4'] = classRes.data.class_customers_list.map(customer => {
- let customerType = '课1-4'; // 默认类型
+ let customerType = ''; // 默认类型
// 根据pay_status设置具体的type
if (customer.pay_status === '点击未支付') {
@@ -677,7 +678,7 @@ const handleStageSelect = (stage, extraData = null) => {
} else if (extraData && extraData.isCourseStage) {
- // 处理课1-4阶段的课程数据(保持原有逻辑)
+ // 处理课程阶段的数据(课1-4、课1、课2、课3、课4)
const courseContacts = extraData.courseData.map(customer => ({
@@ -687,8 +688,8 @@ const handleStageSelect = (stage, extraData = null) => {
profession: customer.profession,
education: customer.education,
avatar: customer.avatar,
- type: customer.type || '课1-4', // 保持原有type字段,如果没有则默认为课1-4
- salesStage: customer.type || '课1-4', // 使用customer.type作为salesStage
+ type: customer.type || stage, // 使用当前选中的阶段作为type
+ salesStage: customer.type || stage, // 使用customer.type或当前阶段作为salesStage
health: customer.health,
customer_name: customer.customer_name,
customer_occupation: customer.customer_occupation,