Commit 1cbb83a78e8c5974d96b9569d9f272cbb8c9a3d3
1 parent
949a8039
update...
Showing
15 changed files
with
246 additions
and
43 deletions
src/main/java/com/bsth/controller/schedule/InOutScheduleController.java
| @@ -4,6 +4,7 @@ import com.bsth.data.schedule.dto.ScheduleInOut; | @@ -4,6 +4,7 @@ import com.bsth.data.schedule.dto.ScheduleInOut; | ||
| 4 | import com.bsth.service.schedule.ScheduleService; | 4 | import com.bsth.service.schedule.ScheduleService; |
| 5 | import org.springframework.beans.factory.annotation.Autowired; | 5 | import org.springframework.beans.factory.annotation.Autowired; |
| 6 | import org.springframework.web.bind.annotation.RequestMapping; | 6 | import org.springframework.web.bind.annotation.RequestMapping; |
| 7 | +import org.springframework.web.bind.annotation.RequestMethod; | ||
| 7 | import org.springframework.web.bind.annotation.RequestParam; | 8 | import org.springframework.web.bind.annotation.RequestParam; |
| 8 | import org.springframework.web.bind.annotation.RestController; | 9 | import org.springframework.web.bind.annotation.RestController; |
| 9 | 10 | ||
| @@ -45,4 +46,9 @@ public class InOutScheduleController { | @@ -45,4 +46,9 @@ public class InOutScheduleController { | ||
| 45 | public Map<String, Object> findSchByLpName(@RequestParam String lineCode, @RequestParam String lpName){ | 46 | public Map<String, Object> findSchByLpName(@RequestParam String lineCode, @RequestParam String lpName){ |
| 46 | return inOutScheduleService.findSchByLpName(lineCode, lpName); | 47 | return inOutScheduleService.findSchByLpName(lineCode, lpName); |
| 47 | } | 48 | } |
| 49 | + | ||
| 50 | + @RequestMapping(value = "dftz", method = RequestMethod.POST) | ||
| 51 | + public Map<String, Object> dftz(@RequestParam Map<String, Object> map){ | ||
| 52 | + return inOutScheduleService.dftz(map); | ||
| 53 | + } | ||
| 48 | } | 54 | } |
src/main/java/com/bsth/data/schedule/real/ScheduleDataBuffer.java
| @@ -110,7 +110,7 @@ public class ScheduleDataBuffer implements CommandLineRunner { | @@ -110,7 +110,7 @@ public class ScheduleDataBuffer implements CommandLineRunner { | ||
| 110 | p_c_mapps(); | 110 | p_c_mapps(); |
| 111 | } | 111 | } |
| 112 | 112 | ||
| 113 | - private static void put(ScheduleInOut sio) { | 113 | + public static void put(ScheduleInOut sio) { |
| 114 | if (allMaps.containsKey(sio.getId())) | 114 | if (allMaps.containsKey(sio.getId())) |
| 115 | update(allMaps.get(sio.getId()), sio); | 115 | update(allMaps.get(sio.getId()), sio); |
| 116 | else | 116 | else |
src/main/java/com/bsth/service/schedule/ScheduleService.java
| @@ -30,6 +30,8 @@ public interface ScheduleService { | @@ -30,6 +30,8 @@ public interface ScheduleService { | ||
| 30 | 30 | ||
| 31 | List<ScheduleInOut> findOutByIdx(String idx); | 31 | List<ScheduleInOut> findOutByIdx(String idx); |
| 32 | 32 | ||
| 33 | + Map<String,Object> dftz(Map<String, Object> map); | ||
| 34 | + | ||
| 33 | //void inOut(CarInOutEntity obj); | 35 | //void inOut(CarInOutEntity obj); |
| 34 | 36 | ||
| 35 | //void busInOut(CarInOutEntity obj); | 37 | //void busInOut(CarInOutEntity obj); |
src/main/java/com/bsth/service/schedule/impl/ScheduleServiceImpl.java
| @@ -10,6 +10,7 @@ import com.bsth.data.schedule.dto.dd.ScheduleRealInfo; | @@ -10,6 +10,7 @@ import com.bsth.data.schedule.dto.dd.ScheduleRealInfo; | ||
| 10 | import com.bsth.data.schedule.real.ScheduleDataBuffer; | 10 | import com.bsth.data.schedule.real.ScheduleDataBuffer; |
| 11 | import com.bsth.data.utils.HttpClientUtils; | 11 | import com.bsth.data.utils.HttpClientUtils; |
| 12 | import com.bsth.data.utils.RsRequestUtils; | 12 | import com.bsth.data.utils.RsRequestUtils; |
| 13 | +import com.bsth.security.util.SecurityUtils; | ||
| 13 | import com.bsth.service.schedule.ScheduleService; | 14 | import com.bsth.service.schedule.ScheduleService; |
| 14 | import com.bsth.util.ConfigUtil; | 15 | import com.bsth.util.ConfigUtil; |
| 15 | import com.google.common.base.Splitter; | 16 | import com.google.common.base.Splitter; |
| @@ -132,4 +133,25 @@ public class ScheduleServiceImpl implements ScheduleService { | @@ -132,4 +133,25 @@ public class ScheduleServiceImpl implements ScheduleService { | ||
| 132 | } | 133 | } |
| 133 | return rs; | 134 | return rs; |
| 134 | } | 135 | } |
| 136 | + | ||
| 137 | + @Override | ||
| 138 | + public Map<String, Object> dftz(Map<String, Object> map) { | ||
| 139 | + Map<String, Object> rs = new HashMap<>(); | ||
| 140 | + try{ | ||
| 141 | + map.put("userId", SecurityUtils.getCurrentUser().getUserName()); | ||
| 142 | + StringBuilder sb = HttpClientUtils.post(dataUrl + "/tcc_dftz" + RsRequestUtils.getParams(), JSON.toJSONString(map)); | ||
| 143 | + | ||
| 144 | + rs = JSON.parseObject(sb.toString()); | ||
| 145 | + | ||
| 146 | + if("SUCCESS".equals(rs.get("status"))){ | ||
| 147 | + ScheduleInOut sio = JSON.toJavaObject(JSON.parseObject(rs.get("t").toString()), ScheduleInOut.class); | ||
| 148 | + ScheduleDataBuffer.put(sio); | ||
| 149 | + } | ||
| 150 | + }catch (Exception e){ | ||
| 151 | + logger.error("", e); | ||
| 152 | + rs.put("status", ResponseCode.ERROR); | ||
| 153 | + rs.put("msg", "服务器出现异常!"); | ||
| 154 | + } | ||
| 155 | + return rs; | ||
| 156 | + } | ||
| 135 | } | 157 | } |
src/main/resources/static/assets/css/abnormal_monitor.css
| @@ -311,12 +311,10 @@ span.red_line_empty{ | @@ -311,12 +311,10 @@ span.red_line_empty{ | ||
| 311 | .o_s_expand_table_modal table tr>th:nth-of-type(6), | 311 | .o_s_expand_table_modal table tr>th:nth-of-type(6), |
| 312 | .o_s_expand_table_modal table tr>td:nth-of-type(6){ | 312 | .o_s_expand_table_modal table tr>td:nth-of-type(6){ |
| 313 | width: 12%; | 313 | width: 12%; |
| 314 | - text-align: center; | ||
| 315 | } | 314 | } |
| 316 | .o_s_expand_table_modal table tr>th:nth-of-type(7), | 315 | .o_s_expand_table_modal table tr>th:nth-of-type(7), |
| 317 | .o_s_expand_table_modal table tr>td:nth-of-type(7){ | 316 | .o_s_expand_table_modal table tr>td:nth-of-type(7){ |
| 318 | width: 12%; | 317 | width: 12%; |
| 319 | - text-align: center; | ||
| 320 | } | 318 | } |
| 321 | .o_s_expand_table_modal table tr>th:nth-of-type(8), | 319 | .o_s_expand_table_modal table tr>th:nth-of-type(8), |
| 322 | .o_s_expand_table_modal table tr>td:nth-of-type(8){ | 320 | .o_s_expand_table_modal table tr>td:nth-of-type(8){ |
| @@ -353,7 +351,7 @@ table.curr_out_plan_table{ | @@ -353,7 +351,7 @@ table.curr_out_plan_table{ | ||
| 353 | background: #f8f8f8; | 351 | background: #f8f8f8; |
| 354 | border: 1px solid #ececec; | 352 | border: 1px solid #ececec; |
| 355 | font-size: 14px; | 353 | font-size: 14px; |
| 356 | - margin-top: 30px; | 354 | + margin-bottom: 10px; |
| 357 | } | 355 | } |
| 358 | 356 | ||
| 359 | .tzrc_table_wrap table.sch_list_table{ | 357 | .tzrc_table_wrap table.sch_list_table{ |
| @@ -366,8 +364,8 @@ table.curr_out_plan_table{ | @@ -366,8 +364,8 @@ table.curr_out_plan_table{ | ||
| 366 | font-size: 12px; | 364 | font-size: 12px; |
| 367 | border-radius: 0; | 365 | border-radius: 0; |
| 368 | height: 17px; | 366 | height: 17px; |
| 369 | - padding: 0px 5px 1px; | ||
| 370 | - margin-left: 2px; | 367 | + padding: 0px 2px 1px; |
| 368 | + margin-left: 0; | ||
| 371 | vertical-align: top; | 369 | vertical-align: top; |
| 372 | margin-top: 1px; | 370 | margin-top: 1px; |
| 373 | } | 371 | } |
| @@ -394,6 +392,7 @@ table.curr_out_plan_table{ | @@ -394,6 +392,7 @@ table.curr_out_plan_table{ | ||
| 394 | 392 | ||
| 395 | .o_s_abnormal_handler_modal .tzrc_form_card form{ | 393 | .o_s_abnormal_handler_modal .tzrc_form_card form{ |
| 396 | margin-left: -12px; | 394 | margin-left: -12px; |
| 395 | + margin-top: 20px; | ||
| 397 | } | 396 | } |
| 398 | 397 | ||
| 399 | .modal_cont_tzrc_wrap form.uk-form-horizontal .uk-form-label{ | 398 | .modal_cont_tzrc_wrap form.uk-form-horizontal .uk-form-label{ |
| @@ -435,27 +434,23 @@ table.curr_out_plan_table{ | @@ -435,27 +434,23 @@ table.curr_out_plan_table{ | ||
| 435 | } | 434 | } |
| 436 | .tzrc_table_wrap table.tab_wid_1 tr>th:nth-of-type(2), | 435 | .tzrc_table_wrap table.tab_wid_1 tr>th:nth-of-type(2), |
| 437 | .tzrc_table_wrap table.tab_wid_1 tr>td:nth-of-type(2){ | 436 | .tzrc_table_wrap table.tab_wid_1 tr>td:nth-of-type(2){ |
| 438 | - width: 16%; | 437 | + width: 22%; |
| 439 | } | 438 | } |
| 440 | .tzrc_table_wrap table.tab_wid_1 tr>th:nth-of-type(3), | 439 | .tzrc_table_wrap table.tab_wid_1 tr>th:nth-of-type(3), |
| 441 | .tzrc_table_wrap table.tab_wid_1 tr>td:nth-of-type(3){ | 440 | .tzrc_table_wrap table.tab_wid_1 tr>td:nth-of-type(3){ |
| 442 | - width: 21%; | 441 | + width: 20%; |
| 443 | } | 442 | } |
| 444 | .tzrc_table_wrap table.tab_wid_1 tr>th:nth-of-type(4), | 443 | .tzrc_table_wrap table.tab_wid_1 tr>th:nth-of-type(4), |
| 445 | .tzrc_table_wrap table.tab_wid_1 tr>td:nth-of-type(4){ | 444 | .tzrc_table_wrap table.tab_wid_1 tr>td:nth-of-type(4){ |
| 446 | - width: 18%; | 445 | + width: 20%; |
| 447 | } | 446 | } |
| 448 | .tzrc_table_wrap table.tab_wid_1 tr>th:nth-of-type(5), | 447 | .tzrc_table_wrap table.tab_wid_1 tr>th:nth-of-type(5), |
| 449 | .tzrc_table_wrap table.tab_wid_1 tr>td:nth-of-type(5){ | 448 | .tzrc_table_wrap table.tab_wid_1 tr>td:nth-of-type(5){ |
| 450 | - width: 15%; | 449 | + width: 17%; |
| 451 | } | 450 | } |
| 452 | .tzrc_table_wrap table.tab_wid_1 tr>th:nth-of-type(6), | 451 | .tzrc_table_wrap table.tab_wid_1 tr>th:nth-of-type(6), |
| 453 | .tzrc_table_wrap table.tab_wid_1 tr>td:nth-of-type(6){ | 452 | .tzrc_table_wrap table.tab_wid_1 tr>td:nth-of-type(6){ |
| 454 | - width: 12%; | ||
| 455 | -} | ||
| 456 | -.tzrc_table_wrap table.tab_wid_1 tr>th:nth-of-type(7), | ||
| 457 | -.tzrc_table_wrap table.tab_wid_1 tr>td:nth-of-type(7){ | ||
| 458 | - width: 13%; | 453 | + width: 16%; |
| 459 | } | 454 | } |
| 460 | 455 | ||
| 461 | .tzrc_table_wrap table.tab_wid_1{ | 456 | .tzrc_table_wrap table.tab_wid_1{ |
| @@ -686,3 +681,18 @@ table tr>td.empty{ | @@ -686,3 +681,18 @@ table tr>td.empty{ | ||
| 686 | position: relative; | 681 | position: relative; |
| 687 | } | 682 | } |
| 688 | 683 | ||
| 684 | +.destroy_row, | ||
| 685 | +.uk-table-hover tbody tr.destroy_row:hover, | ||
| 686 | +.uk-table-hover>tr.destroy_row:hover{ | ||
| 687 | + background: #ebebeb; | ||
| 688 | + color: #464646; | ||
| 689 | + box-shadow: inset 0px 0px 9px 0px rgba(0, 0, 0, 0.17); | ||
| 690 | +} | ||
| 691 | + | ||
| 692 | +.destroy_row a, | ||
| 693 | +.destroy_row .uk-link:hover, | ||
| 694 | +.destroy_row a:hover{ | ||
| 695 | + color: #e85757; | ||
| 696 | +} | ||
| 697 | + | ||
| 698 | + |
src/main/resources/static/assets/js/common.js
| @@ -395,8 +395,9 @@ var gb_common = (function () { | @@ -395,8 +395,9 @@ var gb_common = (function () { | ||
| 395 | labels: { | 395 | labels: { |
| 396 | ok: okBtn, | 396 | ok: okBtn, |
| 397 | cancel: '取消' | 397 | cancel: '取消' |
| 398 | - } | ||
| 399 | - }).then(fun); | 398 | + }, |
| 399 | + stack: true | ||
| 400 | + }).then(fun, null); | ||
| 400 | }; | 401 | }; |
| 401 | 402 | ||
| 402 | var alt_prompt = function (name, defaultVal, okBtn, cb) { | 403 | var alt_prompt = function (name, defaultVal, okBtn, cb) { |
src/main/resources/static/index.html
src/main/resources/static/pages/abnormal/fragments/abnormal_handler.html
| @@ -41,7 +41,7 @@ | @@ -41,7 +41,7 @@ | ||
| 41 | }); | 41 | }); |
| 42 | 42 | ||
| 43 | $('._switcher_cont', wrap).on('show', function (e) { | 43 | $('._switcher_cont', wrap).on('show', function (e) { |
| 44 | - $('div:first', e.target).trigger('init', {ae: ae}); | 44 | + $('div:first', e.target).trigger('init', {ae: ae, modalId: modalId}); |
| 45 | }); | 45 | }); |
| 46 | })(); | 46 | })(); |
| 47 | </script> | 47 | </script> |
src/main/resources/static/pages/abnormal/fragments/expand_card_modal.html
| @@ -45,21 +45,38 @@ | @@ -45,21 +45,38 @@ | ||
| 45 | 45 | ||
| 46 | <script id="o_s_expand_sch_list-temp" type="text/html"> | 46 | <script id="o_s_expand_sch_list-temp" type="text/html"> |
| 47 | {{each list as sch i}} | 47 | {{each list as sch i}} |
| 48 | - <tr> | 48 | + <tr class="{{sch.status==-1?'destroy_row':''}}"> |
| 49 | <td>{{i + 1}}</td> | 49 | <td>{{i + 1}}</td> |
| 50 | <td>{{sch.lineName}}</td> | 50 | <td>{{sch.lineName}}</td> |
| 51 | <td><a>{{sch.lpName}}</a></td> | 51 | <td><a>{{sch.lpName}}</a></td> |
| 52 | <td>{{sch.jsy}}</td> | 52 | <td>{{sch.jsy}}</td> |
| 53 | <td>{{sch.nbbm}}</td> | 53 | <td>{{sch.nbbm}}</td> |
| 54 | - <td>{{sch.attJhTimeStr}}/04:22</td> | ||
| 55 | - <td>{{sch.dfsjStr}}/04:30</td> | ||
| 56 | - <td>{{sch.remarks}}</td> | 54 | + <td>{{sch.attJhTimeStr}}/</td> |
| 57 | <td> | 55 | <td> |
| 58 | - {{if sch.status!=-1}} | 56 | + {{sch.dfsjStr}}/ |
| 57 | + {{if sch.outTimeRfid!=null}} | ||
| 58 | + <span style="color: {{sch.rfidLate>0?'red':'blue'}};">{{sch.outTimeRfidStr}}</span> | ||
| 59 | + {{else if sch.outTimePzsb!=null}} | ||
| 60 | + <span style="color: {{sch.pzsbLate>0?'red':'blue'}};">{{sch.outTimePzsbStr}}</span> | ||
| 61 | + {{else if sch.fcsjActual!=null}} | ||
| 62 | + <span style="color: #8b8b8b">{{sch.fcsjActual}}</span> | ||
| 63 | + {{/if}} | ||
| 64 | + </td> | ||
| 65 | + <td><span title="{{sch.remarks}}">{{sch.remarks}}</span></td> | ||
| 66 | + <td> | ||
| 67 | + {{if sch.outTimeRfid!=null && sch.outTimePzsb!=null}} | ||
| 68 | + <small style="color: #2283e3;">已出场(2)</small> | ||
| 69 | + {{else if sch.outTimeRfid!=null}} | ||
| 70 | + <small>已出场(RFID)</small> | ||
| 71 | + {{else if sch.outTimePzsb!=null}} | ||
| 72 | + <small>已出场(牌照识别)</small> | ||
| 73 | + {{else if sch.fcsjActual!=null}} | ||
| 74 | + <small style="color: #8b8b8b;">已出场(集调)</small> | ||
| 75 | + {{else if sch.status==-1}} | ||
| 76 | + <small style="color: #e85757;">已烂班</small> | ||
| 77 | + {{else}} | ||
| 59 | <button class="uk-button uk-button-primary uk-button-small ct_dftz_btn" data-id="{{sch.id}}" data-line="{{sch.lineCode}}">调档</button> | 78 | <button class="uk-button uk-button-primary uk-button-small ct_dftz_btn" data-id="{{sch.id}}" data-line="{{sch.lineCode}}">调档</button> |
| 60 | <button class="uk-button uk-button-primary uk-button-small ct_hrhc_btn" data-id="{{sch.id}}" data-lp="{{sch.lpName}}" data-line="{{sch.lineCode}}">换人换车</button> | 79 | <button class="uk-button uk-button-primary uk-button-small ct_hrhc_btn" data-id="{{sch.id}}" data-lp="{{sch.lpName}}" data-line="{{sch.lineCode}}">换人换车</button> |
| 61 | - {{else}} | ||
| 62 | - <small style="color: red;">已烂班</small> | ||
| 63 | {{/if}} | 80 | {{/if}} |
| 64 | </td> | 81 | </td> |
| 65 | </tr> | 82 | </tr> |
src/main/resources/static/pages/abnormal/fragments/h_cont_dftz.html
| @@ -7,7 +7,7 @@ | @@ -7,7 +7,7 @@ | ||
| 7 | <script> | 7 | <script> |
| 8 | (function () { | 8 | (function () { |
| 9 | 9 | ||
| 10 | - var wrap = '.handler_cont_dftz_wrap', ae, inoutSch; | 10 | + var wrap = '.handler_cont_dftz_wrap', ae, inoutSch, modalId; |
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | $(wrap).on('init', function (e, data) { | 13 | $(wrap).on('init', function (e, data) { |
| @@ -15,6 +15,7 @@ | @@ -15,6 +15,7 @@ | ||
| 15 | if ($(this).attr('data-init') == 1) | 15 | if ($(this).attr('data-init') == 1) |
| 16 | return; | 16 | return; |
| 17 | 17 | ||
| 18 | + modalId = data.modalId; | ||
| 18 | ae = data.ae; | 19 | ae = data.ae; |
| 19 | 20 | ||
| 20 | inoutSch = gb_os_card.findByLineCode(ae.lineCode)[ae.schId]; | 21 | inoutSch = gb_os_card.findByLineCode(ae.lineCode)[ae.schId]; |
| @@ -26,6 +27,9 @@ | @@ -26,6 +27,9 @@ | ||
| 26 | }, readerScheduleList); | 27 | }, readerScheduleList); |
| 27 | 28 | ||
| 28 | $(this).attr('data-init', 1); | 29 | $(this).attr('data-init', 1); |
| 30 | + | ||
| 31 | + //提交 | ||
| 32 | + $(wrap).on('click', '.submit-btn', _submit); | ||
| 29 | }); | 33 | }); |
| 30 | 34 | ||
| 31 | var readerScheduleList = function (rs) { | 35 | var readerScheduleList = function (rs) { |
| @@ -124,6 +128,50 @@ | @@ -124,6 +128,50 @@ | ||
| 124 | cbox.checked = this.checked; | 128 | cbox.checked = this.checked; |
| 125 | } | 129 | } |
| 126 | }); | 130 | }); |
| 131 | + | ||
| 132 | + | ||
| 133 | + function _submit() { | ||
| 134 | + var f = $('.dftz_form_card>form', wrap); | ||
| 135 | + var fData = f.serializeJSON(); | ||
| 136 | + if(!fData['remarks']){ | ||
| 137 | + _shake_elem($('[name=remarks]', f)); | ||
| 138 | + return UIkit.notification('你必须输入备注信息!', 'danger'); | ||
| 139 | + } | ||
| 140 | + | ||
| 141 | + if(fData['destroyItem'] && !fData['reason']){ | ||
| 142 | + _shake_elem($('[name=reason]', f)); | ||
| 143 | + return UIkit.notification('你必须选择烂班原因!', 'danger'); | ||
| 144 | + } | ||
| 145 | + | ||
| 146 | + gb_common.alt_confirm('确定提交当前操作?', '是的,我确定', function () { | ||
| 147 | + disabledSubmitBtn(); | ||
| 148 | + | ||
| 149 | + var idx = ''; | ||
| 150 | + if(fData['destroyItem']){ | ||
| 151 | + for(var i in fData['destroyItem']) | ||
| 152 | + idx+=(fData['destroyItem'][i]+','); | ||
| 153 | + idx = idx.substr(0, idx.length-1); | ||
| 154 | + } | ||
| 155 | + fData['destroyIdx']=idx; | ||
| 156 | + delete fData['destroyItem']; | ||
| 157 | + | ||
| 158 | + gb_common.$post('/in_out/dftz', fData, function (rs) { | ||
| 159 | + UIkit.notification('操作成功!', 'success'); | ||
| 160 | + gb_os_card.update(rs.t); | ||
| 161 | + UIkit.modal(modalId).hide(); | ||
| 162 | + }); | ||
| 163 | + }); | ||
| 164 | + } | ||
| 165 | + | ||
| 166 | + function disabledSubmitBtn() { | ||
| 167 | + $('.submit-btn', wrap).html('<div uk-spinner></div>').attr('disabled', 'disabled'); | ||
| 168 | + } | ||
| 169 | + | ||
| 170 | + function _shake_elem($e) { | ||
| 171 | + $e.addClass('uk-animation-shake').one('animationend', function () { | ||
| 172 | + $(this).removeClass('uk-animation-shake'); | ||
| 173 | + }); | ||
| 174 | + } | ||
| 127 | })(); | 175 | })(); |
| 128 | </script> | 176 | </script> |
| 129 | </div> | 177 | </div> |
| 130 | \ No newline at end of file | 178 | \ No newline at end of file |
src/main/resources/static/pages/abnormal/fragments/h_cont_hrcc.html
src/main/resources/static/pages/abnormal/fragments/m_dftz.html
| @@ -8,11 +8,12 @@ | @@ -8,11 +8,12 @@ | ||
| 8 | <script> | 8 | <script> |
| 9 | (function () { | 9 | (function () { |
| 10 | 10 | ||
| 11 | - var wrap = '.modal_cont_dftz_wrap', inoutSch; | 11 | + var wrap = '.modal_cont_dftz_wrap', inoutSch, modalId; |
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | $(wrap).on('init', function (e, data) { | 14 | $(wrap).on('init', function (e, data) { |
| 15 | e.stopPropagation(); | 15 | e.stopPropagation(); |
| 16 | + modalId = '#'+data.modalId; | ||
| 16 | 17 | ||
| 17 | inoutSch = gb_os_card.findByLineCode(data.lineCode)[data.id]; | 18 | inoutSch = gb_os_card.findByLineCode(data.lineCode)[data.id]; |
| 18 | 19 | ||
| @@ -24,6 +25,9 @@ | @@ -24,6 +25,9 @@ | ||
| 24 | readerScheduleList(rs); | 25 | readerScheduleList(rs); |
| 25 | data && data.caller && data.caller(); | 26 | data && data.caller && data.caller(); |
| 26 | }); | 27 | }); |
| 28 | + | ||
| 29 | + //提交 | ||
| 30 | + $(modalId).on('click', '.submit-btn', _submit); | ||
| 27 | }); | 31 | }); |
| 28 | 32 | ||
| 29 | var readerScheduleList = function (rs) { | 33 | var readerScheduleList = function (rs) { |
| @@ -122,6 +126,49 @@ | @@ -122,6 +126,49 @@ | ||
| 122 | cbox.checked = this.checked; | 126 | cbox.checked = this.checked; |
| 123 | } | 127 | } |
| 124 | }); | 128 | }); |
| 129 | + | ||
| 130 | + function _submit() { | ||
| 131 | + var f = $('.dftz_form_card>form', modalId); | ||
| 132 | + var fData = f.serializeJSON(); | ||
| 133 | + if(!fData['remarks']){ | ||
| 134 | + _shake_elem($('[name=remarks]', f)); | ||
| 135 | + return UIkit.notification('你必须输入备注信息!', 'danger'); | ||
| 136 | + } | ||
| 137 | + | ||
| 138 | + if(fData['destroyItem'] && !fData['reason']){ | ||
| 139 | + _shake_elem($('[name=reason]', f)); | ||
| 140 | + return UIkit.notification('你必须选择烂班原因!', 'danger'); | ||
| 141 | + } | ||
| 142 | + | ||
| 143 | + gb_common.alt_confirm('确定提交当前操作?', '是的,我确定', function () { | ||
| 144 | + disabledSubmitBtn(); | ||
| 145 | + | ||
| 146 | + var idx = ''; | ||
| 147 | + if(fData['destroyItem']){ | ||
| 148 | + for(var i in fData['destroyItem']) | ||
| 149 | + idx+=(fData['destroyItem'][i]+','); | ||
| 150 | + idx = idx.substr(0, idx.length-1); | ||
| 151 | + } | ||
| 152 | + fData['destroyIdx']=idx; | ||
| 153 | + delete fData['destroyItem']; | ||
| 154 | + | ||
| 155 | + gb_common.$post('/in_out/dftz', fData, function (rs) { | ||
| 156 | + UIkit.notification('操作成功!', 'success'); | ||
| 157 | + gb_os_card.update(rs.t); | ||
| 158 | + UIkit.modal(modalId).hide(); | ||
| 159 | + }); | ||
| 160 | + }); | ||
| 161 | + } | ||
| 162 | + | ||
| 163 | + function disabledSubmitBtn() { | ||
| 164 | + $('.submit-btn', modalId).html('<div uk-spinner></div>').attr('disabled', 'disabled'); | ||
| 165 | + } | ||
| 166 | + | ||
| 167 | + function _shake_elem($e) { | ||
| 168 | + $e.addClass('uk-animation-shake').one('animationend', function () { | ||
| 169 | + $(this).removeClass('uk-animation-shake'); | ||
| 170 | + }); | ||
| 171 | + } | ||
| 125 | })(); | 172 | })(); |
| 126 | </script> | 173 | </script> |
| 127 | </div> | 174 | </div> |
| 128 | \ No newline at end of file | 175 | \ No newline at end of file |
src/main/resources/static/pages/abnormal/fragments/m_tzrc.html
src/main/resources/static/pages/abnormal/js/o_s_card.js
| @@ -9,11 +9,24 @@ var gb_os_card = (function () { | @@ -9,11 +9,24 @@ var gb_os_card = (function () { | ||
| 9 | var init = function (lineIdx, cb) { | 9 | var init = function (lineIdx, cb) { |
| 10 | $.get('/in_out/findOutByIdx',{idx: lineIdx}, function (list) { | 10 | $.get('/in_out/findOutByIdx',{idx: lineIdx}, function (list) { |
| 11 | list.sort(function (a, b) { | 11 | list.sort(function (a, b) { |
| 12 | - return a.dfsjT - b.dfsjT; | 12 | + return a['dfsjT'] - b['dfsjT']; |
| 13 | }); | 13 | }); |
| 14 | for (var i = 0, sch; sch = list[i++];) { | 14 | for (var i = 0, sch; sch = list[i++];) { |
| 15 | sch.attJhTimeStr = moment(sch.attJhTime).format('HH:mm'); | 15 | sch.attJhTimeStr = moment(sch.attJhTime).format('HH:mm'); |
| 16 | sch.dfsjStr = moment(sch.dfsjT).format('HH:mm'); | 16 | sch.dfsjStr = moment(sch.dfsjT).format('HH:mm'); |
| 17 | + if(sch.fcsjActualTime){//集调出场时间 | ||
| 18 | + sch.fcsjActual = moment(sch.fcsjActualTime).format('HH:mm'); | ||
| 19 | + } | ||
| 20 | + | ||
| 21 | + if(sch.outTimeRfid){//rfid出场时间 | ||
| 22 | + sch.outTimeRfidStr = moment(sch.outTimeRfid).format('HH:mm'); | ||
| 23 | + sch.rfidLate = sch.outTimeRfid - sch.dfsjT; | ||
| 24 | + } | ||
| 25 | + | ||
| 26 | + if(sch.outTimePzsb){//牌照识别出场时间 | ||
| 27 | + sch.outTimePzsbStr = moment(sch.outTimePzsb).format('HH:mm'); | ||
| 28 | + sch.pzsbLate = sch.outTimePzsb - sch.dfsjT; | ||
| 29 | + } | ||
| 17 | } | 30 | } |
| 18 | //按线路分组数据 | 31 | //按线路分组数据 |
| 19 | var data = gb_common.groupBy(list, 'lineCode'); | 32 | var data = gb_common.groupBy(list, 'lineCode'); |
| @@ -91,6 +104,23 @@ var gb_os_card = (function () { | @@ -91,6 +104,23 @@ var gb_os_card = (function () { | ||
| 91 | return all; | 104 | return all; |
| 92 | }; | 105 | }; |
| 93 | 106 | ||
| 107 | + var update = function (schArr) { | ||
| 108 | + if (!isArray(schArr)) | ||
| 109 | + schArr = [schArr]; | ||
| 110 | + | ||
| 111 | + $.each(schArr, function () { | ||
| 112 | + try{ | ||
| 113 | + _data[this.lineCode][this.id] = this; | ||
| 114 | + updateDom(this); | ||
| 115 | + }catch (e){ | ||
| 116 | + console.log(e); | ||
| 117 | + } | ||
| 118 | + }); | ||
| 119 | + }; | ||
| 120 | + | ||
| 121 | + var updateDom = function (sch) { | ||
| 122 | + //刷新卡片 | ||
| 123 | + }; | ||
| 94 | 124 | ||
| 95 | return { | 125 | return { |
| 96 | init: init, | 126 | init: init, |
| @@ -98,6 +128,7 @@ var gb_os_card = (function () { | @@ -98,6 +128,7 @@ var gb_os_card = (function () { | ||
| 98 | findLps: findLps, | 128 | findLps: findLps, |
| 99 | findCls: findCls, | 129 | findCls: findCls, |
| 100 | findJsys: findJsys, | 130 | findJsys: findJsys, |
| 101 | - findAll: findAll | 131 | + findAll: findAll, |
| 132 | + update: update | ||
| 102 | }; | 133 | }; |
| 103 | })(); | 134 | })(); |
| 104 | \ No newline at end of file | 135 | \ No newline at end of file |
src/main/resources/static/pages/abnormal/main.html
| @@ -178,7 +178,6 @@ | @@ -178,7 +178,6 @@ | ||
| 178 | <td>{{sch.jGh}}/{{sch.jName}}</td> | 178 | <td>{{sch.jGh}}/{{sch.jName}}</td> |
| 179 | <td>{{sch.sGh}}/{{sch.sName}}</td> | 179 | <td>{{sch.sGh}}/{{sch.sName}}</td> |
| 180 | <td>{{sch.clZbh}}</td> | 180 | <td>{{sch.clZbh}}</td> |
| 181 | - <td>{{sch.lpName}}</td> | ||
| 182 | <td> | 181 | <td> |
| 183 | {{if sch.status==2}} | 182 | {{if sch.status==2}} |
| 184 | <span class="ct_zt_yzx">已执行</span> | 183 | <span class="ct_zt_yzx">已执行</span> |
| @@ -197,63 +196,63 @@ | @@ -197,63 +196,63 @@ | ||
| 197 | </script> | 196 | </script> |
| 198 | 197 | ||
| 199 | <script id="jd_schedule_form_table_002-temp" type="text/html"> | 198 | <script id="jd_schedule_form_table_002-temp" type="text/html"> |
| 200 | - | 199 | + <input type="hidden" name="dftzId" value="{{currSch.id}}"> |
| 201 | <div class="uk-width-1-2@s"> | 200 | <div class="uk-width-1-2@s"> |
| 202 | <label class="uk-form-label">从<small>(停车场)</small></label> | 201 | <label class="uk-form-label">从<small>(停车场)</small></label> |
| 203 | <div class="uk-form-controls"> | 202 | <div class="uk-form-controls"> |
| 204 | - <input class="uk-input" name="" value="{{currSch.qdzName}}" disabled> | 203 | + <input class="uk-input" value="{{currSch.qdzName}}" disabled> |
| 205 | </div> | 204 | </div> |
| 206 | </div> | 205 | </div> |
| 207 | <div class="uk-width-1-2@s"> | 206 | <div class="uk-width-1-2@s"> |
| 208 | <label class="uk-form-label">至<small>(站点)</small></label> | 207 | <label class="uk-form-label">至<small>(站点)</small></label> |
| 209 | <div class="uk-form-controls"> | 208 | <div class="uk-form-controls"> |
| 210 | - <input class="uk-input" name="" value="{{currSch.zdzName}}" disabled> | 209 | + <input class="uk-input" value="{{currSch.zdzName}}" disabled> |
| 211 | </div> | 210 | </div> |
| 212 | </div> | 211 | </div> |
| 213 | 212 | ||
| 214 | <div class="uk-width-1-2@s"> | 213 | <div class="uk-width-1-2@s"> |
| 215 | <label class="uk-form-label">车辆编码</label> | 214 | <label class="uk-form-label">车辆编码</label> |
| 216 | <div class="uk-form-controls"> | 215 | <div class="uk-form-controls"> |
| 217 | - <input class="uk-input" name="" value="{{currSch.clZbh}}" disabled> | 216 | + <input class="uk-input" value="{{currSch.clZbh}}" disabled> |
| 218 | </div> | 217 | </div> |
| 219 | </div> | 218 | </div> |
| 220 | <div class="uk-width-1-2@s"> | 219 | <div class="uk-width-1-2@s"> |
| 221 | <label class="uk-form-label">路牌</label> | 220 | <label class="uk-form-label">路牌</label> |
| 222 | <div class="uk-form-controls"> | 221 | <div class="uk-form-controls"> |
| 223 | - <input class="uk-input" name="" value="{{currSch.lpName}}" disabled> | 222 | + <input class="uk-input" value="{{currSch.lpName}}" disabled> |
| 224 | </div> | 223 | </div> |
| 225 | </div> | 224 | </div> |
| 226 | 225 | ||
| 227 | <div class="uk-width-1-2@s"> | 226 | <div class="uk-width-1-2@s"> |
| 228 | <label class="uk-form-label">驾驶员</label> | 227 | <label class="uk-form-label">驾驶员</label> |
| 229 | <div class="uk-form-controls"> | 228 | <div class="uk-form-controls"> |
| 230 | - <input class="uk-input" name="" value="{{currSch.jGh}}/{{currSch.jName}}" disabled> | 229 | + <input class="uk-input" value="{{currSch.jGh}}/{{currSch.jName}}" disabled> |
| 231 | </div> | 230 | </div> |
| 232 | </div> | 231 | </div> |
| 233 | <div class="uk-width-1-2@s"> | 232 | <div class="uk-width-1-2@s"> |
| 234 | <label class="uk-form-label">售票员</label> | 233 | <label class="uk-form-label">售票员</label> |
| 235 | <div class="uk-form-controls"> | 234 | <div class="uk-form-controls"> |
| 236 | - <input class="uk-input" name="" value="{{currSch.sGh}}/{{currSch.sName}}" disabled> | 235 | + <input class="uk-input" value="{{currSch.sGh}}/{{currSch.sName}}" disabled> |
| 237 | </div> | 236 | </div> |
| 238 | </div> | 237 | </div> |
| 239 | 238 | ||
| 240 | <div class="uk-width-1-2@s"> | 239 | <div class="uk-width-1-2@s"> |
| 241 | <label class="uk-form-label">计发时刻</label> | 240 | <label class="uk-form-label">计发时刻</label> |
| 242 | <div class="uk-form-controls"> | 241 | <div class="uk-form-controls"> |
| 243 | - <input class="uk-input" name="" type="time" value="{{currSch.fcsj}}" disabled> | 242 | + <input class="uk-input" name="fcsj" type="time" value="{{currSch.fcsj}}" disabled> |
| 244 | </div> | 243 | </div> |
| 245 | </div> | 244 | </div> |
| 246 | <div class="uk-width-1-2@s"> | 245 | <div class="uk-width-1-2@s"> |
| 247 | <label class="uk-form-label font-orange">预发时刻</label> | 246 | <label class="uk-form-label font-orange">预发时刻</label> |
| 248 | <div class="uk-form-controls"> | 247 | <div class="uk-form-controls"> |
| 249 | - <input class="uk-input" name="" type="time" value="{{currSch.dfsj}}" > | 248 | + <input class="uk-input" name="newTimeStr" type="time" value="{{currSch.dfsj}}" > |
| 250 | </div> | 249 | </div> |
| 251 | </div> | 250 | </div> |
| 252 | 251 | ||
| 253 | <div class="uk-width-1-1@s"> | 252 | <div class="uk-width-1-1@s"> |
| 254 | <label class="uk-form-label font-orange">备注</label> | 253 | <label class="uk-form-label font-orange">备注</label> |
| 255 | <div class="uk-form-controls"> | 254 | <div class="uk-form-controls"> |
| 256 | - <textarea class="uk-textarea" rows="4" placeholder="必填,不超过50字" >{{currSch.remarks}}</textarea> | 255 | + <textarea class="uk-textarea" name="remarks" rows="4" placeholder="必填,不超过50字" >{{currSch.remarks}}</textarea> |
| 257 | </div> | 256 | </div> |
| 258 | </div> | 257 | </div> |
| 259 | 258 | ||
| @@ -280,7 +279,7 @@ | @@ -280,7 +279,7 @@ | ||
| 280 | {{each list as sch i}} | 279 | {{each list as sch i}} |
| 281 | <tr data-id="{{sch.id}}"> | 280 | <tr data-id="{{sch.id}}"> |
| 282 | <td> | 281 | <td> |
| 283 | - <input class="uk-checkbox " type="checkbox" > | 282 | + <input class="uk-checkbox " type="checkbox" name="destroyItem[{{i}}]" value="{{sch.id}}"> |
| 284 | </td> | 283 | </td> |
| 285 | <td> | 284 | <td> |
| 286 | {{sch.fcsj}} | 285 | {{sch.fcsj}} |
| @@ -325,6 +324,24 @@ | @@ -325,6 +324,24 @@ | ||
| 325 | {{/each}} | 324 | {{/each}} |
| 326 | </table> | 325 | </table> |
| 327 | </div> | 326 | </div> |
| 327 | + | ||
| 328 | + <div class="uk-width-1-2@s" style="padding: 12px 0 12px 0;"> | ||
| 329 | + <label class="uk-form-label font-orange" style="width: 100px;text-indent: 22px;margin-top: 12px;">烂班原因:</label> | ||
| 330 | + <div class="uk-form-controls" style="margin-left: 102px;"> | ||
| 331 | + <select class="uk-select" name="reason"> | ||
| 332 | + <option value="">请选择..</option> | ||
| 333 | + <option value="配车">配车</option> | ||
| 334 | + <option value="保养">保养</option> | ||
| 335 | + <option value="故障">故障</option> | ||
| 336 | + <option value="缺人">缺人</option> | ||
| 337 | + <option value="缺车">缺车</option> | ||
| 338 | + <option value="气候">气候</option> | ||
| 339 | + <option value="援外">援外</option> | ||
| 340 | + <option value="抽减">抽减</option> | ||
| 341 | + <option value="其他">其他</option> | ||
| 342 | + </select> | ||
| 343 | + </div> | ||
| 344 | + </div> | ||
| 328 | </div> | 345 | </div> |
| 329 | <div class="uk-width-1-1@s"> | 346 | <div class="uk-width-1-1@s"> |
| 330 | <hr> | 347 | <hr> |