Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
江名洋
/
linkwe-scrm
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 dc35c1fb
authored
Feb 16, 2022
by
姜鹏凯
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
场景统计
1 parent
fe524ca1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
247 additions
and
71 deletions
linkwe-ui/src/api/drainageCode/customerService.js
linkwe-ui/src/views/customerService/components/SearchTitle.vue
linkwe-ui/src/views/customerService/searchRecord/index.vue
linkwe-ui/src/views/customerService/statistics/scene.vue
linkwe-ui/src/api/drainageCode/customerService.js
View file @
dc35c1f
...
...
@@ -109,4 +109,43 @@ export function getResultDetail (params) {
url
:
service
+
'/wecom/kf/record/detail'
,
params
:
params
})
}
// 场景分析 抬头数据
export
function
getSceneTotal
()
{
return
request
({
url
:
service
+
'/wecom/kf/statistic/scene/getAnalysis'
})
}
// 场景分析 数据趋势 客户总数/实时数据
export
function
getLineChartTotal
(
params
)
{
return
request
({
url
:
service
+
'/wecom/kf/statistic/scene/getRealCnt'
,
params
})
}
// 场景分析 访问场景 top5
export
function
getBarTop5Total
(
params
)
{
return
request
({
url
:
service
+
'/wecom/kf/statistic/scene/getRankCnt'
,
params
})
}
// 场景分析 数据报表
export
function
getTableTotal
(
params
)
{
return
request
({
url
:
service
+
'/wecom/kf/statistic/scene/getRealPageCnt'
,
params
})
}
// 场景分析 数据报表 导出
export
function
getTableExport
(
params
)
{
return
request
({
url
:
service
+
'/wecom/kf/statistic/scene/real/export'
,
params
})
}
\ No newline at end of file
linkwe-ui/src/views/customerService/components/SearchTitle.vue
View file @
dc35c1f
...
...
@@ -8,19 +8,21 @@
</el-button-group>
</div>
<div
class=
"item"
v-if=
"active === 3"
>
<el-date-picker
style=
"width: 250px;"
size=
"mini"
v-model=
"value"
type=
"daterange"
range-separator=
"至"
start-placeholder=
"开始日期"
end-placeholder=
"结束日期"
>
<el-date-picker
style=
"width: 250px;"
@
change=
"setTime"
size=
"mini"
clearable
v-model=
"value"
type=
"daterange"
range-separator=
"至"
start-placeholder=
"开始日期"
end-placeholder=
"结束日期"
>
</el-date-picker>
</div>
<div
class=
"item"
v-if=
"showScene"
>
<el-select
size=
"mini"
v-model=
"value2"
placeholder=
"请选择场景"
>
<el-option
v-for=
"item in options"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
>
</el-option>
<!--
<el-select
size=
"mini"
v-model=
"data."
placeholder=
"请选择场景"
clearable
>
<el-option
v-for=
"item in options"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
></el-option>
</el-select>
-->
<el-select
size=
"mini"
@
change=
"submit()"
v-model=
"data.scenes"
clearable
placeholder=
"请选择场景"
>
<el-option
value=
""
label=
"全部场景"
></el-option>
<el-option
v-for=
"(data, index) in sceneList"
:key=
"index"
:value=
"data.id"
:label=
"data.name"
></el-option>
</el-select>
</div>
<div
class=
"item"
v-if=
"showMember"
>
<el-select
size=
"mini"
v-model=
"value2"
placeholder=
"请选择客服"
>
<el-option
v-for=
"item in options"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
>
</el-option>
<el-option
v-for=
"item in options"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
></el-option>
</el-select>
</div>
<div
class=
"item"
v-if=
"showMember"
>
...
...
@@ -32,16 +34,18 @@
</div>
</
template
>
<
script
>
import
moment
from
'moment'
import
{
getSceneList
}
from
'@/api/drainageCode/customerService.js'
export
default
{
name
:
'search-title'
,
props
:
{
showScene
:{
showScene
:
{
type
:
Boolean
,
default
:
false
},
showMember
:
{
type
:
Boolean
,
default
:
false
default
:
false
}
},
data
()
{
...
...
@@ -49,13 +53,51 @@
active
:
1
,
value
:
[],
options
:
[{
value
:
10
,
label
:
'1123'
}],
value2
:
''
value2
:
''
,
data
:
{
scenes
:
''
,
userIds
:
''
,
beginTime
:
''
,
endTime
:
''
},
sceneList
:
[]
}
},
methods
:
{
submit
()
{
console
.
log
(
this
.
data
)
this
.
$emit
(
'search'
,
this
.
data
)
},
setTime
(
e
)
{
if
(
e
)
{
this
.
data
.
beginTime
=
moment
(
e
[
0
]).
format
(
'YYYY-MM-DD'
)
this
.
data
.
endTime
=
moment
(
e
[
1
]).
format
(
'YYYY-MM-DD'
)
}
else
{
this
.
data
.
beginTime
=
''
this
.
data
.
endTime
=
''
}
this
.
submit
()
},
setType
(
type
)
{
this
.
active
=
type
}
if
(
type
===
1
)
{
const
weekStart
=
moment
().
subtract
(
6
,
'days'
).
format
(
'YYYY-MM-DD'
)
const
weekEnd
=
moment
().
format
(
'YYYY-MM-DD'
)
this
.
data
.
beginTime
=
weekStart
this
.
data
.
endTime
=
weekEnd
this
.
submit
()
}
else
if
(
type
===
2
)
{
this
.
data
.
endTime
=
moment
().
format
(
"YYYY-MM-DD"
)
this
.
data
.
beginTime
=
moment
().
subtract
(
29
,
'days'
).
format
(
"YYYY-MM-DD"
)
this
.
submit
()
}
},
},
created
()
{
getSceneList
({
pageSize
:
1000
}).
then
(
dd
=>
{
this
.
sceneList
=
dd
.
rows
})
this
.
setType
(
1
)
}
}
</
script
>
...
...
linkwe-ui/src/views/customerService/searchRecord/index.vue
View file @
dc35c1f
...
...
@@ -60,7 +60,7 @@
</el-table-column>
<el-table-column
label=
"接待员工"
align=
"center"
min-width=
"100"
prop=
"userName"
>
<
template
slot-scope=
"{ row }"
>
{{
row
.
receptionType
===
1
?
userName
:
'-'
}}
{{
row
.
receptionType
===
1
?
row
.
userName
:
'-'
}}
</
template
>
</el-table-column>
<el-table-column
label=
"咨询开始时间"
align=
"center"
prop=
"sessionStartTime"
width=
"180"
></el-table-column>
...
...
@@ -124,33 +124,13 @@
},
methods
:
{
showResultList
(
data
)
{
//
getResultDetail({ openKfId: data.openKfId, externalUserId: data.externalUserId }).then(res => {
getResultDetail
({
openKfId
:
data
.
openKfId
,
externalUserId
:
data
.
externalUserId
}).
then
(
res
=>
{
this
.
showPreviewDialog
=
true
this
.
detail
=
[{
"content"
:
"string"
,
"customerAvatar"
:
"string"
,
"customerName"
:
"string"
,
"externalUserId"
:
"string"
,
"kfAvatar"
:
"string"
,
"kfName"
:
"string"
,
"msgId"
:
"string"
,
"msgType"
:
"string"
,
"openKfId"
:
"string"
,
"origin"
:
3
,
"sendTime"
:
"2022-02-14T15:40:11.085Z"
},
{
"content"
:
"string"
,
"customerAvatar"
:
"string"
,
"customerName"
:
"string"
,
"externalUserId"
:
"string"
,
"kfAvatar"
:
"string"
,
"kfName"
:
"string"
,
"msgId"
:
"string"
,
"msgType"
:
"string"
,
"openKfId"
:
"string"
,
"origin"
:
5
,
"sendTime"
:
"2022-02-14T15:40:11.085Z"
},]
// })
this
.
detail
=
res
.
rows
this
.
detail
.
forEach
(
dd
=>
{
dd
.
content
=
JSON
.
parse
(
dd
.
content
).
content
})
})
},
exportFn
()
{
this
.
$confirm
(
'确认导出吗?'
,
'提示'
,
{
...
...
linkwe-ui/src/views/customerService/statistics/scene.vue
View file @
dc35c1f
...
...
@@ -8,14 +8,14 @@
数据概览
</div>
<div
class=
"data-content"
>
<el-tabs
v-model=
"activeName"
>
<el-tabs
v-model=
"activeName"
@
tab-click=
"setTabs"
>
<el-tab-pane
label=
"客户总数"
name=
"first"
>
</el-tab-pane>
<el-tab-pane
label=
"实时数据"
name=
"second"
>
</el-tab-pane>
</el-tabs>
<div
class=
"chart-content"
>
<search-title
:showScene=
'true'
></search-title>
<search-title
:showScene=
'true'
@
search=
"getLineData"
></search-title>
<chart-line
style=
"height: 300px;"
:legend=
"legend"
:xData=
"xdata"
:series=
"series"
></chart-line>
</div>
</div>
...
...
@@ -26,13 +26,13 @@
</div>
<div
class=
"data-content"
style=
"margin-top: 20px;"
>
<div
class=
"chart-content"
>
<search-title></search-title>
<search-title
@
search=
"getTop5Fn"
></search-title>
<div
class=
"column"
>
<div
class=
"column-item"
>
<chart-bar
style=
"height: 300px;"
:legend=
"barLegend1"
></chart-bar>
<chart-bar
style=
"height: 300px;"
:
xData=
"bar1"
:series=
"value1"
:
legend=
"barLegend1"
></chart-bar>
</div>
<div
class=
"column-item"
>
<chart-bar
style=
"height: 300px;"
:legend=
"barLegend2"
></chart-bar>
<chart-bar
style=
"height: 300px;"
:
xData=
"bar2"
:series=
"value2"
:
legend=
"barLegend2"
></chart-bar>
</div>
</div>
</div>
...
...
@@ -44,21 +44,21 @@
</div>
<div
class=
"data-content"
style=
"margin-top: 20px;"
>
<div
class=
"search-content"
>
<search-title
:showScene=
'true'
></search-title>
<el-button
type=
"primary"
size=
"mini"
>
导出Excel
</el-button>
<search-title
:showScene=
'true'
@
search=
"getTableFn"
></search-title>
<el-button
type=
"primary"
size=
"mini"
@
click=
"exportFn"
v-loading=
"exportLoading"
>
导出Excel
</el-button>
</div>
<div
class=
"table-content"
>
<el-table
v-loading=
"loading"
:data=
"tableList"
@
selection-change=
"handleSelectionChange"
style=
"width: 100%"
>
<el-table-column
label=
"日期"
align=
"center"
min-width=
"100"
prop=
""
show-overflow-tooltip
/>
<el-table-column
label=
"访问客户总数"
align=
"center"
min-width=
"100"
prop=
""
show-overflow-tooltip
/>
<el-table-column
label=
"咨询客户总数"
align=
"center"
prop=
""
min-width=
"100"
show-overflow-tooltip
></el-table-column>
<el-table-column
label=
"接待客户总数"
align=
"center"
prop=
""
min-width=
"100"
show-overflow-tooltip
></el-table-column>
<el-table-column
label=
"今日新增访问客户"
align=
"center"
prop=
""
min-width=
"100"
show-overflow-tooltip
></el-table-column>
<el-table-column
label=
"今日新增咨询客户"
align=
"center"
prop=
""
min-width=
"100"
show-overflow-tooltip
></el-table-column>
<el-table-column
label=
"今日新增接待客户"
align=
"center"
prop=
""
min-width=
"100"
show-overflow-tooltip
></el-table-column>
<el-table
v-loading=
"loading"
:data=
"tableList"
style=
"width: 100%"
>
<el-table-column
label=
"日期"
align=
"center"
min-width=
"100"
prop=
"
xtime
"
show-overflow-tooltip
/>
<el-table-column
label=
"访问客户总数"
align=
"center"
min-width=
"100"
prop=
"
visitTotalCnt
"
show-overflow-tooltip
/>
<el-table-column
label=
"咨询客户总数"
align=
"center"
prop=
"
consultTotalCnt
"
min-width=
"100"
show-overflow-tooltip
></el-table-column>
<el-table-column
label=
"接待客户总数"
align=
"center"
prop=
"
receptionTotalCnt
"
min-width=
"100"
show-overflow-tooltip
></el-table-column>
<el-table-column
label=
"今日新增访问客户"
align=
"center"
prop=
tdVisitCnt
""
min-width=
"100"
show-overflow-tooltip
></el-table-column>
<el-table-column
label=
"今日新增咨询客户"
align=
"center"
prop=
"
tdConsultCnt
"
min-width=
"100"
show-overflow-tooltip
></el-table-column>
<el-table-column
label=
"今日新增接待客户"
align=
"center"
prop=
"
tdReceptionCnt
"
min-width=
"100"
show-overflow-tooltip
></el-table-column>
</el-table>
<!--
<div
class=
"bottom"
>
-->
<pagination
:total=
"total"
:page
.
sync=
"query.pageNum"
:limit
.
sync=
"query.pageSize"
@
pagination=
"get
List
()"
/>
<pagination
:total=
"total"
:page
.
sync=
"query.pageNum"
:limit
.
sync=
"query.pageSize"
@
pagination=
"get
TableChangeSize
()"
/>
<!--
</div>
-->
</div>
</div>
...
...
@@ -70,6 +70,8 @@
import
ChartLine
from
'@/components/ChartLine.vue'
import
SearchTitle
from
'../components/SearchTitle.vue'
import
CardGroupIndex
from
'@/components/CardGroupIndex.vue'
import
{
getTableExport
,
getTableTotal
,
getBarTop5Total
,
getLineChartTotal
,
getSceneTotal
}
from
'@/api/drainageCode/customerService.js'
import
{
download
}
from
'@/utils/common'
export
default
{
name
:
'scene-statistics-scene'
,
components
:
{
...
...
@@ -80,49 +82,50 @@
},
data
()
{
return
{
exportLoading
:
false
,
barLegend1
:
[
'访问客户总数'
],
barLegend2
:
[
'咨询客户总数'
],
legend
:
[
'访问客户总数'
,
'咨询客户总数'
,
'接待客户总数'
],
xdata
:
[
12
,
13
,
14
],
series
:
[
[
34
,
35
,
26
],
[
22
,
23
,
33
],
[
77
,
57
,
55
]
],
xdata
:
[],
series
:
[],
activeName
:
'first'
,
cardData
:
[
{
title
:
'访问客户总数'
,
tips
:
'进入咨询页面的客户总数(包含重复)'
,
value
:
1234
,
value
:
0
,
noArrow
:
true
},
{
title
:
'咨询客户总数'
,
tips
:
'发送咨询消息的客户总数(包含重复)'
,
value
:
12345
,
value
:
0
,
},
{
title
:
'接待客户总数'
,
tips
:
'人工客服接待的客户总数(包含重复)'
,
value
:
1222453
,
value
:
0
,
},
{
title
:
'今日新增访问客户'
,
tips
:
'今日进入咨询页面的客户数(包含重复)'
,
value
:
1222453
,
value
:
0
,
title1
:
'较前日'
,
value1
:
344
value1
:
0
},
{
title
:
'今日新增咨询客户'
,
tips
:
'今日发送咨询消息的客户数(包含重复)'
,
value
:
1222453
,
value
:
0
,
title1
:
'较前日'
,
value1
:
344
value1
:
0
},
{
title
:
'今日新增接待客户'
,
tips
:
'今日人工客服接待的客户数(包含重复)'
,
value
:
1222453
,
value
:
0
,
title1
:
'较前日'
,
value1
:
344
value1
:
0
}
],
total
:
0
,
...
...
@@ -131,19 +134,131 @@
pageNum
:
1
},
tableList
:
[],
loading
:
false
loading
:
false
,
searchData
:
{},
bar1
:
[],
bar2
:
[],
value1
:
[],
value2
:
[],
tableSearch
:
{}
}
},
methods
:
{
handleSelectionChange
()
{
exportFn
()
{
this
.
$confirm
(
'确认导出吗?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
})
.
then
(()
=>
{
this
.
exportLoading
=
true
return
getTableExport
(
Object
.
assign
({},
this
.
query
,
this
.
tableSearch
))
})
.
then
((
res
)
=>
{
console
.
log
(
res
)
download
(
res
.
msg
)
})
.
catch
((
error
)
=>
{
console
.
error
(
error
)
})
.
finally
(()
=>
{
this
.
exportLoading
=
false
})
},
getList
()
{
setTabs
(
e
)
{
this
.
getLineData
(
this
.
searchData
)
},
getSceneTotalFn
()
{
getSceneTotal
().
then
(
res
=>
{
this
.
cardData
[
0
].
value
=
res
.
data
.
visitCnt
this
.
cardData
[
1
].
value
=
res
.
data
.
consultCnt
this
.
cardData
[
2
].
value
=
res
.
data
.
receptionCnt
this
.
cardData
[
3
].
value
=
res
.
data
.
tdVisitCnt
this
.
cardData
[
3
].
value1
=
res
.
data
.
ydVisitCnt
this
.
cardData
[
4
].
value
=
res
.
data
.
tdConsultCnt
this
.
cardData
[
4
].
value1
=
res
.
data
.
ydConsultCnt
this
.
cardData
[
5
].
value
=
res
.
data
.
tdReceptionCnt
this
.
cardData
[
5
].
value1
=
res
.
data
.
ydReceptionCnt
})
},
getLineData
(
data
)
{
this
.
searchData
=
data
if
(
this
.
activeName
===
'first'
)
{
this
.
legend
=
[
'访问客户总数'
,
'咨询客户总数'
,
'接待客户总数'
]
}
else
{
this
.
legend
=
[
'新增访问客户'
,
'新增咨询客户'
,
'新增接待客户'
]
}
this
.
$forceUpdate
()
getLineChartTotal
(
data
).
then
(
res
=>
{
this
.
xdata
=
[]
this
.
series
=
[]
let
arr1
=
[]
let
arr2
=
[]
let
arr3
=
[]
if
(
this
.
activeName
===
'first'
)
{
if
(
res
.
data
&&
res
.
data
.
length
)
{
res
.
data
.
forEach
(
dd
=>
{
this
.
xdata
.
push
(
dd
.
xtime
)
arr1
.
push
(
dd
.
visitTotalCnt
)
arr2
.
push
(
dd
.
consultTotalCnt
)
arr3
.
push
(
dd
.
receptionTotalCnt
)
})
this
.
series
=
[
arr1
,
arr2
,
arr3
]
}
}
else
{
if
(
res
.
data
&&
res
.
data
.
length
)
{
res
.
data
.
forEach
(
dd
=>
{
this
.
xdata
.
push
(
dd
.
xtime
)
arr1
.
push
(
dd
.
tdVisitCnt
)
arr2
.
push
(
dd
.
tdConsultCnt
)
arr3
.
push
(
dd
.
tdReceptionCnt
)
})
this
.
series
=
[
arr1
,
arr2
,
arr3
]
}
}
})
},
getTop5Fn
(
data
)
{
getBarTop5Total
(
data
).
then
(
res
=>
{
if
(
res
.
data
.
consult
&&
res
.
data
.
consult
.
length
)
{
this
.
bar1
=
[]
this
.
value1
=
[]
res
.
data
.
consult
.
forEach
(
dd
=>
{
this
.
bar1
.
push
(
dd
.
sceneName
)
this
.
value1
.
push
(
dd
.
total
)
})
}
if
(
res
.
data
.
visit
&&
res
.
data
.
visit
.
length
)
{
this
.
bar2
=
[]
this
.
value2
=
[]
res
.
data
.
consult
.
forEach
(
dd
=>
{
this
.
bar2
.
push
(
dd
.
sceneName
)
this
.
value2
.
push
(
dd
.
total
)
})
}
})
},
getTableChangeSize
()
{
this
.
loading
=
true
getTableTotal
(
Object
.
assign
({},
this
.
query
,
this
.
tableSearch
)).
then
(
res
=>
{
this
.
tableList
=
res
.
rows
this
.
total
=
Number
(
res
.
total
)
this
.
loading
=
false
})
},
getTableFn
(
data
)
{
this
.
loading
=
true
this
.
tableSearch
=
data
getTableTotal
(
Object
.
assign
({},
this
.
query
,
data
)).
then
(
res
=>
{
this
.
tableList
=
res
.
rows
this
.
total
=
Number
(
res
.
total
)
this
.
loading
=
false
})
}
},
created
()
{
this
.
getSceneTotalFn
()
// this.getTop5Fn()
}
}
</
script
>
...
...
@@ -157,7 +272,7 @@
.title
{
font-size
:
16px
;
color
:
#333
;
font-weight
:
5
00
;
font-weight
:
6
00
;
}
.data-content
{
margin-top
:
10px
;
...
...
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