|
@@ -1,7 +1,7 @@
|
|
|
<!-- 客户跟进次数分析 -->
|
|
|
<template>
|
|
|
<!-- Echarts图 -->
|
|
|
- <el-card shadow="never">
|
|
|
+ <el-card shadow="never" >
|
|
|
<el-skeleton :loading="loading" animated>
|
|
|
<Echart :height="500" :options="echartsOption" />
|
|
|
</el-skeleton>
|
|
@@ -28,9 +28,11 @@ import {
|
|
|
CrmStatisticsFollowUpSummaryByDateRespVO,
|
|
|
CrmStatisticsFollowUpSummaryByUserRespVO
|
|
|
} from '@/api/crm/statistics/customer'
|
|
|
+import Echart from '@/components/Echart/src/Echart.vue';
|
|
|
import { EChartsOption } from 'echarts'
|
|
|
|
|
|
defineOptions({ name: 'CustomerFollowupSummary' })
|
|
|
+
|
|
|
const props = defineProps<{ queryParams: any }>() // 搜索参数
|
|
|
|
|
|
const loading = ref(false) // 加载中
|
|
@@ -40,7 +42,7 @@ const list = ref<CrmStatisticsFollowUpSummaryByUserRespVO[]>([]) // 列表的数
|
|
|
const echartsOption = reactive<EChartsOption>({
|
|
|
grid: {
|
|
|
left: 20,
|
|
|
- right: 20,
|
|
|
+ right: 30, // 让X轴右侧显示完整
|
|
|
bottom: 20,
|
|
|
containLabel: true
|
|
|
},
|
|
@@ -49,11 +51,13 @@ const echartsOption = reactive<EChartsOption>({
|
|
|
{
|
|
|
name: '跟进客户数',
|
|
|
type: 'bar',
|
|
|
+ yAxisIndex: 0,
|
|
|
data: []
|
|
|
},
|
|
|
{
|
|
|
name: '跟进次数',
|
|
|
type: 'bar',
|
|
|
+ yAxisIndex: 1,
|
|
|
data: []
|
|
|
}
|
|
|
],
|
|
@@ -74,19 +78,38 @@ const echartsOption = reactive<EChartsOption>({
|
|
|
type: 'shadow'
|
|
|
}
|
|
|
},
|
|
|
- yAxis: {
|
|
|
- type: 'value',
|
|
|
- name: '数量(个)'
|
|
|
- },
|
|
|
+ yAxis: [
|
|
|
+ {
|
|
|
+ type: 'value',
|
|
|
+ name: '跟进客户数',
|
|
|
+ min: 0,
|
|
|
+ minInterval: 1, // 显示整数刻度
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: 'value',
|
|
|
+ name: '跟进次数',
|
|
|
+ min: 0,
|
|
|
+ minInterval: 1, // 显示整数刻度
|
|
|
+ splitLine: {
|
|
|
+ lineStyle: {
|
|
|
+ type: 'dotted', // 右侧网格线虚化, 减少混乱
|
|
|
+ opacity: 0.7,
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ],
|
|
|
xAxis: {
|
|
|
type: 'category',
|
|
|
name: '日期',
|
|
|
+ axisTick: {
|
|
|
+ alignWithLabel: true
|
|
|
+ },
|
|
|
data: []
|
|
|
}
|
|
|
}) as EChartsOption
|
|
|
|
|
|
-/** 获取统计数据 */
|
|
|
-const loadData = async () => {
|
|
|
+/** 获取数据并填充图表 */
|
|
|
+const fetchAndFill = async () => {
|
|
|
// 1. 加载统计数据
|
|
|
loading.value = true
|
|
|
const followUpSummaryByDate = await StatisticsCustomerApi.getFollowUpSummaryByDate(
|
|
@@ -113,7 +136,17 @@ const loadData = async () => {
|
|
|
}
|
|
|
// 2.2 更新列表数据
|
|
|
list.value = followUpSummaryByUser
|
|
|
- loading.value = false
|
|
|
+}
|
|
|
+
|
|
|
+/** 获取统计数据 */
|
|
|
+const loadData = async () => {
|
|
|
+ loading.value = true
|
|
|
+ try {
|
|
|
+ fetchAndFill()
|
|
|
+ }
|
|
|
+ finally {
|
|
|
+ loading.value = false
|
|
|
+ }
|
|
|
}
|
|
|
defineExpose({ loadData })
|
|
|
|