|
|
@@ -0,0 +1,400 @@
|
|
|
1
|
+<!DOCTYPE html>
|
|
|
2
|
+<html>
|
|
|
3
|
+
|
|
|
4
|
+ <head>
|
|
|
5
|
+ <meta charset="utf-8">
|
|
|
6
|
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
7
|
+ <script src="Script/Common/huayi.load.js"></script>
|
|
|
8
|
+ <script src="Script/Common/huayi.config.js"></script>
|
|
|
9
|
+ <title>通话时长</title>
|
|
|
10
|
+ <!--[if lt IE 9]>
|
|
|
11
|
+ <meta http-equiv="refresh" content="0;ie.html" />
|
|
|
12
|
+ <![endif]-->
|
|
|
13
|
+ <link rel="stylesheet" href="./css/init.css" />
|
|
|
14
|
+ <link rel="stylesheet" href="css/Table/table1.css" />
|
|
|
15
|
+ <style>
|
|
|
16
|
+ .clearfix:after {
|
|
|
17
|
+ content: "";
|
|
|
18
|
+ display: block;
|
|
|
19
|
+ clear: both;
|
|
|
20
|
+ }
|
|
|
21
|
+
|
|
|
22
|
+ .th-top {
|
|
|
23
|
+ background: #f3f3f4;
|
|
|
24
|
+ height: 60px;
|
|
|
25
|
+ padding: 10px 20px;
|
|
|
26
|
+ }
|
|
|
27
|
+
|
|
|
28
|
+ .topCon {
|
|
|
29
|
+ float: right;
|
|
|
30
|
+ margin-right: 45px;
|
|
|
31
|
+ }
|
|
|
32
|
+
|
|
|
33
|
+ .th-content h2 {
|
|
|
34
|
+ font-size: 22px;
|
|
|
35
|
+ /*margin-bottom: 20px;*/
|
|
|
36
|
+ }
|
|
|
37
|
+
|
|
|
38
|
+ .th-content {
|
|
|
39
|
+ width: 90%;
|
|
|
40
|
+ margin: 0 auto;
|
|
|
41
|
+ }
|
|
|
42
|
+
|
|
|
43
|
+ .th-table table thead tr td {
|
|
|
44
|
+ background: #1ab394;
|
|
|
45
|
+ color: #fff;
|
|
|
46
|
+ }
|
|
|
47
|
+
|
|
|
48
|
+ .th-table {
|
|
|
49
|
+ display: none;
|
|
|
50
|
+ }
|
|
|
51
|
+ </style>
|
|
|
52
|
+ </head>
|
|
|
53
|
+
|
|
|
54
|
+ <body class="gray-bg" style="background: #fefefe;">
|
|
|
55
|
+ <div class="thTime">
|
|
|
56
|
+ <div class="daoHang clearfix">
|
|
|
57
|
+ <div class="dhLeft">
|
|
|
58
|
+ <sapn><i class="syIcon"></i>位置:
|
|
|
59
|
+ <a id="ReIndex" href="javaScript:;">首页</a>>
|
|
|
60
|
+ <a href="javaScript:;">报表分析</a>>
|
|
|
61
|
+ <a href="javaScript:;">话务运营分析</a>>
|
|
|
62
|
+ <a href="" class="nowPosition">通话时长统计</a>
|
|
|
63
|
+ </sapn>
|
|
|
64
|
+ </div>
|
|
|
65
|
+ <div class="dhRight">
|
|
|
66
|
+ <a href="#" title="刷新"><i class="fa fa-refresh"></i></a>
|
|
|
67
|
+ </div>
|
|
|
68
|
+ </div>
|
|
|
69
|
+ <div class="th-top clearfix">
|
|
|
70
|
+ <div class="topCon">
|
|
|
71
|
+ <div class="form-inline th-bar clearfix">
|
|
|
72
|
+ <div class="time-box form-group">
|
|
|
73
|
+ <i class="tub fa fa-calendar"></i>
|
|
|
74
|
+ <input class="form-control" type="text" id="startTime" placeholder="起始时间" style=" width: 228px;">
|
|
|
75
|
+ </div>
|
|
|
76
|
+ <div class="form-group tool_bars pull-right">
|
|
|
77
|
+ <button class="btns sear">搜索</button>
|
|
|
78
|
+ <a class="btns export">导出</a>
|
|
|
79
|
+ </div>
|
|
|
80
|
+
|
|
|
81
|
+ </div>
|
|
|
82
|
+
|
|
|
83
|
+ </div>
|
|
|
84
|
+ </div>
|
|
|
85
|
+ <ul class="nav nav-tabs th-tab">
|
|
|
86
|
+ <li role="presentation" class="active">
|
|
|
87
|
+ <a href="javascript:;">图形</a>
|
|
|
88
|
+ </li>
|
|
|
89
|
+ <li role="presentation">
|
|
|
90
|
+ <a href="javascript:;">表格</a>
|
|
|
91
|
+ </li>
|
|
|
92
|
+ </ul>
|
|
|
93
|
+ <div class="th-content">
|
|
|
94
|
+ <div class="th-tu" style="width: 100%;">
|
|
|
95
|
+ <h2 style="text-align: center;">服务热线坐席通话时长统计</h2>
|
|
|
96
|
+ <div id="tabtu" style="width: 100%; height: 500px;"></div>
|
|
|
97
|
+ </div>
|
|
|
98
|
+ <div class="th-table">
|
|
|
99
|
+ <h2 style="text-align: center;">热线坐席通话时长统计</h2>
|
|
|
100
|
+ <table class="table table-bordered text-center table-hover thTable" style="width: 100%;">
|
|
|
101
|
+ <thead>
|
|
|
102
|
+ <tr>
|
|
|
103
|
+ </tr>
|
|
|
104
|
+ </thead>
|
|
|
105
|
+ <tbody class="tbody">
|
|
|
106
|
+
|
|
|
107
|
+ </tbody>
|
|
|
108
|
+ </table>
|
|
|
109
|
+ </div>
|
|
|
110
|
+
|
|
|
111
|
+ </div>
|
|
|
112
|
+ </div>
|
|
|
113
|
+ <script src="./js/laydate/laydate.js"></script>
|
|
|
114
|
+ <script src="./js/echarts.common.min.js"></script>
|
|
|
115
|
+ <script>
|
|
|
116
|
+ var token = $.cookie("token");
|
|
|
117
|
+ var myChartp;
|
|
|
118
|
+ $(document).ready(function() {
|
|
|
119
|
+ //日期
|
|
|
120
|
+ laydate.render({
|
|
|
121
|
+ elem: '#startTime',
|
|
|
122
|
+ range: '~',
|
|
|
123
|
+ theme: '#00a1cb',
|
|
|
124
|
+ });
|
|
|
125
|
+ //tab切换
|
|
|
126
|
+ $('.th-tab li').click(function() {
|
|
|
127
|
+ $(this).addClass('active')
|
|
|
128
|
+ .siblings().removeClass('active');
|
|
|
129
|
+
|
|
|
130
|
+ var index = $(this).index();
|
|
|
131
|
+ $('.th-content >div').eq(index).show()
|
|
|
132
|
+ .siblings().hide();
|
|
|
133
|
+ })
|
|
|
134
|
+
|
|
|
135
|
+ //搜索事件
|
|
|
136
|
+ $(".sear").click(function() {
|
|
|
137
|
+ getDataLists();
|
|
|
138
|
+ });
|
|
|
139
|
+ //导出功能
|
|
|
140
|
+ $('.export').click(function() {
|
|
|
141
|
+ dcexcel(this);
|
|
|
142
|
+ });
|
|
|
143
|
+
|
|
|
144
|
+ myChartp = echarts.init(document.getElementById('tabtu'));
|
|
|
145
|
+ myChartp.clear();
|
|
|
146
|
+ myChartp.showLoading();
|
|
|
147
|
+ var option = {
|
|
|
148
|
+ tooltip: {
|
|
|
149
|
+ trigger: 'axis',
|
|
|
150
|
+ // axisPointer: {
|
|
|
151
|
+ // type: 'shadow'
|
|
|
152
|
+ // },
|
|
|
153
|
+ // position: function(point, params, dom) {
|
|
|
154
|
+ // var posDis = window.innerWidth - dom.offsetWidth - 200;
|
|
|
155
|
+ // return posDis < point[0] ? [posDis + 10, '10%'] : [point[0] + 10, '10%'];
|
|
|
156
|
+ //
|
|
|
157
|
+ // },
|
|
|
158
|
+ },
|
|
|
159
|
+ legend: {
|
|
|
160
|
+ data: [],
|
|
|
161
|
+ bottom: 40,
|
|
|
162
|
+ padding: 5,
|
|
|
163
|
+ },
|
|
|
164
|
+ grid: {
|
|
|
165
|
+ bottom: 180
|
|
|
166
|
+ },
|
|
|
167
|
+ dataZoom: [{ // 这个dataZoom组件,默认控制x轴。
|
|
|
168
|
+ type: 'slider', // 这个 dataZoom 组件是 slider 型 dataZoom 组件
|
|
|
169
|
+ xAxisIndex: 0,
|
|
|
170
|
+ start: 0, // 左边在 0% 的位置。
|
|
|
171
|
+ end: 100, // 右边在 100% 的位置。
|
|
|
172
|
+ bottom: 100,
|
|
|
173
|
+ },
|
|
|
174
|
+
|
|
|
175
|
+ ],
|
|
|
176
|
+ xAxis: [{
|
|
|
177
|
+ type: 'category',
|
|
|
178
|
+ data: [],
|
|
|
179
|
+ axisPointer: {
|
|
|
180
|
+ type: ''
|
|
|
181
|
+ },
|
|
|
182
|
+ axisLabel: {
|
|
|
183
|
+ interval: 0,
|
|
|
184
|
+ rotate: 40
|
|
|
185
|
+ }
|
|
|
186
|
+ }],
|
|
|
187
|
+ yAxis: [{
|
|
|
188
|
+ type: 'value',
|
|
|
189
|
+ name: '通话次数(通)',
|
|
|
190
|
+ nameLocation: 'end',
|
|
|
191
|
+ axisLabel: {
|
|
|
192
|
+ formatter: '{value} '
|
|
|
193
|
+ }
|
|
|
194
|
+
|
|
|
195
|
+ },
|
|
|
196
|
+ {
|
|
|
197
|
+ type: 'value',
|
|
|
198
|
+ name: '通话时长(s)',
|
|
|
199
|
+ nameLocation: 'end',
|
|
|
200
|
+ axisLabel: {
|
|
|
201
|
+ formatter: '{value} '
|
|
|
202
|
+ }
|
|
|
203
|
+ }
|
|
|
204
|
+ ],
|
|
|
205
|
+ series: [{
|
|
|
206
|
+ type: 'bar',
|
|
|
207
|
+ name: '呼入次数',
|
|
|
208
|
+ data: []
|
|
|
209
|
+ }, {
|
|
|
210
|
+ type: 'line',
|
|
|
211
|
+ name: '呼入时长',
|
|
|
212
|
+ yAxisIndex: 1,
|
|
|
213
|
+ data: []
|
|
|
214
|
+ },
|
|
|
215
|
+ {
|
|
|
216
|
+ type: 'bar',
|
|
|
217
|
+ name: '呼出次数',
|
|
|
218
|
+ data: []
|
|
|
219
|
+ }, {
|
|
|
220
|
+ type: 'line',
|
|
|
221
|
+ name: '呼出时长',
|
|
|
222
|
+ yAxisIndex: 1,
|
|
|
223
|
+ data: []
|
|
|
224
|
+ }, {
|
|
|
225
|
+ type: 'bar',
|
|
|
226
|
+ name: '呼出未接通次数',
|
|
|
227
|
+ data: []
|
|
|
228
|
+ }, {
|
|
|
229
|
+ type: 'line',
|
|
|
230
|
+ name: '振铃时长',
|
|
|
231
|
+ yAxisIndex: 1,
|
|
|
232
|
+ data: []
|
|
|
233
|
+ },
|
|
|
234
|
+ {
|
|
|
235
|
+ type: 'line',
|
|
|
236
|
+ name: '通话总时长',
|
|
|
237
|
+ yAxisIndex: 1,
|
|
|
238
|
+ data: []
|
|
|
239
|
+ },
|
|
|
240
|
+ {
|
|
|
241
|
+ type: 'line',
|
|
|
242
|
+ name: '平均通话时长',
|
|
|
243
|
+ yAxisIndex: 1,
|
|
|
244
|
+ data: []
|
|
|
245
|
+ }
|
|
|
246
|
+ ],
|
|
|
247
|
+ color: ['#1ab394', '#fbbe5b', '#88ebc4', '#fa957f', '#cddc39', '#ff5722', '#e91e63', '#673ab7']
|
|
|
248
|
+ };
|
|
|
249
|
+ // 使用刚指定的配置项和数据显示图表。
|
|
|
250
|
+ myChartp.setOption(option);
|
|
|
251
|
+ getDataLists(); //加载数据
|
|
|
252
|
+ getColumnList(); //获取表格
|
|
|
253
|
+
|
|
|
254
|
+ });
|
|
|
255
|
+
|
|
|
256
|
+ //获取数据
|
|
|
257
|
+ function getDataLists() {
|
|
|
258
|
+ $.ajax({
|
|
|
259
|
+ type: "get",
|
|
|
260
|
+ url: huayi.config.callcenter_url + "TalkTime/GetDataList",
|
|
|
261
|
+ async: true,
|
|
|
262
|
+ dataType: 'json',
|
|
|
263
|
+ data: {
|
|
|
264
|
+ token: token,
|
|
|
265
|
+ stime: $('#startTime').val() && $('#startTime').val().split(' ~ ')[0],
|
|
|
266
|
+ endtime: $('#startTime').val() && $('#startTime').val().split(' ~ ')[1]
|
|
|
267
|
+ },
|
|
|
268
|
+ success: function(data) {
|
|
|
269
|
+
|
|
|
270
|
+ }
|
|
|
271
|
+ })
|
|
|
272
|
+ .then(function(data) {
|
|
|
273
|
+ $('.thTable tbody').html('');
|
|
|
274
|
+ myChartp.hideLoading();
|
|
|
275
|
+ if(data.state.toLowerCase() == "success") {
|
|
|
276
|
+ var tbodyCon = data.data;
|
|
|
277
|
+ // 填入数据
|
|
|
278
|
+ if(tbodyCon) {
|
|
|
279
|
+ myChartp.setOption({
|
|
|
280
|
+ xAxis: {
|
|
|
281
|
+ data: (function() {
|
|
|
282
|
+ var res = [];
|
|
|
283
|
+ for(var i = 0; i < tbodyCon.length; i++) {
|
|
|
284
|
+ res.push(tbodyCon[i].坐席名称);
|
|
|
285
|
+ }
|
|
|
286
|
+ return res;
|
|
|
287
|
+ })(),
|
|
|
288
|
+ },
|
|
|
289
|
+ series: (function() {
|
|
|
290
|
+ var sres = [],
|
|
|
291
|
+ sres1 = [],
|
|
|
292
|
+ sres2 = [],
|
|
|
293
|
+ sres3 = [],
|
|
|
294
|
+ sres4 = [],
|
|
|
295
|
+ sres5 = [],
|
|
|
296
|
+ sres6 = [],
|
|
|
297
|
+ sres7 = [];
|
|
|
298
|
+ var sobj = [{
|
|
|
299
|
+ data: sres,
|
|
|
300
|
+ },
|
|
|
301
|
+ {
|
|
|
302
|
+ data: sres1,
|
|
|
303
|
+ },
|
|
|
304
|
+ {
|
|
|
305
|
+ data: sres2,
|
|
|
306
|
+ },
|
|
|
307
|
+ {
|
|
|
308
|
+ data: sres3,
|
|
|
309
|
+ },
|
|
|
310
|
+ {
|
|
|
311
|
+ data: sres4,
|
|
|
312
|
+ },
|
|
|
313
|
+ {
|
|
|
314
|
+ data: sres5,
|
|
|
315
|
+ },
|
|
|
316
|
+ {
|
|
|
317
|
+ data: sres6,
|
|
|
318
|
+ },
|
|
|
319
|
+ {
|
|
|
320
|
+ data: sres7,
|
|
|
321
|
+ },
|
|
|
322
|
+ ];
|
|
|
323
|
+ for(var i = 0; i < tbodyCon.length; i++) {
|
|
|
324
|
+ sres.push(tbodyCon[i].呼入次数);
|
|
|
325
|
+ sres1.push(tbodyCon[i].呼入时长);
|
|
|
326
|
+ sres2.push(tbodyCon[i].呼出次数);
|
|
|
327
|
+ sres3.push(tbodyCon[i].呼出时长);
|
|
|
328
|
+ sres4.push(tbodyCon[i].呼出未接通次数);
|
|
|
329
|
+ sres5.push(tbodyCon[i].振铃时长);
|
|
|
330
|
+ sres6.push(tbodyCon[i].通话总时长);
|
|
|
331
|
+ sres7.push(tbodyCon[i].平均通话总时长);
|
|
|
332
|
+ }
|
|
|
333
|
+ return sobj;
|
|
|
334
|
+ })(),
|
|
|
335
|
+ });
|
|
|
336
|
+ //填充表格数据
|
|
|
337
|
+ for(var j = 0; j < tbodyCon.length; j++) {
|
|
|
338
|
+ $('<tr><td>' + tbodyCon[j].坐席名称 + '</td><td>' + tbodyCon[j].呼入次数 + '</td><td>' + tbodyCon[j].呼入时长 + '</td><td>' + tbodyCon[j].呼出次数 + '</td><td>' + tbodyCon[j].呼出时长 + '</td><td>' + tbodyCon[j].呼出未接通次数 + '</td><td>' + tbodyCon[j].振铃时长 + '</td><td style="color:#e73926;font-weight: bold;">' + tbodyCon[j].通话总时长 + '</td><td>' + tbodyCon[j].平均通话总时长 + '</td></tr>').appendTo('.thTable tbody');
|
|
|
339
|
+ }
|
|
|
340
|
+ } else {
|
|
|
341
|
+ $('#tabtu').html('<p class="text-center">暂无数据</p>');
|
|
|
342
|
+ $('.thTable tbody').html('<td colspan="9">没有找到您想要的记录呢!我会努力的...</td>');
|
|
|
343
|
+ }
|
|
|
344
|
+
|
|
|
345
|
+ } else {
|
|
|
346
|
+ $('#tabtu').html('<p class="text-center">暂无数据</p>');
|
|
|
347
|
+ $('.thTable tbody').html('<td colspan="9">没有找到您想要的记录呢!我会努力的...</td>');
|
|
|
348
|
+ }
|
|
|
349
|
+ });
|
|
|
350
|
+
|
|
|
351
|
+ }
|
|
|
352
|
+
|
|
|
353
|
+ //获取表头数据和图形legend
|
|
|
354
|
+ function getColumnList() {
|
|
|
355
|
+ $.ajax({
|
|
|
356
|
+ type: "get",
|
|
|
357
|
+ url: huayi.config.callcenter_url + "TalkTime/GetColumnList",
|
|
|
358
|
+ async: false,
|
|
|
359
|
+ dataType: 'json',
|
|
|
360
|
+ data: {
|
|
|
361
|
+ token: token
|
|
|
362
|
+ },
|
|
|
363
|
+ success: function(res) {
|
|
|
364
|
+
|
|
|
365
|
+ }
|
|
|
366
|
+
|
|
|
367
|
+ })
|
|
|
368
|
+
|
|
|
369
|
+ .then(function(data) {
|
|
|
370
|
+ $('.thTable thead tr').html('');
|
|
|
371
|
+ if(data.state.toLowerCase() == "success") {
|
|
|
372
|
+ var con = data.data;
|
|
|
373
|
+ if(con) {
|
|
|
374
|
+ myChartp.setOption({
|
|
|
375
|
+ legend: {
|
|
|
376
|
+ data: con,
|
|
|
377
|
+ },
|
|
|
378
|
+ });
|
|
|
379
|
+
|
|
|
380
|
+ for(var i = 0; i < con.length; i++) {
|
|
|
381
|
+ $('<td>' + con[i] + '</td>').appendTo('.thTable thead tr')
|
|
|
382
|
+ }
|
|
|
383
|
+ } else {
|
|
|
384
|
+ $('<td colspan="9">暂无表头数据</td>').appendTo('.thTable thead tr')
|
|
|
385
|
+ }
|
|
|
386
|
+ } else {
|
|
|
387
|
+ $('<td colspan="9">暂无表头数据</td>').appendTo('.thTable thead tr')
|
|
|
388
|
+ }
|
|
|
389
|
+ });
|
|
|
390
|
+ }
|
|
|
391
|
+ //导出
|
|
|
392
|
+ function dcexcel(obj) {
|
|
|
393
|
+ var url = huayi.config.callcenter_url + "TalkTime/ExptList?token=" + $.cookie("token");
|
|
|
394
|
+ url += "&stime=" + $('#startTime').val() && $('#startTime').val().split('~')[0] + "&endtime=" + $('#startTime').val() && $('#startTime').val().split('~')[1];
|
|
|
395
|
+ obj.href = url;
|
|
|
396
|
+ }
|
|
|
397
|
+ </script>
|
|
|
398
|
+ </body>
|
|
|
399
|
+
|
|
|
400
|
+</html>
|