taskDetail.vue
8.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
<!-- -->
<template>
<div class="container-detail">
<div class="ai-main-header">
<div class="ai-main-title">
离店客户加企微
</div>
<div class="ai-main-desc">系统将通过AI机器人,使用门店的福利官企微号自动添加客户,并自动发放客户福利权益。</div>
</div>
<div class="outbound-info">
<div class="outbound-info-title flex">
离店客户加好友概览
</div>
<div class="outbound-info-wrap">
<div class="general">
<div class="general-item" v-for="(item, index) in statisticsList" :key="index">
<div class="general-item-icon">
<img :src="item.logo" />
</div>
<div>
<div class="general-item-title">{{ item.describe }}</div>
<div class="general-item-num">
{{ item.value(detailData) }}
<span class="font-14;color3;m-l-4">人</span>
</div>
</div>
</div>
</div>
<div class="chart" id="lineRef"></div>
<GLCombiForm :rowNumber="1" class="searchForm" ref="detailsSearch" :formObj="searchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<GLTable ref="detailsTable" :searchForm="searchForm" :pageConf="pageConf" :tableParams="tableParams" :getListApi="getListApi">
<template slot="phoneStatus" slot-scope="scope">
<div :class="['task_icon', `task_icon${scope.scope.phoneStatus}`]">{{ taskStatus(scope.scope.phoneStatus) }}</div>
</template>
</GLTable>
</div>
</div>
</div>
</template>
<script>
const TASK_STATUS = [
{
label: '该用户不存在',
value: 1
},
{
label: '待发送好友申请',
value: 2
},
{
label: '已发送申请',
value: 3
},
{
label: '申请通过',
value: 4
}
]
import * as echarts from 'echarts'
export default {
data() {
return {
id: this.$route.query.id ? this.$route.query.id : '',
getListApi: this.$apis.aiCard.phoneStatusPage,
detailData: {},
myChart: null,
searchForm: {
phone: '',
status: '',
id: this.$route.query.id ? this.$route.query.id : ''
},
outboundParams: [
{
label: '任务名称',
prop: 'taskName',
span: 12
},
{
label: '选择话术机器人:',
prop: 'robotName',
span: 12
},
{
label: '外呼主叫号码:',
prop: 'callerNums',
span: 12
},
{
label: '外呼时间:',
addHtml: 'dialTime',
span: 12
},
{
label: '重播设置:',
addHtml: 'retryTimes',
span: 12
},
{
label: '号码过滤:',
prop: 'numTypeFilterList',
span: 12
}
],
searchFormData: [
{
label: '手机号',
name: 'phone',
type: 'input'
}
],
statisticsList: [
{
logo: require('../../assets/img/ai/customer.png'),
describe: '客户总数',
value: obj => {
return obj.phoneCount ? obj.phoneCount : 0
}
},
{
logo: require('../../assets/img/ai/apply.png'),
describe: '通过申请',
value: obj => {
return obj.passNums ? obj.passNums : 0
}
},
{
logo: require('../../assets/img/ai/user.png'),
describe: '不存在的手机号用户',
value: obj => {
return obj.noneUserNums ? obj.noneUserNums : 0
}
}
],
// 表格参数
tableParams: {
listName: 'data',
tableColumns: [
{
label: '手机号',
prop: 'phone'
},
{
label: '状态',
prop: 'phoneStatus',
addHtml: 'phoneStatus'
}
]
},
pageConf: {
pageSize: 'pageSize',
pageNum: 'pageNum',
totalCount: 'count'
}
}
},
mounted() {
this.taskbaseDetails()
let chartDom = document.getElementById('lineRef')
this.myChart = echarts.init(chartDom)
window.addEventListener('resize', () => {
this.myChart.resize()
})
},
methods: {
taskStatus(status) {
const val = TASK_STATUS.find(item => item.value == status)
return val ? val.label : '--'
},
taskbaseDetails() {
let params = {
id: this.id
}
this.$apis.aiCard.taskDetail(params).then(res => {
if (res) {
this.detailData = res
this.initCanvas(this.detailData.phoneStatusDailyCharts)
}
})
},
handleSearch() {
this.$refs.detailsTable.refreshTable()
},
handleReset() {
this.searchForm = {
phone: '',
status: '',
id: this.$route.query.id ? this.$route.query.id : ''
}
this.handleSearch()
},
initCanvas(lineValue) {
const x_data = lineValue && lineValue.length ? lineValue.map(item => item.dailyDate) : []
const y_data = lineValue && lineValue.length ? lineValue.map(item => item.passedCounts) : []
console.log(x_data, y_data)
this.option = {
tooltip: {
show: true,
axisPointer: {
// type: 'cross'
}
},
grid: {
right: '90x',
left: '90px'
},
minInterval: 1,
xAxis: {
type: 'category',
data: x_data
},
yAxis: {
type: 'value'
},
series: [
{
// symbol: 'none',
data: y_data,
type: 'line',
smooth: true,
areaStyle: {
color: 'rgba(88,80,255, 0.15)'
}
}
]
}
this.myChart.clear()
this.myChart.setOption(this.option)
},
btnClick() {}
}
}
</script>
<style scoped lang="scss">
.task_icon {
position: relative;
&::after {
content: '';
position: absolute;
top: 4px;
left: -10px;
width: 6px;
height: 6px;
border-radius: 4px;
}
&.task_icon1 {
&::after {
background: #999999;
}
}
&.task_icon2 {
&::after {
background: #fdb757;
}
}
&.task_icon3 {
&::after {
background: #5850ff;
}
}
&.task_icon4 {
&::after {
background: #2cca74;
}
}
}
.container-detail {
padding: 20px 0;
overflow-y: scroll;
height: 100%;
.ai-main-header {
background: #fff;
padding: 16px 20px;
margin-bottom: 16px;
.ai-main-title {
font-size: 20px;
color: #333333;
font-weight: 600;
}
.ai-main-desc {
margin-top: 10px;
font-size: 14px;
font-weight: 400;
color: #666666;
line-height: 22px;
}
}
.outbound-info {
width: 100%;
height: auto;
background: #ffffff;
box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
margin-bottom: 10px;
&-title {
line-height: 28px;
font-size: 16px;
font-weight: 600;
color: #333333;
padding: 15px 0 15px 20px;
border-bottom: 1px solid #e5e5e5;
}
.glsx-rows-wrap {
padding: 32px 76px;
}
&-wrap {
padding: 20px 16px;
box-sizing: border-box;
background: #ffffff;
.general {
display: flex;
align-items: center;
margin: 0 40px 20px 40px;
.general-item {
width: 274px;
height: 100px;
background: #f9fafc;
border-radius: 4px;
padding: 20px 16px;
display: flex;
box-sizing: border-box;
margin-right: 16px;
&-icon {
width: 48px;
height: 48px;
margin-right: 16px;
img {
width: 100%;
}
}
&-title {
font-size: 14px;
color: #333333;
line-height: 20px;
margin-bottom: 10px;
}
&-num {
font-size: 26px;
font-weight: bold;
color: #333;
line-height: 31px;
}
}
}
.chart {
height: 320px;
}
}
}
.m-b-7 {
margin-bottom: 70px;
}
.footer-btn {
position: fixed;
bottom: 0;
width: 100%;
text-align: center;
background-color: #fff;
}
}
</style>