feat(secondTop): 优化团队成员展示和排序逻辑
refactor(sale): 调整数据分析区域布局和样式 fix(router): 移除路由元信息注释 style(StatisticData): 调整统计卡片网格布局 feat(api): 新增顶级管理接口文件
This commit is contained in:
@@ -102,7 +102,7 @@ $white: #ffffff;
|
||||
// 统计指标卡片特定样式
|
||||
.stats-grid-inner {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
|
||||
grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
|
||||
gap: 0.75rem;
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
{{ routeUserName }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- 自己登录时的顶栏:原有样式 -->
|
||||
<template v-else>
|
||||
<h1 class="app-title">销售驾驶舱</h1>
|
||||
@@ -39,23 +39,7 @@
|
||||
<UserDropdown />
|
||||
</template>
|
||||
</div>
|
||||
|
||||
<div class="section-content">
|
||||
<!-- 数据分析区域加载状态 -->
|
||||
<div v-if="isKpiLoading || isStatisticsLoading || isUrgentProblemLoading" class="section-loading">
|
||||
<div class="loading-spinner"></div>
|
||||
<div class="loading-text">正在加载数据分析...</div>
|
||||
</div>
|
||||
<!-- 数据分析内容 -->
|
||||
<PersonalDashboard
|
||||
v-else
|
||||
:kpi-data="kpiData"
|
||||
:funnel-data="funnelData"
|
||||
:contact-time-data="contactTimeData"
|
||||
:statistics-data="statisticsData"
|
||||
:urgent-problem-data="urgentProblemData"
|
||||
/>
|
||||
</div>
|
||||
|
||||
</section>
|
||||
<!-- 销售时间线区域 -->
|
||||
<section class="timeline-section">
|
||||
@@ -119,7 +103,25 @@
|
||||
</section>
|
||||
</main>
|
||||
</div>
|
||||
|
||||
<section class="analytics-section-full" style="width: 100%;">
|
||||
|
||||
<div class="section-content">
|
||||
<!-- 数据分析区域加载状态 -->
|
||||
<div v-if="isKpiLoading || isStatisticsLoading || isUrgentProblemLoading" class="section-loading">
|
||||
<div class="loading-spinner"></div>
|
||||
<div class="loading-text">正在加载数据分析...</div>
|
||||
</div>
|
||||
<!-- 数据分析内容 -->
|
||||
<PersonalDashboard
|
||||
v-else
|
||||
:kpi-data="kpiData"
|
||||
:funnel-data="funnelData"
|
||||
:contact-time-data="contactTimeData"
|
||||
:statistics-data="statisticsData"
|
||||
:urgent-problem-data="urgentProblemData"
|
||||
/>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
@@ -132,7 +134,6 @@ import CustomerDetail from "./components/CustomerDetail.vue";
|
||||
import PersonalDashboard from "./components/PersonalDashboard.vue";
|
||||
import SalesTimelineWithTaskList from "./components/SalesTimelineWithTaskList.vue";
|
||||
import RawDataCards from "./components/RawDataCards.vue";
|
||||
// import FloatingTodo from "./components/FloatingTodo.vue";
|
||||
import UserDropdown from "@/components/UserDropdown.vue";
|
||||
import Loading from "@/components/Loading.vue";
|
||||
import {getCustomerAttendance,getTodayCall,getProblemDistribution,getTableFillingRate,getAverageResponseTime,
|
||||
@@ -501,50 +502,6 @@ async function getCustomerChat() {
|
||||
}
|
||||
try {
|
||||
const res = await getCustomerChatInfo(params)
|
||||
/**
|
||||
* message:[
|
||||
* 0:{content
|
||||
:
|
||||
"您好孩子妈妈,我是负责咱们本次课程的王慧老师[玫瑰]"
|
||||
format_add_time
|
||||
:
|
||||
"2天前"
|
||||
format_direction
|
||||
:
|
||||
"我"
|
||||
type
|
||||
:
|
||||
"文本"},
|
||||
1:{
|
||||
content
|
||||
:
|
||||
"嗯,王老师好"
|
||||
format_add_time
|
||||
:
|
||||
"2天前"
|
||||
format_direction
|
||||
:
|
||||
"客户"
|
||||
type
|
||||
:
|
||||
"文本"
|
||||
},
|
||||
3:{
|
||||
content
|
||||
:
|
||||
"孩子妈妈,您好,这个是咱们的青少年成长评估表。您这个抽一分钟的时间填写一下孩子的基本信息。填写完了之后,您跟老师说一声。"
|
||||
format_add_time
|
||||
:
|
||||
"2天前"
|
||||
format_direction
|
||||
:
|
||||
"我"
|
||||
type
|
||||
:
|
||||
"语音"
|
||||
}
|
||||
* ]
|
||||
*/
|
||||
if(res.code === 200) {
|
||||
chatRecords.value = res.data
|
||||
console.log('聊天数据获取成功:', res.data)
|
||||
@@ -854,9 +811,6 @@ $primary: #3b82f6;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 主要布局
|
||||
.main-layout {
|
||||
width: 100vw;
|
||||
@@ -1348,7 +1302,7 @@ $primary: #3b82f6;
|
||||
min-height: 400px;
|
||||
|
||||
@include desktop {
|
||||
min-height: 450px;
|
||||
min-height: 150px;
|
||||
}
|
||||
|
||||
@include tablet {
|
||||
|
||||
@@ -67,11 +67,7 @@
|
||||
</div>
|
||||
<div class="summary-item">
|
||||
<span class="label">成员数:</span>
|
||||
<span class="value">{{ selectedGroup.memberCount }}人</span>
|
||||
</div>
|
||||
<div class="summary-item">
|
||||
<span class="label">今日业绩:</span>
|
||||
<span class="value">{{ formatCurrency(selectedGroup.todayPerformance) }}</span>
|
||||
<span class="value">{{ (groupPerformance && groupPerformance.group_details) ? groupPerformance.group_details.length : 0 }}人</span>
|
||||
</div>
|
||||
<div class="summary-item">
|
||||
<span class="label">转化率:</span>
|
||||
@@ -87,11 +83,11 @@
|
||||
<div class="member-info">
|
||||
<h3 class="member-name">{{ member.name }}</h3>
|
||||
<p class="member-position">{{ member.position }}</p>
|
||||
<p class="member-phone">{{ member.phone }}</p>
|
||||
</div>
|
||||
<div class="member-status">
|
||||
<span class="status-badge" :class="member.status">{{ getStatusText(member.status) }}</span>
|
||||
<span class="join-date">入职: {{ member.joinDate }}</span>
|
||||
<!-- 本人排名 -->
|
||||
<div class="member-ranking">
|
||||
<span class="ranking-label">排名:</span>
|
||||
<span class="ranking-value">{{ member.rank }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -207,7 +203,6 @@
|
||||
return []
|
||||
})
|
||||
|
||||
|
||||
// 中心总业绩
|
||||
async function CenterOverallCenterPerformance() {
|
||||
const params = getRequestParams()
|
||||
@@ -484,55 +479,60 @@ const conversionRateVsAverage = ref({})
|
||||
// 选择组别函数
|
||||
const selectGroup = async (group) => {
|
||||
selectedGroup.value = group
|
||||
console.log('选中的组别111:', group)
|
||||
|
||||
// // 获取组名并调用API获取团队成员详情
|
||||
// let departmentName = group.name
|
||||
|
||||
// 获取组名并调用API获取团队成员详情
|
||||
let departmentName = group.name
|
||||
// // 如果有groupList数据,尝试找到完整的部门名称
|
||||
// if (groupList.value && groupList.value.formal_plural) {
|
||||
// const departmentKeys = Object.keys(groupList.value.formal_plural)
|
||||
// console.log('所有部门名称:', departmentKeys)
|
||||
// console.log('当前选中组别名称:', group.name)
|
||||
|
||||
// // 优先进行精确匹配
|
||||
// let matchedDepartment = departmentKeys.find(key => key === group.name)
|
||||
|
||||
// // 如果精确匹配失败,尝试模糊匹配
|
||||
// if (!matchedDepartment) {
|
||||
// matchedDepartment = departmentKeys.find(key => {
|
||||
// // 提取部门主要名称进行匹配(去掉经理名字部分)
|
||||
// const mainName = key.split('-')[0] || key
|
||||
// const groupMainName = group.name.split('-')[0] || group.name
|
||||
// return mainName.includes(groupMainName) || groupMainName.includes(mainName)
|
||||
// })
|
||||
// }
|
||||
|
||||
// if (matchedDepartment) {
|
||||
// departmentName = matchedDepartment
|
||||
// }
|
||||
// }
|
||||
|
||||
// 如果有groupList数据,尝试找到完整的部门名称
|
||||
if (groupList.value && groupList.value.formal_plural) {
|
||||
const departmentKeys = Object.keys(groupList.value.formal_plural)
|
||||
console.log('所有部门名称:', departmentKeys)
|
||||
console.log('当前选中组别名称:', group.name)
|
||||
|
||||
// 优先进行精确匹配
|
||||
let matchedDepartment = departmentKeys.find(key => key === group.name)
|
||||
|
||||
// 如果精确匹配失败,尝试模糊匹配
|
||||
if (!matchedDepartment) {
|
||||
matchedDepartment = departmentKeys.find(key => {
|
||||
// 提取部门主要名称进行匹配(去掉经理名字部分)
|
||||
const mainName = key.split('-')[0] || key
|
||||
const groupMainName = group.name.split('-')[0] || group.name
|
||||
return mainName.includes(groupMainName) || groupMainName.includes(mainName)
|
||||
})
|
||||
}
|
||||
|
||||
if (matchedDepartment) {
|
||||
departmentName = matchedDepartment
|
||||
}
|
||||
}
|
||||
|
||||
console.log('选中的组别:', group.name, '-> 发送的部门名称:', departmentName)
|
||||
// console.log('选中的组别:', group.name, '-> 发送的部门名称:', departmentName)
|
||||
const departmentName = group.name+'-'+group.leader
|
||||
|
||||
try {
|
||||
await CenterGroupPerformance(departmentName)
|
||||
|
||||
// 将API返回的数据整理后更新到selectedGroup的members字段
|
||||
if (groupPerformance.value && groupPerformance.value.group_details) {
|
||||
const formattedMembers = groupPerformance.value.group_details.map((member, index) => ({
|
||||
id: index + 1,
|
||||
name: member.name,
|
||||
position: '销售顾问', // 默认职位
|
||||
phone: '***-****-****', // 隐藏手机号
|
||||
status: member.rank === 1 ? 'excellent' : member.rank === 2 ? 'good' : 'average',
|
||||
joinDate: '2023-01-01', // 默认入职日期
|
||||
todayPerformance: member.today_performance || 0,
|
||||
monthlyPerformance: member.monthly_performance || 0,
|
||||
conversionRate: parseFloat(member.conversion_rate_this_period) || 0,
|
||||
callCount: member.call_count_this_period || 0,
|
||||
newClients: member.new_customers_this_period || 0,
|
||||
deals: member.deals_this_period || 0
|
||||
}))
|
||||
const formattedMembers = groupPerformance.value.group_details
|
||||
.map((member, index) => ({
|
||||
id: index + 1,
|
||||
name: member.name,
|
||||
position: '销售顾问', // 默认职位
|
||||
phone: '***-****-****', // 隐藏手机号
|
||||
status: member.rank === 1 ? 'excellent' : member.rank === 2 ? 'good' : 'average',
|
||||
joinDate: '2023-01-01', // 默认入职日期
|
||||
todayPerformance: member.today_performance || 0,
|
||||
monthlyPerformance: member.monthly_performance || 0,
|
||||
conversionRate: parseFloat(member.conversion_rate_this_period) || 0,
|
||||
callCount: member.call_count_this_period || 0,
|
||||
newClients: member.new_customers_this_period || 0,
|
||||
deals: member.deals_this_period || 0,
|
||||
rank: member.rank || 0
|
||||
}))
|
||||
.sort((a, b) => b.deals - a.deals) // 根据成交单数从高到低排序
|
||||
|
||||
// 更新selectedGroup的members数据
|
||||
selectedGroup.value = {
|
||||
@@ -575,16 +575,15 @@ const conversionRateVsAverage = ref({})
|
||||
return statusMap[status] || '未知'
|
||||
}
|
||||
onMounted(async () => {
|
||||
await CenterOverallCenterPerformance()
|
||||
await CenterTotalGroupCount()
|
||||
await CenterConversionRate()
|
||||
await CenterTotalCallCount()
|
||||
await CenterNewCustomer()
|
||||
await CenterDepositConversionRate()
|
||||
await CenterCustomerType()
|
||||
await CenterUrgentNeedToAddress()
|
||||
await CenterConversionRateVsAverage()
|
||||
|
||||
// await CenterOverallCenterPerformance()
|
||||
// await CenterTotalGroupCount()
|
||||
// await CenterConversionRate()
|
||||
// await CenterTotalCallCount()
|
||||
// await CenterNewCustomer()
|
||||
// await CenterDepositConversionRate()
|
||||
// await CenterCustomerType()
|
||||
// await CenterUrgentNeedToAddress()
|
||||
// await CenterConversionRateVsAverage()
|
||||
await CenterSeniorManagerList()
|
||||
await CenterGroupList('all') // 初始化加载全部高级经理数据
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user