Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx
/
dj-scrm-wx-work-attachment-report
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
4
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 6c7058cb
authored
Jan 20, 2022
by
王志慧
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
commit
1 parent
9ff73696
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
60 additions
and
80 deletions
src/assets/css/sprite.scss
src/assets/images/sprite.png
src/assets/spritesmith/icondown.png
src/assets/spritesmith/iconup.png
src/components/CanvasTab.vue
src/components/Chart.vue
src/components/Statistics.vue
src/store/modules/report.js
src/views/report/index.vue
src/assets/css/sprite.scss
View file @
6c7058c
...
@@ -6,6 +6,8 @@
...
@@ -6,6 +6,8 @@
.icon-equity
{
width
:
40px
;
height
:
44px
;
background-position
:
-50px
-190px
;}
.icon-equity
{
width
:
40px
;
height
:
44px
;
background-position
:
-50px
-190px
;}
.icon-helmet
{
width
:
26px
;
height
:
26px
;
background-position
:
-73px
-244px
;}
.icon-helmet
{
width
:
26px
;
height
:
26px
;
background-position
:
-73px
-244px
;}
.icon-huangguan
{
width
:
14px
;
height
:
15px
;
background-position
:
-217px
-244px
;}
.icon-huangguan
{
width
:
14px
;
height
:
15px
;
background-position
:
-217px
-244px
;}
.icon-icondown
{
width
:
5px
;
height
:
8px
;
background-position
:
-287px
-244px
;}
.icon-iconup
{
width
:
5px
;
height
:
8px
;
background-position
:
-302px
-244px
;}
.icon-liushi
{
width
:
40px
;
height
:
44px
;
background-position
:
-100px
-190px
;}
.icon-liushi
{
width
:
40px
;
height
:
44px
;
background-position
:
-100px
-190px
;}
.icon-message
{
width
:
14px
;
height
:
13px
;
background-position
:
-241px
-244px
;}
.icon-message
{
width
:
14px
;
height
:
13px
;
background-position
:
-241px
-244px
;}
.icon-production
{
width
:
40px
;
height
:
44px
;
background-position
:
-150px
-190px
;}
.icon-production
{
width
:
40px
;
height
:
44px
;
background-position
:
-150px
-190px
;}
...
@@ -16,5 +18,3 @@
...
@@ -16,5 +18,3 @@
.icon-speed
{
width
:
26px
;
height
:
26px
;
background-position
:
-181px
-244px
;}
.icon-speed
{
width
:
26px
;
height
:
26px
;
background-position
:
-181px
-244px
;}
.icon-totalCu
{
width
:
40px
;
height
:
44px
;
background-position
:
-250px
-190px
;}
.icon-totalCu
{
width
:
40px
;
height
:
44px
;
background-position
:
-250px
-190px
;}
.icon-wechat-customers
{
width
:
40px
;
height
:
44px
;
background-position
:
-300px
-190px
;}
.icon-wechat-customers
{
width
:
40px
;
height
:
44px
;
background-position
:
-300px
-190px
;}
\ No newline at end of file
\ No newline at end of file
.icon-icondown
{
width
:
5px
;
height
:
9px
;
background-position
:
-287px
-244px
;}
.icon-iconup
{
width
:
5px
;
height
:
9px
;
background-position
:
-302px
-244px
;}
\ No newline at end of file
\ No newline at end of file
src/assets/images/sprite.png
View file @
6c7058c
173 KB
|
W:
|
H:
173 KB
|
W:
|
H:
2-up
Swipe
Onion skin
src/assets/spritesmith/icondown.png
View file @
6c7058c
421 Bytes
|
W:
|
H:
349 Bytes
|
W:
|
H:
2-up
Swipe
Onion skin
src/assets/spritesmith/iconup.png
View file @
6c7058c
424 Bytes
|
W:
|
H:
383 Bytes
|
W:
|
H:
2-up
Swipe
Onion skin
src/components/CanvasTab.vue
View file @
6c7058c
...
@@ -28,9 +28,10 @@ export default {
...
@@ -28,9 +28,10 @@ export default {
},
},
outputData
:
{
outputData
:
{
handler
()
{
handler
()
{
this
.
initData
()
this
.
init
Text
Data
()
},
},
deep
:
true
deep
:
true
,
immediate
:
true
}
}
},
},
computed
:
{
computed
:
{
...
@@ -45,7 +46,8 @@ export default {
...
@@ -45,7 +46,8 @@ export default {
},
},
data
()
{
data
()
{
return
{
return
{
data
:
[]
data
:
[],
text
:
''
}
}
},
},
mounted
()
{},
mounted
()
{},
...
@@ -53,26 +55,27 @@ export default {
...
@@ -53,26 +55,27 @@ export default {
...
mapMutations
({
...
mapMutations
({
SET_TABTYPE_INDEX
:
'report/SET_TABTYPE_INDEX'
SET_TABTYPE_INDEX
:
'report/SET_TABTYPE_INDEX'
}),
}),
initData
()
{
initTextData
()
{
let
{
let
{
reportType
,
outputData
}
=
this
userInfo
:
{
accountLevel
},
reportType
,
outputData
}
=
this
let
text
if
(
reportType
==
0
)
{
if
(
reportType
==
0
)
{
text
=
'本周'
t
his
.
t
ext
=
'本周'
//
document.title = '周报'
document
.
title
=
'周报'
}
else
{
}
else
{
let
time
=
outputData
.
reportTimeStart
.
split
(
'-'
)
let
time
=
outputData
.
reportTimeStart
.
split
(
'-'
)
if
(
time
[
1
]
>
9
)
{
if
(
parseInt
(
time
[
1
])
>
9
)
{
text
=
time
[
1
]
+
'月'
t
his
.
t
ext
=
time
[
1
]
+
'月'
}
else
{
}
else
{
text
=
time
[
1
].
split
(
''
)[
1
]
+
'月'
t
his
.
t
ext
=
time
[
1
].
split
(
''
)[
1
]
+
'月'
}
}
document
.
title
=
'月报'
document
.
title
=
'月报'
}
}
},
initData
()
{
let
{
userInfo
:
{
accountLevel
},
reportType
,
text
}
=
this
if
(
accountLevel
!==
4
&&
this
.
tabIndex
==
0
)
{
if
(
accountLevel
!==
4
&&
this
.
tabIndex
==
0
)
{
//集团客户周月报
//集团客户周月报
if
(
reportType
==
0
)
{
if
(
reportType
==
0
)
{
...
...
src/components/Chart.vue
View file @
6c7058c
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<canvas
<canvas
id=
"lineCustomerChart"
id=
"lineCustomerChart"
class=
"canvas"
class=
"canvas"
v-
if
=
"
v-
show
=
"
(userInfo.accountLevel != 4 && reportType == 1 && tabType.index == 2 && tabIndex == 0 && trendChartList.length > 0) ||
(userInfo.accountLevel != 4 && reportType == 1 && tabType.index == 2 && tabIndex == 0 && trendChartList.length > 0) ||
(userInfo.accountLevel == 4 && reportType == 1 && tabType.index == 0 && tabIndex == 0 && trendChartList.length > 0)
(userInfo.accountLevel == 4 && reportType == 1 && tabType.index == 0 && tabIndex == 0 && trendChartList.length > 0)
"
"
...
@@ -16,13 +16,13 @@
...
@@ -16,13 +16,13 @@
<canvas
<canvas
id=
"lineChart"
id=
"lineChart"
class=
"canvas"
class=
"canvas"
v-
if
=
"
v-
show
=
"
(tabIndex == 1 && userInfo.accountLevel != 4 && reportType == 1 && tabType.index == 2 && trendList.length > 0) ||
(tabIndex == 1 && userInfo.accountLevel != 4 && reportType == 1 && tabType.index == 2 && trendList.length > 0) ||
(tabIndex == 1 && userInfo.accountLevel == 4 && reportType == 1 && tabType.index == 0 && trendList.length > 0)
(tabIndex == 1 && userInfo.accountLevel == 4 && reportType == 1 && tabType.index == 0 && trendList.length > 0)
"
"
></canvas>
></canvas>
<canvas
class=
"canvas"
id=
"pieChart"
v-
if
=
"tabIndex == 1 && tabType.index == 1 && productionValueReportList.length > 0"
></canvas>
<canvas
class=
"canvas"
id=
"pieChart"
v-
show
=
"tabIndex == 1 && tabType.index == 1 && productionValueReportList.length > 0"
></canvas>
<template
<template
v-if=
"
v-if=
"
...
@@ -112,12 +112,11 @@ export default {
...
@@ -112,12 +112,11 @@ export default {
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
let
{
reportType
,
tabIndex
,
tabType
}
=
this
let
{
reportType
,
tabIndex
,
tabType
}
=
this
if
((
tabIndex
==
1
&&
type
!=
4
&&
reportType
==
1
&&
tabType
.
index
==
2
)
||
(
tabIndex
==
1
&&
type
==
4
&&
reportType
==
1
&&
tabType
.
index
==
0
))
this
.
initLineChart
()
//产值
if
((
tabIndex
==
1
&&
type
!=
4
&&
reportType
==
1
&&
tabType
.
index
==
2
)
||
(
tabIndex
==
1
&&
type
==
4
&&
reportType
==
1
&&
tabType
.
index
==
0
))
this
.
initLineChart
()
//产值
if
((
tabIndex
==
0
&&
type
!=
4
&&
reportType
==
1
&&
tabType
.
index
==
2
)
||
(
tabIndex
==
0
&&
type
==
4
&&
reportType
==
1
&&
tabType
.
index
==
0
))
this
.
lineCustomerChart
()
//客户
if
((
tabIndex
==
0
&&
type
!=
4
&&
reportType
==
1
&&
tabType
.
index
==
2
)
||
(
tabIndex
==
0
&&
type
==
4
&&
reportType
==
1
&&
tabType
.
index
==
0
))
this
.
lineCustomerChart
()
//客户
if
((
type
==
4
&&
tabIndex
==
1
&&
tabType
.
index
==
1
)
||
(
type
!=
4
&&
tabIndex
==
1
&&
tabType
.
index
==
1
)
||
reportType
==
0
)
this
.
initPieChart
()
if
((
type
==
4
&&
tabIndex
==
1
&&
tabType
.
index
==
1
)
||
(
type
!=
4
&&
tabIndex
==
1
&&
tabType
.
index
==
1
)
||
reportType
==
0
)
this
.
initPieChart
()
})
})
},
},
initLineChart
(
id
=
'lineChart'
)
{
initLineChart
(
id
=
'lineChart'
)
{
console
.
log
(
'产值折线图'
)
let
{
tabIndex
}
=
this
let
{
tabIndex
}
=
this
this
.
lineChart
&&
this
.
lineChart
.
clear
()
this
.
lineChart
&&
this
.
lineChart
.
clear
()
this
.
lineChart
=
null
this
.
lineChart
=
null
...
@@ -196,11 +195,7 @@ export default {
...
@@ -196,11 +195,7 @@ export default {
tickCount
:
5
,
tickCount
:
5
,
range
:
[
0
,
1
]
range
:
[
0
,
1
]
},
},
orderMoneyTotalSum
:
{
orderMoneyTotalSum
:
{}
formatter
(
e
)
{
return
Math
.
ceil
(
e
)
}
}
})
})
this
.
lineChart
.
axis
(
'dataDateStr'
,
{
this
.
lineChart
.
axis
(
'dataDateStr'
,
{
label
:
function
label
(
text
,
index
,
total
)
{
label
:
function
label
(
text
,
index
,
total
)
{
...
@@ -213,23 +208,12 @@ export default {
...
@@ -213,23 +208,12 @@ export default {
return
textCfg
return
textCfg
}
}
})
})
// this.lineChart
// .area()
// .position('dataDateStr*orderMoneyTotalSum')
// .color('country', val => {
// return ['#3975C6', '#F7F7F7']
// })
// .adjust('stack')
this
.
lineChart
.
tooltip
({
this
.
lineChart
.
tooltip
({
showTitle
:
true
,
// 展示 tooltip 的标题
showTitle
:
true
,
// 展示 tooltip 的标题
layout
:
'vertical'
layout
:
'vertical'
})
})
this
.
lineChart
.
legend
(
false
)
this
.
lineChart
.
legend
(
false
)
this
.
lineChart
.
line
().
position
(
'dataDateStr*orderMoneyTotalSum'
).
shape
(
'smooth'
).
color
(
'type'
,
[
'#3975C6'
])
this
.
lineChart
.
line
().
position
(
'dataDateStr*orderMoneyTotalSum'
).
shape
(
'smooth'
).
color
(
'type'
,
[
'#3975C6'
])
// this.lineChart.point().position('dataDateStr*orderMoneyTotalSum').shape('smooth').style({
// stroke: '#fff',
// lineWidth: 1
// })
}
}
const
textObj
=
{
const
textObj
=
{
top
:
true
,
top
:
true
,
...
@@ -242,22 +226,21 @@ export default {
...
@@ -242,22 +226,21 @@ export default {
}
}
}
}
this
.
lineChart
.
guide
().
text
({
//
this.lineChart.guide().text({
...
textObj
,
//
...textObj,
content
:
'日期'
,
//
content: '日期',
offsetX
:
window
.
screen
.
width
-
70
,
//
offsetX: window.screen.width - 70,
offsetY
:
14
//
offsetY: 14
})
//
})
this
.
lineChart
.
guide
().
text
({
this
.
lineChart
.
guide
().
text
({
...
textObj
,
...
textObj
,
content
:
'产值'
,
content
:
'产值'
,
offsetX
:
-
10
,
offsetX
:
-
10
,
offsetY
:
-
1
60
offsetY
:
-
1
75
})
})
this
.
lineChart
.
render
()
this
.
lineChart
.
render
()
},
},
initPieChart
(
id
=
'pieChart'
)
{
initPieChart
(
id
=
'pieChart'
)
{
let
{
productionValueReportList
,
orderSource
}
=
this
let
{
productionValueReportList
,
orderSource
}
=
this
productionValueReportList
.
map
(
e
=>
{
productionValueReportList
.
map
(
e
=>
{
e
.
count
=
'count'
e
.
count
=
'count'
...
@@ -310,7 +293,6 @@ export default {
...
@@ -310,7 +293,6 @@ export default {
this
.
chart
.
render
()
this
.
chart
.
render
()
},
},
lineCustomerChart
(
id
=
'lineCustomerChart'
)
{
lineCustomerChart
(
id
=
'lineCustomerChart'
)
{
console
.
log
(
'客户折线图'
)
// var tooltipEl = document.createElement('div')
// var tooltipEl = document.createElement('div')
// var dom = document.getElementById('lineCustomerChart')
// var dom = document.getElementById('lineCustomerChart')
this
.
lineChartCustomer
&&
this
.
lineChartCustomer
.
clear
()
this
.
lineChartCustomer
&&
this
.
lineChartCustomer
.
clear
()
...
@@ -335,8 +317,6 @@ export default {
...
@@ -335,8 +317,6 @@ export default {
type
:
'新增客户数'
,
type
:
'新增客户数'
,
value
:
item
.
newlyCustomerCount
value
:
item
.
newlyCustomerCount
}
}
)
)
})
})
this
.
lineChartCustomer
.
source
(
trendList
,
{
this
.
lineChartCustomer
.
source
(
trendList
,
{
...
@@ -347,9 +327,9 @@ export default {
...
@@ -347,9 +327,9 @@ export default {
tickCount
:
5
tickCount
:
5
},
},
value
:
{
value
:
{
formatter
(
e
)
{
type
:
'linear'
,
return
Math
.
ceil
(
e
)
nice
:
true
,
}
tickInterval
:
2
}
}
})
})
this
.
lineChartCustomer
.
axis
(
'dayTime'
,
{
this
.
lineChartCustomer
.
axis
(
'dayTime'
,
{
...
@@ -419,17 +399,17 @@ export default {
...
@@ -419,17 +399,17 @@ export default {
}
}
}
}
this
.
lineChartCustomer
.
guide
().
text
({
//
this.lineChartCustomer.guide().text({
...
textObj
,
//
...textObj,
content
:
'日期'
,
//
content: '日期',
offsetX
:
window
.
screen
.
width
-
70
,
//
offsetX: window.screen.width - 70,
offsetY
:
14
//
offsetY: 14
})
//
})
this
.
lineChartCustomer
.
guide
().
text
({
this
.
lineChartCustomer
.
guide
().
text
({
...
textObj
,
...
textObj
,
content
:
'数量'
,
content
:
'数量'
,
offsetX
:
-
10
,
offsetX
:
-
10
,
offsetY
:
-
1
60
offsetY
:
-
1
75
})
})
this
.
lineChartCustomer
.
render
()
this
.
lineChartCustomer
.
render
()
}
}
...
...
src/components/Statistics.vue
View file @
6c7058c
...
@@ -138,7 +138,7 @@ export default {
...
@@ -138,7 +138,7 @@ export default {
width
:
auto
;
width
:
auto
;
border-radius
:
3px
;
border-radius
:
3px
;
height
:
15px
;
height
:
15px
;
font-size
:
1
1
px
;
font-size
:
1
0
px
;
font-weight
:
500
;
font-weight
:
500
;
line-height
:
15px
;
line-height
:
15px
;
margin-left
:
5px
;
margin-left
:
5px
;
...
@@ -169,6 +169,7 @@ export default {
...
@@ -169,6 +169,7 @@ export default {
}
}
.ratio
{
.ratio
{
margin-left
:
2px
;
margin-left
:
2px
;
margin-bottom
:
0
;
&
.applybcolor
{
&
.applybcolor
{
color
:
#3975c6
;
color
:
#3975c6
;
}
}
...
...
src/store/modules/report.js
View file @
6c7058c
...
@@ -62,6 +62,9 @@ export default {
...
@@ -62,6 +62,9 @@ export default {
payload
.
reportData
.
productionValueReportList
&&
payload
.
reportData
.
productionValueReportList
.
map
(
e
=>
{
payload
.
reportData
.
productionValueReportList
&&
payload
.
reportData
.
productionValueReportList
.
map
(
e
=>
{
e
.
newProductionValue
=
e
.
newProductionValue
/
100
e
.
newProductionValue
=
e
.
newProductionValue
/
100
})
//新增产值分布饼图数据处理
})
//新增产值分布饼图数据处理
payload
.
reportData
.
trendList
&&
payload
.
reportData
.
trendList
.
map
(
e
=>
{
e
.
orderMoneyTotalSum
=
e
.
orderMoneyTotalSum
&&
(
e
.
orderMoneyTotalSum
/
100
).
toFixed
(
2
)
})
//新增产值分布饼图数据处理
state
.
productionReportList
=
payload
.
reportData
.
merchantProductionValueReportList
;
state
.
productionReportList
=
payload
.
reportData
.
merchantProductionValueReportList
;
state
.
productionValueReportList
=
payload
.
reportData
.
productionValueReportList
?
payload
.
reportData
.
productionValueReportList
:
[];
state
.
productionValueReportList
=
payload
.
reportData
.
productionValueReportList
?
payload
.
reportData
.
productionValueReportList
:
[];
state
.
trendList
=
payload
.
reportData
.
trendList
?
payload
.
reportData
.
trendList
:
[]
//新增产值趋势图
state
.
trendList
=
payload
.
reportData
.
trendList
?
payload
.
reportData
.
trendList
:
[]
//新增产值趋势图
...
...
src/views/report/index.vue
View file @
6c7058c
<
template
>
<
template
>
<div
class=
"layout"
>
<div
class=
"layout-wrap"
>
<div
class=
"layout-wrap"
>
<div
class=
"content"
>
<div
class=
"content"
>
<time-search
ref=
"timeSearch"
></time-search>
<time-search
ref=
"timeSearch"
></time-search>
...
@@ -16,8 +15,6 @@
...
@@ -16,8 +15,6 @@
</
template
>
</
template
>
</div>
</div>
<div
class=
"head-bg"
></div>
<div
class=
"head-bg"
></div>
</div>
<div
class=
"bottom"
>
<div
class=
"bottom"
>
<tab
:list=
"['客户统计', '产值统计']"
@
change=
"change"
:index=
"tabIndex"
></tab>
<tab
:list=
"['客户统计', '产值统计']"
@
change=
"change"
:index=
"tabIndex"
></tab>
</div>
</div>
...
@@ -125,14 +122,14 @@ export default {
...
@@ -125,14 +122,14 @@ export default {
getData
()
{
getData
()
{
// this.userInfo.accountLevel = 1
// this.userInfo.accountLevel = 1
// this.SET_UESR_INFI({ accountLevel: 1 })
// this.SET_UESR_INFI({ accountLevel: 1 })
this
.
INIT_DATA
()
if
(
this
.
tabIndex
==
1
)
{
if
(
this
.
tabIndex
==
1
)
{
this
.
getReport
({
this
.
getReport
({
reportType
:
this
.
reportType
,
reportType
:
this
.
reportType
,
reportTimeStart
:
this
.
outputData
.
reportTimeStart
,
reportTimeStart
:
this
.
outputData
.
reportTimeStart
,
success
:
res
=>
{
success
:
res
=>
{
this
.
hideLoading
()
this
.
hideLoading
()
this
.
INIT_DATA
()
//
this.INIT_DATA()
this
.
$refs
.
ranking
.
initFastData
()
this
.
$refs
.
ranking
.
initFastData
()
}
}
})
})
...
@@ -143,7 +140,7 @@ export default {
...
@@ -143,7 +140,7 @@ export default {
reportType
:
this
.
reportType
,
reportType
:
this
.
reportType
,
success
:
res
=>
{
success
:
res
=>
{
this
.
hideLoading
()
this
.
hideLoading
()
this
.
INIT_DATA
()
//
this.INIT_DATA()
this
.
$refs
.
ranking
.
initFastData
()
this
.
$refs
.
ranking
.
initFastData
()
}
}
})
})
...
@@ -154,7 +151,6 @@ export default {
...
@@ -154,7 +151,6 @@ export default {
reportType
:
this
.
reportType
,
reportType
:
this
.
reportType
,
success
:
res
=>
{
success
:
res
=>
{
this
.
hideLoading
()
this
.
hideLoading
()
this
.
INIT_DATA
()
this
.
$refs
.
ranking
.
initFastData
()
this
.
$refs
.
ranking
.
initFastData
()
}
}
})
})
...
@@ -164,27 +160,25 @@ export default {
...
@@ -164,27 +160,25 @@ export default {
}
}
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
.layout
{
.layout
-wrap
{
color
:
#333333
;
color
:
#333333
;
font-size
:
14px
;
font-size
:
14px
;
height
:
100%
;
height
:
100%
;
overflow
:
hidden
;
.layout-wrap
{
padding
:
0
15px
;
padding
:
0
15px
;
box-sizing
:
border-box
;
box-sizing
:
border-box
;
position
:
relative
;
position
:
relative
;
height
:
100%
;
height
:
100%
;
box-sizing
:
border-box
;
box-sizing
:
border-box
;
overflow
:
scroll
;
overflow
:
scroll
;
.content{
.content
{
position
:
absolute
;
position
:
absolute
;
top
:
0
;
top
:
0
;
left
:
15px
;
left
:
15px
;
right
:
15px
;
right
:
15px
;
z-index
:
999
;
z-index
:
999
;
}
}
}
.bottom
{
}
.bottom
{
position
:
fixed
;
position
:
fixed
;
bottom
:
0
;
bottom
:
0
;
left
:
0
;
left
:
0
;
...
@@ -192,7 +186,6 @@ export default {
...
@@ -192,7 +186,6 @@ export default {
z-index
:
999
;
z-index
:
999
;
width
:
100%
;
width
:
100%
;
right
:
0
;
right
:
0
;
}
}
}
</
style
>
</
style
>
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