|
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+<!DOCTYPE html>
|
|
|
2
|
+<html>
|
|
|
3
|
+
|
|
|
4
|
+ <head>
|
|
|
5
|
+
|
|
|
6
|
+ <meta charset="utf-8">
|
|
|
7
|
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
8
|
+ <title>产品日期分布情况表</title>
|
|
|
9
|
+ <!--[if lt IE 9]>
|
|
|
10
|
+ <meta http-equiv="refresh" content="0;ie.html" />
|
|
|
11
|
+ <![endif]-->
|
|
|
12
|
+ <script src="../Script/Common/huayi.load.js"></script>
|
|
|
13
|
+ <script src="../Script/Common/huayi.config.js"></script>
|
|
|
14
|
+ <link rel="stylesheet" href="../js/select2/css/select2.min.css" />
|
|
|
15
|
+ <link rel="stylesheet" href="../css/init.css" />
|
|
|
16
|
+ <style>
|
|
|
17
|
+ .zxtable {
|
|
|
18
|
+ font-size: 12px;
|
|
|
19
|
+ background: #F5F5F5;
|
|
|
20
|
+ }
|
|
|
21
|
+
|
|
|
22
|
+ .zxt-top {
|
|
|
23
|
+ background: #FFFFFF;
|
|
|
24
|
+ height: 60px;
|
|
|
25
|
+ width: 95%;
|
|
|
26
|
+ margin: 40px auto 0 auto;
|
|
|
27
|
+ padding: 10px 20px;
|
|
|
28
|
+ }
|
|
|
29
|
+
|
|
|
30
|
+ .topCon {
|
|
|
31
|
+ float: right;
|
|
|
32
|
+ margin-right: 45px;
|
|
|
33
|
+ }
|
|
|
34
|
+ .zxt-content {
|
|
|
35
|
+ width: 95%;
|
|
|
36
|
+ margin: 0 auto;
|
|
|
37
|
+ }
|
|
|
38
|
+
|
|
|
39
|
+ .zxt-table {
|
|
|
40
|
+ overflow-x: auto;
|
|
|
41
|
+ }
|
|
|
42
|
+
|
|
|
43
|
+ .zxt-table table {
|
|
|
44
|
+ font-size: 12px;
|
|
|
45
|
+ margin: 40px auto;
|
|
|
46
|
+ width: 85%;
|
|
|
47
|
+ max-width: 100%;
|
|
|
48
|
+ background: #FFFFFF;
|
|
|
49
|
+ }
|
|
|
50
|
+
|
|
|
51
|
+ .zxt-table table tr td {
|
|
|
52
|
+ /*background: #1ab394;*/
|
|
|
53
|
+ /*color: #fff;*/
|
|
|
54
|
+ }
|
|
|
55
|
+ .header-num-date{
|
|
|
56
|
+ position: relative;
|
|
|
57
|
+ }
|
|
|
58
|
+
|
|
|
59
|
+ .num-header{
|
|
|
60
|
+ position: absolute;
|
|
|
61
|
+ top: 10px;
|
|
|
62
|
+ right: 10px;
|
|
|
63
|
+ }
|
|
|
64
|
+
|
|
|
65
|
+ .date-header{
|
|
|
66
|
+ position: absolute;
|
|
|
67
|
+ left: 10px;
|
|
|
68
|
+ bottom: 10px;
|
|
|
69
|
+ }
|
|
|
70
|
+
|
|
|
71
|
+ </style>
|
|
|
72
|
+ </head>
|
|
|
73
|
+
|
|
|
74
|
+ <body class="gray-bg" style="background: #fefefe;">
|
|
|
75
|
+ <div class="zxtable">
|
|
|
76
|
+ <div class="daoHang clearfix">
|
|
|
77
|
+ <div class="dhLeft">
|
|
|
78
|
+ <sapn><i class="syIcon"></i>位置:<a id="ReIndex" href="javaScript:;">首页</a>><a href="javaScript:;">报表分析</a>><a href="javaScript:;">业务数据分析</a>><a href="" class="nowPosition">产品日期分布情况表</a></sapn>
|
|
|
79
|
+ </div>
|
|
|
80
|
+ <div class="dhRight">
|
|
|
81
|
+ <a href="#" title="刷新"><i class="fa fa-refresh"></i></a>
|
|
|
82
|
+ </div>
|
|
|
83
|
+ </div>
|
|
|
84
|
+ <div class="zxt-top clearfix">
|
|
|
85
|
+ <div class="topCon">
|
|
|
86
|
+ <div class="form-inline th-bar clearfix">
|
|
|
87
|
+ <div class="time-box form-group" >
|
|
|
88
|
+ <i class="tub fa fa-calendar"></i>
|
|
|
89
|
+ <input class="form-control" type="text" id="startTime" placeholder="请选择起止时间" style="width: 228px;">
|
|
|
90
|
+ </div>
|
|
|
91
|
+ <div class="form-group tool_bars pull-right">
|
|
|
92
|
+ <button class="btns sear">搜索</button>
|
|
|
93
|
+ <a class="btns export">导出</a>
|
|
|
94
|
+ </div>
|
|
|
95
|
+
|
|
|
96
|
+ </div>
|
|
|
97
|
+
|
|
|
98
|
+ </div>
|
|
|
99
|
+ </div>
|
|
|
100
|
+
|
|
|
101
|
+ <div class="zxt-content">
|
|
|
102
|
+
|
|
|
103
|
+ <div class="zxt-table">
|
|
|
104
|
+ <table class="table table-bordered text-center zjTable">
|
|
|
105
|
+ </table>
|
|
|
106
|
+ </div>
|
|
|
107
|
+ </div>
|
|
|
108
|
+ </div>
|
|
|
109
|
+
|
|
|
110
|
+ <script src="../js/jquery.min.js?v=2.1.4"></script>
|
|
|
111
|
+ <script src="../js/bootstrap.min.js?v=3.3.6"></script>
|
|
|
112
|
+ <script src="../js/jquery.cookie.js"></script>
|
|
|
113
|
+ <script src="../js/laydate/laydate.js"></script>
|
|
|
114
|
+ <script src="../js/select2/js/select2.min.js"></script>
|
|
|
115
|
+
|
|
|
116
|
+ <script>
|
|
|
117
|
+ $(function() {
|
|
|
118
|
+ //日期
|
|
|
119
|
+ laydate.render({
|
|
|
120
|
+ elem: '#startTime',
|
|
|
121
|
+ type: 'date',
|
|
|
122
|
+ theme: '#1ab394',
|
|
|
123
|
+// range: '~',
|
|
|
124
|
+ });
|
|
|
125
|
+
|
|
|
126
|
+ reportForm();
|
|
|
127
|
+ //点击搜索事件
|
|
|
128
|
+ $('.sear').click(function() {
|
|
|
129
|
+ reportForm();
|
|
|
130
|
+ })
|
|
|
131
|
+ //按enter搜索
|
|
|
132
|
+ document.onkeydown = function (e) { // 回车提交表单
|
|
|
133
|
+ var theEvent = window.event || e;
|
|
|
134
|
+ var code = theEvent.keyCode || theEvent.which || theEvent.charCode;
|
|
|
135
|
+ if (code == 13) {
|
|
|
136
|
+ reportForm();
|
|
|
137
|
+ }
|
|
|
138
|
+ }
|
|
|
139
|
+ //表格
|
|
|
140
|
+ function reportForm () {
|
|
|
141
|
+ $.ajax({
|
|
|
142
|
+ type: "get",
|
|
|
143
|
+ dataType: "json",
|
|
|
144
|
+ url: huayi.config.callcenter_url+"Business/Distribution",
|
|
|
145
|
+ async: true,
|
|
|
146
|
+ data: {
|
|
|
147
|
+ token: $.cookie("token"),
|
|
|
148
|
+ datetime: $("#startTime").val(),
|
|
|
149
|
+ isdc: 0,
|
|
|
150
|
+ },
|
|
|
151
|
+ success: function(data) {
|
|
|
152
|
+ if (data.state.toLowerCase() == 'success') {
|
|
|
153
|
+ var content = data.data.rows;
|
|
|
154
|
+ $('.table').html('');
|
|
|
155
|
+ $('.table').append(
|
|
|
156
|
+ '<tr>'+
|
|
|
157
|
+ '<td rowspan="1" colspan="12" style="font-size: 16px; font-weight: 700">'+ data.data.msg + '</td>'+
|
|
|
158
|
+ '</tr>'+
|
|
|
159
|
+ '<tr>'+
|
|
|
160
|
+ '<td rowspan="2" colspan="1" class="header-num-date"><div class="num-header">数量</div><div class="date-header">日期</div></td>'+
|
|
|
161
|
+ '<td rowspan="1" colspan="1">投诉产品</td>'+
|
|
|
162
|
+ '<td rowspan="1" colspan="2" class="month-count-1name"></td>'+
|
|
|
163
|
+ '<td rowspan="1" colspan="2" class="month-count-2name"></td>'+
|
|
|
164
|
+ '<td rowspan="1" colspan="2" class="month-count-3name"></td>'+
|
|
|
165
|
+ '<td rowspan="1" colspan="2" class="month-count-4name"></td>'+
|
|
|
166
|
+ '<td rowspan="1" colspan="2" class="month-count-5name"></td>'+
|
|
|
167
|
+ '</tr>'+
|
|
|
168
|
+ '<tr>'+
|
|
|
169
|
+ '<td>数量</td>'+
|
|
|
170
|
+ '<td>数量</td>'+
|
|
|
171
|
+ '<td>占比</td>'+
|
|
|
172
|
+ '<td>数量</td>'+
|
|
|
173
|
+ '<td>占比</td>'+
|
|
|
174
|
+ '<td>数量</td>'+
|
|
|
175
|
+ '<td>占比</td>'+
|
|
|
176
|
+ '<td>数量</td>'+
|
|
|
177
|
+ '<td>占比</td>'+
|
|
|
178
|
+ '<td>数量</td>'+
|
|
|
179
|
+ '<td>占比</td>'+
|
|
|
180
|
+ '</tr>'
|
|
|
181
|
+ );
|
|
|
182
|
+ //投诉产品日期分布情况表
|
|
|
183
|
+ $(".month-count-1name").html(content.dates[0].MonthCount1name);
|
|
|
184
|
+ $(".month-count-2name").html(content.dates[0].MonthCount2name);
|
|
|
185
|
+ $(".month-count-3name").html(content.dates[0].MonthCount3name);
|
|
|
186
|
+ $(".month-count-4name").html(content.dates[0].MonthCount4name);
|
|
|
187
|
+ $(".month-count-5name").html(content.dates[0].MonthCount5name);
|
|
|
188
|
+
|
|
|
189
|
+ for (var i = 0; i < content.dates.length; i++){
|
|
|
190
|
+ $(".table").append('<tr>'+
|
|
|
191
|
+ '<td>'+ content.dates[i].name + '</td>' +
|
|
|
192
|
+ '<td>'+ content.dates[i].total + '</td>' +
|
|
|
193
|
+ '<td>'+ content.dates[i].MonthCount1 + '</td>' +
|
|
|
194
|
+ '<td>'+ content.dates[i].MonthCountmix1 + '</td>' +
|
|
|
195
|
+ '<td>'+ content.dates[i].MonthCount2 + '</td>' +
|
|
|
196
|
+ '<td>'+ content.dates[i].MonthCountmix2 + '</td>' +
|
|
|
197
|
+ '<td>'+ content.dates[i].MonthCount3 + '</td>' +
|
|
|
198
|
+ '<td>'+ content.dates[i].MonthCountmix3 + '</td>' +
|
|
|
199
|
+ '<td>'+ content.dates[i].MonthCount4 + '</td>' +
|
|
|
200
|
+ '<td>'+ content.dates[i].MonthCountmix4 + '</td>' +
|
|
|
201
|
+ '<td>'+ content.dates[i].MonthCount5 + '</td>' +
|
|
|
202
|
+ '<td>'+ content.dates[i].MonthCountmix5 + '</td>' +
|
|
|
203
|
+ '</tr>')
|
|
|
204
|
+ }
|
|
|
205
|
+
|
|
|
206
|
+ //工厂投诉比,各质量问题占比,结构占比
|
|
|
207
|
+ var factoryLen = content.factory.length;
|
|
|
208
|
+ var cyclesNum = content.problem.length + content.product.length;
|
|
|
209
|
+ var factoryLenHalfCeil = Math.ceil(factoryLen / 2) ;
|
|
|
210
|
+ for (var i=0,num=0,p=0; num < cyclesNum; i+=2, num++){
|
|
|
211
|
+ if (i === 0) {
|
|
|
212
|
+ $(".table").append('<tr>'+
|
|
|
213
|
+ '<td rowspan="'+ cyclesNum + '">工厂投诉占比</td>'+
|
|
|
214
|
+ '<td>' + content.factory[i].name + '</td>'+
|
|
|
215
|
+ '<td>' + content.factory[i].number + '</td>'+
|
|
|
216
|
+ '<td>' + content.factory[i].proportion + '</td>'+
|
|
|
217
|
+ '<td>' + content.factory[i+1].name + '</td>'+
|
|
|
218
|
+ '<td>' + content.factory[i+1].number + '</td>'+
|
|
|
219
|
+ '<td>' + content.factory[i+1].proportion + '</td>'+
|
|
|
220
|
+ '<td rowspan="'+ content.problem.length + '">各质量问题占比</td>'+
|
|
|
221
|
+ '<td colspan="2">' + content.problem[num].name + '</td>'+
|
|
|
222
|
+ '<td>' + content.problem[num].number + '</td>'+
|
|
|
223
|
+ '<td>' + content.problem[num].proportion + '</td>'+
|
|
|
224
|
+ '</tr>')
|
|
|
225
|
+ } else if (i > 0 && i < factoryLen) {
|
|
|
226
|
+ if (num < content.problem.length){
|
|
|
227
|
+ $(".table").append('<tr>'+
|
|
|
228
|
+ '<td>' + content.factory[i].name +'</td>'+
|
|
|
229
|
+ '<td>' + content.factory[i].number +'</td>'+
|
|
|
230
|
+ '<td>' + content.factory[i].proportion +'</td>'+
|
|
|
231
|
+ '<td>' + content.factory[i+1].name +'</td>'+
|
|
|
232
|
+ '<td>' + content.factory[i+1].number +'</td>'+
|
|
|
233
|
+ '<td>' + content.factory[i+1].proportion +'</td>'+
|
|
|
234
|
+ '<td colspan="2">' + content.problem[num].name + '</td>'+
|
|
|
235
|
+ '<td>' + content.problem[num].number + '</td>'+
|
|
|
236
|
+ '<td>' + content.problem[num].proportion + '</td>'+
|
|
|
237
|
+ '</tr>')
|
|
|
238
|
+ } else if (num >= content.problem.length) {
|
|
|
239
|
+ if(p === 0){
|
|
|
240
|
+ $(".table").append('<tr>'+
|
|
|
241
|
+ '<td>' + content.factory[i].name +'</td>'+
|
|
|
242
|
+ '<td>' + content.factory[i].number +'</td>'+
|
|
|
243
|
+ '<td>' + content.factory[i].proportion +'</td>'+
|
|
|
244
|
+ '<td>' + content.factory[i+1].name +'</td>'+
|
|
|
245
|
+ '<td>' + content.factory[i+1].number +'</td>'+
|
|
|
246
|
+ '<td>' + content.factory[i+1].proportion +'</td>'+
|
|
|
247
|
+ '<td rowspan="'+ content.product.length + '">结构占比</td>'+
|
|
|
248
|
+ '<td colspan="2">' + content.product[p].name + '</td>'+
|
|
|
249
|
+ '<td>' + content.product[p].number + '</td>'+
|
|
|
250
|
+ '<td>' + content.product[p].proportion + '</td>'+
|
|
|
251
|
+ '</tr>')
|
|
|
252
|
+ } else if (0 < p && p < content.product.length) {
|
|
|
253
|
+ $(".table").append('<tr>'+
|
|
|
254
|
+ '<td>' + content.factory[i].name +'</td>'+
|
|
|
255
|
+ '<td>' + content.factory[i].number +'</td>'+
|
|
|
256
|
+ '<td>' + content.factory[i].proportion +'</td>'+
|
|
|
257
|
+ '<td>' + content.factory[i+1].name +'</td>'+
|
|
|
258
|
+ '<td>' + content.factory[i+1].number +'</td>'+
|
|
|
259
|
+ '<td>' + content.factory[i+1].proportion +'</td>'+
|
|
|
260
|
+ '<td colspan="2">' + content.product[p].name + '</td>'+
|
|
|
261
|
+ '<td>' + content.product[p].number + '</td>'+
|
|
|
262
|
+ '<td>' + content.product[p].proportion + '</td>'+
|
|
|
263
|
+ '</tr>')
|
|
|
264
|
+ }
|
|
|
265
|
+ p += 1;
|
|
|
266
|
+ }
|
|
|
267
|
+ } else if ( i >= factoryLen) {
|
|
|
268
|
+ if (num < content.problem.length){
|
|
|
269
|
+ $(".table").append('<tr>'+
|
|
|
270
|
+ '<td></td>'+
|
|
|
271
|
+ '<td></td>'+
|
|
|
272
|
+ '<td></td>'+
|
|
|
273
|
+ '<td></td>'+
|
|
|
274
|
+ '<td></td>'+
|
|
|
275
|
+ '<td></td>'+
|
|
|
276
|
+ '<td colspan="2">' + content.problem[num].name + '</td>'+
|
|
|
277
|
+ '<td>' + content.problem[num].number + '</td>'+
|
|
|
278
|
+ '<td>' + content.problem[num].proportion + '</td>'+
|
|
|
279
|
+ '</tr>')
|
|
|
280
|
+ } else if (num >= content.problem.length) {
|
|
|
281
|
+ if(p === 0){
|
|
|
282
|
+ $(".table").append('<tr>'+
|
|
|
283
|
+ '<td></td>'+
|
|
|
284
|
+ '<td></td>'+
|
|
|
285
|
+ '<td></td>'+
|
|
|
286
|
+ '<td></td>'+
|
|
|
287
|
+ '<td></td>'+
|
|
|
288
|
+ '<td></td>'+
|
|
|
289
|
+ '<td rowspan="'+ content.product.length + '">结构占比</td>'+
|
|
|
290
|
+ '<td colspan="2">' + content.product[p].name + '</td>'+
|
|
|
291
|
+ '<td>' + content.product[p].number + '</td>'+
|
|
|
292
|
+ '<td>' + content.product[p].proportion + '</td>'+
|
|
|
293
|
+ '</tr>')
|
|
|
294
|
+ } else if (0 < p && p < content.product.length) {
|
|
|
295
|
+ $(".table").append('<tr>'+
|
|
|
296
|
+ '<td></td>'+
|
|
|
297
|
+ '<td></td>'+
|
|
|
298
|
+ '<td></td>'+
|
|
|
299
|
+ '<td></td>'+
|
|
|
300
|
+ '<td></td>'+
|
|
|
301
|
+ '<td></td>'+
|
|
|
302
|
+ '<td colspan="2">' + content.product[p].name + '</td>'+
|
|
|
303
|
+ '<td>' + content.product[p].number + '</td>'+
|
|
|
304
|
+ '<td>' + content.product[p].proportion + '</td>'+
|
|
|
305
|
+ '</tr>')
|
|
|
306
|
+ }
|
|
|
307
|
+ p += 1;
|
|
|
308
|
+ }
|
|
|
309
|
+ }
|
|
|
310
|
+ }
|
|
|
311
|
+ } else {
|
|
|
312
|
+ layer.msg(data.message);
|
|
|
313
|
+ }
|
|
|
314
|
+ }
|
|
|
315
|
+ });
|
|
|
316
|
+ }
|
|
|
317
|
+ //导出
|
|
|
318
|
+ $(".export").click(function () {
|
|
|
319
|
+ var url = huayi.config.callcenter_url + "Business/Distribution?token=" + $.cookie("token");
|
|
|
320
|
+ url += "&datetime=" + $("#startTime").val() + "&isdc=1";
|
|
|
321
|
+ window.location.href = url;
|
|
|
322
|
+ });
|
|
|
323
|
+ })
|
|
|
324
|
+ </script>
|
|
|
325
|
+ </body>
|
|
|
326
|
+
|
|
|
327
|
+</html>
|