Kaynağa Gözat

报表导出

miaofuhao 7 yıl önce
ebeveyn
işleme
df5d85e75c

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

55
 						</div>-->
55
 						</div>-->
56
 						<div class="pull-right">
56
 						<div class="pull-right">
57
 							<button class="btns search">搜索</button>
57
 							<button class="btns search">搜索</button>
58
-							<!--<a href="" class="btns export">导出</a>-->
58
+							<a href="" class="btns export">导出</a>
59
 						</div>
59
 						</div>
60
 					</div>
60
 					</div>
61
 				</div>
61
 				</div>
75
 				<h2 style="text-align: center; margin-top: 20px;">数据饼状图</h2>
75
 				<h2 style="text-align: center; margin-top: 20px;">数据饼状图</h2>
76
 				<div id="quantity" style="width: 100%;height: 500px;"></div>
76
 				<div id="quantity" style="width: 100%;height: 500px;"></div>
77
 			</div>
77
 			</div>
78
-			<div class="hu-con-left">
78
+			<div class="hu-con-left" style="width: 80%; margin: 0 auto;">
79
 				<h2 style="text-align: center; margin-top: 20px; display: none;">投诉原因统计</h2>
79
 				<h2 style="text-align: center; margin-top: 20px; display: none;">投诉原因统计</h2>
80
 				<table class="layui-hide" id="t_callTotal"></table> 
80
 				<table class="layui-hide" id="t_callTotal"></table> 
81
 			</div>
81
 			</div>
109
 					partOne();
109
 					partOne();
110
 					//getTableDataList(); //获取表格数据
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
 				//tab切换
119
 				//tab切换
113
 				$('.hu-tab li').click(function() {
120
 				$('.hu-tab li').click(function() {
114
 					$(this).addClass('active')
121
 					$(this).addClass('active')
120
 					loadDatas();	
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
 			function loadDatas() {
132
 			function loadDatas() {
136
 				}
137
 				}
137
 			}
138
 			}
138
 			function dcexcel(obj) {
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
 				obj.href = url;
142
 				obj.href = url;
142
 			}
143
 			}
143
 
144
 

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

97
 				<a href="#" title="刷新"><i class="fa fa-refresh"></i></a>
97
 				<a href="#" title="刷新"><i class="fa fa-refresh"></i></a>
98
 			</div>
98
 			</div>
99
 		</div>
99
 		</div>
100
+		
101
+		
100
 		<div class="toolBox">
102
 		<div class="toolBox">
101
 			<div class="th-bar clearfix">
103
 			<div class="th-bar clearfix">
102
 				<div class="pull-right">
104
 				<div class="pull-right">
124
 
126
 
125
 						<div class="pull-right">
127
 						<div class="pull-right">
126
 							<button class="btns search">搜索</button>
128
 							<button class="btns search">搜索</button>
127
-							<!--<a href="" class="btns export">导出</a>-->
129
+							<a href="" class="btns export">导出</a>
128
 						</div>
130
 						</div>
129
 					</div>
131
 					</div>
130
 				</div>
132
 				</div>
131
 			</div>
133
 			</div>
132
 		</div>
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
 		</div>
154
 		</div>
136
 		<script src="../js/zTree/jquery.ztree.core.js"></script>
155
 		<script src="../js/zTree/jquery.ztree.core.js"></script>
137
 		<script src="../js/layui/layui.js"></script>
156
 		<script src="../js/layui/layui.js"></script>
182
 						onClick: changeTreeClick
201
 						onClick: changeTreeClick
183
 					}
202
 					}
184
 				}
203
 				}
185
-
186
 				function changeTreeClick(event, treeId, treeNode) {
204
 				function changeTreeClick(event, treeId, treeNode) {
187
 
205
 
188
 					chanId = treeNode.F_Id;
206
 					chanId = treeNode.F_Id;
240
 						result = $.parseJSON(result);
258
 						result = $.parseJSON(result);
241
 
259
 
242
 						var Count = result.data;
260
 						var Count = result.data;
243
-
261
+						$('<option value="" selected="selected">全部</option>').appendTo($(".orderType2"))
244
 						$(Count).each(function(i, n) {
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
 				$(".search").click(function() {
269
 				$(".search").click(function() {
258
 					partThree(); //获取表格数据
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
 			partThree();
381
 			partThree();
262
 			//pasrt 3
382
 			//pasrt 3
263
 			var main = echarts.init(document.getElementById('main'));
383
 			var main = echarts.init(document.getElementById('main'));
336
 							//					var part3 = result.data.b;
456
 							//					var part3 = result.data.b;
337
 							main.setOption({
457
 							main.setOption({
338
 								xAxis: {
458
 								xAxis: {
339
-									data: con.months
459
+									data: con.chartdata.months
340
 								},
460
 								},
341
 								series: [{
461
 								series: [{
342
 									name: "客诉数量",
462
 									name: "客诉数量",
343
 									type: "bar",
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
 					},
175
 					},
176
 				}).then(function() {
176
 				}).then(function() {
177
 					layer.close(loadindex);
177
 					layer.close(loadindex);
178
+				
178
 				});
179
 				});
179
 			}
180
 			}
180
 		</script>
181
 		</script>