Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
6772568a
authored
Apr 05, 2024
by
YunaiV
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crm:code review 客户画像
parent
8926dd11
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
18 deletions
+22
-18
src/views/crm/statistics/portrait/components/CustomerAddress.vue
+6
-3
src/views/crm/statistics/portrait/components/CustomerIndustry.vue
+5
-5
src/views/crm/statistics/portrait/components/CustomerLevel.vue
+6
-5
src/views/crm/statistics/portrait/components/CustomerSource.vue
+4
-5
src/views/crm/statistics/portrait/index.vue
+1
-0
No files found.
src/views/crm/statistics/portrait/components/CustomerAddress.vue
View file @
6772568a
...
@@ -25,6 +25,7 @@ import {
...
@@ -25,6 +25,7 @@ import {
StatisticsPortraitApi
StatisticsPortraitApi
}
from
'@/api/crm/statistics/portrait'
}
from
'@/api/crm/statistics/portrait'
// TODO @puhui999:address 换成 area 会更合适哈,
defineOptions
({
name
:
'CustomerAddress'
})
defineOptions
({
name
:
'CustomerAddress'
})
const
props
=
defineProps
<
{
queryParams
:
any
}
>
()
// 搜索参数
const
props
=
defineProps
<
{
queryParams
:
any
}
>
()
// 搜索参数
...
@@ -34,7 +35,7 @@ echarts?.registerMap('china', china as any)
...
@@ -34,7 +35,7 @@ echarts?.registerMap('china', china as any)
const
loading
=
ref
(
false
)
// 加载中
const
loading
=
ref
(
false
)
// 加载中
const
areaStatisticsList
=
ref
<
CrmStatisticCustomerAreaRespVO
[]
>
([])
// 列表的数据
const
areaStatisticsList
=
ref
<
CrmStatisticCustomerAreaRespVO
[]
>
([])
// 列表的数据
/** 地图配置 */
/** 地图配置
(全部客户)
*/
const
echartsOption
=
reactive
<
EChartsOption
>
({
const
echartsOption
=
reactive
<
EChartsOption
>
({
title
:
{
title
:
{
text
:
'全部客户'
,
text
:
'全部客户'
,
...
@@ -66,7 +67,7 @@ const echartsOption = reactive<EChartsOption>({
...
@@ -66,7 +67,7 @@ const echartsOption = reactive<EChartsOption>({
]
]
})
as
EChartsOption
})
as
EChartsOption
/** 地图配置 */
/** 地图配置
(成交客户)
*/
const
echartsOption2
=
reactive
<
EChartsOption
>
({
const
echartsOption2
=
reactive
<
EChartsOption
>
({
title
:
{
title
:
{
text
:
'成交客户'
,
text
:
'成交客户'
,
...
@@ -106,7 +107,7 @@ const loadData = async () => {
...
@@ -106,7 +107,7 @@ const loadData = async () => {
areaStatisticsList
.
value
=
areaList
.
map
((
item
:
CrmStatisticCustomerAreaRespVO
)
=>
{
areaStatisticsList
.
value
=
areaList
.
map
((
item
:
CrmStatisticCustomerAreaRespVO
)
=>
{
return
{
return
{
...
item
,
...
item
,
areaName
:
item
.
areaName
areaName
:
item
.
areaName
// TODO @puhui999:这里最好注释下原因哈
.
replace
(
'维吾尔自治区'
,
''
)
.
replace
(
'维吾尔自治区'
,
''
)
.
replace
(
'壮族自治区'
,
''
)
.
replace
(
'壮族自治区'
,
''
)
.
replace
(
'回族自治区'
,
''
)
.
replace
(
'回族自治区'
,
''
)
...
@@ -120,6 +121,7 @@ const loadData = async () => {
...
@@ -120,6 +121,7 @@ const loadData = async () => {
}
}
defineExpose
({
loadData
})
defineExpose
({
loadData
})
// TODO @puhui999:builder 改成 build 更合理哈
const
builderLeftMap
=
()
=>
{
const
builderLeftMap
=
()
=>
{
let
min
=
0
let
min
=
0
let
max
=
0
let
max
=
0
...
@@ -143,6 +145,7 @@ const builderRightMap = () => {
...
@@ -143,6 +145,7 @@ const builderRightMap = () => {
echartsOption2
.
visualMap
!
[
'min'
]
=
min
echartsOption2
.
visualMap
!
[
'min'
]
=
min
echartsOption2
.
visualMap
!
[
'max'
]
=
max
echartsOption2
.
visualMap
!
[
'max'
]
=
max
}
}
/** 初始化 */
/** 初始化 */
onMounted
(()
=>
{
onMounted
(()
=>
{
loadData
()
loadData
()
...
...
src/views/crm/statistics/portrait/components/CustomerIndustry.vue
View file @
6772568a
...
@@ -48,7 +48,7 @@ const props = defineProps<{ queryParams: any }>() // 搜索参数
...
@@ -48,7 +48,7 @@ const props = defineProps<{ queryParams: any }>() // 搜索参数
const
loading
=
ref
(
false
)
// 加载中
const
loading
=
ref
(
false
)
// 加载中
const
list
=
ref
<
CrmStatisticCustomerIndustryRespVO
[]
>
([])
// 列表的数据
const
list
=
ref
<
CrmStatisticCustomerIndustryRespVO
[]
>
([])
// 列表的数据
/** 饼图配置 */
/** 饼图配置
(全部客户)
*/
const
echartsOption
=
reactive
<
EChartsOption
>
({
const
echartsOption
=
reactive
<
EChartsOption
>
({
title
:
{
title
:
{
text
:
'全部客户'
,
text
:
'全部客户'
,
...
@@ -95,7 +95,8 @@ const echartsOption = reactive<EChartsOption>({
...
@@ -95,7 +95,8 @@ const echartsOption = reactive<EChartsOption>({
}
}
]
]
})
as
EChartsOption
})
as
EChartsOption
/** 饼图配置 */
/** 饼图配置(成交客户) */
const
echartsOption2
=
reactive
<
EChartsOption
>
({
const
echartsOption2
=
reactive
<
EChartsOption
>
({
title
:
{
title
:
{
text
:
'成交客户'
,
text
:
'成交客户'
,
...
@@ -172,9 +173,8 @@ const loadData = async () => {
...
@@ -172,9 +173,8 @@ const loadData = async () => {
loading
.
value
=
false
loading
.
value
=
false
}
}
defineExpose
({
loadData
})
defineExpose
({
loadData
})
/**
* 计算比例
/** 计算比例 */
*/
const
calculateProportion
=
(
sourceList
:
CrmStatisticCustomerIndustryRespVO
[])
=>
{
const
calculateProportion
=
(
sourceList
:
CrmStatisticCustomerIndustryRespVO
[])
=>
{
if
(
isEmpty
(
sourceList
))
{
if
(
isEmpty
(
sourceList
))
{
return
return
...
...
src/views/crm/statistics/portrait/components/CustomerLevel.vue
View file @
6772568a
...
@@ -48,7 +48,7 @@ const props = defineProps<{ queryParams: any }>() // 搜索参数
...
@@ -48,7 +48,7 @@ const props = defineProps<{ queryParams: any }>() // 搜索参数
const
loading
=
ref
(
false
)
// 加载中
const
loading
=
ref
(
false
)
// 加载中
const
list
=
ref
<
CrmStatisticCustomerLevelRespVO
[]
>
([])
// 列表的数据
const
list
=
ref
<
CrmStatisticCustomerLevelRespVO
[]
>
([])
// 列表的数据
/** 饼图配置 */
/** 饼图配置
(全部客户)
*/
const
echartsOption
=
reactive
<
EChartsOption
>
({
const
echartsOption
=
reactive
<
EChartsOption
>
({
title
:
{
title
:
{
text
:
'全部客户'
,
text
:
'全部客户'
,
...
@@ -95,7 +95,8 @@ const echartsOption = reactive<EChartsOption>({
...
@@ -95,7 +95,8 @@ const echartsOption = reactive<EChartsOption>({
}
}
]
]
})
as
EChartsOption
})
as
EChartsOption
/** 饼图配置 */
/** 饼图配置(成交客户) */
const
echartsOption2
=
reactive
<
EChartsOption
>
({
const
echartsOption2
=
reactive
<
EChartsOption
>
({
title
:
{
title
:
{
text
:
'成交客户'
,
text
:
'成交客户'
,
...
@@ -172,9 +173,8 @@ const loadData = async () => {
...
@@ -172,9 +173,8 @@ const loadData = async () => {
loading
.
value
=
false
loading
.
value
=
false
}
}
defineExpose
({
loadData
})
defineExpose
({
loadData
})
/**
* 计算比例
/** 计算比例 */
*/
const
calculateProportion
=
(
levelList
:
CrmStatisticCustomerLevelRespVO
[])
=>
{
const
calculateProportion
=
(
levelList
:
CrmStatisticCustomerLevelRespVO
[])
=>
{
if
(
isEmpty
(
levelList
))
{
if
(
isEmpty
(
levelList
))
{
return
return
...
@@ -184,6 +184,7 @@ const calculateProportion = (levelList: CrmStatisticCustomerLevelRespVO[]) => {
...
@@ -184,6 +184,7 @@ const calculateProportion = (levelList: CrmStatisticCustomerLevelRespVO[]) => {
const
sumCustomerCount
=
getSumValue
(
list
.
map
((
item
)
=>
item
.
customerCount
))
const
sumCustomerCount
=
getSumValue
(
list
.
map
((
item
)
=>
item
.
customerCount
))
const
sumDealCount
=
getSumValue
(
list
.
map
((
item
)
=>
item
.
dealCount
))
const
sumDealCount
=
getSumValue
(
list
.
map
((
item
)
=>
item
.
dealCount
))
list
.
forEach
((
item
)
=>
{
list
.
forEach
((
item
)
=>
{
// TODO @puhui999:可以使用 erpCalculatePercentage 方法
item
.
levelPortion
=
item
.
levelPortion
=
item
.
customerCount
===
0
?
0
:
((
item
.
customerCount
/
sumCustomerCount
)
*
100
).
toFixed
(
2
)
item
.
customerCount
===
0
?
0
:
((
item
.
customerCount
/
sumCustomerCount
)
*
100
).
toFixed
(
2
)
item
.
dealPortion
=
item
.
dealCount
===
0
?
0
:
((
item
.
dealCount
/
sumDealCount
)
*
100
).
toFixed
(
2
)
item
.
dealPortion
=
item
.
dealCount
===
0
?
0
:
((
item
.
dealCount
/
sumDealCount
)
*
100
).
toFixed
(
2
)
...
...
src/views/crm/statistics/portrait/components/CustomerSource.vue
View file @
6772568a
...
@@ -48,7 +48,7 @@ const props = defineProps<{ queryParams: any }>() // 搜索参数
...
@@ -48,7 +48,7 @@ const props = defineProps<{ queryParams: any }>() // 搜索参数
const
loading
=
ref
(
false
)
// 加载中
const
loading
=
ref
(
false
)
// 加载中
const
list
=
ref
<
CrmStatisticCustomerSourceRespVO
[]
>
([])
// 列表的数据
const
list
=
ref
<
CrmStatisticCustomerSourceRespVO
[]
>
([])
// 列表的数据
/** 饼图配置 */
/** 饼图配置
(全部客户)
*/
const
echartsOption
=
reactive
<
EChartsOption
>
({
const
echartsOption
=
reactive
<
EChartsOption
>
({
title
:
{
title
:
{
text
:
'全部客户'
,
text
:
'全部客户'
,
...
@@ -95,7 +95,8 @@ const echartsOption = reactive<EChartsOption>({
...
@@ -95,7 +95,8 @@ const echartsOption = reactive<EChartsOption>({
}
}
]
]
})
as
EChartsOption
})
as
EChartsOption
/** 饼图配置 */
/** 饼图配置(成交客户) */
const
echartsOption2
=
reactive
<
EChartsOption
>
({
const
echartsOption2
=
reactive
<
EChartsOption
>
({
title
:
{
title
:
{
text
:
'成交客户'
,
text
:
'成交客户'
,
...
@@ -173,9 +174,7 @@ const loadData = async () => {
...
@@ -173,9 +174,7 @@ const loadData = async () => {
}
}
defineExpose
({
loadData
})
defineExpose
({
loadData
})
/**
/** 计算比例 */
* 计算比例
*/
const
calculateProportion
=
(
sourceList
:
CrmStatisticCustomerSourceRespVO
[])
=>
{
const
calculateProportion
=
(
sourceList
:
CrmStatisticCustomerSourceRespVO
[])
=>
{
if
(
isEmpty
(
sourceList
))
{
if
(
isEmpty
(
sourceList
))
{
return
return
...
...
src/views/crm/statistics/portrait/index.vue
View file @
6772568a
...
@@ -85,6 +85,7 @@ import * as UserApi from '@/api/system/user'
...
@@ -85,6 +85,7 @@ import * as UserApi from '@/api/system/user'
import
{
useUserStore
}
from
'@/store/modules/user'
import
{
useUserStore
}
from
'@/store/modules/user'
import
{
beginOfDay
,
defaultShortcuts
,
endOfDay
,
formatDate
}
from
'@/utils/formatTime'
import
{
beginOfDay
,
defaultShortcuts
,
endOfDay
,
formatDate
}
from
'@/utils/formatTime'
import
{
defaultProps
,
handleTree
}
from
'@/utils/tree'
import
{
defaultProps
,
handleTree
}
from
'@/utils/tree'
// TODO @puhui999:最好命名带上模块名,如:CrmStatisticsPortrait
import
CustomerAddress
from
'./components/CustomerAddress.vue'
import
CustomerAddress
from
'./components/CustomerAddress.vue'
import
CustomerIndustry
from
'./components/CustomerIndustry.vue'
import
CustomerIndustry
from
'./components/CustomerIndustry.vue'
import
CustomerSource
from
'./components/CustomerSource.vue'
import
CustomerSource
from
'./components/CustomerSource.vue'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment