Commit 485f89c576c910707e7b5535b6c56b0f8443c43f

Authored by 王通
1 parent 23e19fb6

1.发车信息微调修正时间显示错误

src/main/resources/static/real_control_v2/fragments/north/nav/sch_edit_info/list.html
1   -<div class="uk-modal ct_move_modal" id="history-sch-edit-info-modal">
2   - <div class="uk-modal-dialog" style="width: 1280px;">
3   - <a href="" class="uk-modal-close uk-close"></a>
4   - <div class="uk-modal-header">
5   - <h2>班次修正日志</h2>
6   - </div>
7   -
8   - <div style="padding-left: 12px;margin: 20px 0">
9   - <ul class="uk-subnav uk-subnav-pill h-s-time">
10   - </ul>
11   - </div>
12   -
13   - <div style="padding-left: 12px;">
14   - <ul class="uk-subnav uk-subnav-pill h-s-line">
15   - </ul>
16   - </div>
17   -
18   - <div class="uk-panel uk-panel-box uk-panel-box-primary">
19   - <form class="uk-form search-form">
20   - <fieldset data-uk-margin>
21   - <span class="horizontal-field">路牌</span>
22   - <select name="lpName" style="width: 80px;"></select>
23   - <span class="horizontal-field">上下行</span>
24   - <select name="xlDir">
25   - <option value="">全部</option>
26   - <option value="0">上行</option>
27   - <option value="1">下行</option>
28   - </select>
29   - &nbsp;
30   - <span class="horizontal-field">车辆</span>
31   - <div class="uk-autocomplete uk-form autocomplete-cars">
32   - <input type="text" name="clZbh" placeholder="车辆自编号">
33   - </div>
34   - <span class="horizontal-field">驾驶员</span>
35   - <div class="uk-autocomplete uk-form autocomplete-jsy">
36   - <input type="text" name="jGh" placeholder="驾驶员">
37   - </div>
38   - &nbsp;
39   - <span class="horizontal-field">修正类型</span>
40   - <select name="type">
41   - <option value="">全部</option>
42   - <option value="DFTZ">待发调整</option>
43   - <option value="SFTZ">实发调整</option>
44   - <option value="FCXXWT">发车信息微调</option>
45   - <option value="TZRC">调整人车</option>
46   - <option value="JHLB">计划烂班</option>
47   - <option value="CXLB">撤销烂班</option>
48   - <option value="CXSF">撤销实发</option>
49   - <option value="CXZX">撤销执行</option>
50   - <option value="LPDD">路牌对调</option>
51   - <option value="ZRW">添加子任务</option>
52   - <option value="LSBCTZ">历史班次调整</option>
53   - </select>
54   - <button class="uk-button">检索</button>
55   -
56   - <label style="float: right;font-size: 12px;color: #989797;">
57   - <input type="checkbox" disabled> 显示系统修正日志
58   - </label>
59   - </fieldset>
60   - </form>
61   - </div>
62   -
63   - <div class="ct_table_wrap ct_table_no_border edit-info-table-wrap" style="height: 510px;">
64   - <div class="ct_table sch-edit-info-table">
65   - <div class="ct_table_head">
66   - <dl>
67   - <dt>序号</dt>
68   - <dt>路牌</dt>
69   - <dt>车辆</dt>
70   - <dt>驾驶员</dt>
71   - <dt>计发</dt>
72   - <dt>修正记录</dt>
73   - </dl>
74   - </div>
75   - <div class="ct_table_body">
76   - </div>
77   - </div>
78   - </div>
79   -
80   - <div class="load-panel">
81   - <i class="uk-icon-spinner uk-icon-spin"></i>
82   - 正在加载数据
83   - </div>
84   - </div>
85   -
86   - <script id="history-sch-edit-info-temp" type="text/html">
87   - {{each list as obj i}}
88   - <dl>
89   - <dd>{{i + 1}}</dd>
90   - <dd>{{obj.lpName}}</dd>
91   - <dd>{{obj.clZbh}}</dd>
92   - <dd>{{obj.jGh}}/{{obj.jName}}</dd>
93   - <dd>{{obj.fcsj}}</dd>
94   - <dd>
95   - {{each obj.editArray as e j}}
96   - <div class="ct-badge ct-badge-{{e.type}}" data-id="{{e.id}}">
97   - {{e.timeStr}}{{e.typeStr}}
98   - </div>
99   - {{/each}}
100   - </dd>
101   - </dl>
102   - {{/each}}
103   - </script>
104   -
105   - <!-- 待发调整 tip -->
106   - <script id="edit-info-tip-dftz-temp" type="text/html">
107   - <div class="edit-info-tip">
108   - <p class="text">待发时间从 {{jsonArray.old}} 调整为 {{jsonArray.now}}</p>
109   - <p class="sub_text">调整人:{{user}} 调整时间:{{timeStr}}</p>
110   - {{if remarks!=null && remarks != ''}}
111   - <p class="sub_text">备注:{{remarks}}</p>
112   - {{/if}}
113   - </div>
114   - </script>
115   -
116   - <!-- 实发调整 -->
117   - <script id="edit-info-tip-sftz-temp" type="text/html">
118   - <div class="edit-info-tip">
119   - <p class="text">实发时间由 {{jsonArray.old==null?'无':jsonArray.old}} 调整为 {{jsonArray.now}}</p>
120   - <p class="sub_text">调整人:{{user}} 调整时间:{{timeStr}}</p>
121   - {{if remarks!=null && remarks != ''}}
122   - <p class="sub_text">备注:{{remarks}}</p>
123   - {{/if}}
124   - </div>
125   - </script>
126   -
127   -
128   - <!-- 发车信息微调 tip -->
129   - <script id="edit-info-tip-fcxxwt-temp" type="text/html">
130   - <div class="edit-info-tip">
131   - {{each jsonArray as obj i}}
132   - <p class="text">{{obj.title}} 由 {{obj.old==null?'无':obj.old}} 调整为 {{obj.now}}</p>
133   - {{/each}}
134   - <p class="sub_text">调整人:{{user}} 调整时间:{{timeStr}}</p>
135   - {{if remarks!=null && remarks != ''}}
136   - <p class="sub_text">备注:{{remarks}}</p>
137   - {{/if}}
138   - </div>
139   - </script>
140   -
141   - <!-- 历史班次调整 tip -->
142   - <script id="edit-info-tip-lsbctz-temp" type="text/html">
143   - <div class="edit-info-tip">
144   - {{each jsonArray as obj i}}
145   - <p class="text">{{obj.title}} 由 {{obj.old==null?'无':obj.old}} 调整为 {{obj.now}}</p>
146   - {{/each}}
147   - <p class="sub_text">调整人:{{user}} 调整时间:{{ts_str}}</p>
148   - {{if remarks!=null && remarks != ''}}
149   - <p class="sub_text">备注:{{remarks}}</p>
150   - {{/if}}
151   - </div>
152   - </script>
153   -
154   - <!-- 撤销实发tip -->
155   - <script id="edit-info-tip-cxsf-temp" type="text/html">
156   - <div class="edit-info-tip">
157   - <p class="text">将实发时间 {{jsonArray.old_sfsj}} 撤销</p>
158   - <p class="sub_text">调整人:{{user}} 调整时间:{{timeStr}}</p>
159   - {{if remarks!=null && remarks != ''}}
160   - <p class="sub_text">备注:{{remarks}}</p>
161   - {{/if}}
162   - </div>
163   - </script>
164   -
165   - <!-- 撤销执行 -->
166   - <script id="edit-info-tip-cxzx-temp" type="text/html">
167   - <div class="edit-info-tip">
168   - {{if jsonArray.old_sfsj != null}}
169   - <p class="text">将实发时间 {{jsonArray.old_sfsj}} 撤销</p>
170   - {{/if}}
171   - {{if jsonArray.old_sdsj != null}}
172   - <p class="text">将实达时间 {{jsonArray.old_sdsj}} 撤销</p>
173   - {{/if}}
174   - <p class="sub_text">调整人:{{user}} 调整时间:{{timeStr}}</p>
175   - {{if remarks!=null && remarks != ''}}
176   - <p class="sub_text">备注:{{remarks}}</p>
177   - {{/if}}
178   - </div>
179   - </script>
180   -
181   - <!-- 调整人车 -->
182   - <script id="edit-info-tip-tzrc-temp" type="text/html">
183   - <div class="edit-info-tip">
184   - {{if jsonArray.now_jsy != null}}
185   - <p class="text">驾驶员从 {{jsonArray.old_jsy}} 调整为 {{jsonArray.now_jsy}}</p>
186   - {{/if}}
187   - {{if jsonArray.now_nbbm != null}}
188   - <p class="text">车辆从 {{jsonArray.old_nbbm}} 调整为 {{jsonArray.now_nbbm}}</p>
189   - {{/if}}
190   - {{if jsonArray.now_spy != null}}
191   - <p class="text">售票员从 {{jsonArray.old_spy}} 调整为 {{jsonArray.now_spy}}</p>
192   - {{/if}}
193   -
194   - <p class="sub_text">调整人:{{user}} 调整时间:{{timeStr}}</p>
195   - {{if remarks!=null && remarks != ''}}
196   - <p class="sub_text">备注:{{remarks}}</p>
197   - {{/if}}
198   - </div>
199   - </script>
200   -
201   - <script>
202   - (function () {
203   - var modal = '#history-sch-edit-info-modal';
204   - var etInfos={};//id映射
205   -
206   - //滚动条
207   - $('.edit-info-table-wrap', modal).perfectScrollbar({suppressScrollX: true});
208   -
209   - $(modal).on('init', function (e, data) {
210   - e.stopPropagation();
211   - $.get('/realSchedule/dateArray?c=1', function (rs) {
212   - //日期tab
213   - var tsStr = '';
214   - $.each(rs, function (i) {
215   - tsStr += '<li ' + (i == 0 ? 'class="uk-active"' : '') + '><a>' + this + '</a></li>';
216   - });
217   - $('.h-s-time', modal).html(tsStr);
218   -
219   - //线路tab
220   - var xlStr = '';
221   - $.each(gb_data_basic.activeLines, function (i) {
222   - xlStr += '<li ' + (i == 0 ? 'class="uk-active"' : '') + ' data-id="' + this.lineCode + '"><a>' + this.name + '</a></li>';
223   - });
224   - $('.h-s-line', modal).html(xlStr);
225   -
226   - clearLpSelect();
227   - //reLoadLp=true;
228   - jsQuery();
229   - });
230   - });
231   -
232   - $(modal).on('refresh', jsQuery);
233   -
234   - $(modal).on('click', '.h-s-time li,.h-s-line li', function () {
235   - if(loading)
236   - return;
237   - $(this).parent().find('li.uk-active').removeClass('uk-active');
238   - $(this).addClass('uk-active');
239   - clearLpSelect();
240   - //检索之前将滚动条置顶
241   - $('.edit-info-table-wrap', modal)[0].scrollTop = 0;
242   - jsQuery();
243   - });
244   -
245   - $('.search-form', modal).on('submit', function (e) {
246   - try {
247   - //检索之前将滚动条置顶
248   - $('.edit-info-table-wrap', modal)[0].scrollTop = 0;
249   - jsQuery();
250   - }catch(e){
251   - console.log(e);
252   - }
253   - return false;
254   - });
255   -
256   - var reLoadLp;
257   - var nbbmArray,jsyArray,lpArray,loading;
258   - function jsQuery() {
259   - var data = $('.search-form', modal).serializeJSON();
260   - var rq = $('.h-s-time li.uk-active', modal).text(),
261   - lineCode = $('.h-s-line li.uk-active', modal).data('id');
262   - data.rq = rq;
263   - data.lineCode = lineCode;
264   - if(data.jGh.indexOf('/')!=-1){
265   - var jsy=data.jGh.split('/');
266   - data.jGh=jsy[0];
267   - data.jName=jsy[1];
268   - }
269   -
270   - $('.load-panel', modal).show();
271   - loading=true;
272   - gb_common.$get('/schEditInfo/_list', data, function (rs) {
273   - etInfos = {};
274   - nbbmArray=[];
275   - jsyArray=[];
276   - lpArray = [];
277   - $.each(rs.list, function () {
278   - this.jsonArray = JSON.parse(this.jsonArray);
279   - etInfos[this.id] = this;
280   - this['ts_str'] = moment(this.ts).format('YYYY-MM-DD HH:mm');
281   -
282   - nbbmArray.push({value: this.clZbh});
283   - jsyArray.push({value: this.jGh+'/'+this.jName,
284   - fullChars: pinyin.getFullChars(this.jName).toUpperCase(),
285   - camelChars: pinyin.getCamelChars(this.jName)});
286   - lpArray.push({value: this.lpName});
287   - });
288   - //根据班次ID合并修正操作
289   - var list = mergeData(rs.list).sort(sortFun);
290   - var htmlStr = template('history-sch-edit-info-temp', {list: list});
291   - $('.sch-edit-info-table .ct_table_body', modal).html(htmlStr);
292   - $('.load-panel', modal).hide();
293   - loading=false;
294   -
295   - //value
296   - nbbmArray=distinctByField(nbbmArray);
297   - jsyArray=distinctByField(jsyArray);
298   - lpArray=distinctByField(lpArray);
299   - if(reLoadLp){
300   - //路牌下拉框
301   - var ops = '<option value="">全部</option>';
302   - $.each(lpArray, function () {
303   - ops += '<option value="'+this.value+'">'+this.value+'</option>';
304   - });
305   - $('[name=lpName]', modal).html(ops);
306   - reLoadLp = false;
307   - }
308   -
309   - //更新滚动条高度
310   - $('.edit-info-table-wrap', modal).perfectScrollbar('update');
311   - });
312   - }
313   -
314   - function clearLpSelect() {
315   - $('[name=lpName_eq]', modal).val('').html('');
316   - reLoadLp = true;
317   - }
318   -
319   - //nbbm autocomplete
320   - var carAutoCom=$('.autocomplete-cars', modal);
321   - UIkit.autocomplete(carAutoCom, {
322   - minLength: 1,
323   - delay: 50,
324   - source: function(release) {
325   - var q = $('input', carAutoCom).val().toUpperCase()
326   - ,rs = [],
327   - count = 0;
328   - $.each(nbbmArray, function () {
329   - if(this.value.indexOf(q) != -1){
330   - rs.push(this);
331   - count++;
332   - }
333   - if (count >= 15)
334   - return false;
335   - });
336   - release && release(rs);
337   - }
338   - });
339   -
340   - //jsy autocomplete
341   - var jsyAutoCom=$('.autocomplete-jsy', modal);
342   - UIkit.autocomplete(jsyAutoCom, {
343   - minLength: 1,
344   - delay: 50,
345   - source: function(release) {
346   - var q = $('input', jsyAutoCom).val().toUpperCase()
347   - ,rs = [],
348   - count = 0;
349   -
350   - $.each(jsyArray, function() {
351   - if (this.value.indexOf(q) != -1 || this.fullChars.indexOf(q) != -1 || this.camelChars.indexOf(q) != -1){
352   - rs.push(this);
353   - count++;
354   - }
355   -
356   - if (count >= 10)
357   - return false;
358   - });
359   - release && release(rs);
360   - }
361   - });
362   -
363   - function distinctByField(arr, f){
364   - if(!f)
365   - f = 'value';
366   - var rs = {};
367   - $.each(arr, function () {
368   - rs[this[f]]=this;
369   - });
370   - return gb_common.get_vals(rs);
371   - }
372   -
373   - function mergeData(list) {
374   - var rs = {};
375   - $.each(list, function () {
376   - if(rs[this.schId]){
377   - rs[this.schId]['editArray'].push(subData(this));
378   - }
379   - else{
380   - rs[this.schId] = {
381   - schId: this.schId,
382   - clZbh: this.clZbh,
383   - fcsj: this.fcsj,
384   - gsbm: this.gsbm,
385   - fgsbm: this.fgsbm,
386   - lineCode: this.lineCode,
387   - lpName: this.lpName,
388   - jGh: this.jGh,
389   - jName: this.jName,
390   - realExecDate: this.realExecDate,
391   - editArray: [subData(this)]
392   - }
393   - }
394   - });
395   - return gb_common.get_vals(rs);
396   - }
397   -
398   - var types = {'DFTZ': '待发调整', 'FCXXWT':'发车信息微调', 'JHLB': '计划烂班', 'CXLB': '撤销烂班', 'CXZX': '撤销执行', 'CXSF': '撤销实发', 'SFTZ': '实发调整', 'TZRC': '调整人车', 'LSBCTZ':'历史班次调整'};
399   - function subData(data){
400   - return {
401   - id: data.id,
402   - type: data.type,
403   - typeStr: types[data.type]?types[data.type]:data.type,
404   - type2: data.type2,
405   - user: data.user,
406   - jsonArray: data.jsonArray,
407   - remarks: data.remarks,
408   - timeStr: data.timeStr
409   - }
410   - }
411   - gb_ct_table.fixedHead($('.ct_table_wrap', modal));
412   -
413   -
414   - /**
415   - * 鼠标悬停、显示详细
416   - */
417   - var _opts = {
418   - show:{ready: true, delay: 300},
419   - position: {viewport: $(window), my: 'top center', at: 'bottom center'},
420   - hide: {fixed: true, delay: 300},
421   - events: {
422   - hidden: function(event, api) {
423   - $(this).qtip('destroy', true);
424   - }
425   - }
426   - };
427   - //待发调整tip
428   - $(modal).on('mouseenter', '.ct-badge.ct-badge-DFTZ', function() {
429   - $(this).qtip({
430   - show: _opts.show,
431   - content: {
432   - title: '待发调整',
433   - text: function() {
434   - var obj = etInfos[$(this).data('id')];
435   - return template('edit-info-tip-dftz-temp', obj);
436   - }
437   - },
438   - position: _opts.position,
439   - style: {
440   - classes: 'qtip-green qtip-rounded qtip-shadow sch-badge-tip'
441   - },
442   - hide: _opts.hide,
443   - events: _opts.events
444   - });
445   - });
446   -
447   - //实发调整tip
448   - $(modal).on('mouseenter', '.ct-badge.ct-badge-SFTZ', function() {
449   - $(this).qtip({
450   - show: _opts.show,
451   - content: {
452   - title: '实发调整',
453   - text: function() {
454   - var obj = etInfos[$(this).data('id')];
455   - return template('edit-info-tip-sftz-temp', obj);
456   - }
457   - },
458   - position: _opts.position,
459   - style: {
460   - classes: 'qtip-green qtip-rounded qtip-shadow sch-badge-tip'
461   - },
462   - hide: _opts.hide,
463   - events: _opts.events
464   - });
465   - });
466   -
467   - //发车信息微调tip
468   - $(modal).on('mouseenter', '.ct-badge.ct-badge-FCXXWT', function() {
469   - $(this).qtip({
470   - show: _opts.show,
471   - content: {
472   - title: '发车信息微调',
473   - text: function() {
474   - var obj = etInfos[$(this).data('id')];
475   - return template('edit-info-tip-fcxxwt-temp', obj);
476   - }
477   - },
478   - position: _opts.position,
479   - style: {
480   - classes: 'qtip-blue qtip-rounded qtip-shadow sch-badge-tip'
481   - },
482   - hide: _opts.hide,
483   - events: _opts.events
484   - });
485   - });
486   -
487   - //撤销实发tip
488   - $(modal).on('mouseenter', '.ct-badge.ct-badge-CXSF', function() {
489   - $(this).qtip({
490   - show: _opts.show,
491   - content: {
492   - title: '撤销实发',
493   - text: function() {
494   - var obj = etInfos[$(this).data('id')];
495   - return template('edit-info-tip-cxsf-temp', obj);
496   - }
497   - },
498   - position: _opts.position,
499   - style: {
500   - classes: 'qtip-light qtip-rounded qtip-shadow sch-badge-tip'
501   - },
502   - hide: _opts.hide,
503   - events: _opts.events
504   - });
505   - });
506   -
507   - //撤销执行tip
508   - $(modal).on('mouseenter', '.ct-badge.ct-badge-CXZX', function() {
509   - $(this).qtip({
510   - show: _opts.show,
511   - content: {
512   - title: '撤销执行',
513   - text: function() {
514   - var obj = etInfos[$(this).data('id')];
515   - return template('edit-info-tip-cxzx-temp', obj);
516   - }
517   - },
518   - position: _opts.position,
519   - style: {
520   - classes: 'qtip-light qtip-rounded qtip-shadow sch-badge-tip'
521   - },
522   - hide: _opts.hide,
523   - events: _opts.events
524   - });
525   - });
526   -
527   - //计划烂班tip
528   - $(modal).on('mouseenter', '.ct-badge.ct-badge-JHLB', function() {
529   - $(this).qtip({
530   - show: _opts.show,
531   - content: {
532   - text: function() {
533   - var obj = etInfos[$(this).data('id')];
534   - return obj.remarks;
535   - }
536   - },
537   - position: _opts.position,
538   - style: {
539   - classes: 'qtip-red qtip-rounded qtip-shadow sch-badge-tip'
540   - },
541   - hide: _opts.hide,
542   - events: _opts.events
543   - });
544   - });
545   -
546   - //调整人车tip
547   - $(modal).on('mouseenter', '.ct-badge.ct-badge-TZRC', function() {
548   - $(this).qtip({
549   - show: _opts.show,
550   - content: {
551   - title: '调整人车',
552   - text: function() {
553   - var obj = etInfos[$(this).data('id')];
554   - console.log('obj', obj);
555   - return template('edit-info-tip-tzrc-temp', obj);
556   - }
557   - },
558   - position: _opts.position,
559   - style: {
560   - classes: 'qtip-rounded qtip-shadow sch-badge-tip'
561   - },
562   - hide: _opts.hide,
563   - events: _opts.events
564   - });
565   - });
566   -
567   -
568   - //发车信息微调tip
569   - $(modal).on('mouseenter', '.ct-badge.ct-badge-LSBCTZ', function() {
570   - $(this).qtip({
571   - show: _opts.show,
572   - content: {
573   - title: '发车信息微调',
574   - text: function() {
575   - var obj = etInfos[$(this).data('id')];
576   - return template('edit-info-tip-lsbctz-temp', obj);
577   - }
578   - },
579   - position: _opts.position,
580   - style: {
581   - classes: 'qtip-blue qtip-rounded qtip-shadow sch-badge-tip'
582   - },
583   - hide: _opts.hide,
584   - events: _opts.events
585   - });
586   - });
587   -
588   - function sortFun(a, b) {
589   - return (a.realExecDate + a.fcsj).localeCompare(b.realExecDate + b.fcsj);
590   - }
591   - })();
592   - </script>
  1 +<div class="uk-modal ct_move_modal" id="history-sch-edit-info-modal">
  2 + <div class="uk-modal-dialog" style="width: 1280px;">
  3 + <a href="" class="uk-modal-close uk-close"></a>
  4 + <div class="uk-modal-header">
  5 + <h2>班次修正日志</h2>
  6 + </div>
  7 +
  8 + <div style="padding-left: 12px;margin: 20px 0">
  9 + <ul class="uk-subnav uk-subnav-pill h-s-time">
  10 + </ul>
  11 + </div>
  12 +
  13 + <div style="padding-left: 12px;">
  14 + <ul class="uk-subnav uk-subnav-pill h-s-line">
  15 + </ul>
  16 + </div>
  17 +
  18 + <div class="uk-panel uk-panel-box uk-panel-box-primary">
  19 + <form class="uk-form search-form">
  20 + <fieldset data-uk-margin>
  21 + <span class="horizontal-field">路牌</span>
  22 + <select name="lpName" style="width: 80px;"></select>
  23 + <span class="horizontal-field">上下行</span>
  24 + <select name="xlDir">
  25 + <option value="">全部</option>
  26 + <option value="0">上行</option>
  27 + <option value="1">下行</option>
  28 + </select>
  29 + &nbsp;
  30 + <span class="horizontal-field">车辆</span>
  31 + <div class="uk-autocomplete uk-form autocomplete-cars">
  32 + <input type="text" name="clZbh" placeholder="车辆自编号">
  33 + </div>
  34 + <span class="horizontal-field">驾驶员</span>
  35 + <div class="uk-autocomplete uk-form autocomplete-jsy">
  36 + <input type="text" name="jGh" placeholder="驾驶员">
  37 + </div>
  38 + &nbsp;
  39 + <span class="horizontal-field">修正类型</span>
  40 + <select name="type">
  41 + <option value="">全部</option>
  42 + <option value="DFTZ">待发调整</option>
  43 + <option value="SFTZ">实发调整</option>
  44 + <option value="FCXXWT">发车信息微调</option>
  45 + <option value="TZRC">调整人车</option>
  46 + <option value="JHLB">计划烂班</option>
  47 + <option value="CXLB">撤销烂班</option>
  48 + <option value="CXSF">撤销实发</option>
  49 + <option value="CXZX">撤销执行</option>
  50 + <option value="LPDD">路牌对调</option>
  51 + <option value="ZRW">添加子任务</option>
  52 + <option value="LSBCTZ">历史班次调整</option>
  53 + </select>
  54 + <button class="uk-button">检索</button>
  55 +
  56 + <label style="float: right;font-size: 12px;color: #989797;">
  57 + <input type="checkbox" disabled> 显示系统修正日志
  58 + </label>
  59 + </fieldset>
  60 + </form>
  61 + </div>
  62 +
  63 + <div class="ct_table_wrap ct_table_no_border edit-info-table-wrap" style="height: 510px;">
  64 + <div class="ct_table sch-edit-info-table">
  65 + <div class="ct_table_head">
  66 + <dl>
  67 + <dt>序号</dt>
  68 + <dt>路牌</dt>
  69 + <dt>车辆</dt>
  70 + <dt>驾驶员</dt>
  71 + <dt>计发</dt>
  72 + <dt>修正记录</dt>
  73 + </dl>
  74 + </div>
  75 + <div class="ct_table_body">
  76 + </div>
  77 + </div>
  78 + </div>
  79 +
  80 + <div class="load-panel">
  81 + <i class="uk-icon-spinner uk-icon-spin"></i>
  82 + 正在加载数据
  83 + </div>
  84 + </div>
  85 +
  86 + <script id="history-sch-edit-info-temp" type="text/html">
  87 + {{each list as obj i}}
  88 + <dl>
  89 + <dd>{{i + 1}}</dd>
  90 + <dd>{{obj.lpName}}</dd>
  91 + <dd>{{obj.clZbh}}</dd>
  92 + <dd>{{obj.jGh}}/{{obj.jName}}</dd>
  93 + <dd>{{obj.fcsj}}</dd>
  94 + <dd>
  95 + {{each obj.editArray as e j}}
  96 + <div class="ct-badge ct-badge-{{e.type}}" data-id="{{e.id}}">
  97 + {{e.timeStr}}{{e.typeStr}}
  98 + </div>
  99 + {{/each}}
  100 + </dd>
  101 + </dl>
  102 + {{/each}}
  103 + </script>
  104 +
  105 + <!-- 待发调整 tip -->
  106 + <script id="edit-info-tip-dftz-temp" type="text/html">
  107 + <div class="edit-info-tip">
  108 + <p class="text">待发时间从 {{jsonArray.old}} 调整为 {{jsonArray.now}}</p>
  109 + <p class="sub_text">调整人:{{user}} 调整时间:{{timeStr}}</p>
  110 + {{if remarks!=null && remarks != ''}}
  111 + <p class="sub_text">备注:{{remarks}}</p>
  112 + {{/if}}
  113 + </div>
  114 + </script>
  115 +
  116 + <!-- 实发调整 -->
  117 + <script id="edit-info-tip-sftz-temp" type="text/html">
  118 + <div class="edit-info-tip">
  119 + <p class="text">实发时间由 {{jsonArray.old==null?'无':jsonArray.old}} 调整为 {{jsonArray.now}}</p>
  120 + <p class="sub_text">调整人:{{user}} 调整时间:{{timeStr}}</p>
  121 + {{if remarks!=null && remarks != ''}}
  122 + <p class="sub_text">备注:{{remarks}}</p>
  123 + {{/if}}
  124 + </div>
  125 + </script>
  126 +
  127 +
  128 + <!-- 发车信息微调 tip -->
  129 + <script id="edit-info-tip-fcxxwt-temp" type="text/html">
  130 + <div class="edit-info-tip">
  131 + {{each jsonArray as obj i}}
  132 + <p class="text">{{obj.title}} 由 {{obj.old==null?'无':obj.old}} 调整为 {{obj.now}}</p>
  133 + {{/each}}
  134 + <p class="sub_text">调整人:{{user}} 调整时间:{{timeStr}}</p>
  135 + {{if remarks!=null && remarks != ''}}
  136 + <p class="sub_text">备注:{{remarks}}</p>
  137 + {{/if}}
  138 + </div>
  139 + </script>
  140 +
  141 + <!-- 历史班次调整 tip -->
  142 + <script id="edit-info-tip-lsbctz-temp" type="text/html">
  143 + <div class="edit-info-tip">
  144 + {{each jsonArray as obj i}}
  145 + <p class="text">{{obj.title}} 由 {{obj.old==null?'无':obj.old}} 调整为 {{obj.now}}</p>
  146 + {{/each}}
  147 + <p class="sub_text">调整人:{{user}} 调整时间:{{timeStr}}</p>
  148 + {{if remarks!=null && remarks != ''}}
  149 + <p class="sub_text">备注:{{remarks}}</p>
  150 + {{/if}}
  151 + </div>
  152 + </script>
  153 +
  154 + <!-- 撤销实发tip -->
  155 + <script id="edit-info-tip-cxsf-temp" type="text/html">
  156 + <div class="edit-info-tip">
  157 + <p class="text">将实发时间 {{jsonArray.old_sfsj}} 撤销</p>
  158 + <p class="sub_text">调整人:{{user}} 调整时间:{{timeStr}}</p>
  159 + {{if remarks!=null && remarks != ''}}
  160 + <p class="sub_text">备注:{{remarks}}</p>
  161 + {{/if}}
  162 + </div>
  163 + </script>
  164 +
  165 + <!-- 撤销执行 -->
  166 + <script id="edit-info-tip-cxzx-temp" type="text/html">
  167 + <div class="edit-info-tip">
  168 + {{if jsonArray.old_sfsj != null}}
  169 + <p class="text">将实发时间 {{jsonArray.old_sfsj}} 撤销</p>
  170 + {{/if}}
  171 + {{if jsonArray.old_sdsj != null}}
  172 + <p class="text">将实达时间 {{jsonArray.old_sdsj}} 撤销</p>
  173 + {{/if}}
  174 + <p class="sub_text">调整人:{{user}} 调整时间:{{timeStr}}</p>
  175 + {{if remarks!=null && remarks != ''}}
  176 + <p class="sub_text">备注:{{remarks}}</p>
  177 + {{/if}}
  178 + </div>
  179 + </script>
  180 +
  181 + <!-- 调整人车 -->
  182 + <script id="edit-info-tip-tzrc-temp" type="text/html">
  183 + <div class="edit-info-tip">
  184 + {{if jsonArray.now_jsy != null}}
  185 + <p class="text">驾驶员从 {{jsonArray.old_jsy}} 调整为 {{jsonArray.now_jsy}}</p>
  186 + {{/if}}
  187 + {{if jsonArray.now_nbbm != null}}
  188 + <p class="text">车辆从 {{jsonArray.old_nbbm}} 调整为 {{jsonArray.now_nbbm}}</p>
  189 + {{/if}}
  190 + {{if jsonArray.now_spy != null}}
  191 + <p class="text">售票员从 {{jsonArray.old_spy}} 调整为 {{jsonArray.now_spy}}</p>
  192 + {{/if}}
  193 +
  194 + <p class="sub_text">调整人:{{user}} 调整时间:{{timeStr}}</p>
  195 + {{if remarks!=null && remarks != ''}}
  196 + <p class="sub_text">备注:{{remarks}}</p>
  197 + {{/if}}
  198 + </div>
  199 + </script>
  200 +
  201 + <script>
  202 + (function () {
  203 + var modal = '#history-sch-edit-info-modal';
  204 + var etInfos={};//id映射
  205 +
  206 + //滚动条
  207 + $('.edit-info-table-wrap', modal).perfectScrollbar({suppressScrollX: true});
  208 +
  209 + $(modal).on('init', function (e, data) {
  210 + e.stopPropagation();
  211 + $.get('/realSchedule/dateArray?c=1', function (rs) {
  212 + //日期tab
  213 + var tsStr = '';
  214 + $.each(rs, function (i) {
  215 + tsStr += '<li ' + (i == 0 ? 'class="uk-active"' : '') + '><a>' + this + '</a></li>';
  216 + });
  217 + $('.h-s-time', modal).html(tsStr);
  218 +
  219 + //线路tab
  220 + var xlStr = '';
  221 + $.each(gb_data_basic.activeLines, function (i) {
  222 + xlStr += '<li ' + (i == 0 ? 'class="uk-active"' : '') + ' data-id="' + this.lineCode + '"><a>' + this.name + '</a></li>';
  223 + });
  224 + $('.h-s-line', modal).html(xlStr);
  225 +
  226 + clearLpSelect();
  227 + //reLoadLp=true;
  228 + jsQuery();
  229 + });
  230 + });
  231 +
  232 + $(modal).on('refresh', jsQuery);
  233 +
  234 + $(modal).on('click', '.h-s-time li,.h-s-line li', function () {
  235 + if(loading)
  236 + return;
  237 + $(this).parent().find('li.uk-active').removeClass('uk-active');
  238 + $(this).addClass('uk-active');
  239 + clearLpSelect();
  240 + //检索之前将滚动条置顶
  241 + $('.edit-info-table-wrap', modal)[0].scrollTop = 0;
  242 + jsQuery();
  243 + });
  244 +
  245 + $('.search-form', modal).on('submit', function (e) {
  246 + try {
  247 + //检索之前将滚动条置顶
  248 + $('.edit-info-table-wrap', modal)[0].scrollTop = 0;
  249 + jsQuery();
  250 + }catch(e){
  251 + console.log(e);
  252 + }
  253 + return false;
  254 + });
  255 +
  256 + var reLoadLp;
  257 + var nbbmArray,jsyArray,lpArray,loading;
  258 + function jsQuery() {
  259 + var data = $('.search-form', modal).serializeJSON();
  260 + var rq = $('.h-s-time li.uk-active', modal).text(),
  261 + lineCode = $('.h-s-line li.uk-active', modal).data('id');
  262 + data.rq = rq;
  263 + data.lineCode = lineCode;
  264 + if(data.jGh.indexOf('/')!=-1){
  265 + var jsy=data.jGh.split('/');
  266 + data.jGh=jsy[0];
  267 + data.jName=jsy[1];
  268 + }
  269 +
  270 + $('.load-panel', modal).show();
  271 + loading=true;
  272 + gb_common.$get('/schEditInfo/_list', data, function (rs) {
  273 + etInfos = {};
  274 + nbbmArray=[];
  275 + jsyArray=[];
  276 + lpArray = [];
  277 + $.each(rs.list, function () {
  278 + this.jsonArray = JSON.parse(this.jsonArray);
  279 + etInfos[this.id] = this;
  280 + this['ts_str'] = moment(this.ts).format('YYYY-MM-DD HH:mm');
  281 +
  282 + nbbmArray.push({value: this.clZbh});
  283 + jsyArray.push({value: this.jGh+'/'+this.jName,
  284 + fullChars: pinyin.getFullChars(this.jName).toUpperCase(),
  285 + camelChars: pinyin.getCamelChars(this.jName)});
  286 + lpArray.push({value: this.lpName});
  287 + });
  288 + //根据班次ID合并修正操作
  289 + var list = mergeData(rs.list).sort(sortFun);
  290 + var htmlStr = template('history-sch-edit-info-temp', {list: list});
  291 + $('.sch-edit-info-table .ct_table_body', modal).html(htmlStr);
  292 + $('.load-panel', modal).hide();
  293 + loading=false;
  294 +
  295 + //value
  296 + nbbmArray=distinctByField(nbbmArray);
  297 + jsyArray=distinctByField(jsyArray);
  298 + lpArray=distinctByField(lpArray);
  299 + if(reLoadLp){
  300 + //路牌下拉框
  301 + var ops = '<option value="">全部</option>';
  302 + $.each(lpArray, function () {
  303 + ops += '<option value="'+this.value+'">'+this.value+'</option>';
  304 + });
  305 + $('[name=lpName]', modal).html(ops);
  306 + reLoadLp = false;
  307 + }
  308 +
  309 + //更新滚动条高度
  310 + $('.edit-info-table-wrap', modal).perfectScrollbar('update');
  311 + });
  312 + }
  313 +
  314 + function clearLpSelect() {
  315 + $('[name=lpName_eq]', modal).val('').html('');
  316 + reLoadLp = true;
  317 + }
  318 +
  319 + //nbbm autocomplete
  320 + var carAutoCom=$('.autocomplete-cars', modal);
  321 + UIkit.autocomplete(carAutoCom, {
  322 + minLength: 1,
  323 + delay: 50,
  324 + source: function(release) {
  325 + var q = $('input', carAutoCom).val().toUpperCase()
  326 + ,rs = [],
  327 + count = 0;
  328 + $.each(nbbmArray, function () {
  329 + if(this.value.indexOf(q) != -1){
  330 + rs.push(this);
  331 + count++;
  332 + }
  333 + if (count >= 15)
  334 + return false;
  335 + });
  336 + release && release(rs);
  337 + }
  338 + });
  339 +
  340 + //jsy autocomplete
  341 + var jsyAutoCom=$('.autocomplete-jsy', modal);
  342 + UIkit.autocomplete(jsyAutoCom, {
  343 + minLength: 1,
  344 + delay: 50,
  345 + source: function(release) {
  346 + var q = $('input', jsyAutoCom).val().toUpperCase()
  347 + ,rs = [],
  348 + count = 0;
  349 +
  350 + $.each(jsyArray, function() {
  351 + if (this.value.indexOf(q) != -1 || this.fullChars.indexOf(q) != -1 || this.camelChars.indexOf(q) != -1){
  352 + rs.push(this);
  353 + count++;
  354 + }
  355 +
  356 + if (count >= 10)
  357 + return false;
  358 + });
  359 + release && release(rs);
  360 + }
  361 + });
  362 +
  363 + function distinctByField(arr, f){
  364 + if(!f)
  365 + f = 'value';
  366 + var rs = {};
  367 + $.each(arr, function () {
  368 + rs[this[f]]=this;
  369 + });
  370 + return gb_common.get_vals(rs);
  371 + }
  372 +
  373 + function mergeData(list) {
  374 + var rs = {};
  375 + $.each(list, function () {
  376 + if(rs[this.schId]){
  377 + rs[this.schId]['editArray'].push(subData(this));
  378 + }
  379 + else{
  380 + rs[this.schId] = {
  381 + schId: this.schId,
  382 + clZbh: this.clZbh,
  383 + fcsj: this.fcsj,
  384 + gsbm: this.gsbm,
  385 + fgsbm: this.fgsbm,
  386 + lineCode: this.lineCode,
  387 + lpName: this.lpName,
  388 + jGh: this.jGh,
  389 + jName: this.jName,
  390 + realExecDate: this.realExecDate,
  391 + editArray: [subData(this)]
  392 + }
  393 + }
  394 + });
  395 + return gb_common.get_vals(rs);
  396 + }
  397 +
  398 + var types = {'DFTZ': '待发调整', 'FCXXWT':'发车信息微调', 'JHLB': '计划烂班', 'CXLB': '撤销烂班', 'CXZX': '撤销执行', 'CXSF': '撤销实发', 'SFTZ': '实发调整', 'TZRC': '调整人车', 'LSBCTZ':'历史班次调整'};
  399 + function subData(data){
  400 + return {
  401 + id: data.id,
  402 + type: data.type,
  403 + typeStr: types[data.type]?types[data.type]:data.type,
  404 + type2: data.type2,
  405 + user: data.user,
  406 + jsonArray: data.jsonArray,
  407 + remarks: data.remarks,
  408 + timeStr: data.timeStr
  409 + }
  410 + }
  411 + gb_ct_table.fixedHead($('.ct_table_wrap', modal));
  412 +
  413 +
  414 + /**
  415 + * 鼠标悬停、显示详细
  416 + */
  417 + var _opts = {
  418 + show:{ready: true, delay: 300},
  419 + position: {viewport: $(window), my: 'top center', at: 'bottom center'},
  420 + hide: {fixed: true, delay: 300},
  421 + events: {
  422 + hidden: function(event, api) {
  423 + $(this).qtip('destroy', true);
  424 + }
  425 + }
  426 + };
  427 + //待发调整tip
  428 + $(modal).on('mouseenter', '.ct-badge.ct-badge-DFTZ', function() {
  429 + $(this).qtip({
  430 + show: _opts.show,
  431 + content: {
  432 + title: '待发调整',
  433 + text: function() {
  434 + var obj = etInfos[$(this).data('id')];
  435 + return template('edit-info-tip-dftz-temp', obj);
  436 + }
  437 + },
  438 + position: _opts.position,
  439 + style: {
  440 + classes: 'qtip-green qtip-rounded qtip-shadow sch-badge-tip'
  441 + },
  442 + hide: _opts.hide,
  443 + events: _opts.events
  444 + });
  445 + });
  446 +
  447 + //实发调整tip
  448 + $(modal).on('mouseenter', '.ct-badge.ct-badge-SFTZ', function() {
  449 + $(this).qtip({
  450 + show: _opts.show,
  451 + content: {
  452 + title: '实发调整',
  453 + text: function() {
  454 + var obj = etInfos[$(this).data('id')];
  455 + return template('edit-info-tip-sftz-temp', obj);
  456 + }
  457 + },
  458 + position: _opts.position,
  459 + style: {
  460 + classes: 'qtip-green qtip-rounded qtip-shadow sch-badge-tip'
  461 + },
  462 + hide: _opts.hide,
  463 + events: _opts.events
  464 + });
  465 + });
  466 +
  467 + //发车信息微调tip
  468 + $(modal).on('mouseenter', '.ct-badge.ct-badge-FCXXWT', function() {
  469 + $(this).qtip({
  470 + show: _opts.show,
  471 + content: {
  472 + title: '发车信息微调',
  473 + text: function() {
  474 + var obj = etInfos[$(this).data('id')];
  475 + return template('edit-info-tip-fcxxwt-temp', obj);
  476 + }
  477 + },
  478 + position: _opts.position,
  479 + style: {
  480 + classes: 'qtip-blue qtip-rounded qtip-shadow sch-badge-tip'
  481 + },
  482 + hide: _opts.hide,
  483 + events: _opts.events
  484 + });
  485 + });
  486 +
  487 + //撤销实发tip
  488 + $(modal).on('mouseenter', '.ct-badge.ct-badge-CXSF', function() {
  489 + $(this).qtip({
  490 + show: _opts.show,
  491 + content: {
  492 + title: '撤销实发',
  493 + text: function() {
  494 + var obj = etInfos[$(this).data('id')];
  495 + return template('edit-info-tip-cxsf-temp', obj);
  496 + }
  497 + },
  498 + position: _opts.position,
  499 + style: {
  500 + classes: 'qtip-light qtip-rounded qtip-shadow sch-badge-tip'
  501 + },
  502 + hide: _opts.hide,
  503 + events: _opts.events
  504 + });
  505 + });
  506 +
  507 + //撤销执行tip
  508 + $(modal).on('mouseenter', '.ct-badge.ct-badge-CXZX', function() {
  509 + $(this).qtip({
  510 + show: _opts.show,
  511 + content: {
  512 + title: '撤销执行',
  513 + text: function() {
  514 + var obj = etInfos[$(this).data('id')];
  515 + return template('edit-info-tip-cxzx-temp', obj);
  516 + }
  517 + },
  518 + position: _opts.position,
  519 + style: {
  520 + classes: 'qtip-light qtip-rounded qtip-shadow sch-badge-tip'
  521 + },
  522 + hide: _opts.hide,
  523 + events: _opts.events
  524 + });
  525 + });
  526 +
  527 + //计划烂班tip
  528 + $(modal).on('mouseenter', '.ct-badge.ct-badge-JHLB', function() {
  529 + $(this).qtip({
  530 + show: _opts.show,
  531 + content: {
  532 + text: function() {
  533 + var obj = etInfos[$(this).data('id')];
  534 + return obj.remarks;
  535 + }
  536 + },
  537 + position: _opts.position,
  538 + style: {
  539 + classes: 'qtip-red qtip-rounded qtip-shadow sch-badge-tip'
  540 + },
  541 + hide: _opts.hide,
  542 + events: _opts.events
  543 + });
  544 + });
  545 +
  546 + //调整人车tip
  547 + $(modal).on('mouseenter', '.ct-badge.ct-badge-TZRC', function() {
  548 + $(this).qtip({
  549 + show: _opts.show,
  550 + content: {
  551 + title: '调整人车',
  552 + text: function() {
  553 + var obj = etInfos[$(this).data('id')];
  554 + console.log('obj', obj);
  555 + return template('edit-info-tip-tzrc-temp', obj);
  556 + }
  557 + },
  558 + position: _opts.position,
  559 + style: {
  560 + classes: 'qtip-rounded qtip-shadow sch-badge-tip'
  561 + },
  562 + hide: _opts.hide,
  563 + events: _opts.events
  564 + });
  565 + });
  566 +
  567 +
  568 + //发车信息微调tip
  569 + $(modal).on('mouseenter', '.ct-badge.ct-badge-LSBCTZ', function() {
  570 + $(this).qtip({
  571 + show: _opts.show,
  572 + content: {
  573 + title: '发车信息微调',
  574 + text: function() {
  575 + var obj = etInfos[$(this).data('id')];
  576 + return template('edit-info-tip-lsbctz-temp', obj);
  577 + }
  578 + },
  579 + position: _opts.position,
  580 + style: {
  581 + classes: 'qtip-blue qtip-rounded qtip-shadow sch-badge-tip'
  582 + },
  583 + hide: _opts.hide,
  584 + events: _opts.events
  585 + });
  586 + });
  587 +
  588 + function sortFun(a, b) {
  589 + return (a.realExecDate + a.fcsj).localeCompare(b.realExecDate + b.fcsj);
  590 + }
  591 + })();
  592 + </script>
593 593 </div>
594 594 \ No newline at end of file
... ...