Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
gh
/
data-view
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 34eefc91
authored
Jun 30, 2022
by
胡悦
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'dev_v1.0.0' of
http://192.168.3.233:8090/gh/data-view
into dev_v1.0.0
2 parents
9abe597e
e47ee55c
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
257 additions
and
59 deletions
src/api/modules/afterSales.js
src/api/modules/common.js
src/api/modules/overview.js
src/api/request.js
src/components/PieChart.vue
src/components/ViewTabs.vue
src/mixins/clientMixin.js
src/mixins/salesMixin.js
src/views/afterSales/analyze.vue
src/views/afterSales/mileage.vue
src/views/customer/age.vue
src/views/customer/buyCar.vue
src/views/customer/sex.vue
src/views/salesData/customerCategory.vue
src/views/salesData/enterCategory.vue
src/views/salesData/infoFrom.vue
src/api/modules/afterSales.js
View file @
34eefc9
...
@@ -23,4 +23,9 @@ const aftersaleother = params => {
...
@@ -23,4 +23,9 @@ const aftersaleother = params => {
return
request
.
get
(
'brand/aftersaleother'
,
params
)
return
request
.
get
(
'brand/aftersaleother'
,
params
)
}
}
export
default
{
getAfterSale
,
getMerchantAfterSale
,
aftersaleother
}
// 获取门店品牌售后其他信息
const
afterMerchantSaleother
=
params
=>
{
return
request
.
get
(
'merchant/aftersaleother'
,
params
)
}
export
default
{
getAfterSale
,
aftersaleother
,
afterMerchantSaleother
,
getMerchantAfterSale
}
src/api/modules/common.js
View file @
34eefc9
...
@@ -10,8 +10,7 @@ export default {
...
@@ -10,8 +10,7 @@ export default {
getBrandList
()
{
getBrandList
()
{
return
request
.
get
(
'brand/getBrandName'
,
{
return
request
.
get
(
'brand/getBrandName'
,
{
req
:
{
req
:
{
corporateGroupName
:
'集团1'
,
queryTime
:
window
.
vm
.
getCurrentDate
()
queryTime
:
'2022-06-23'
}
}
})
})
}
}
...
...
src/api/modules/overview.js
View file @
34eefc9
...
@@ -4,7 +4,11 @@ var request = new Request()
...
@@ -4,7 +4,11 @@ var request = new Request()
// window.$HTTP
// window.$HTTP
export
default
{
export
default
{
/**获取品牌---总体模块信息(包括:总客户:total,企微客户:wechat,企微群:wechatGroup,小程序:applet,公众号:publiccus 的基础数据 和 前五排行/后五排行 ) */
/**获取品牌---总体模块信息(包括:总客户:total,企微客户:wechat,企微群:wechatGroup,小程序:applet,公众号:publiccus 的基础数据 和 前五排行/后五排行 ) */
getBrandOverallbase
(
params
){
getBrandOverallbase
(
req
)
{
return
request
.
get
(
'brand/overallbase'
,
params
)
return
request
.
get
(
'brand/overallbase'
,
{
req
})
},
/*获取品牌---总体模块趋势图指标(包括:总客户:total,企微客户:wechat,企微群:wechatGroup,小程序:applet,公众号:publiccus) */
getBrandOveralltrend
(
req
)
{
return
request
.
get
(
'brand/overalltrend'
,
{
req
})
}
}
}
}
src/api/request.js
View file @
34eefc9
...
@@ -3,13 +3,13 @@ class Request {
...
@@ -3,13 +3,13 @@ class Request {
constructor
(
_request_
)
{
constructor
(
_request_
)
{
this
.
DOMAIN
=
_request_
?
_request_
.
baseURL
:
this
.
DOMAIN
this
.
DOMAIN
=
_request_
?
_request_
.
baseURL
:
this
.
DOMAIN
}
}
get
(
url
,
params
,
returnAll
)
{
get
(
url
,
params
,
returnAll
)
{
return
this
.
request
(
'GET'
,
url
,
params
,
returnAll
)
return
this
.
request
(
'GET'
,
url
,
params
,
returnAll
)
}
}
post
(
url
,
params
,
returnAll
)
{
post
(
url
,
params
,
returnAll
)
{
return
this
.
request
(
'POST'
,
url
,
params
,
returnAll
)
return
this
.
request
(
'POST'
,
url
,
params
,
returnAll
)
}
}
request
(
method
,
url
,
params
,
returnAll
)
{
request
(
method
,
url
,
params
,
returnAll
)
{
var
requestConfig
=
{
var
requestConfig
=
{
headers
:
{
headers
:
{
// 'Content-Type': method == 'GET' ? 'application/json' : 'application/x-www-form-urlencoded; charset=UTF-8'
// 'Content-Type': method == 'GET' ? 'application/json' : 'application/x-www-form-urlencoded; charset=UTF-8'
...
@@ -17,7 +17,7 @@ class Request {
...
@@ -17,7 +17,7 @@ class Request {
},
},
method
method
}
}
params
.
req
.
corporateGroupName
=
'集团1'
if
(
method
===
'GET'
)
{
if
(
method
===
'GET'
)
{
var
paramsArray
=
[]
var
paramsArray
=
[]
Object
.
keys
(
params
.
req
).
forEach
(
key
=>
paramsArray
.
push
(
'req.'
+
key
+
'='
+
params
.
req
[
key
]))
Object
.
keys
(
params
.
req
).
forEach
(
key
=>
paramsArray
.
push
(
'req.'
+
key
+
'='
+
params
.
req
[
key
]))
...
...
src/components/PieChart.vue
View file @
34eefc9
...
@@ -178,7 +178,7 @@ export default {
...
@@ -178,7 +178,7 @@ export default {
this
.
setAnamiteText
()
this
.
setAnamiteText
()
},
},
setAnamiteText
()
{
setAnamiteText
()
{
document
.
querySelector
(
`.
${
this
.
id
}
`
).
style
=
`--step:
${
this
.
mainValue
}
`
if
(
document
.
querySelector
(
`.
${
this
.
id
}
`
))
document
.
querySelector
(
`.
${
this
.
id
}
`
).
style
=
`--step:
${
this
.
mainValue
}
`
},
},
//高亮
//高亮
pieActive
()
{
pieActive
()
{
...
...
src/components/ViewTabs.vue
View file @
34eefc9
<
template
>
<
template
>
<div
class=
"tabs"
>
<div
class=
"tabs"
>
<div
class=
"tab pointer"
>
<div
class=
"tab pointer"
>
<div
class=
"tab-left box"
>
<div
class=
"tab-left box"
@
click=
"changeType('total')"
>
<div
class=
"tab-total-box"
>
<div
class=
"tab-total-box"
>
<div
class=
"total-title-box flex"
>
<div
class=
"total-title-box flex"
>
<div
class=
"title inline total"
>
客户总数
</div>
<div
class=
"title inline total"
>
客户总数
</div>
...
@@ -29,6 +32,7 @@
...
@@ -29,6 +32,7 @@
<div
<div
:key=
"index"
:key=
"index"
class=
"item flex"
class=
"item flex"
@
click=
"changeType(i.key)"
>
>
<div
class=
"item-title"
>
{{
i
.
title
}}
</div>
<div
class=
"item-title"
>
{{
i
.
title
}}
</div>
<transition-number
<transition-number
...
@@ -48,22 +52,51 @@
...
@@ -48,22 +52,51 @@
</
template
>
</
template
>
</div>
</div>
</div>
</div>
<div
class=
"
<div
class=
"tabs-content box"
>
tabs-content
<div
class=
"tabs-title"
>
客户增长趋势
</div>
box"
>
<div
class=
"tabs-content-chart flex"
>
<div
class=
"title inline"
>
客户增长趋势
</div>
<div
class=
"line"
id=
"total-chart"
></div>
<div
class=
"table user-select pointer"
>
<div
class=
"table-head"
>
<
template
v-for=
"(i,index) in tabHead"
>
<div
:class=
"['table-head-item flex',
{'active':index == tabIndex}]"
:key="index"
@click="changeTab(index)"
>
{{
i
}}
</div>
</
template
>
</div>
<div
class=
"table-body flex"
>
<
template
v-for=
"(i,index) in tabIndex == 0 ? pageData[tabType].top : pageData[tabType].last"
>
<div
class=
"table-body-item flex"
:key=
"index"
>
<div
class=
"table-num flex"
>
{{
index
+
1
}}
</div>
<div
class=
"table-key"
>
<marquee
:direction=
"directionTimer"
:delay=
"delayTimer"
:text=
"i.name"
/>
</div>
<div
class=
"table-value"
>
{{
i
.
num
}}
</div>
</div>
</
template
>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
</template>
<
script
type=
"text/ecmascript-6"
>
<
script
type=
"text/ecmascript-6"
>
import
{
changeMixin
}
from
'@/mixins'
const
tabs
=
[
export
default
{
name
:
'ViewTabs'
,
mixins
:
[
changeMixin
],
data
()
{
return
{
tabs
:
[
{
{
title
:
'企微客户'
,
title
:
'企微客户'
,
key
:
'wechat'
key
:
'wechat'
...
@@ -80,9 +113,21 @@ export default {
...
@@ -80,9 +113,21 @@ export default {
title
:
'公众号客户数'
,
title
:
'公众号客户数'
,
key
:
'publiccus'
key
:
'publiccus'
}
}
],
]
queryItem
:
'total'
,
let
tabHead
=
[
'前5品牌'
,
'后5品牌'
]
id
:
'10086'
,
import
{
changeMixin
}
from
'@/mixins'
import
*
as
echarts
from
'echarts'
export
default
{
name
:
'ViewTabs'
,
mixins
:
[
changeMixin
],
data
()
{
return
{
tabs
,
tabHead
,
tabType
:
'total'
,
tabIndex
:
0
,
delayTimer
:
3000
,
directionTimer
:
3000
,
pageData
:
{
pageData
:
{
total
:
{},
total
:
{},
wechat
:
{},
wechat
:
{},
...
@@ -104,24 +149,49 @@ export default {
...
@@ -104,24 +149,49 @@ export default {
this
.
getBrandOverallbase
(
'wechatGroup'
)
this
.
getBrandOverallbase
(
'wechatGroup'
)
this
.
getBrandOverallbase
(
'applet'
)
this
.
getBrandOverallbase
(
'applet'
)
this
.
getBrandOverallbase
(
'publiccus'
)
this
.
getBrandOverallbase
(
'publiccus'
)
this
.
getBrandOveralltrend
(
'total'
)
},
changeType
(
type
)
{
console
.
log
(
type
)
this
.
tabType
=
type
this
.
getBrandOveralltrend
(
type
)
},
changeTab
(
index
)
{
this
.
tabIndex
=
index
},
},
getBrandOverallbase
(
queryItem
)
{
getBrandOverallbase
(
queryItem
)
{
const
params
=
{
const
params
=
{
req
:
{
queryItem
,
queryItem
,
queryTime
:
'2022-06-23'
,
queryTime
:
'2022-06-23'
,
corporateGroupName
:
'集团1'
,
corporateGroupName
:
'集团1'
,
queryType
:
0
queryType
:
0
}
}
}
this
.
api
.
overview
.
getBrandOverallbase
(
params
).
then
(({
code
,
data
})
=>
{
this
.
api
.
overview
.
getBrandOverallbase
(
params
).
then
(
res
=>
{
const
{
code
,
data
}
=
res
if
(
code
==
0
)
{
if
(
code
==
0
)
{
let
[
dataList
]
=
data
.
dataList
let
[
dataList
]
=
data
.
dataList
console
.
log
(
`________________
${
queryItem
}
_______________________`
,
data
)
dataList
.
top
=
this
.
ObjectToArray
(
dataList
.
topList
)
dataList
.
last
=
this
.
ObjectToArray
(
dataList
.
lastList
)
this
.
pageData
[
queryItem
]
=
dataList
this
.
pageData
[
queryItem
]
=
dataList
}
}
})
})
},
ObjectToArray
(
obj
)
{
let
arr
=
[]
obj
=
JSON
.
parse
(
obj
)
Object
.
keys
(
obj
).
map
(
name
=>
arr
.
push
({
name
,
num
:
obj
[
name
]
}))
return
arr
},
getBrandOveralltrend
(
queryItem
)
{
const
params
=
{
queryItem
,
querystartTime
:
'2022-05-23'
,
queryendTime
:
'2022-06-23'
,
corporateGroupName
:
'集团1'
,
queryType
:
0
}
this
.
api
.
overview
.
getBrandOverallbase
(
params
).
then
(
res
=>
{
console
.
log
(
`________________
${
queryItem
}
_______________________`
,
res
)
})
}
}
}
}
}
}
...
@@ -200,6 +270,74 @@ export default {
...
@@ -200,6 +270,74 @@ export default {
}
}
&
-content
{
&
-content
{
height
:
24.4vh
;
height
:
24.4vh
;
box-sizing
:
border-box
;
padding
:
1vh
8px
;
display
:
flex
;
flex-direction
:
column
;
.tabs-title
{
font-size
:
12px
;
color
:
#e8e8e8
;
}
&
-chart
{
height
:
20.2vh
;
margin-top
:
auto
;
justify-content
:
space-between
;
gap
:
0
8px
;
.line
{
flex
:
7
;
background
:
#022
;
}
.table
{
flex
:
3
;
background
:
#262525
;
&-head
{
display
:
grid
;
grid-template-columns
:
repeat
(
2
,
50%
);
height
:
2.4vh
;
&-item
{
height
:
100%
;
font-size
:
10px
;
background
:
#353535
;
color
:
rgba
(
$
color
:
#fff
,
$
alpha
:
0.7
);
justify-content
:
center
;
&:hover
{
opacity
:
0.9
;
}
}
.active
{
background
:
#eb6001
;
color
:
#fff
;
}
}
&
-body
{
height
:
calc
(
100%
-
2.4vh
);
flex-direction
:
column
;
justify-content
:
space-between
;
&-item
{
line-height
:
3.4vh
;
width
:
100%
;
font-size
:
10px
;
color
:
#ffffff
;
.table-num
{
width
:
22px
;
justify-content
:
center
;
color
:
#606266
;
}
.table-key
{
width
:
calc
(
100%
-
96px
);
}
.tab-value
{
width
:
52px
;
margin-left
:
auto
;
padding-right
:
4px
;
}
}
}
}
>
div
{
height
:
100%
;
}
}
}
}
}
}
</
style
>
</
style
>
src/mixins/clientMixin.js
View file @
34eefc9
...
@@ -15,7 +15,7 @@ export default {
...
@@ -15,7 +15,7 @@ export default {
},
},
methods
:
{
methods
:
{
getClientData
()
{
getClientData
()
{
let
clientApi
=
this
.
isBrand
?
'overalldistribution'
:
'merchantOveralldistribution'
let
clientApi
=
!
this
.
isBrand
?
'overalldistribution'
:
'merchantOveralldistribution'
const
params
=
{
const
params
=
{
req
:
{
req
:
{
corporateGroupName
:
'集团1'
,
corporateGroupName
:
'集团1'
,
...
@@ -27,6 +27,9 @@ export default {
...
@@ -27,6 +27,9 @@ export default {
}
}
if
(
this
.
isBrand
)
params
.
req
.
brandName
=
this
.
brandName
if
(
this
.
isBrand
)
params
.
req
.
brandName
=
this
.
brandName
this
.
api
.
customer
[
clientApi
](
params
).
then
(
res
=>
{
this
.
api
.
customer
[
clientApi
](
params
).
then
(
res
=>
{
this
.
clientData
=
[]
this
.
brandList
=
[]
this
.
distributionRank
=
''
if
(
res
.
data
.
dataList
.
length
>
0
)
{
if
(
res
.
data
.
dataList
.
length
>
0
)
{
let
distribution
=
JSON
.
parse
(
res
.
data
.
dataList
[
0
].
distribution
)
let
distribution
=
JSON
.
parse
(
res
.
data
.
dataList
[
0
].
distribution
)
const
keys
=
Object
.
keys
(
distribution
)
const
keys
=
Object
.
keys
(
distribution
)
...
@@ -37,13 +40,10 @@ export default {
...
@@ -37,13 +40,10 @@ export default {
})
})
})
})
this
.
distributionRank
=
JSON
.
parse
(
res
.
data
.
dataList
[
0
].
distributionRank
)
this
.
distributionRank
=
JSON
.
parse
(
res
.
data
.
dataList
[
0
].
distributionRank
)
}
else
{
this
.
clientData
=
[]
}
}
})
})
},
},
init
(
newVal
)
{
init
(
newVal
)
{
console
.
log
(
newVal
,
99999999999999999
)
this
.
isBrand
=
false
this
.
isBrand
=
false
if
(
newVal
.
brand
)
{
if
(
newVal
.
brand
)
{
this
.
isBrand
=
true
this
.
isBrand
=
true
...
...
src/mixins/salesMixin.js
View file @
34eefc9
...
@@ -15,7 +15,7 @@ export default {
...
@@ -15,7 +15,7 @@ export default {
},
},
methods
:
{
methods
:
{
getSalesData
()
{
getSalesData
()
{
let
salesApi
=
this
.
isBrand
?
'getSales'
:
'getMerchantSales'
let
salesApi
=
!
this
.
isBrand
?
'getSales'
:
'getMerchantSales'
const
params
=
{
const
params
=
{
req
:
{
req
:
{
corporateGroupName
:
'集团1'
,
corporateGroupName
:
'集团1'
,
...
@@ -27,6 +27,9 @@ export default {
...
@@ -27,6 +27,9 @@ export default {
}
}
if
(
this
.
isBrand
)
params
.
req
.
brandName
=
this
.
brandName
if
(
this
.
isBrand
)
params
.
req
.
brandName
=
this
.
brandName
this
.
api
.
sales
[
salesApi
](
params
).
then
(
res
=>
{
this
.
api
.
sales
[
salesApi
](
params
).
then
(
res
=>
{
this
.
salesData
=
[]
this
.
typeRanking
=
''
this
.
brandList
=
[]
if
(
res
.
data
.
dataList
.
length
>
0
)
{
if
(
res
.
data
.
dataList
.
length
>
0
)
{
let
typeNum
=
JSON
.
parse
(
res
.
data
.
dataList
[
0
].
typeNum
)
let
typeNum
=
JSON
.
parse
(
res
.
data
.
dataList
[
0
].
typeNum
)
Object
.
keys
(
typeNum
).
forEach
((
item
,
index
)
=>
{
Object
.
keys
(
typeNum
).
forEach
((
item
,
index
)
=>
{
...
@@ -37,8 +40,6 @@ export default {
...
@@ -37,8 +40,6 @@ export default {
})
})
this
.
typeRanking
=
JSON
.
parse
(
res
.
data
.
dataList
[
0
].
typeRanking
)
this
.
typeRanking
=
JSON
.
parse
(
res
.
data
.
dataList
[
0
].
typeRanking
)
}
else
{
this
.
salesData
=
[]
}
}
})
})
},
},
...
...
src/views/afterSales/analyze.vue
View file @
34eefc9
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
<
template
>
<
template
>
<div>
<div>
<div
class=
"title"
>
售后客户价值分析
</div>
<div
class=
"title"
>
售后客户价值分析
</div>
<template
v-if=
"barData.length > 0"
>
<div
class=
"analyze-content"
:style=
"
{ height: height - 4.9 + 'vh' }">
<div
class=
"analyze-content"
:style=
"
{ height: height - 4.9 + 'vh' }">
<div
class=
"content-left bg"
>
<div
class=
"content-left bg"
>
<div
id=
"analyzeBar"
style=
"height: 100%"
></div>
<div
id=
"analyzeBar"
style=
"height: 100%"
></div>
...
@@ -16,15 +17,21 @@
...
@@ -16,15 +17,21 @@
<pie-chart
:id=
"chart.id"
:list=
"analyzeData"
:height=
"height - 4.9 + 'vh'"
:radius=
"chart.radius"
></pie-chart>
<pie-chart
:id=
"chart.id"
:list=
"analyzeData"
:height=
"height - 4.9 + 'vh'"
:radius=
"chart.radius"
></pie-chart>
</div>
</div>
</div>
</div>
</
template
>
<div
class=
"empty"
:style=
"{ height: height - 4.9 + 'vh' }"
v-else
>
<img
src=
"../../assets/images/empty.png"
alt=
""
/>
</div>
</div>
</div>
</template>
</template>
<
script
>
<
script
>
import
*
as
echarts
from
'echarts'
import
*
as
echarts
from
'echarts'
import
datas
from
'../../utils/data'
import
datas
from
'../../utils/data'
import
{
changeMixin
}
from
'../../mixins/index'
export
default
{
export
default
{
name
:
'Analyze'
,
name
:
'Analyze'
,
props
:
[
'height'
],
props
:
[
'height'
],
mixins
:
[
changeMixin
],
data
()
{
data
()
{
return
{
return
{
analyzeData
:
[],
analyzeData
:
[],
...
@@ -35,15 +42,12 @@ export default {
...
@@ -35,15 +42,12 @@ export default {
barChart
:
''
,
barChart
:
''
,
option
:
{},
option
:
{},
barData
:
[],
barData
:
[],
key
:
1
key
:
1
,
isBrand
:
false
,
brandName
:
''
}
}
},
},
mounted
()
{
mounted
()
{
this
.
barChart
=
echarts
.
init
(
document
.
getElementById
(
'analyzeBar'
))
// resize
window
.
addEventListener
(
'resize'
,
()
=>
{
this
.
barChart
.
resize
()
})
this
.
init
()
this
.
init
()
},
},
methods
:
{
methods
:
{
...
@@ -51,6 +55,11 @@ export default {
...
@@ -51,6 +55,11 @@ export default {
this
.
getValueType
()
this
.
getValueType
()
},
},
getChart
()
{
getChart
()
{
this
.
barChart
=
echarts
.
init
(
document
.
getElementById
(
'analyzeBar'
))
// resize
window
.
addEventListener
(
'resize'
,
()
=>
{
this
.
barChart
.
resize
()
})
this
.
option
=
{
this
.
option
=
{
grid
:
{
grid
:
{
left
:
'3%'
,
left
:
'3%'
,
...
@@ -114,6 +123,7 @@ export default {
...
@@ -114,6 +123,7 @@ export default {
}
}
]
]
}
}
this
.
barChart
.
clear
()
this
.
barChart
.
setOption
(
this
.
option
)
this
.
barChart
.
setOption
(
this
.
option
)
// 鼠标划入
// 鼠标划入
this
.
barChart
.
on
(
'mouseover'
,
data
=>
{
this
.
barChart
.
on
(
'mouseover'
,
data
=>
{
...
@@ -121,25 +131,33 @@ export default {
...
@@ -121,25 +131,33 @@ export default {
})
})
},
},
getValueType
()
{
getValueType
()
{
let
analyzeApi
=
!
this
.
isBrand
?
'aftersaleother'
:
'afterMerchantSaleother'
const
params
=
{
const
params
=
{
req
:
{
req
:
{
corporateGroupName
:
'集团1'
,
corporateGroupName
:
'集团1'
,
queryItem
:
'valueanalyse'
,
queryItem
:
'valueanalyse'
,
// queryTime: this.getCurrentDate,
queryTime
:
'2022-06-23'
,
queryTime
:
'2022-06-23'
,
queryType
:
0
queryType
:
this
.
watchReportParams
.
reportType
}
}
}
}
this
.
api
.
afterSales
.
aftersaleother
(
params
).
then
(
res
=>
{
if
(
this
.
isBrand
)
params
.
req
.
brandName
=
this
.
brandName
this
.
api
.
afterSales
[
analyzeApi
](
params
).
then
(
res
=>
{
this
.
analyzeData
=
[]
this
.
barData
=
[]
if
(
res
.
data
.
dataList
.
length
>
0
)
{
const
reqData
=
JSON
.
parse
(
res
.
data
.
dataList
[
0
].
distribution
)
const
reqData
=
JSON
.
parse
(
res
.
data
.
dataList
[
0
].
distribution
)
this
.
distributionRank
=
JSON
.
parse
(
res
.
data
.
dataList
[
0
].
distributionRank
)
this
.
distributionRank
=
JSON
.
parse
(
res
.
data
.
dataList
[
0
].
distributionRank
)
this
.
barData
=
[]
this
.
barData
=
[]
for
(
let
i
in
reqData
)
{
for
(
let
i
in
reqData
)
{
this
.
barData
.
push
(
reqData
[
i
])
this
.
barData
.
push
(
reqData
[
i
])
}
}
this
.
$nextTick
(()
=>
{
this
.
getChart
()
this
.
getChart
()
this
.
initPieData
()
this
.
initPieData
()
})
})
}
})
},
},
initPieData
(
name
)
{
initPieData
(
name
)
{
const
distributionRank
=
this
.
distributionRank
[
this
.
key
]
const
distributionRank
=
this
.
distributionRank
[
this
.
key
]
...
@@ -149,6 +167,14 @@ export default {
...
@@ -149,6 +167,14 @@ export default {
value
:
distributionRank
[
item
]
value
:
distributionRank
[
item
]
})
})
})
})
},
init
(
newVal
)
{
this
.
isBrand
=
false
if
(
newVal
&&
newVal
.
brand
)
{
this
.
isBrand
=
true
this
.
brandName
=
newVal
.
brand
.
name
}
this
.
getValueType
()
}
}
}
}
}
}
...
...
src/views/afterSales/mileage.vue
View file @
34eefc9
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
<
template
>
<
template
>
<div>
<div>
<div
class=
"title"
>
售后车辆里程
</div>
<div
class=
"title"
>
售后车辆里程
</div>
<template
v-if=
"mileageData.length > 0"
>
<div
class=
"flex"
>
<div
class=
"flex"
>
<pie-chart
:id=
"chart.id"
:list=
"mileageData"
:height=
"height - 4.9 + 'vh'"
:radius=
"chart.radius"
@
pieAction=
"pieAction"
></pie-chart>
<pie-chart
:id=
"chart.id"
:list=
"mileageData"
:height=
"height - 4.9 + 'vh'"
:radius=
"chart.radius"
@
pieAction=
"pieAction"
></pie-chart>
<div
class=
"ranking-container"
>
<div
class=
"ranking-container"
>
...
@@ -24,13 +25,19 @@
...
@@ -24,13 +25,19 @@
</div>
</div>
</div>
</div>
</div>
</div>
</
template
>
<div
class=
"empty"
:style=
"{ height: height - 4.9 + 'vh' }"
v-else
>
<img
src=
"../../assets/images/empty.png"
alt=
""
/>
</div>
</div>
</div>
</template>
</template>
<
script
>
<
script
>
import
{
changeMixin
}
from
'../../mixins/index'
export
default
{
export
default
{
name
:
'Mileage'
,
name
:
'Mileage'
,
props
:
[
'height'
],
props
:
[
'height'
],
mixins
:
[
changeMixin
],
data
()
{
data
()
{
return
{
return
{
mileageData
:
[],
mileageData
:
[],
...
@@ -42,7 +49,9 @@ export default {
...
@@ -42,7 +49,9 @@ export default {
},
},
delayTimer
:
3000
,
delayTimer
:
3000
,
directionTimer
:
3000
,
directionTimer
:
3000
,
brandList
:
this
.
list
brandList
:
this
.
list
,
isBrand
:
false
,
brandName
:
''
}
}
},
},
mounted
()
{
mounted
()
{
...
@@ -50,15 +59,21 @@ export default {
...
@@ -50,15 +59,21 @@ export default {
},
},
methods
:
{
methods
:
{
getValueType
()
{
getValueType
()
{
let
mileageApi
=
!
this
.
isBrand
?
'aftersaleother'
:
'afterMerchantSaleother'
const
params
=
{
const
params
=
{
req
:
{
req
:
{
corporateGroupName
:
'集团1'
,
corporateGroupName
:
'集团1'
,
queryItem
:
'mileage'
,
queryItem
:
'mileage'
,
// queryTime: this.getCurrentDate,
queryTime
:
'2022-06-23'
,
queryTime
:
'2022-06-23'
,
queryType
:
0
queryType
:
this
.
watchReportParams
.
reportType
}
}
}
}
this
.
api
.
afterSales
.
aftersaleother
(
params
).
then
(
res
=>
{
if
(
this
.
isBrand
)
params
.
req
.
brandName
=
this
.
brandName
this
.
api
.
afterSales
[
mileageApi
](
params
).
then
(
res
=>
{
this
.
mileageData
=
[]
this
.
rankingData
=
[]
if
(
res
.
data
.
dataList
.
length
>
0
)
{
let
distribution
=
JSON
.
parse
(
res
.
data
.
dataList
[
0
].
distribution
)
let
distribution
=
JSON
.
parse
(
res
.
data
.
dataList
[
0
].
distribution
)
// console.log()
// console.log()
const
keys
=
Object
.
keys
(
distribution
)
const
keys
=
Object
.
keys
(
distribution
)
...
@@ -69,10 +84,10 @@ export default {
...
@@ -69,10 +84,10 @@ export default {
})
})
})
})
this
.
distributionRank
=
JSON
.
parse
(
res
.
data
.
dataList
[
0
].
distributionRank
)
this
.
distributionRank
=
JSON
.
parse
(
res
.
data
.
dataList
[
0
].
distributionRank
)
}
})
})
},
},
pieAction
(
data
)
{
pieAction
(
data
)
{
this
.
rankingData
=
[]
let
distributionRank
=
this
.
distributionRank
[
data
.
name
]
let
distributionRank
=
this
.
distributionRank
[
data
.
name
]
for
(
const
key
in
distributionRank
)
{
for
(
const
key
in
distributionRank
)
{
this
.
rankingData
.
push
({
this
.
rankingData
.
push
({
...
@@ -80,6 +95,14 @@ export default {
...
@@ -80,6 +95,14 @@ export default {
value
:
distributionRank
[
key
]
value
:
distributionRank
[
key
]
})
})
}
}
},
init
(
newVal
)
{
this
.
isBrand
=
false
if
(
newVal
&&
newVal
.
brand
)
{
this
.
isBrand
=
true
this
.
brandName
=
newVal
.
brand
.
name
}
this
.
getValueType
()
}
}
}
}
}
}
...
...
src/views/customer/age.vue
View file @
34eefc9
...
@@ -38,7 +38,7 @@ export default {
...
@@ -38,7 +38,7 @@ export default {
},
},
methods
:
{
methods
:
{
pieAction
(
data
)
{
pieAction
(
data
)
{
this
.
brandList
=
Object
.
keys
(
this
.
distributionRank
[
data
.
name
])
this
.
brandList
=
this
.
distributionRank
&&
this
.
distributionRank
[
data
.
name
]
&&
Object
.
keys
(
this
.
distributionRank
[
data
.
name
])
}
}
}
}
}
}
...
...
src/views/customer/buyCar.vue
View file @
34eefc9
...
@@ -38,7 +38,7 @@ export default {
...
@@ -38,7 +38,7 @@ export default {
},
},
methods
:
{
methods
:
{
pieAction
(
data
)
{
pieAction
(
data
)
{
this
.
brandList
=
Object
.
keys
(
this
.
distributionRank
[
data
.
name
])
this
.
brandList
=
this
.
distributionRank
&&
this
.
distributionRank
[
data
.
name
]
&&
Object
.
keys
(
this
.
distributionRank
[
data
.
name
])
}
}
}
}
}
}
...
...
src/views/customer/sex.vue
View file @
34eefc9
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
</div>
</div>
<div
class=
"container flex"
>
<div
class=
"container flex"
>
<template
v-if=
"clientData.length > 0"
>
<template
v-if=
"clientData.length > 0"
>
<pie-chart
:id=
"chart.id"
:list=
"clientData"
@
pieAction=
"pieAction"
></pie-chart>
<pie-chart
:id=
"chart.id"
:list=
"clientData"
:colors=
"chart.colors"
@
pieAction=
"pieAction"
></pie-chart>
<ran-king
:list=
"brandList"
></ran-king>
<ran-king
:list=
"brandList"
></ran-king>
</
template
>
</
template
>
<div
class=
"empty"
style=
"height:12.7vh"
v-else
>
<div
class=
"empty"
style=
"height:12.7vh"
v-else
>
...
@@ -31,13 +31,15 @@ export default {
...
@@ -31,13 +31,15 @@ export default {
return
{
return
{
type
:
'gender'
,
type
:
'gender'
,
chart
:
{
chart
:
{
id
:
'sex-pie'
id
:
'sex-pie'
,
colors
:[
"#EB6001"
,
"#BF98FF"
,
"#FF6E76"
]
}
}
}
}
},
},
methods
:{
methods
:{
pieAction
(
data
){
pieAction
(
data
){
this
.
brandList
=
Object
.
keys
(
this
.
distributionRank
[
data
.
name
])
console
.
log
(
this
.
distributionRank
,
'客户性别'
)
this
.
brandList
=
this
.
distributionRank
&&
this
.
distributionRank
[
data
.
name
]
&&
Object
.
keys
(
this
.
distributionRank
[
data
.
name
])
}
}
}
}
}
}
...
...
src/views/salesData/customerCategory.vue
View file @
34eefc9
...
@@ -38,7 +38,7 @@ export default {
...
@@ -38,7 +38,7 @@ export default {
},
},
methods
:
{
methods
:
{
pieAction
(
data
)
{
pieAction
(
data
)
{
this
.
brandList
=
Object
.
keys
(
this
.
typeRanking
[
data
.
name
])
this
.
brandList
=
this
.
typeRanking
&&
this
.
typeRanking
[
data
.
name
]
&&
Object
.
keys
(
this
.
typeRanking
[
data
.
name
])
}
}
}
}
}
}
...
...
src/views/salesData/enterCategory.vue
View file @
34eefc9
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
<pie-chart
:id=
"chart.id"
:list=
"salesData"
@
pieAction=
"pieAction"
></pie-chart>
<pie-chart
:id=
"chart.id"
:list=
"salesData"
@
pieAction=
"pieAction"
></pie-chart>
<ran-king
:list=
"brandList"
></ran-king>
<ran-king
:list=
"brandList"
></ran-king>
</
template
>
</
template
>
<div
class=
"empty"
style=
"height:12.7vh"
v-else
>
<div
class=
"empty"
style=
"height:
12.7vh"
v-else
>
<img
src=
"../../assets/images/empty.png"
alt=
""
/>
<img
src=
"../../assets/images/empty.png"
alt=
""
/>
</div>
</div>
</div>
</div>
...
@@ -38,7 +38,7 @@ export default {
...
@@ -38,7 +38,7 @@ export default {
},
},
methods
:
{
methods
:
{
pieAction
(
data
)
{
pieAction
(
data
)
{
this
.
brandList
=
Object
.
keys
(
this
.
typeRanking
[
data
.
name
])
this
.
brandList
=
this
.
typeRanking
&&
this
.
typeRanking
[
data
.
name
]
&&
Object
.
keys
(
this
.
typeRanking
[
data
.
name
])
}
}
}
}
}
}
...
...
src/views/salesData/infoFrom.vue
View file @
34eefc9
...
@@ -38,7 +38,7 @@ export default {
...
@@ -38,7 +38,7 @@ export default {
},
},
methods
:
{
methods
:
{
pieAction
(
data
)
{
pieAction
(
data
)
{
this
.
brandList
=
Object
.
keys
(
this
.
typeRanking
[
data
.
name
])
this
.
brandList
=
this
.
typeRanking
&&
this
.
typeRanking
[
data
.
name
]
&&
Object
.
keys
(
this
.
typeRanking
[
data
.
name
])
}
}
}
}
}
}
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment