Commit c80e2f2479f90bf7b58a0cba6087bbb4708f61ac

Authored by 王通
1 parent 00469210

1.烂班明细统计 增加直属公司所有分公司、烂般原因筛选条件

src/main/resources/static/pages/summary/destory_sch_detail/list.html
1 -<!DOCTYPE html>  
2 -<html lang="zh-cn">  
3 -  
4 -<head>  
5 - <meta charset="UTF-8">  
6 - <link rel="stylesheet" href="/assets/plugins/uk3.0/uikit.min.css"/>  
7 - <link rel="stylesheet" href="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.css" />  
8 - <!-- flatpickr -->  
9 - <link rel="stylesheet" href="/real_control_v2/assets/plugins/flatpickr/flatpickr.min.css">  
10 - <style>  
11 - html,body{  
12 - height: 100%;  
13 - }  
14 - .ct_page{  
15 - padding: 25px 15px;  
16 - height: 100%;  
17 - height: calc(100% - 50px);  
18 - }  
19 -  
20 - .ct_cont{  
21 - height: calc(100% - 35px);  
22 - }  
23 -  
24 - .ct_cont>div>div.uk-card{  
25 - height: 99%;  
26 - }  
27 -  
28 - .loading{  
29 - height: 100%;  
30 - text-align: center;  
31 - }  
32 - .loading .uk-spinner{  
33 - margin-top: 200px;  
34 - }  
35 - .loading circle{  
36 - stroke: red;  
37 - }  
38 -  
39 - .ps-container > .ps-scrollbar-x-rail, .ps-container > .ps-scrollbar-y-rail{  
40 - opacity: 0.6 !important;  
41 - padding: 0 !important;  
42 - }  
43 -  
44 - .ct_destroy_sch_table_width th:nth-of-type(1),.ct_destroy_sch_table_width td:nth-of-type(1){  
45 - width: 9%;  
46 - }  
47 - .ct_destroy_sch_table_width th:nth-of-type(2),.ct_destroy_sch_table_width td:nth-of-type(2){  
48 - width: 9%;  
49 - }  
50 - .ct_destroy_sch_table_width th:nth-of-type(3),.ct_destroy_sch_table_width td:nth-of-type(3){  
51 - width: 9%;  
52 - }  
53 - .ct_destroy_sch_table_width th:nth-of-type(4),.ct_destroy_sch_table_width td:nth-of-type(4){  
54 - width: 9%;  
55 - }  
56 - .ct_destroy_sch_table_width th:nth-of-type(5),.ct_destroy_sch_table_width td:nth-of-type(5){  
57 - width: 9%;  
58 - }  
59 - .ct_destroy_sch_table_width th:nth-of-type(6),.ct_destroy_sch_table_width td:nth-of-type(6){  
60 - width: 9%;  
61 - }  
62 - .ct_destroy_sch_table_width th:nth-of-type(7),.ct_destroy_sch_table_width td:nth-of-type(7){  
63 - width: 8%;  
64 - }  
65 - .ct_destroy_sch_table_width th:nth-of-type(8),.ct_destroy_sch_table_width td:nth-of-type(8){  
66 - width: 8%;  
67 - }  
68 - .ct_destroy_sch_table_width th:nth-of-type(9),.ct_destroy_sch_table_width td:nth-of-type(9){  
69 - width: 8%;  
70 - }  
71 - .ct_destroy_sch_table_width th:nth-of-type(10),.ct_destroy_sch_table_width td:nth-of-type(10){  
72 - }  
73 -  
74 - .ct_search_form_wrap{  
75 - border-bottom: 1px solid #e5e5e5;  
76 - padding: 10px 0 25px 10px;  
77 - }  
78 - .ct_search_form_wrap .ct_field{  
79 - display: inline-block;  
80 - margin: 0 5px;  
81 - }  
82 -  
83 - .ct_search_form_wrap .ct_field label{  
84 - font-size: 14px;  
85 - }  
86 -  
87 - .ct_search_form_wrap .ct_field input{  
88 - width: 110px;  
89 - }  
90 -  
91 - .ct_search_form_wrap .ct_field select{  
92 - width: auto;  
93 - min-width: 100px;  
94 - }  
95 -  
96 - .ct_search_form_wrap .uk-button{  
97 - padding: 0 14px;  
98 - }  
99 -  
100 - .ct_search_form_wrap .uk-button i{  
101 - vertical-align: middle;  
102 - margin-top: -2px;  
103 - margin-right: 7px;  
104 - }  
105 -  
106 - .ct_table_wrap{  
107 - font-size: 14px;  
108 - height: calc(100% - 77px);  
109 - }  
110 -  
111 - .t_body_wrap{  
112 - height: calc(100% - 41px);  
113 - overflow: auto;  
114 - position: relative;  
115 - }  
116 -  
117 - .ct_field.ct_field_bottom{  
118 - vertical-align: bottom;  
119 - font-size: 12px;  
120 - margin-left: 0;  
121 - }  
122 - </style>  
123 -</head>  
124 -  
125 -<body>  
126 -<div class="loading">  
127 - <div uk-spinner></div>  
128 -</div>  
129 -<div class="ct_page" style="display: none;">  
130 - <h3 class="uk-heading-line uk-heading-bullet"><span style="color: #ff5353;">烂班明细统计</span></h3>  
131 - <div class="ct_cont" >  
132 - <div class="ct_search_form_wrap">  
133 - <form>  
134 - <div class="ct_field">  
135 - <label>公司:  
136 - <select class="uk-select" name="gsBm_eq">  
137 - </select>  
138 - </label>  
139 - </div>  
140 - <div class="ct_field">  
141 - <label>分公司:  
142 - <select class="uk-select" name="fgsBm_eq">  
143 - </select>  
144 - </label>  
145 - </div>  
146 - <div class="ct_field">  
147 - <label>线路:  
148 - <select class="uk-select" name="lineCode_eq">  
149 - </select>  
150 - </label>  
151 - </div>  
152 - <div class="ct_field">  
153 - <label>日期:  
154 - <input class="uk-input" name="rq" style="width: 220px;">  
155 - </label>  
156 - </div>  
157 - <div class="ct_field">  
158 - <button class="uk-button uk-button-primary search"><i uk-icon="icon: search"></i>搜索</button>  
159 - </div>  
160 - <div class="ct_field ct_field_bottom">  
161 - <button class="uk-button uk-button-text export_excel" style="padding: 0 5px;">导出数据</button>  
162 - </div>  
163 - <div class="ct_field ct_field_bottom">  
164 - <span uk-icon="icon: question" title="不统计进出场和2点间空驶" uk-tooltip="pos: bottom"></span>  
165 - </div>  
166 - </form>  
167 - </div>  
168 - <div class="ct_table_wrap day">  
169 - <table class="uk-table uk-table-small ct_destroy_sch_table_width" style="margin-bottom: 0;">  
170 - <thead>  
171 - <tr>  
172 - <th>日期</th>  
173 - <th>线路</th>  
174 - <th>车号</th>  
175 - <th>司机</th>  
176 - <th>售票员</th>  
177 - <th>原因</th>  
178 - <th>班次</th>  
179 - <th>烂班公里</th>  
180 - <th>烂班时间</th>  
181 - <th>备注</th>  
182 - </tr>  
183 - </thead>  
184 - </table>  
185 - <div class="t_body_wrap">  
186 - <table class="uk-table uk-table-divider uk-table-hover uk-table-small ct_destroy_sch_table ct_destroy_sch_table_width">  
187 - <tbody>  
188 - </tbody>  
189 - </table>  
190 - </div>  
191 - </div>  
192 - </div>  
193 -</div>  
194 -  
195 -<script id="destroy_sch_list_temp" type="text/html">  
196 - {{each list as obj i}}  
197 - <tr>  
198 - <td>{{obj.rq}}</td>  
199 - <td>{{obj.lineName}}</td>  
200 - <td>{{obj.nbbm}}</td>  
201 - <td>{{obj.jGh}}</td>  
202 - <td>{{obj.sGh}}</td>  
203 - <td>{{obj.reason}}</td>  
204 - <td><a style="text-decoration: underline;">{{obj.size}}</a></td>  
205 - <td>{{obj.mileage}}</td>  
206 - <td>{{obj.timeStr}}</td>  
207 - <td>{{obj.remark}}</td>  
208 - </tr>  
209 - {{/each}}  
210 -</script>  
211 -  
212 -<script src="/metronic_v4.5.4/plugins/jquery.min.js"></script>  
213 -<script src="/assets/plugins/uk3.0/uikit.min.js"></script>  
214 -<script src="/assets/plugins/uk3.0/uikit-icons.min.js"></script>  
215 -<script src="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.jquery.js" ></script>  
216 -<!-- EventProxy -->  
217 -<script src="/assets/js/eventproxy.js"></script>  
218 -<!-- art-template 模版引擎 -->  
219 -<script src="/assets/plugins/template.js"></script>  
220 -<script src="/real_control_v2/assets/plugins/moment/moment.min.js"></script>  
221 -<!-- jquery.serializejson JSON序列化插件 -->  
222 -<script src="/assets/plugins/jquery.serializejson.js" merge="plugins"></script>  
223 -<!-- flatpickr -->  
224 -<script src="/real_control_v2/assets/plugins/flatpickr/flatpickr.min.js" ></script>  
225 -<script src="/real_control_v2/assets/plugins/flatpickr/l10n/zh.js" ></script>  
226 -<script>  
227 -  
228 - var f = $('form', '');  
229 - //var page=0, pageSize=120;  
230 -  
231 - var ep = EventProxy.create('query_comps', 'query_lines', function () {  
232 - $('[name=gsBm_eq]', f).trigger('change');//公司change  
233 - query();  
234 -  
235 - $('.loading').remove();  
236 - $('.ct_page').show();  
237 - });  
238 -  
239 - //点击搜索  
240 - $('button.search', f).on('click', query);  
241 -  
242 - function query() {  
243 - $('button.search', f).attr('disabled', 'disabled');  
244 - var data = f.serializeJSON();  
245 - $('.ct_destroy_sch_table tbody').html('');  
246 - //开始结束时间  
247 - data.rq_ge = data.rq.substr(0, 10);  
248 - data.rq_le = data.rq.substr(13);  
249 - //data.order='t';  
250 - delete data.rq;  
251 -  
252 - $.get('/summary/destroy_detail/all', data, function (rs) {  
253 - $('button.search', f).removeAttr('disabled');  
254 - if(!rs || rs.length==0)  
255 - return UIkit.notification('没有搜索到相关数据!!', 'danger');  
256 - $.each(rs, function () {  
257 - this.timeStr=moment(this.t).format('HH:mm')  
258 - });  
259 -  
260 - var htmlStr = template('destroy_sch_list_temp', {list: rs});  
261 - $('.ct_destroy_sch_table tbody').html(htmlStr);  
262 - $('.t_body_wrap').perfectScrollbar('update');  
263 - });  
264 - }  
265 -  
266 -  
267 - //日期选择框  
268 - var fs='YYYY-MM-DD'  
269 - , ets=moment().subtract(1, 'days').format(fs)  
270 - , sts=moment().subtract(3, 'days').format(fs);  
271 - flatpickr('.ct_search_form_wrap [name=rq]', {  
272 - mode: "range", dateFormat: "Y-m-d","locale": "zh", defaultDate: [sts, ets]  
273 - });  
274 - var comps;  
275 - //构建公司级联下拉框  
276 - $.get('/user/companyData', function (rs) {  
277 - comps = rs;  
278 - var opts = '';  
279 - for(var i=0,obj;obj=comps[i++];){  
280 - opts += '<option value="'+obj.companyCode+'">'+obj.companyName+'</option>';  
281 - }  
282 - $('[name=gsBm_eq]', f).html(opts);  
283 - ep.emit('query_comps');  
284 - });  
285 -  
286 - var lineMapps;  
287 - //加载线路信息  
288 - $.get('/line/all', {'destroy_eq': 0}, function (rs) {  
289 - rs.sort(function (a, b) {  
290 - return a.name.localeCompare(b.name);  
291 - });  
292 - lineMapps={};  
293 - var k;  
294 - $.each(rs, function () {  
295 - k = this.company+'_'+this.brancheCompany;  
296 - if(!lineMapps[k])  
297 - lineMapps[k]=[];  
298 - lineMapps[k].push(this);  
299 - });  
300 -  
301 - ep.emit('query_lines');  
302 - });  
303 -  
304 - $('[name=gsBm_eq]', f).on('change', function () {  
305 - var code = $(this).val(), subs=[];  
306 - $.each(comps, function () {  
307 - if(this.companyCode==code)  
308 - subs=this.children;  
309 - });  
310 -  
311 - var opts='';  
312 - $.each(subs, function () {  
313 - opts += '<option value="'+this.code+'">'+this.name+'</option>';  
314 - });  
315 - $('[name=fgsBm_eq]', f).html(opts).trigger('change');  
316 - });  
317 -  
318 - $('[name=fgsBm_eq]', f).on('change', function () {  
319 - var k = $('[name=gsBm_eq]', f).val() + '_' + $(this).val();  
320 - var array = lineMapps[k];  
321 - var opts = '<option value="">全部</option>';  
322 - if(array){  
323 - $.each(array, function () {  
324 - opts += '<option value="'+this.lineCode+'">'+this.name+'</option>';  
325 - });  
326 - }  
327 - $('[name=lineCode_eq]', f).html(opts);  
328 - });  
329 -  
330 - //  
331 - //滚动条  
332 - $('.t_body_wrap').perfectScrollbar({suppressScrollX: true});  
333 -  
334 - $(document).on('submit', 'form', function () {  
335 - return false;  
336 - });  
337 -  
338 - /**  
339 - * 导出  
340 - */  
341 - $('.export_excel').on('click', function () {  
342 - var data = f.serializeJSON();  
343 - data.rq_ge = data.rq.substr(0, 10);  
344 - data.rq_le = data.rq.substr(13);  
345 - data.order='t';  
346 - delete data.rq;  
347 -  
348 - window.open('/summary/destroy_detail/excel?' + $.param(data));  
349 - });  
350 -  
351 -</script>  
352 -</body> 1 +<!DOCTYPE html>
  2 +<html lang="zh-cn">
  3 +
  4 +<head>
  5 + <meta charset="UTF-8">
  6 + <link rel="stylesheet" href="/assets/plugins/uk3.0/uikit.min.css"/>
  7 + <link rel="stylesheet" href="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.css" />
  8 + <!-- flatpickr -->
  9 + <link rel="stylesheet" href="/real_control_v2/assets/plugins/flatpickr/flatpickr.min.css">
  10 + <style>
  11 + html,body{
  12 + height: 100%;
  13 + }
  14 + .ct_page{
  15 + padding: 25px 15px;
  16 + height: 100%;
  17 + height: calc(100% - 50px);
  18 + }
  19 +
  20 + .ct_cont{
  21 + height: calc(100% - 35px);
  22 + }
  23 +
  24 + .ct_cont>div>div.uk-card{
  25 + height: 99%;
  26 + }
  27 +
  28 + .loading{
  29 + height: 100%;
  30 + text-align: center;
  31 + }
  32 + .loading .uk-spinner{
  33 + margin-top: 200px;
  34 + }
  35 + .loading circle{
  36 + stroke: red;
  37 + }
  38 +
  39 + .ps-container > .ps-scrollbar-x-rail, .ps-container > .ps-scrollbar-y-rail{
  40 + opacity: 0.6 !important;
  41 + padding: 0 !important;
  42 + }
  43 +
  44 + .ct_destroy_sch_table_width th:nth-of-type(1),.ct_destroy_sch_table_width td:nth-of-type(1){
  45 + width: 9%;
  46 + }
  47 + .ct_destroy_sch_table_width th:nth-of-type(2),.ct_destroy_sch_table_width td:nth-of-type(2){
  48 + width: 9%;
  49 + }
  50 + .ct_destroy_sch_table_width th:nth-of-type(3),.ct_destroy_sch_table_width td:nth-of-type(3){
  51 + width: 9%;
  52 + }
  53 + .ct_destroy_sch_table_width th:nth-of-type(4),.ct_destroy_sch_table_width td:nth-of-type(4){
  54 + width: 9%;
  55 + }
  56 + .ct_destroy_sch_table_width th:nth-of-type(5),.ct_destroy_sch_table_width td:nth-of-type(5){
  57 + width: 9%;
  58 + }
  59 + .ct_destroy_sch_table_width th:nth-of-type(6),.ct_destroy_sch_table_width td:nth-of-type(6){
  60 + width: 9%;
  61 + }
  62 + .ct_destroy_sch_table_width th:nth-of-type(7),.ct_destroy_sch_table_width td:nth-of-type(7){
  63 + width: 8%;
  64 + }
  65 + .ct_destroy_sch_table_width th:nth-of-type(8),.ct_destroy_sch_table_width td:nth-of-type(8){
  66 + width: 8%;
  67 + }
  68 + .ct_destroy_sch_table_width th:nth-of-type(9),.ct_destroy_sch_table_width td:nth-of-type(9){
  69 + width: 8%;
  70 + }
  71 + .ct_destroy_sch_table_width th:nth-of-type(10),.ct_destroy_sch_table_width td:nth-of-type(10){
  72 + }
  73 +
  74 + .ct_search_form_wrap{
  75 + border-bottom: 1px solid #e5e5e5;
  76 + padding: 10px 0 25px 10px;
  77 + }
  78 + .ct_search_form_wrap .ct_field{
  79 + display: inline-block;
  80 + margin: 0 5px;
  81 + }
  82 +
  83 + .ct_search_form_wrap .ct_field label{
  84 + font-size: 14px;
  85 + }
  86 +
  87 + .ct_search_form_wrap .ct_field input{
  88 + width: 110px;
  89 + }
  90 +
  91 + .ct_search_form_wrap .ct_field select{
  92 + width: auto;
  93 + min-width: 100px;
  94 + }
  95 +
  96 + .ct_search_form_wrap .uk-button{
  97 + padding: 0 14px;
  98 + }
  99 +
  100 + .ct_search_form_wrap .uk-button i{
  101 + vertical-align: middle;
  102 + margin-top: -2px;
  103 + margin-right: 7px;
  104 + }
  105 +
  106 + .ct_table_wrap{
  107 + font-size: 14px;
  108 + height: calc(100% - 77px);
  109 + }
  110 +
  111 + .t_body_wrap{
  112 + height: calc(100% - 41px);
  113 + overflow: auto;
  114 + position: relative;
  115 + }
  116 +
  117 + .ct_field.ct_field_bottom{
  118 + vertical-align: bottom;
  119 + font-size: 12px;
  120 + margin-left: 0;
  121 + }
  122 + </style>
  123 +</head>
  124 +
  125 +<body>
  126 +<div class="loading">
  127 + <div uk-spinner></div>
  128 +</div>
  129 +<div class="ct_page" style="display: none;">
  130 + <h3 class="uk-heading-line uk-heading-bullet"><span style="color: #ff5353;">烂班明细统计</span></h3>
  131 + <div class="ct_cont" >
  132 + <div class="ct_search_form_wrap">
  133 + <form>
  134 + <div class="ct_field">
  135 + <label>公司:
  136 + <select class="uk-select" name="gsBm_eq">
  137 + </select>
  138 + </label>
  139 + </div>
  140 + <div class="ct_field">
  141 + <label>分公司:
  142 + <select class="uk-select" name="fgsBm_eq">
  143 + </select>
  144 + </label>
  145 + </div>
  146 + <div class="ct_field">
  147 + <label>线路:
  148 + <select class="uk-select" name="lineCode_eq">
  149 + </select>
  150 + </label>
  151 + </div>
  152 + <div class="ct_field">
  153 + <label>原因:
  154 + <select class="uk-select" name="reason_eq">
  155 + <option value="">全部</option>
  156 + <option value="配车">配车</option>
  157 + <option value="保养">保养</option>
  158 + <option value="故障">故障</option>
  159 + <option value="肇事">肇事</option>
  160 + <option value="路阻">路阻</option>
  161 + <option value="纠纷">纠纷</option>
  162 + <option value="缺人">缺人</option>
  163 + <option value="客稀">客稀</option>
  164 + <option value="缺车">缺车</option>
  165 + <option value="气候">气候</option>
  166 + <option value="援外">援外</option>
  167 + <option value="吊慢">吊慢</option>
  168 + <option value="抽减">抽减</option>
  169 + <option value="其他">其他</option>
  170 + </select>
  171 + </label>
  172 + </div>
  173 + <div class="ct_field">
  174 + <label>日期:
  175 + <input class="uk-input" name="rq" style="width: 220px;">
  176 + </label>
  177 + </div>
  178 + <div class="ct_field">
  179 + <button class="uk-button uk-button-primary search"><i uk-icon="icon: search"></i>搜索</button>
  180 + </div>
  181 + <div class="ct_field ct_field_bottom">
  182 + <button class="uk-button uk-button-text export_excel" style="padding: 0 5px;">导出数据</button>
  183 + </div>
  184 + <div class="ct_field ct_field_bottom">
  185 + <span uk-icon="icon: question" title="不统计进出场和2点间空驶" uk-tooltip="pos: bottom"></span>
  186 + </div>
  187 + </form>
  188 + </div>
  189 + <div class="ct_table_wrap day">
  190 + <table class="uk-table uk-table-small ct_destroy_sch_table_width" style="margin-bottom: 0;">
  191 + <thead>
  192 + <tr>
  193 + <th>日期</th>
  194 + <th>线路</th>
  195 + <th>车号</th>
  196 + <th>司机</th>
  197 + <th>售票员</th>
  198 + <th>原因</th>
  199 + <th>班次</th>
  200 + <th>烂班公里</th>
  201 + <th>烂班时间</th>
  202 + <th>备注</th>
  203 + </tr>
  204 + </thead>
  205 + </table>
  206 + <div class="t_body_wrap">
  207 + <table class="uk-table uk-table-divider uk-table-hover uk-table-small ct_destroy_sch_table ct_destroy_sch_table_width">
  208 + <tbody>
  209 + </tbody>
  210 + </table>
  211 + </div>
  212 + </div>
  213 + </div>
  214 +</div>
  215 +
  216 +<script id="destroy_sch_list_temp" type="text/html">
  217 + {{each list as obj i}}
  218 + <tr>
  219 + <td>{{obj.rq}}</td>
  220 + <td>{{obj.lineName}}</td>
  221 + <td>{{obj.nbbm}}</td>
  222 + <td>{{obj.jGh}}</td>
  223 + <td>{{obj.sGh}}</td>
  224 + <td>{{obj.reason}}</td>
  225 + <td><a style="text-decoration: underline;">{{obj.size}}</a></td>
  226 + <td>{{obj.mileage}}</td>
  227 + <td>{{obj.timeStr}}</td>
  228 + <td>{{obj.remark}}</td>
  229 + </tr>
  230 + {{/each}}
  231 +</script>
  232 +
  233 +<script src="/metronic_v4.5.4/plugins/jquery.min.js"></script>
  234 +<script src="/assets/plugins/uk3.0/uikit.min.js"></script>
  235 +<script src="/assets/plugins/uk3.0/uikit-icons.min.js"></script>
  236 +<script src="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.jquery.js" ></script>
  237 +<!-- EventProxy -->
  238 +<script src="/assets/js/eventproxy.js"></script>
  239 +<!-- art-template 模版引擎 -->
  240 +<script src="/assets/plugins/template.js"></script>
  241 +<script src="/real_control_v2/assets/plugins/moment/moment.min.js"></script>
  242 +<!-- jquery.serializejson JSON序列化插件 -->
  243 +<script src="/assets/plugins/jquery.serializejson.js" merge="plugins"></script>
  244 +<!-- flatpickr -->
  245 +<script src="/real_control_v2/assets/plugins/flatpickr/flatpickr.min.js" ></script>
  246 +<script src="/real_control_v2/assets/plugins/flatpickr/l10n/zh.js" ></script>
  247 +<script>
  248 +
  249 + var f = $('form', '');
  250 + //var page=0, pageSize=120;
  251 +
  252 + var ep = EventProxy.create('query_comps', 'query_lines', function () {
  253 + $('[name=gsBm_eq]', f).trigger('change');//公司change
  254 + query();
  255 +
  256 + $('.loading').remove();
  257 + $('.ct_page').show();
  258 + });
  259 +
  260 + //点击搜索
  261 + $('button.search', f).on('click', query);
  262 +
  263 + function query() {
  264 + $('button.search', f).attr('disabled', 'disabled');
  265 + var data = f.serializeJSON();
  266 + $('.ct_destroy_sch_table tbody').html('');
  267 + //开始结束时间
  268 + data.rq_ge = data.rq.substr(0, 10);
  269 + data.rq_le = data.rq.substr(13);
  270 + //data.order='t';
  271 + delete data.rq;
  272 +
  273 + $.get('/summary/destroy_detail/all', data, function (rs) {
  274 + $('button.search', f).removeAttr('disabled');
  275 + if(!rs || rs.length==0)
  276 + return UIkit.notification('没有搜索到相关数据!!', 'danger');
  277 + $.each(rs, function () {
  278 + this.timeStr=moment(this.t).format('HH:mm')
  279 + });
  280 +
  281 + var htmlStr = template('destroy_sch_list_temp', {list: rs});
  282 + $('.ct_destroy_sch_table tbody').html(htmlStr);
  283 + $('.t_body_wrap').perfectScrollbar('update');
  284 + });
  285 + }
  286 +
  287 +
  288 + //日期选择框
  289 + var fs='YYYY-MM-DD'
  290 + , ets=moment().subtract(1, 'days').format(fs)
  291 + , sts=moment().subtract(3, 'days').format(fs);
  292 + flatpickr('.ct_search_form_wrap [name=rq]', {
  293 + mode: "range", dateFormat: "Y-m-d","locale": "zh", defaultDate: [sts, ets]
  294 + });
  295 + var comps;
  296 + //构建公司级联下拉框
  297 + $.get('/user/companyData', function (rs) {
  298 + comps = rs;
  299 + var opts = '';
  300 + for(var i=0,obj;obj=comps[i++];){
  301 + opts += '<option value="'+obj.companyCode+'">'+obj.companyName+'</option>';
  302 + }
  303 + $('[name=gsBm_eq]', f).html(opts);
  304 + ep.emit('query_comps');
  305 + });
  306 +
  307 + var lineMapps;
  308 + //加载线路信息
  309 + $.get('/line/all', {'destroy_eq': 0}, function (rs) {
  310 + rs.sort(function (a, b) {
  311 + return a.name.localeCompare(b.name);
  312 + });
  313 + lineMapps={};
  314 + var k;
  315 + $.each(rs, function () {
  316 + k = this.company+'_'+this.brancheCompany;
  317 + if(!lineMapps[k])
  318 + lineMapps[k]=[];
  319 + lineMapps[k].push(this);
  320 + });
  321 +
  322 + ep.emit('query_lines');
  323 + });
  324 +
  325 + $('[name=gsBm_eq]', f).on('change', function () {
  326 + var code = $(this).val(), subs=[];
  327 + $.each(comps, function () {
  328 + if(this.companyCode==code)
  329 + subs=this.children;
  330 + });
  331 +
  332 + var opts='<option value="">全部</option>';
  333 + $.each(subs, function () {
  334 + opts += '<option value="'+this.code+'">'+this.name+'</option>';
  335 + });
  336 + $('[name=fgsBm_eq]', f).html(opts).trigger('change');
  337 + });
  338 +
  339 + $('[name=fgsBm_eq]', f).on('change', function () {
  340 + var k = $('[name=gsBm_eq]', f).val() + '_' + $(this).val();
  341 + var array = lineMapps[k];
  342 + var opts = '<option value="">全部</option>';
  343 + if(array){
  344 + $.each(array, function () {
  345 + opts += '<option value="'+this.lineCode+'">'+this.name+'</option>';
  346 + });
  347 + }
  348 + $('[name=lineCode_eq]', f).html(opts);
  349 + });
  350 +
  351 + //
  352 + //滚动条
  353 + $('.t_body_wrap').perfectScrollbar({suppressScrollX: true});
  354 +
  355 + $(document).on('submit', 'form', function () {
  356 + return false;
  357 + });
  358 +
  359 + /**
  360 + * 导出
  361 + */
  362 + $('.export_excel').on('click', function () {
  363 + var data = f.serializeJSON();
  364 + data.rq_ge = data.rq.substr(0, 10);
  365 + data.rq_le = data.rq.substr(13);
  366 + data.order='t';
  367 + delete data.rq;
  368 +
  369 + window.open('/summary/destroy_detail/excel?' + $.param(data));
  370 + });
  371 +
  372 +</script>
  373 +</body>
353 </html> 374 </html>
354 \ No newline at end of file 375 \ No newline at end of file