fix: 更新API基础路径并优化销售进度展示
修复API基础路径配置错误,将IP地址从192.168.15.53更新为192.168.15.54 重构销售进度组件,移除提示信息改为展示实时团队数据 优化KPI指标显示文本和数据处理逻辑
This commit is contained in:
@@ -16,10 +16,8 @@
|
||||
<div class="dashboard-row row-1">
|
||||
<!-- 核心业绩指标 -->
|
||||
<kpi-metrics :kpi-data="totalDeals" :format-number="formatNumber" />
|
||||
|
||||
<!-- 销售实时进度 -->
|
||||
<sales-progress :sales-data="salesData" />
|
||||
|
||||
<sales-progress :sales-data="realTimeProgress" />
|
||||
<!-- 下发任务 -->
|
||||
<task-list
|
||||
:tasks="tasks"
|
||||
@@ -592,19 +590,127 @@ async function getTotalDeals() {
|
||||
const res4=await getCompanyNewCustomer()
|
||||
const res5=await getCompanyConversionRate()
|
||||
totalDeals.value={
|
||||
totalDeals:res1.data,
|
||||
totalAmount:res1.data,
|
||||
conversionRate:res2.data,
|
||||
totalCallCount:res3.data,
|
||||
newCustomer:res4.data,
|
||||
conversionRate:res5.data,
|
||||
totalDeal:res1.data, //总成交单数
|
||||
DingconversionRate:res2.data, //定金转化率
|
||||
totalCallCount:res3.data, // 总通话
|
||||
newCustomer:res4.data, //新客户
|
||||
conversionRate:res5.data,//转化率
|
||||
}
|
||||
|
||||
|
||||
} catch (error) {
|
||||
console.error("获取总成交金额失败:", error);
|
||||
}
|
||||
}
|
||||
// 实时进度
|
||||
const realTimeProgress = ref({});
|
||||
async function getRealTimeProgress() {
|
||||
try {
|
||||
const res = await getCompanyRealTimeProgress()
|
||||
// console.log(111111,res)
|
||||
realTimeProgress.value = res.data
|
||||
} catch (error) {
|
||||
console.error("获取实时进度失败:", error);
|
||||
}
|
||||
}
|
||||
// 转化对比
|
||||
const conversionComparison = ref({});
|
||||
async function getConversionComparison(data) {
|
||||
const params={
|
||||
check_type:data,
|
||||
}
|
||||
try {
|
||||
const res = await getCompanyConversionRateVsLast(params)
|
||||
console.log(111111,res)
|
||||
conversionComparison.value = res.data
|
||||
} catch (error) {
|
||||
console.error("获取转化对比失败:", error);
|
||||
}
|
||||
}
|
||||
|
||||
// 获取全公司销售月度业绩红黑榜 params:{"rank_type": "red" // "rank_type": "black"}
|
||||
const companySalesRank = ref({});
|
||||
async function getCompanySalesRank(Rank) {
|
||||
const params={
|
||||
rank_type:Rank,
|
||||
}
|
||||
try {
|
||||
const res = await getSalesMonthlyPerformance(params)
|
||||
console.log(1222222,res)
|
||||
companySalesRank.value = res.data
|
||||
} catch (error) {
|
||||
console.error("获取销售月度业绩红黑榜失败:", error);
|
||||
}
|
||||
}
|
||||
// 获取全中心业绩排行榜
|
||||
const centerSalesRank = ref({});
|
||||
async function getCenterSalesRank(data) {
|
||||
const params={
|
||||
check_type:data //periods、month、year
|
||||
}
|
||||
try {
|
||||
const res = await getCenterPerformanceRank(params)
|
||||
console.log(1222222,res)
|
||||
centerSalesRank.value = res.data
|
||||
} catch (error) {
|
||||
console.error("获取全中心业绩排行榜失败:", error);
|
||||
}
|
||||
}
|
||||
// 客户类型占比
|
||||
const customerTypeRatio = ref({});
|
||||
async function getCustomerTypeRatio(data) {
|
||||
const params={
|
||||
distribution_type:data // child_education territory occupation
|
||||
}
|
||||
try {
|
||||
const res = await getCustomerTypeDistribution(params)
|
||||
console.log(1222222,res)
|
||||
customerTypeRatio.value = res.data
|
||||
} catch (error) {
|
||||
console.error("获取客户类型占比失败:", error);
|
||||
}
|
||||
}
|
||||
// 客户迫切解决的问题排行榜
|
||||
const customerUrgency = ref({});
|
||||
async function getCustomerUrgency() {
|
||||
try {
|
||||
const res = await getUrgentNeedToAddress()
|
||||
console.log(1222222,res)
|
||||
customerUrgency.value = res.data
|
||||
} catch (error) {
|
||||
console.error("获取客户迫切解决的问题排行榜失败:", error);
|
||||
}
|
||||
}
|
||||
// 获取级别树
|
||||
const levelTree = ref({});
|
||||
async function CusotomGetLevelTree() {
|
||||
try {
|
||||
const res = await getLevelTree()
|
||||
console.log(1222222,res)
|
||||
levelTree.value = res.data
|
||||
} catch (error) {
|
||||
console.error("获取级别树失败:", error);
|
||||
}
|
||||
}
|
||||
// 获取详细数据表格
|
||||
const detailData = ref({});
|
||||
async function getDetailData(level) {
|
||||
const params={
|
||||
level,
|
||||
}
|
||||
try {
|
||||
const res = await getDetailedDataTable(params)
|
||||
console.log(1222222,res)
|
||||
detailData.value = res.data
|
||||
} catch (error) {
|
||||
console.error("获取详细数据表格失败:", error);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -612,7 +718,10 @@ async function getTotalDeals() {
|
||||
|
||||
onMounted(async() => {
|
||||
// 页面初始化逻辑
|
||||
await getRealTimeProgress()
|
||||
await getTotalDeals()
|
||||
await getConversionComparison()
|
||||
await getCompanySalesRank('red')
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user