feat(secondTop): 优化团队成员展示和排序逻辑
refactor(sale): 调整数据分析区域布局和样式 fix(router): 移除路由元信息注释 style(StatisticData): 调整统计卡片网格布局 feat(api): 新增顶级管理接口文件
This commit is contained in:
@@ -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