refactor(views): 优化客户阶段显示逻辑和业绩单位显示
- 合并课1-4阶段显示,简化客户阶段逻辑 - 修改业绩显示单位为"单"而非货币 - 调整警告提示样式增加底部间距 - 完善组业绩详情请求参数处理
This commit is contained in:
@@ -91,6 +91,7 @@ const aggregatedAlerts = computed(() => {
|
|||||||
padding: 0.25rem;
|
padding: 0.25rem;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
font-size: 0.9rem;
|
font-size: 0.9rem;
|
||||||
|
margin-bottom: 0.2rem;
|
||||||
|
|
||||||
&.warning {
|
&.warning {
|
||||||
background: #fef3c7;
|
background: #fef3c7;
|
||||||
|
|||||||
@@ -316,23 +316,6 @@ const getStageCount = (stageType) => {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 课1-4阶段从courseCustomers获取数量
|
|
||||||
if (stageType === '课1-4' && props.courseCustomers?.['课1-4']) {
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 待填表单阶段特殊处理:筛选customer_occupation或customer_child_education字段为'未知'的客户
|
// 待填表单阶段特殊处理:筛选customer_occupation或customer_child_education字段为'未知'的客户
|
||||||
if (stageType === '待填表单') {
|
if (stageType === '待填表单') {
|
||||||
if (props.customersList?.length) {
|
if (props.customersList?.length) {
|
||||||
@@ -396,14 +379,11 @@ const stages = computed(() => {
|
|||||||
{ id: 3, name: '待入群', displayName: '待入群', count: getStageCount('待入群'), color: '#bbdefb' },
|
{ id: 3, name: '待入群', displayName: '待入群', count: getStageCount('待入群'), color: '#bbdefb' },
|
||||||
{ id: 4, name: '待联系', displayName: '待联系', count: getStageCount('待联系'), color: '#bbdefb' },
|
{ id: 4, name: '待联系', displayName: '待联系', count: getStageCount('待联系'), color: '#bbdefb' },
|
||||||
{ id: 5, name: '待到课', displayName: '待到课', count: getStageCount('待到课'), color: '#bbdefb'},
|
{ id: 5, name: '待到课', displayName: '待到课', count: getStageCount('待到课'), color: '#bbdefb'},
|
||||||
{ id: 6, name: '课1', displayName: '课1', count: getStageCount('课1'), color: '#81c784' },
|
{ id: 6, name: '课1-4', displayName: '课1-4', count: getStageCount('课1-4'), color: '#81c784' },
|
||||||
{ id: 7, name: '课2', displayName: '课2', count: getStageCount('课2'), color: '#64b5f6' },
|
{ id: 7, name: '点击未支付', displayName: '点击未支付', count: getStageCount('点击未支付'), color: '#42a5f5' },
|
||||||
{ id: 8, name: '课3', displayName: '课3', count: getStageCount('课3'), color: '#ffb74d' },
|
{ id: 8, name: '付定金', displayName: '付定金', count: getStageCount('付定金'), color: '#2196f3' },
|
||||||
{ id: 9, name: '课4', displayName: '课4', count: getStageCount('课4'), color: '#f06292' },
|
{ id: 9, name: '定金转化', displayName: '定金转化', count: getStageCount('定金转化'), color: '#1e88e5' },
|
||||||
{ id: 10, name: '点击未支付', displayName: '点击未支付', count: getStageCount('点击未支付'), color: '#42a5f5' },
|
{ id: 10, name: '成交', displayName: '成交', count: getStageCount('成交'), color: '#1976d2' }
|
||||||
{ 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;
|
return stageList;
|
||||||
@@ -451,20 +431,7 @@ const selectStage = (stageName) => {
|
|||||||
filteredCustomers: props.courseCustomers['课1-4']
|
filteredCustomers: props.courseCustomers['课1-4']
|
||||||
});
|
});
|
||||||
return;
|
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 === '成交') {
|
} else if (stageName === '成交') {
|
||||||
// 成交阶段使用payMoneyCustomersList数据
|
// 成交阶段使用payMoneyCustomersList数据
|
||||||
if (props.payMoneyCustomersList && props.payMoneyCustomersList.length > 0) {
|
if (props.payMoneyCustomersList && props.payMoneyCustomersList.length > 0) {
|
||||||
|
|||||||
@@ -693,7 +693,10 @@ const conversionRateVsAverage = ref({})
|
|||||||
|
|
||||||
// 根据传来的组名字来获取组业绩详情
|
// 根据传来的组名字来获取组业绩详情
|
||||||
async function CenterGroupPerformance(groupName) {
|
async function CenterGroupPerformance(groupName) {
|
||||||
const params = getRequestParams()
|
const routeParams = getRequestParams()
|
||||||
|
const params = routeParams.user_name
|
||||||
|
? routeParams
|
||||||
|
: {user_name: userStore.userInfo.username, user_level: userStore.userInfo.user_level.toString()}
|
||||||
const hasParams = params.user_name
|
const hasParams = params.user_name
|
||||||
const requestParams = hasParams ? {
|
const requestParams = hasParams ? {
|
||||||
...params,
|
...params,
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
<div class="key-metrics">
|
<div class="key-metrics">
|
||||||
<div class="mini-metric">
|
<div class="mini-metric">
|
||||||
<span class="mini-label">业绩</span>
|
<span class="mini-label">业绩</span>
|
||||||
<span class="mini-value">{{ formatCurrency(group.todayPerformance) }}</span>
|
<span class="mini-value">{{ group.todayPerformance }}单</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="mini-metric">
|
<div class="mini-metric">
|
||||||
<span class="mini-label">转化</span>
|
<span class="mini-label">转化</span>
|
||||||
@@ -84,7 +84,7 @@ const processedGroups = computed(() => {
|
|||||||
id: index + 1,
|
id: index + 1,
|
||||||
name: name,
|
name: name,
|
||||||
leader: leader,
|
leader: leader,
|
||||||
todayPerformance: performance * 10000, // 假设单位转换
|
todayPerformance: performance, // 假设单位转换
|
||||||
conversionRate: conversionRate,
|
conversionRate: conversionRate,
|
||||||
newClients: Math.floor(performance * 2.5), // 根据业绩估算
|
newClients: Math.floor(performance * 2.5), // 根据业绩估算
|
||||||
deals: performance,
|
deals: performance,
|
||||||
|
|||||||
Reference in New Issue
Block a user