Skip to content

Commit e8a3745

Browse files
committed
crm:code review 公海客户分析
1 parent 091ce90 commit e8a3745

File tree

7 files changed

+52
-51
lines changed

7 files changed

+52
-51
lines changed

src/views/crm/statistics/customer/components/CustomerConversionStat.vue

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ const list = ref<CrmStatisticsCustomerSummaryByDateRespVO[]>([]) // 列表的数
8484
const echartsOption = reactive<EChartsOption>({
8585
grid: {
8686
left: 20,
87-
right: 40, // 让X轴右侧显示完整
87+
right: 40, // 让 X 轴右侧显示完整
8888
bottom: 20,
8989
containLabel: true
9090
},
@@ -155,9 +155,8 @@ const fetchAndFill = async () => {
155155
const loadData = async () => {
156156
loading.value = true
157157
try {
158-
fetchAndFill()
159-
}
160-
finally {
158+
await fetchAndFill()
159+
} finally {
161160
loading.value = false
162161
}
163162
}

src/views/crm/statistics/customer/components/CustomerDealCycle.vue

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
import {
2727
StatisticsCustomerApi,
2828
CrmStatisticsCustomerDealCycleByDateRespVO,
29-
CrmStatisticsCustomerSummaryByDateRespVO,
29+
CrmStatisticsCustomerSummaryByDateRespVO
3030
} from '@/api/crm/statistics/customer'
3131
import { EChartsOption } from 'echarts'
3232
@@ -41,7 +41,7 @@ const list = ref<CrmStatisticsCustomerDealCycleByDateRespVO[]>([]) // 列表的
4141
const echartsOption = reactive<EChartsOption>({
4242
grid: {
4343
left: 20,
44-
right: 40, // 让X轴右侧显示完整
44+
right: 40, // 让 X 轴右侧显示完整
4545
bottom: 20,
4646
containLabel: true
4747
},
@@ -51,13 +51,13 @@ const echartsOption = reactive<EChartsOption>({
5151
name: '成交周期(天)',
5252
type: 'bar',
5353
data: [],
54-
yAxisIndex: 0,
54+
yAxisIndex: 0
5555
},
5656
{
5757
name: '成交客户数',
5858
type: 'bar',
5959
data: [],
60-
yAxisIndex: 1,
60+
yAxisIndex: 1
6161
}
6262
],
6363
toolbox: {
@@ -82,7 +82,7 @@ const echartsOption = reactive<EChartsOption>({
8282
type: 'value',
8383
name: '成交周期(天)',
8484
min: 0,
85-
minInterval: 1, // 显示整数刻度
85+
minInterval: 1 // 显示整数刻度
8686
},
8787
{
8888
type: 'value',
@@ -92,10 +92,10 @@ const echartsOption = reactive<EChartsOption>({
9292
splitLine: {
9393
lineStyle: {
9494
type: 'dotted', // 右侧网格线虚化, 减少混乱
95-
opacity: 0.7,
95+
opacity: 0.7
9696
}
9797
}
98-
},
98+
}
9999
],
100100
xAxis: {
101101
type: 'category',
@@ -110,7 +110,7 @@ const fetchAndFill = async () => {
110110
const customerDealCycleByDate = await StatisticsCustomerApi.getCustomerDealCycleByDate(
111111
props.queryParams
112112
)
113-
const customerSummaryByDate = await StatisticsCustomerApi.getCustomerSummaryByDate(
113+
const customerSummaryByDate = await StatisticsCustomerApi.getCustomerSummaryByDate(
114114
props.queryParams
115115
)
116116
const customerDealCycleByUser = await StatisticsCustomerApi.getCustomerDealCycleByUser(
@@ -140,9 +140,8 @@ const fetchAndFill = async () => {
140140
const loadData = async () => {
141141
loading.value = true
142142
try {
143-
fetchAndFill()
144-
}
145-
finally {
143+
await fetchAndFill()
144+
} finally {
146145
loading.value = false
147146
}
148147
}

src/views/crm/statistics/customer/components/CustomerFollowUpSummary.vue

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!-- 客户跟进次数分析 -->
22
<template>
33
<!-- Echarts图 -->
4-
<el-card shadow="never" >
4+
<el-card shadow="never">
55
<el-skeleton :loading="loading" animated>
66
<Echart :height="500" :options="echartsOption" />
77
</el-skeleton>
@@ -28,7 +28,7 @@ import {
2828
CrmStatisticsFollowUpSummaryByDateRespVO,
2929
CrmStatisticsFollowUpSummaryByUserRespVO
3030
} from '@/api/crm/statistics/customer'
31-
import Echart from '@/components/Echart/src/Echart.vue';
31+
import Echart from '@/components/Echart/src/Echart.vue'
3232
import { EChartsOption } from 'echarts'
3333
3434
defineOptions({ name: 'CustomerFollowupSummary' })
@@ -42,7 +42,7 @@ const list = ref<CrmStatisticsFollowUpSummaryByUserRespVO[]>([]) // 列表的数
4242
const echartsOption = reactive<EChartsOption>({
4343
grid: {
4444
left: 20,
45-
right: 30, // 让X轴右侧显示完整
45+
right: 30, // 让 X 轴右侧显示完整
4646
bottom: 20,
4747
containLabel: true
4848
},
@@ -83,7 +83,7 @@ const echartsOption = reactive<EChartsOption>({
8383
type: 'value',
8484
name: '跟进客户数',
8585
min: 0,
86-
minInterval: 1, // 显示整数刻度
86+
minInterval: 1 // 显示整数刻度
8787
},
8888
{
8989
type: 'value',
@@ -93,7 +93,7 @@ const echartsOption = reactive<EChartsOption>({
9393
splitLine: {
9494
lineStyle: {
9595
type: 'dotted', // 右侧网格线虚化, 减少混乱
96-
opacity: 0.7,
96+
opacity: 0.7
9797
}
9898
}
9999
}
@@ -142,9 +142,8 @@ const fetchAndFill = async () => {
142142
const loadData = async () => {
143143
loading.value = true
144144
try {
145-
fetchAndFill()
146-
}
147-
finally {
145+
await fetchAndFill()
146+
} finally {
148147
loading.value = false
149148
}
150149
}

src/views/crm/statistics/customer/components/CustomerFollowUpType.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,8 @@ const fetchAndFill = async () => {
105105
const loadData = async () => {
106106
loading.value = true
107107
try {
108-
fetchAndFill()
109-
}
110-
finally {
108+
await fetchAndFill()
109+
} finally {
111110
loading.value = false
112111
}
113112
}

src/views/crm/statistics/customer/components/PoolSummary.vue renamed to src/views/crm/statistics/customer/components/CustomerPoolSummary.vue

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,18 @@
1212
<el-table v-loading="loading" :data="list">
1313
<el-table-column label="序号" align="center" type="index" width="80" fixed="left" />
1414
<el-table-column label="员工姓名" prop="ownerUserName" min-width="100" fixed="left" />
15-
<el-table-column label="进入公海客户数" align="right" prop="customerPutCount" min-width="200" />
16-
<el-table-column label="公海领取客户数" align="right" prop="customerTakeCount" min-width="200" />
15+
<el-table-column
16+
label="进入公海客户数"
17+
align="right"
18+
prop="customerPutCount"
19+
min-width="200"
20+
/>
21+
<el-table-column
22+
label="公海领取客户数"
23+
align="right"
24+
prop="customerTakeCount"
25+
min-width="200"
26+
/>
1727
</el-table>
1828
</el-card>
1929
</template>
@@ -25,7 +35,7 @@ import {
2535
} from '@/api/crm/statistics/customer'
2636
import { EChartsOption } from 'echarts'
2737
28-
defineOptions({ name: 'CustomerSummary' })
38+
defineOptions({ name: 'CustomerPoolSummary' })
2939
3040
const props = defineProps<{ queryParams: any }>() // 搜索参数
3141
@@ -36,7 +46,7 @@ const list = ref<CrmStatisticsPoolSummaryByUserRespVO[]>([]) // 列表的数据
3646
const echartsOption = reactive<EChartsOption>({
3747
grid: {
3848
left: 20,
39-
right: 40, // 让X轴右侧显示完整
49+
right: 40, // 让 X 轴右侧显示完整
4050
bottom: 20,
4151
containLabel: true
4252
},
@@ -77,7 +87,7 @@ const echartsOption = reactive<EChartsOption>({
7787
type: 'value',
7888
name: '进入公海客户数',
7989
min: 0,
80-
minInterval: 1, // 显示整数刻度
90+
minInterval: 1 // 显示整数刻度
8191
},
8292
{
8393
type: 'value',
@@ -87,27 +97,23 @@ const echartsOption = reactive<EChartsOption>({
8797
splitLine: {
8898
lineStyle: {
8999
type: 'dotted', // 右侧网格线虚化, 减少混乱
90-
opacity: 0.7,
100+
opacity: 0.7
91101
}
92102
}
93103
}
94104
],
95105
xAxis: {
96106
type: 'category',
97107
name: '日期',
98-
data: [],
108+
data: []
99109
}
100110
}) as EChartsOption
101111
102112
/** 获取数据并填充图表 */
103113
const fetchAndFill = async () => {
104114
// 1. 加载统计数据
105-
const poolSummaryByDate = await StatisticsCustomerApi.getPoolSummaryByDate(
106-
props.queryParams
107-
)
108-
const poolSummaryByUser = await StatisticsCustomerApi.getPoolSummaryByUser(
109-
props.queryParams
110-
)
115+
const poolSummaryByDate = await StatisticsCustomerApi.getPoolSummaryByDate(props.queryParams)
116+
const poolSummaryByUser = await StatisticsCustomerApi.getPoolSummaryByUser(props.queryParams)
111117
// 2.1 更新 Echarts 数据
112118
if (echartsOption.xAxis && echartsOption.xAxis['data']) {
113119
echartsOption.xAxis['data'] = poolSummaryByDate.map(
@@ -133,7 +139,7 @@ const fetchAndFill = async () => {
133139
const loadData = async () => {
134140
loading.value = true
135141
try {
136-
fetchAndFill()
142+
await fetchAndFill()
137143
} finally {
138144
loading.value = false
139145
}

src/views/crm/statistics/customer/components/CustomerSummary.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ const list = ref<CrmStatisticsCustomerSummaryByUserRespVO[]>([]) // 列表的数
7171
const echartsOption = reactive<EChartsOption>({
7272
grid: {
7373
left: 20,
74-
right: 30, // 让X轴右侧显示完整
74+
right: 30, // 让 X 轴右侧显示完整
7575
bottom: 20,
7676
containLabel: true
7777
},
@@ -112,7 +112,7 @@ const echartsOption = reactive<EChartsOption>({
112112
type: 'value',
113113
name: '新增客户数',
114114
min: 0,
115-
minInterval: 1, // 显示整数刻度
115+
minInterval: 1 // 显示整数刻度
116116
},
117117
{
118118
type: 'value',
@@ -122,15 +122,15 @@ const echartsOption = reactive<EChartsOption>({
122122
splitLine: {
123123
lineStyle: {
124124
type: 'dotted', // 右侧网格线虚化, 减少混乱
125-
opacity: 0.7,
125+
opacity: 0.7
126126
}
127127
}
128128
}
129129
],
130130
xAxis: {
131131
type: 'category',
132132
name: '日期',
133-
data: [],
133+
data: []
134134
}
135135
}) as EChartsOption
136136
@@ -168,7 +168,7 @@ const fetchAndFill = async () => {
168168
const loadData = async () => {
169169
loading.value = true
170170
try {
171-
fetchAndFill()
171+
await fetchAndFill()
172172
} finally {
173173
loading.value = false
174174
}

src/views/crm/statistics/customer/index.vue

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@
4646
class="!w-240px"
4747
node-key="id"
4848
placeholder="请选择归属部门"
49-
@change="queryParams.userId = undefined;handleQuery()
50-
"
49+
@change="(queryParams.userId = undefined), handleQuery()"
5150
/>
5251
</el-form-item>
5352
<el-form-item label="员工" prop="userId">
@@ -100,7 +99,7 @@
10099
</el-tab-pane>
101100
<!-- 公海客户分析 -->
102101
<el-tab-pane label="公海客户分析" lazy name="poolSummary">
103-
<PoolSummary ref="poolSummaryRef" :query-params="queryParams" />
102+
<CustomerPoolSummary ref="customerPoolSummaryRef" :query-params="queryParams" />
104103
</el-tab-pane>
105104
<!-- 成交周期分析 -->
106105
<el-tab-pane label="成交周期分析" lazy name="dealCycle">
@@ -122,7 +121,7 @@ import CustomerDealCycle from './components/CustomerDealCycle.vue'
122121
import CustomerFollowUpSummary from './components/CustomerFollowUpSummary.vue'
123122
import CustomerFollowUpType from './components/CustomerFollowUpType.vue'
124123
import CustomerSummary from './components/CustomerSummary.vue'
125-
import PoolSummary from './components/PoolSummary.vue'
124+
import CustomerPoolSummary from './components/CustomerPoolSummary.vue'
126125
127126
defineOptions({ name: 'CrmStatisticsCustomer' })
128127
@@ -153,7 +152,7 @@ const customerSummaryRef = ref() // 1. 客户总量分析
153152
const followUpSummaryRef = ref() // 2. 客户跟进次数分析
154153
const followUpTypeRef = ref() // 3. 客户跟进方式分析
155154
const conversionStatRef = ref() // 4. 客户转化率分析
156-
const poolSummaryRef = ref() // 5. 客户公海分析
155+
const customerPoolSummaryRef = ref() // 5. 客户公海分析
157156
const dealCycleRef = ref() // 6. 成交周期分析
158157
159158
/** 搜索按钮操作 */
@@ -172,7 +171,7 @@ const handleQuery = () => {
172171
conversionStatRef.value?.loadData?.()
173172
break
174173
case 'poolSummary': // 公海客户分析
175-
poolSummaryRef.value?.loadData?.()
174+
customerPoolSummaryRef.value?.loadData?.()
176175
break
177176
case 'dealCycle': // 成交周期分析
178177
dealCycleRef.value?.loadData?.()

0 commit comments

Comments
 (0)