miaofuhao 7 年 前
コミット
df5d85e75c
共有3 個のファイルを変更した146 個の追加24 個の削除を含む
  1. 11 10
      CallCenterWeb.UI/ReportForm/workOrderComplain.html
  2. 134 14
      CallCenterWeb.UI/ReportForm/workOrderCustomer.html
  3. 1 0
      CallCenterWeb.UI/ReportForm/workOrderSource.html

+ 11 - 10
CallCenterWeb.UI/ReportForm/workOrderComplain.html

@@ -55,7 +55,7 @@
55 55
 						</div>-->
56 56
 						<div class="pull-right">
57 57
 							<button class="btns search">搜索</button>
58
-							<!--<a href="" class="btns export">导出</a>-->
58
+							<a href="" class="btns export">导出</a>
59 59
 						</div>
60 60
 					</div>
61 61
 				</div>
@@ -75,7 +75,7 @@
75 75
 				<h2 style="text-align: center; margin-top: 20px;">数据饼状图</h2>
76 76
 				<div id="quantity" style="width: 100%;height: 500px;"></div>
77 77
 			</div>
78
-			<div class="hu-con-left">
78
+			<div class="hu-con-left" style="width: 80%; margin: 0 auto;">
79 79
 				<h2 style="text-align: center; margin-top: 20px; display: none;">投诉原因统计</h2>
80 80
 				<table class="layui-hide" id="t_callTotal"></table> 
81 81
 			</div>
@@ -109,6 +109,13 @@
109 109
 					partOne();
110 110
 					//getTableDataList(); //获取表格数据
111 111
 				})
112
+				//导出
113
+				$('.export').click(function() {
114
+					stime = $('#startTime').val() && $('#startTime').val().split(' ~ ')[0];
115
+					endtime = $('#startTime').val() && $('#startTime').val().split(' ~ ')[1];
116
+					dcexcel(this);
117
+				});
118
+				
112 119
 				//tab切换
113 120
 				$('.hu-tab li').click(function() {
114 121
 					$(this).addClass('active')
@@ -120,12 +127,6 @@
120 127
 					loadDatas();	
121 128
 				});
122 129
 				
123
-//				//导出
124
-//				$('.export').click(function() {
125
-//					stime = $('#startTime').val() && $('#startTime').val().split(' ~ ')[0];
126
-//					endtime = $('#startTime').val() && $('#startTime').val().split(' ~ ')[1];
127
-//					dcexcel(this);
128
-//				});
129 130
 
130 131
 			});
131 132
 			function loadDatas() {
@@ -136,8 +137,8 @@
136 137
 				}
137 138
 			}
138 139
 			function dcexcel(obj) {
139
-				var url = huayi.config.callcenter_url + "GDLY/ExportExcel?token=" + token;
140
-				url += "&stime=" + stime + "&endtime=" + endtime + "&dpt=" + $('#bumen').val();
140
+				var url = huayi.config.callcenter_url + "Business/GetTypeReport?isdc=1&token=" + token;
141
+				url += "&stime=" + stime + "&endtime=" + endtime;
141 142
 				obj.href = url;
142 143
 			}
143 144
 

+ 134 - 14
CallCenterWeb.UI/ReportForm/workOrderCustomer.html

@@ -97,6 +97,8 @@
97 97
 				<a href="#" title="刷新"><i class="fa fa-refresh"></i></a>
98 98
 			</div>
99 99
 		</div>
100
+		
101
+		
100 102
 		<div class="toolBox">
101 103
 			<div class="th-bar clearfix">
102 104
 				<div class="pull-right">
@@ -124,14 +126,31 @@
124 126
 
125 127
 						<div class="pull-right">
126 128
 							<button class="btns search">搜索</button>
127
-							<!--<a href="" class="btns export">导出</a>-->
129
+							<a href="" class="btns export">导出</a>
128 130
 						</div>
129 131
 					</div>
130 132
 				</div>
131 133
 			</div>
132 134
 		</div>
133
-		<div class="th-content">
134
-			<div id="main" style="width: 100%; height: 400px;"></div>
135
+		<ul class="nav nav-tabs hu-tab">
136
+			<li role="presentation" class="active">
137
+				<a href="javascript:;">图形</a>
138
+			</li>
139
+			<li role="presentation">
140
+				<a href="javascript:;">表格</a>
141
+			</li>
142
+
143
+		</ul>
144
+		
145
+		<div class="hu-content">
146
+			<div class="hu-con-right">
147
+				<h2 style="text-align: center; margin-top: 20px;">客诉数量柱状图</h2>
148
+				<div id="main" style="width: 100%; height: 400px;"></div>
149
+			</div>
150
+			<div class="hu-con-left" style="width: 80%; margin: 0 auto;">
151
+				<h2 style="text-align: center; margin-top: 20px; display: none;">客诉数量统计</h2>
152
+				<table class="layui-hide" id="t_callTotal"></table> 
153
+			</div>
135 154
 		</div>
136 155
 		<script src="../js/zTree/jquery.ztree.core.js"></script>
137 156
 		<script src="../js/layui/layui.js"></script>
@@ -182,7 +201,6 @@
182 201
 						onClick: changeTreeClick
183 202
 					}
184 203
 				}
