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 20ccfb75
authored
Feb 08, 2022
by
王志慧
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
commit
1 parent
793c0912
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
68 additions
and
130 deletions
src/components/CanvasTab.vue
src/components/Chart.vue
src/components/CustomerRanking.vue
src/components/Ranking.vue
src/components/Statistics.vue
src/components/StoresRanking.vue
src/store/modules/report.js
src/views/report/index.vue
src/components/CanvasTab.vue
View file @
20ccfb7
...
...
@@ -16,7 +16,7 @@
</template>
<
script
type=
'text/ecmascript-6'
>
import
{
mapState
,
map
Getters
,
mapActions
,
map
Mutations
}
from
'vuex'
import
{
mapState
,
mapMutations
}
from
'vuex'
export
default
{
name
:
'CanvasTab'
,
watch
:
{
...
...
@@ -56,7 +56,6 @@ export default {
SET_TABTYPE_INDEX
:
'report/SET_TABTYPE_INDEX'
}),
initTextData
()
{
console
.
log
(
this
.
reportType
)
let
{
reportType
,
outputData
}
=
this
if
(
reportType
==
0
)
{
this
.
text
=
'本周'
...
...
@@ -73,9 +72,10 @@ export default {
let
{
userInfo
:
{
accountLevel
},
reportType
,
text
text
,
tabIndex
}
=
this
if
(
accountLevel
!==
4
&&
t
his
.
t
abIndex
==
0
)
{
if
(
accountLevel
!==
4
&&
tabIndex
==
0
)
{
//集团客户周月报
if
(
reportType
==
0
)
{
this
.
data
=
[
...
...
@@ -89,7 +89,7 @@ export default {
{
title
:
'新增客户趋势'
,
location
:
'right'
}
]
}
}
else
if
(
accountLevel
==
4
&&
t
his
.
t
abIndex
==
0
)
{
}
else
if
(
accountLevel
==
4
&&
tabIndex
==
0
)
{
//门店客户周月报
if
(
reportType
==
1
)
{
this
.
data
=
[
...
...
@@ -99,7 +99,7 @@ export default {
}
else
{
this
.
data
=
[]
}
}
else
if
(
accountLevel
!==
4
&&
t
his
.
t
abIndex
==
1
)
{
}
else
if
(
accountLevel
!==
4
&&
tabIndex
==
1
)
{
//集团产值周月报
if
(
reportType
==
0
)
{
this
.
data
=
[
...
...
src/components/Chart.vue
View file @
20ccfb7
...
...
@@ -329,7 +329,7 @@ export default {
value
:
{
type
:
'linear'
,
nice
:
true
,
t
ickInterval
:
2
minT
ickInterval
:
2
}
})
this
.
lineChartCustomer
.
axis
(
'dayTime'
,
{
...
...
@@ -409,7 +409,7 @@ export default {
...
textObj
,
content
:
'数量'
,
offsetX
:
-
10
,
offsetY
:
-
1
7
5
offsetY
:
-
1
6
5
})
this
.
lineChartCustomer
.
render
()
}
...
...
src/components/CustomerRanking.vue
View file @
20ccfb7
...
...
@@ -4,7 +4,7 @@
<template
v-if=
"staffDistributionVOList.length > 0"
>
<div
class=
"store-rank-inline flex"
v-for=
"i in staffDistributionVOList"
:key=
"i.id"
>
<div
class=
"customers-portrait"
>
<template
v-if=
"i.staffId != -1"
>
<template
v-if=
"i.staffId != -1
&&i.thumbAvatar
"
>
<img
:src=
"i.thumbAvatar"
alt=
""
/>
</
template
>
<
template
v-else
>
...
...
@@ -22,7 +22,6 @@
</div>
</div>
</template>
<
template
v-else
>
<Empty></Empty>
</
template
>
...
...
src/components/Ranking.vue
View file @
20ccfb7
...
...
@@ -10,7 +10,6 @@
</
template
>
<
template
v-else
>
<span>
{{
item
.
value
(
reportData
)
}}
</span>
<!--
<span>
{{
item
.
value
(
reportData
)
*
100
}}
%
</span>
-->
</
template
>
</div>
</div>
...
...
@@ -19,15 +18,9 @@
</template>
<
script
type=
'text/ecmascript-6'
>
import
{
mapState
,
mapGetters
,
mapActions
,
mapMutations
}
from
'vuex'
import
{
mapState
}
from
'vuex'
export
default
{
name
:
'Ranking'
,
props
:
{
fastOrderSource
:
{
type
:
Number
,
default
:
0
}
},
data
()
{
return
{
fastData
:
[]
...
...
@@ -48,7 +41,7 @@ export default {
userInfo
:
{
accountLevel
}
}
=
this
this
.
fastData
=
[]
let
text
=
'-'
let
text
=
'-'
if
(
this
.
tabIndex
==
1
)
{
//增长速度最快业务1商城订单2直播订单3活动订单4会员套餐5精品升级6权益提单
let
{
fastOrderSource
}
=
this
.
reportData
...
...
@@ -66,41 +59,41 @@ export default {
?
'精品升级'
:
'权益提单'
}
this
.
fastData
.
push
(
{
text
:
'增长速度最快业务:'
,
info
:
text
,
icon
:
'rank'
this
.
fastData
.
push
({
text
:
'增长速度最快业务:'
,
info
:
text
,
icon
:
'rank'
})
if
(
accountLevel
!==
4
)
{
this
.
fastData
.
push
({
text
:
'产值排行榜冠军店:'
,
value
:
obj
=>
{
return
obj
.
mostProductionValueMerchantName
?
obj
.
mostProductionValueMerchantName
:
'-'
},
{
text
:
'产值排行榜冠军店:'
,
value
:
obj
=>
{
return
obj
.
mostProductionValueMerchantName
?
obj
.
mostProductionValueMerchantName
:
'-'
},
icon
:
'helmet'
}
)
icon
:
'helmet'
})
}
}
else
{
if
(
accountLevel
!==
4
)
{
this
.
fastData
.
push
(
{
text
:
'企微客户占比最高的门店:'
,
value
:
obj
=>
{
return
obj
.
newlyQyFastestGrowthMerchant
?
obj
.
newlyQyFastestGrowthMerchant
:
'-'
return
obj
.
newlyQyFastestGrowthMerchant
?
obj
.
newlyQyFastestGrowthMerchant
:
'-'
},
icon
:
'proportion'
},
{
text
:
'企微增长速度最快的门店:'
,
value
:
obj
=>
{
return
obj
.
newlyQyFastestGrowthMerchant
?
obj
.
newlyQyFastestGrowthMerchant
:
'-'
return
obj
.
newlyQyFastestGrowthMerchant
?
obj
.
newlyQyFastestGrowthMerchant
:
'-'
},
icon
:
'speed'
},
{
text
:
'企微客户数最多的门店:'
,
value
:
obj
=>
{
return
obj
.
newlyQyMostMerchant
?
obj
.
newlyQyMostMerchant
:
'-'
return
obj
.
newlyQyMostMerchant
?
obj
.
newlyQyMostMerchant
:
'-'
},
icon
:
'client'
}
...
...
@@ -109,17 +102,12 @@ export default {
this
.
fastData
.
push
({
text
:
'企业微信客户占比:'
,
value
:
obj
=>
{
return
obj
.
qyCustomerRatio
?((
obj
.
qyCustomerRatio
)
*
100
).
toFixed
(
0
)
+
'%'
:
'-'
return
obj
.
qyCustomerRatio
?
(
obj
.
qyCustomerRatio
*
100
).
toFixed
(
0
)
+
'%'
:
'-'
},
icon
:
'qycustomer'
})
}
console
.
log
(
this
.
fastData
)
}
},
click
(
tabIndex
)
{
this
.
tabIndex
=
tabIndex
this
.
$emit
(
'change'
,
tabIndex
)
}
}
}
...
...
src/components/Statistics.vue
View file @
20ccfb7
...
...
@@ -68,7 +68,7 @@
</template>
<
script
type=
'text/ecmascript-6'
>
import
{
mapState
,
mapGetters
,
mapActions
,
mapMutations
}
from
'vuex'
import
{
mapState
}
from
'vuex'
export
default
{
name
:
'Statistics'
,
data
()
{
...
...
@@ -80,7 +80,7 @@ export default {
...
mapState
({
reportData
:
state
=>
state
.
report
.
reportData
,
statisticsObj
:
state
=>
state
.
report
.
statisticsObj
,
reportType
:
state
=>
state
.
report
.
reportType
//
reportType: state => state.report.reportType
})
},
mounted
()
{},
...
...
src/components/StoresRanking.vue
View file @
20ccfb7
...
...
@@ -2,39 +2,41 @@
<div
class=
"store-ranking-wrap"
>
<template
v-if=
"tabIndex == 0"
>
<div
class=
"weekTitle headline"
>
新增客户分布
</div>
<van-swipe
:loop=
"false"
:width=
"170"
:show-indicators=
"false"
>
<template
v-for=
"(i, index) in staffDistributionVOList"
>
<van-swipe-item
:key=
"i.id"
>
<template
v-if=
"index == 0"
>
<div
class=
"sprite-icon icon-crown"
></div>
</
template
>
<div
class=
"customers-portrait"
>
<
template
v-if=
"i.staffId != -1"
>
<img
:src=
"i.thumbAvatar"
alt=
""
/>
</
template
>
<
template
v-else
>
<img
src=
"@/assets/images/general.png"
alt=
""
/>
</
template
>
<template
v-if=
"staffDistributionVOList.length > 0"
>
<van-swipe
:loop=
"false"
:width=
"170"
:show-indicators=
"false"
>
<template
v-for=
"(i, index) in staffDistributionVOList"
>
<van-swipe-item
:key=
"i.id"
>
<template
v-if=
"index == 0"
>
<div
class=
"sprite-icon icon-
huanggua
n"
></div>
<div
class=
"sprite-icon icon-
crow
n"
></div>
</
template
>
</div>
<div
class=
"gray-text"
>
{{ i.staffName }}
</div>
<div
class=
"gray-text location"
>
新增
<span>
{{ i.newlyQyCount }}
</span>
位客户
</div>
<div
class=
"rate"
>
占{{ (i.newlyQyRatio * 100).toFixed(0) }}%
</div>
</van-swipe-item>
</template>
</van-swipe>
<div
class=
"customers-portrait"
>
<
template
v-if=
"i.staffId != -1"
>
<img
:src=
"i.thumbAvatar"
alt=
""
/>
</
template
>
<
template
v-else
>
<img
src=
"@/assets/images/general.png"
alt=
""
/>
</
template
>
<
template
v-if=
"index == 0"
>
<div
class=
"sprite-icon icon-huangguan"
></div>
</
template
>
</div>
<div
class=
"gray-text"
>
{{ i.staffName }}
</div>
<div
class=
"gray-text location"
>
新增
<span>
{{ i.newlyQyCount }}
</span>
位客户
</div>
<div
class=
"rate"
>
占{{ (i.newlyQyRatio * 100).toFixed(0) }}%
</div>
</van-swipe-item>
</template>
</van-swipe>
</template>
</template>
<
template
v-if=
"tabIndex == 1"
>
<div
class=
"weekTitle headline"
>
新增产值分布
</div>
<canvas
class=
"canvas"
id=
"pieChart"
v-
if
=
"productionValueReportList.length > 0"
></canvas>
<canvas
class=
"canvas"
id=
"pieChart"
v-
show
=
"productionValueReportList.length > 0"
></canvas>
</
template
>
<
template
v-if=
"(tabIndex == 0 && staffDistributionVOList.length == 0) || (tabIndex == 1 && productionValueReportList.length == 0)"
>
<Empty></Empty>
...
...
@@ -44,7 +46,7 @@
<
script
type=
'text/ecmascript-6'
>
import
F2
from
'@antv/f2/lib/index-all'
import
{
mapState
,
mapGetters
,
mapActions
,
mapMutations
}
from
'vuex'
import
{
mapState
}
from
'vuex'
export
default
{
name
:
'StoresRanking'
,
data
()
{
...
...
@@ -62,11 +64,8 @@ export default {
},
computed
:
{
...
mapState
({
reportData
:
state
=>
state
.
report
.
reportData
,
tabIndex
:
state
=>
state
.
report
.
tabIndex
,
reportType
:
state
=>
state
.
report
.
reportType
,
tabType
:
state
=>
state
.
report
.
tabType
,
userInfo
:
state
=>
state
.
report
.
userInfo
,
productionValueReportList
:
state
=>
state
.
report
.
productionValueReportList
,
staffDistributionVOList
:
state
=>
state
.
report
.
staffDistributionVOList
})
...
...
@@ -74,43 +73,35 @@ export default {
watch
:
{
tabIndex
:
{
handler
(
n
)
{
let
{
userInfo
}
=
this
this
.
$nextTick
(()
=>
{
this
.
initCanvas
(
userInfo
.
accountLevel
)
this
.
initCanvas
()
})
},
deep
:
true
},
productionValueReportList
:
{
handler
(
n
)
{
let
{
userInfo
}
=
this
this
.
$nextTick
(()
=>
{
this
.
initCanvas
(
userInfo
.
accountLevel
)
this
.
initCanvas
()
})
},
deep
:
true
}
},
mounted
()
{
console
.
log
(
this
.
staffDistributionVOList
)
let
{
userInfo
}
=
this
if
(
userInfo
)
{
this
.
$nextTick
(()
=>
{
this
.
initCanvas
(
userInfo
.
accountLevel
)
})
}
this
.
$nextTick
(()
=>
{
this
.
initCanvas
()
})
},
methods
:
{
initCanvas
(
type
)
{
initCanvas
()
{
//tabIndex 0 客户 1 产值
let
{
reportType
,
tabIndex
}
=
this
if
(
type
==
4
&&
tabIndex
==
1
&&
reportType
==
0
)
this
.
initPieChart
()
if
(
tabIndex
==
1
&&
reportType
==
0
)
this
.
initPieChart
()
},
initPieChart
(
id
=
'pieChart'
)
{
let
{
productionValueReportList
,
orderSource
}
=
this
productionValueReportList
.
map
(
e
=>
(
e
.
count
=
'count'
))
console
.
log
(
productionValueReportList
)
this
.
chart
&&
this
.
chart
.
clear
()
this
.
chart
=
null
this
.
chart
=
new
F2
.
Chart
({
...
...
@@ -152,7 +143,6 @@ export default {
onClick
(
ev
)
{
const
data
=
ev
.
data
if
(
data
)
{
console
.
log
(
data
)
}
}
})
...
...
src/store/modules/report.js
View file @
20ccfb7
import
Vue
from
'vue'
;
import
{
getReportData
,
getCumerchantReportData
,
getCugroupReportData
}
from
"../../api/reportApi"
;
export
default
{
namespaced
:
true
,
...
...
src/views/report/index.vue
View file @
20ccfb7
...
...
@@ -76,43 +76,6 @@ export default {
SET_UESR_INFI
:
'report/SET_UESR_INFI'
,
//切换集团门店
SET_REPORT_TYPE
:
'report/SET_REPORT_TYPE'
//获取周报月报
}),
// /**获取当前门店周报月报产值统计 */
// getReport(reportTimeStart = '') {
// let { userInfo, reportType } = this
// reportApi
// .getReport({
// reportType,
// reportTimeStart
// })
// .then(({ code, data, message }) => {
// this.hideLoading()
// if (code == 0) {
// if (data) {
// if (data.newProductionValueSequential) data.newProductionValueSequential = Number(data.newProductionValueSequential.replace('%', ''))
// if (data.newEquityBillLadingSequential) data.newEquityBillLadingSequential = Number(data.newEquityBillLadingSequential.replace('%', ''))
// if (data.merchantProductionValueReportList) {
// data.merchantProductionValueReportList.map(e => Number((e.newProductionValue = this.centsToyuan(e.newProductionValue))))
// }
// if (data.productionValueReportList) {
// data.productionValueReportList.map(e => Number((e.newProductionValue = this.centsToyuan(e.newProductionValue))))
// }
// if (data.trendList) {
// data.trendList.map(e => Number((e.orderMoneyTotalSum = this.centsToyuan(e.orderMoneyTotalSum))))
// }
// data.userInfo = userInfo
// this.reportData = data
// this.initData()
// this.$nextTick(() => {
// this.$refs.ranking.initFastData()
// })
// }
// } else {
// this.refreshPage(`产值统计:${message}`).then(() => {
// this.getOutputReport(reportTimeStart)
// })
// }
// })
// },
canvasChange
(
index
)
{
this
.
SET_TABTYPE_INDEX
({
index
:
index
})
},
...
...
@@ -127,8 +90,6 @@ export default {
this
.
getData
()
},
getData
()
{
// this.userInfo.accountLevel = 1
// this.SET_UESR_INFI({ accountLevel: 1 })
this
.
INIT_DATA
()
if
(
this
.
tabIndex
==
1
)
{
this
.
getReport
({
...
...
@@ -136,7 +97,6 @@ export default {
reportTimeStart
:
this
.
outputData
.
reportTimeStart
,
success
:
res
=>
{
this
.
hideLoading
()
// this.INIT_DATA()
this
.
$refs
.
ranking
.
initFastData
()
}
})
...
...
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