185
-
186 204
 				function changeTreeClick(event, treeId, treeNode) {
187 205
 
188 206
 					chanId = treeNode.F_Id;
@@ -240,15 +258,9 @@
240 258
 						result = $.parseJSON(result);
241 259
 
242 260
 						var Count = result.data;
243
-
261
+						$('<option value="" selected="selected">全部</option>').appendTo($(".orderType2"))
244 262
 						$(Count).each(function(i, n) {
245
-
246
-							if(n.F_DictionaryValueId == "468") {
247
-								$('<option value="' + n.F_DictionaryValueId + '" selected="selected">' + n.F_Name + '</option>').appendTo($(".orderType2"));
248
-							} else {
249
-								$('<option value="' + n.F_DictionaryValueId + '">' + n.F_Name + '</option>').appendTo($(".orderType2"));
250
-							}
251
-
263
+							$('<option value="' + n.F_DictionaryValueId + '">' + n.F_Name + '</option>').appendTo($(".orderType2"));
252 264
 						})
253 265
 
254 266
 					});
@@ -257,7 +269,115 @@
257 269
 				$(".search").click(function() {
258 270
 					partThree(); //获取表格数据
259 271
 				})
272
+				//导出
273
+				$('.export').click(function() {
274
+					stime = $('#startTime').val() && $('#startTime').val().split(' ~ ')[0];
275
+					endtime = $('#startTime').val() && $('#startTime').val().split(' ~ ')[1];
276
+					dcexcel(this);
277
+				});
278
+				function dcexcel(obj) {
279
+					var url = huayi.config.callcenter_url + "Business/GetWorkMonthCountReport?isdc=1&token=" + token;
280
+					url += "&type=" + $('#orderType2').val()
281
+					+ "&area=" + $('.inps2').attr("index")
282
+					+ "&province=" + $('.inps3').attr("index")
283
+					+ "&city=" + $('.inps4').attr("index");									
284
+					obj.href = url;
285
+				}
286
+				//tab切换
287
+				$('.hu-tab li').click(function() {
288
+					$(this).addClass('active')
289
+						.siblings().removeClass('active');
290
+			
291
+					tabIndex = $(this).index();
292
+					$('.hu-content >div').eq(tabIndex).show()
293
+						.siblings().hide();
294
+					loadDatas();	
295
+				});
296
+				function loadDatas() {
297
+					if(tabIndex == 0) {
298
+						//tu(); //加载图形
299
+					} else if(tabIndex == 1) {
300
+						getDataList(); //加载表格
301
+					}
302
+				}
260 303
 			});
304
+			function getDataList() {
305
+				var colsArr = [];
306
+				var dataArr = [];
307
+				var loadindex;
308
+				$.ajax({
309
+					type: 'get',
310
+					url: huayi.config.callcenter_url + "Business/GetWorkMonthCountReport",
311
+					async: true,
312
+					dataType: 'json',
313
+					beforeSend: function() {
314
+						loadindex = layer.load()
315
+					},
316
+					data: {
317
+						sdate: stime,
318
+						edate: endtime,
319
+						dpt: $('#bumen').val(),
320
+						token: token,
321
+					},
322
+					success: function(data) {
323
+						if(data.state.toLowerCase() == "success") {
324
+							var res = data.data.list;
325
+							if(res && res.length > 0) {
326
+								dataArr = res;
327
+								var newArr = [];
328
+							    var keys = [];
329
+							    for (var property in res[0]){
330
+							    	keys.push(property);
331
+							    }
332
+								newArr.push({
333
+									field: keys[0],
334
+									title: keys[0],
335
+									align: 'center',
336
+									fixed: true,
337
+									//sort: true,
338
+									width: 150,
339
+								});
340
+								for(var i = 1, colNL = keys.length; i < colNL; i++) {
341
+									newArr.push({
342
+										field: keys[i],
343
+										title: keys[i],
344
+										align: 'center',
345
+										//fixed: true, 
346
+										//sort: true,
347
+										//width: 150,
348
+									});
349
+								}
350
+								colsArr.push(newArr);
351
+								layui.use('table', function() {
352
+									var table = layui.table;
353
+									//方法级渲染
354
+									
355
+									table.render({
356
+										elem: '#t_callTotal',
357
+										skin: 'row', //line (行边框风格) row (列边框风格) nob (无边框风格)
358
+										even: true, //开启隔行背景
359
+										size: 'lg', //sm,lg尺寸的表格
360
+										cellMinWidth: 100,
361
+										page: true,
362
+										cols: colsArr,
363
+										data: dataArr,
364
+										height: 'full-150',
365
+										limitName: 'pageSize', //每页数据量的参数名,默认:limit			
366
+										response: {
367
+											pageSize: 20, //数据状态的字段名称,默认:code
368
+										},
369
+									});
370
+									  
371
+								});
372
+
373
+							}
374
+						}
375
+					},
376
+				}).then(function() {
377
+					layer.close(loadindex);
378
+				
379
+				});
380
+			}
261 381
 			partThree();
262 382
 			//pasrt 3
263 383
 			var main = echarts.init(document.getElementById('main'));
@@ -336,12 +456,12 @@
336 456
 							//					var part3 = result.data.b;
337 457
 							main.setOption({
338 458
 								xAxis: {
339
-									data: con.months
459
+									data: con.chartdata.months
340 460
 								},
341 461
 								series: [{
342 462
 									name: "客诉数量",
343 463
 									type: "bar",
344
-									data: con.counts[0]
464
+									data: con.chartdata.counts
345 465
 								}]
346 466
 							})
347 467
 

+ 1 - 0
CallCenterWeb.UI/ReportForm/workOrderSource.html

@@ -175,6 +175,7 @@
175 175
 					},
176 176
 				}).then(function() {
177 177
 					layer.close(loadindex);
178
+				
178 179
 				});
179 180
 			}
180 181
 		</script>