Commit dc49f2979b8f7f3da5048608cca71922f6e4cbe7
1 parent
90164ff0
update...
Showing
12 changed files
with
727 additions
and
28 deletions
src/main/java/com/bsth/controller/realcontrol/ScheduleRealInfoController.java
| ... | ... | @@ -41,7 +41,7 @@ public class ScheduleRealInfoController extends BaseController<ScheduleRealInfo, |
| 41 | 41 | */ |
| 42 | 42 | @RequestMapping(value = "/outgoAdjust", method = RequestMethod.POST) |
| 43 | 43 | public Map<String, Object> outgoAdjust(@RequestParam Long id, @RequestParam String remarks, |
| 44 | - @RequestParam String dfsj,@RequestParam String bcType) { | |
| 44 | + @RequestParam String dfsj,String bcType) { | |
| 45 | 45 | return scheduleRealInfoService.outgoAdjust(id, remarks, dfsj, bcType); |
| 46 | 46 | } |
| 47 | 47 | |
| ... | ... | @@ -402,4 +402,9 @@ public class ScheduleRealInfoController extends BaseController<ScheduleRealInfo, |
| 402 | 402 | public Map<String, Object> findSvgAttr(@RequestParam String idx){ |
| 403 | 403 | return scheduleRealInfoService.findSvgAttr(idx); |
| 404 | 404 | } |
| 405 | + | |
| 406 | + @RequestMapping(value = "addRemarks", method = RequestMethod.POST) | |
| 407 | + public Map<String, Object> addRemarks(@RequestParam Long id, @RequestParam String remarks){ | |
| 408 | + return scheduleRealInfoService.addRemarks(id, remarks); | |
| 409 | + } | |
| 405 | 410 | } | ... | ... |
src/main/java/com/bsth/data/pilot80/PilotReport.java
| ... | ... | @@ -77,7 +77,6 @@ public class PilotReport { |
| 77 | 77 | ScheduleRealInfo outSch = dayOfSchedule.nextByBcType(nbbm, "out"); |
| 78 | 78 | //如果有对应出场班次 |
| 79 | 79 | if(outSch != null){ |
| 80 | - | |
| 81 | 80 | //没有计划里程的出场班次,出场既是首发站,发送下一班次的营运指令 |
| 82 | 81 | if(outSch.getJhlc() == null) |
| 83 | 82 | outSch = dayOfSchedule.next(outSch); |
| ... | ... | @@ -86,13 +85,6 @@ public class PilotReport { |
| 86 | 85 | directiveService.send60Dispatch(outSch, dayOfSchedule.doneSum(nbbm), "请出@系统"); |
| 87 | 86 | //下发线路切换指令 |
| 88 | 87 | directiveService.lineChange(outSch.getClZbh(), outSch.getXlBm(), "请出@系统"); |
| 89 | -/* d80.setRemarks("计划出场时间:" + outSch.getDfsj()); | |
| 90 | - //当前GPS位置 | |
| 91 | - GpsEntity gps = gpsRealData.get(d80.getDeviceId()); | |
| 92 | - if(null != gps) | |
| 93 | - d80.addRemarks("<br> 位置:" + coordHtmlStr(gps));*/ | |
| 94 | - | |
| 95 | - //sendUtils.refreshSch(outSch); | |
| 96 | 88 | }else |
| 97 | 89 | d80.setRemarks("没有出场计划"); |
| 98 | 90 | ... | ... |
src/main/java/com/bsth/service/realcontrol/ScheduleRealInfoService.java
| ... | ... | @@ -132,4 +132,6 @@ public interface ScheduleRealInfoService extends BaseService<ScheduleRealInfo, L |
| 132 | 132 | Map<String,Object> svgAttr(String jsonStr); |
| 133 | 133 | |
| 134 | 134 | Map<String,Object> findSvgAttr(String idx); |
| 135 | + | |
| 136 | + Map<String,Object> addRemarks(Long id, String remarks); | |
| 135 | 137 | } | ... | ... |
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
| ... | ... | @@ -2067,6 +2067,22 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 2067 | 2067 | } |
| 2068 | 2068 | |
| 2069 | 2069 | @Override |
| 2070 | + public Map<String, Object> addRemarks(Long id, String remarks) { | |
| 2071 | + Map<String, Object> rs = new HashMap<>(); | |
| 2072 | + try { | |
| 2073 | + ScheduleRealInfo sch = dayOfSchedule.get(id); | |
| 2074 | + sch.addRemarks(remarks); | |
| 2075 | + | |
| 2076 | + rs.put("status", ResponseCode.SUCCESS); | |
| 2077 | + rs.put("t", sch); | |
| 2078 | + } catch (Exception e) { | |
| 2079 | + logger.error("", e); | |
| 2080 | + rs.put("status", ResponseCode.ERROR); | |
| 2081 | + } | |
| 2082 | + return rs; | |
| 2083 | + } | |
| 2084 | + | |
| 2085 | + @Override | |
| 2070 | 2086 | public List<Map<String, Object>> yesterdayDataList(String line) { |
| 2071 | 2087 | // TODO Auto-generated method stub |
| 2072 | 2088 | return null; | ... | ... |
src/main/resources/static/real_control_v2/css/home.css
| ... | ... | @@ -58,7 +58,7 @@ |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | .home-gps-table { |
| 61 | - width: 560px; | |
| 61 | + width: 620px; | |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | .home-gps-table small { |
| ... | ... | @@ -66,7 +66,7 @@ |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | .home-gps-table dl dt:nth-of-type(1), .home-gps-table dl dd:nth-of-type(1) { |
| 69 | - width: 15%; | |
| 69 | + width: 14%; | |
| 70 | 70 | font-size: 14px; |
| 71 | 71 | } |
| 72 | 72 | |
| ... | ... | @@ -75,19 +75,19 @@ |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | .home-gps-table dl dt:nth-of-type(3), .home-gps-table dl dd:nth-of-type(3) { |
| 78 | - width: 10% | |
| 78 | + width: 8% | |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | .home-gps-table dl dt:nth-of-type(4), .home-gps-table dl dd:nth-of-type(4) { |
| 82 | - width: 10% | |
| 82 | + width: 9% | |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | .home-gps-table dl dt:nth-of-type(5), .home-gps-table dl dd:nth-of-type(5) { |
| 86 | - width: 19% | |
| 86 | + width: 17% | |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | .home-gps-table dl dt:nth-of-type(6), .home-gps-table dl dd:nth-of-type(6) { |
| 90 | - width: 18% | |
| 90 | + width: 17% | |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | .home-gps-table dl dt:nth-of-type(7), .home-gps-table dl dd:nth-of-type(7) { |
| ... | ... | @@ -95,7 +95,7 @@ |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | .home-gps-table dl dt:nth-of-type(8), .home-gps-table dl dd:nth-of-type(8) { |
| 98 | - width: 9%; | |
| 98 | + width: 16%; | |
| 99 | 99 | border-right: 0; |
| 100 | 100 | } |
| 101 | 101 | ... | ... |
src/main/resources/static/real_control_v2/css/main.css
| ... | ... | @@ -643,4 +643,48 @@ li.map-panel{ |
| 643 | 643 | .station-list.down .station-item:hover{ |
| 644 | 644 | box-shadow: 0px 3px 6px 0 rgba(0, 0, 0, 0.2), 0px 1px 4px 0 rgba(0, 0, 0, 0.19); |
| 645 | 645 | background: #e95151; |
| 646 | +} | |
| 647 | + | |
| 648 | +.modal-dotted-hr{ | |
| 649 | + height: 1px;border: none;border-top: 1px dashed #d1d1d1;width: calc(100% + 40px);margin-left: -20px; | |
| 650 | +} | |
| 651 | + | |
| 652 | +#add-sub-task-range_turn-modal .main-sch-panel{ | |
| 653 | + height: 60px; | |
| 654 | + border: 1px solid #dddddd; | |
| 655 | + border-radius: 5px; | |
| 656 | + position: relative; | |
| 657 | + padding: 20px 0 0 8px; | |
| 658 | +} | |
| 659 | + | |
| 660 | +#add-sub-task-range_turn-modal .main-sch-panel:before{ | |
| 661 | + content: '主任务'; | |
| 662 | + position: absolute; | |
| 663 | + top: -10px; | |
| 664 | + left: 10px; | |
| 665 | + background: #fff; | |
| 666 | + padding: 0 4px; | |
| 667 | + font-size: 12px; | |
| 668 | + color: #adadad; | |
| 669 | +} | |
| 670 | + | |
| 671 | +.ct_row { | |
| 672 | + font-size: 0; | |
| 673 | +} | |
| 674 | + | |
| 675 | +.ct_row .ct_cell { | |
| 676 | + display: inline-block; | |
| 677 | + font-size: 13px; | |
| 678 | + white-space: nowrap; | |
| 679 | + overflow: hidden; | |
| 680 | + text-overflow: ellipsis; | |
| 681 | +} | |
| 682 | + | |
| 683 | +.ct_row .ct_cell label{ | |
| 684 | + color: #979393; | |
| 685 | + margin-right: 3px; | |
| 686 | +} | |
| 687 | + | |
| 688 | +.ct_row .ct_cell.c_1_3 { | |
| 689 | + width: 33%; | |
| 646 | 690 | } |
| 647 | 691 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/fcxxwt.html
| ... | ... | @@ -129,7 +129,7 @@ |
| 129 | 129 | </div> |
| 130 | 130 | </div> |
| 131 | 131 | |
| 132 | - <hr style="height: 1px;border: none;border-top: 1px dashed #d1d1d1;width: calc(100% + 40px);margin-left: -20px;"> | |
| 132 | + <hr class="modal-dotted-hr"> | |
| 133 | 133 | <div class="uk-grid"> |
| 134 | 134 | <div class="uk-width-1-2"> |
| 135 | 135 | <div class="uk-form-row"> | ... | ... |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/lj_zrw.html
| ... | ... | @@ -330,6 +330,19 @@ |
| 330 | 330 | }, modal_opts); |
| 331 | 331 | }; |
| 332 | 332 | |
| 333 | + //区间掉头子任务 | |
| 334 | + var add_sub_task_range_turn = function () { | |
| 335 | + var sch = getActiveSch(); | |
| 336 | + if (!sch) | |
| 337 | + return notify_err('无法获取到主任务信息!'); | |
| 338 | + if(sch.bcType == 'out' || sch.bcType == 'in') | |
| 339 | + return notify_err('进出场班次不能做区间掉头!'); | |
| 340 | + | |
| 341 | + open_modal(folder + '/sub_task/add_sub_task_range_turn.html', { | |
| 342 | + sch: sch | |
| 343 | + }, modal_opts); | |
| 344 | + }; | |
| 345 | + | |
| 333 | 346 | //删除子任务 |
| 334 | 347 | var remove_sub_task = function () { |
| 335 | 348 | var activeDl = $(s_t_body, modal).find('dl.context-menu-active'); |
| ... | ... | @@ -358,7 +371,8 @@ |
| 358 | 371 | add_sub_task_other: add_sub_task_other, |
| 359 | 372 | add_sub_task_in: add_sub_task_in, |
| 360 | 373 | remove_sub_task: remove_sub_task, |
| 361 | - add_sub_task_out: add_sub_task_out | |
| 374 | + add_sub_task_out: add_sub_task_out, | |
| 375 | + add_sub_task_range_turn: add_sub_task_range_turn | |
| 362 | 376 | }; |
| 363 | 377 | |
| 364 | 378 | //右键菜单 |
| ... | ... | @@ -382,8 +396,7 @@ |
| 382 | 396 | name: '出场' |
| 383 | 397 | }, |
| 384 | 398 | 'add_sub_task_range_turn': { |
| 385 | - name: '区间掉头', | |
| 386 | - disabled: true | |
| 399 | + name: '区间掉头' | |
| 387 | 400 | }, |
| 388 | 401 | 'add_sub_task_other': { |
| 389 | 402 | name: '自定义' | ... | ... |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/sub_task/add_sub_task_range_turn.html
0 → 100644
| 1 | +<div class="uk-modal ct-form-modal" id="add-sub-task-range_turn-modal"> | |
| 2 | + <div class="uk-modal-dialog" style="width: 1200px;"> | |
| 3 | + <a href="" class="uk-modal-close uk-close"></a> | |
| 4 | + <div class="uk-modal-header"> | |
| 5 | + <h2>区间掉头子任务</h2></div> | |
| 6 | + | |
| 7 | + <div style="width: 100%;padding-left: 1%;"> | |
| 8 | + <form class="uk-form uk-form-horizontal"> | |
| 9 | + <div class="uk-grid"> | |
| 10 | + <div class="uk-width-1-4"> | |
| 11 | + <div class="uk-form-row" style="margin-top: 20px;"> | |
| 12 | + <label class="uk-form-label">掉头站点</label> | |
| 13 | + <div class="uk-form-controls"> | |
| 14 | + <select id="turnStationSelect"> | |
| 15 | + <option value="">请选择...</option> | |
| 16 | + </select> | |
| 17 | + </div> | |
| 18 | + </div> | |
| 19 | + </div> | |
| 20 | + <div class="uk-width-1-4"> | |
| 21 | + <div class="uk-form-row" style="margin-top: 20px;"> | |
| 22 | + <label class="uk-form-label">掉头原因</label> | |
| 23 | + <div class="uk-form-controls"> | |
| 24 | + <select id="turnReason" style="width: calc(100% - 9px);"> | |
| 25 | + <option value="">请选择...</option> | |
| 26 | + </select> | |
| 27 | + </div> | |
| 28 | + </div> | |
| 29 | + </div> | |
| 30 | + <div class="uk-width-2-4" style="padding-left: 28px;"> | |
| 31 | + <h6 style="color: #a7a5a5;margin-top: 35px;"><i class="uk-icon-question-circle"> </i> | |
| 32 | + 如果“掉头站点”在另一个走向不存在,你需要手动选择第二个营运起点</h6> | |
| 33 | + </div> | |
| 34 | + </div> | |
| 35 | + </form> | |
| 36 | + </div> | |
| 37 | + <hr class="modal-dotted-hr"> | |
| 38 | + <div class="uk-grid"> | |
| 39 | + <div class="uk-width-1-2"> | |
| 40 | + <div class="main-sch-panel curr"></div> | |
| 41 | + | |
| 42 | + <div style="margin-top: 5px;"> | |
| 43 | + <div class="sub-task-card" style="margin: 0 0 0 7px;"> | |
| 44 | + <div class="uk-panel uk-panel-box uk-panel-box-primary" style="padding-bottom: 32px;"> | |
| 45 | + <div class="uk-panel-badge uk-badge">营运</div> | |
| 46 | + <h3 class="uk-panel-title">线路上站点间</h3> | |
| 47 | + | |
| 48 | + <form class="uk-form uk-form-horizontal" curr_service_form> | |
| 49 | + </form> | |
| 50 | + </div> | |
| 51 | + </div> | |
| 52 | + <div class="sub-task-card " style="margin: 0;"> | |
| 53 | + <div class="uk-panel uk-panel-box" style="padding-bottom: 32px;"> | |
| 54 | + <div class="uk-panel-badge uk-badge uk-badge-danger">烂班</div> | |
| 55 | + <h3 class="uk-panel-title">线路上站点间</h3> | |
| 56 | + <form class="uk-form uk-form-horizontal " curr_destroy_form> | |
| 57 | + </form> | |
| 58 | + </div> | |
| 59 | + </div> | |
| 60 | + </div> | |
| 61 | + </div> | |
| 62 | + <div class="uk-width-1-2"> | |
| 63 | + <div class="main-sch-panel next"></div> | |
| 64 | + | |
| 65 | + <div style="margin: 5px;"> | |
| 66 | + <div class="sub-task-card " style="margin: 0 0 0 7px;"> | |
| 67 | + <div class="uk-panel uk-panel-box" style="padding-bottom: 32px;"> | |
| 68 | + <div class="uk-panel-badge uk-badge uk-badge-danger">烂班</div> | |
| 69 | + <h3 class="uk-panel-title">线路上站点间</h3> | |
| 70 | + <form class="uk-form uk-form-horizontal " next_destroy_form></form> | |
| 71 | + </div> | |
| 72 | + </div> | |
| 73 | + <div class="sub-task-card" style="margin: 0;"> | |
| 74 | + <div class="uk-panel uk-panel-box uk-panel-box-primary" style="padding-bottom: 32px;"> | |
| 75 | + <div class="uk-panel-badge uk-badge">营运</div> | |
| 76 | + <h3 class="uk-panel-title">线路上站点间</h3> | |
| 77 | + | |
| 78 | + <form class="uk-form uk-form-horizontal" next_service_form> | |
| 79 | + </form> | |
| 80 | + </div> | |
| 81 | + </div> | |
| 82 | + </div> | |
| 83 | + </div> | |
| 84 | + </div> | |
| 85 | + | |
| 86 | + | |
| 87 | + <div class="uk-modal-footer uk-text-right"> | |
| 88 | + <button type="button" class="uk-button uk-modal-close">取消</button> | |
| 89 | + <button type="button" class="uk-button uk-button-primary" id="submitChildTaskBtn">提交子任务</button> | |
| 90 | + | |
| 91 | + <div class="ct-footer-left"> | |
| 92 | + <a id="betweenStationRangeCalc" data-drawer-id="station_route_spacing_chart_drawer">站点间公里不准?</a> | |
| 93 | + </div> | |
| 94 | + </div> | |
| 95 | + </div> | |
| 96 | + <!-- 主任务信息 --> | |
| 97 | + <script id="range_turn_main_sch-temp" type="text/html"> | |
| 98 | + <div class="ct_row"> | |
| 99 | + <div class="ct_cell c_1_3"> | |
| 100 | + <label>待发</label> | |
| 101 | + <span>{{dfsj}}</span> | |
| 102 | + </div> | |
| 103 | + <div class="ct_cell c_1_3"> | |
| 104 | + <label>计达</label> | |
| 105 | + <span>{{zdsj}}</span> | |
| 106 | + </div> | |
| 107 | + <div class="ct_cell c_1_3"> | |
| 108 | + <label>车辆</label> | |
| 109 | + <span>{{clZbh}}</span> | |
| 110 | + </div> | |
| 111 | + </div> | |
| 112 | + <div class="ct_row"> | |
| 113 | + <div class="ct_cell c_1_3"> | |
| 114 | + <label>起点</label> | |
| 115 | + <span>{{qdzName}}</span> | |
| 116 | + </div> | |
| 117 | + <div class="ct_cell c_1_3"> | |
| 118 | + <label>终点</label> | |
| 119 | + <span>{{zdzName}}</span> | |
| 120 | + </div> | |
| 121 | + <div class="ct_cell c_1_3"> | |
| 122 | + <label>里程</label> | |
| 123 | + <span>{{jhlc}}</span> | |
| 124 | + </div> | |
| 125 | + </div> | |
| 126 | + </script> | |
| 127 | + | |
| 128 | + <!-- 子任务营运表单 --> | |
| 129 | + <script id="range_turn_child_service-temp" type="text/html"> | |
| 130 | + <input type="hidden" name="schedule.id" value="{{sch.id}}"> | |
| 131 | + <input type="hidden" name="type2" value="1"> | |
| 132 | + <input type="hidden" value="正常" name="type1"> | |
| 133 | + <input type="hidden" name="mileageType" value="service"> | |
| 134 | + <div class="uk-grid"> | |
| 135 | + <div class="uk-width-3-10"> | |
| 136 | + <div class="uk-form-row"> | |
| 137 | + <label class="uk-form-label">起点 </label> | |
| 138 | + </div> | |
| 139 | + </div> | |
| 140 | + <div class="uk-width-7-10 pl5"> | |
| 141 | + <select name="startStation"> | |
| 142 | + {{each routes as r i}} | |
| 143 | + <option value="{{r.stationCode}}">{{r.stationName}}</option> | |
| 144 | + {{/each}} | |
| 145 | + </select> | |
| 146 | + </div> | |
| 147 | + </div> | |
| 148 | + <div class="uk-grid"> | |
| 149 | + <div class="uk-width-3-10"> | |
| 150 | + <div class="uk-form-row"> | |
| 151 | + <label class="uk-form-label">终点 </label> | |
| 152 | + </div> | |
| 153 | + </div> | |
| 154 | + <div class="uk-width-7-10 pl5"> | |
| 155 | + <select name="endStation" class="ct_focus" disabled> | |
| 156 | + {{each routes as r i}} | |
| 157 | + <option value="{{r.stationCode}}" {{if r.stationCode==sch.zdzCode}}selected{{/if}}> | |
| 158 | + {{r.stationName}} | |
| 159 | + </option> | |
| 160 | + {{/each}} | |
| 161 | + </select> | |
| 162 | + </div> | |
| 163 | + </div> | |
| 164 | + <div class="uk-grid"> | |
| 165 | + <div class="uk-width-3-10"> | |
| 166 | + <div class="uk-form-row"> | |
| 167 | + <label class="uk-form-label">营运里程</label> | |
| 168 | + </div> | |
| 169 | + </div> | |
| 170 | + <div class="uk-width-7-10 pl5"> | |
| 171 | + <input type="text" name="mileage" value="{{sch.jhlc}}" required> | |
| 172 | + </div> | |
| 173 | + </div> | |
| 174 | + <div class="uk-grid"> | |
| 175 | + <div class="uk-width-3-10"> | |
| 176 | + <div class="uk-form-row"> | |
| 177 | + <label class="uk-form-label">开始时间</label> | |
| 178 | + </div> | |
| 179 | + </div> | |
| 180 | + <div class="uk-width-7-10 pl5"> | |
| 181 | + <input type="time" name="startDate" value="{{sch.dfsj}}" required disabled> | |
| 182 | + </div> | |
| 183 | + </div> | |
| 184 | + <div class="uk-grid"> | |
| 185 | + <div class="uk-width-3-10"> | |
| 186 | + <div class="uk-form-row"> | |
| 187 | + <label class="uk-form-label">结束时间</label> | |
| 188 | + </div> | |
| 189 | + </div> | |
| 190 | + <div class="uk-width-7-10 pl5"> | |
| 191 | + <input type="time" name="endDate" value="{{sch.zdsj}}" required> | |
| 192 | + </div> | |
| 193 | + </div> | |
| 194 | + </script> | |
| 195 | + | |
| 196 | + <!-- 子任务烂班表单 --> | |
| 197 | + <script id="range_turn_child_destroy-temp" type="text/html"> | |
| 198 | + <input type="hidden" name="schedule.id" value="{{sch.id}}"> | |
| 199 | + <input type="hidden" value="正常" name="type1"> | |
| 200 | + <input type="hidden" value="1" name="type2"> | |
| 201 | + <input type="hidden" name="mileageType" value="service"> | |
| 202 | + <input type="hidden" name="destroy" value="true"> | |
| 203 | + <div class="uk-grid"> | |
| 204 | + <div class="uk-width-3-10"> | |
| 205 | + <div class="uk-form-row"> | |
| 206 | + <label class="uk-form-label">起点 </label> | |
| 207 | + </div> | |
| 208 | + </div> | |
| 209 | + <div class="uk-width-7-10 pl5"> | |
| 210 | + <select name="startStation" required disabled> | |
| 211 | + {{each routes as r i}} | |
| 212 | + <option value="{{r.stationCode}}">{{r.stationName}}</option> | |
| 213 | + {{/each}} | |
| 214 | + </select> | |
| 215 | + </div> | |
| 216 | + </div> | |
| 217 | + <div class="uk-grid"> | |
| 218 | + <div class="uk-width-3-10"> | |
| 219 | + <div class="uk-form-row"> | |
| 220 | + <label class="uk-form-label">终点 </label> | |
| 221 | + </div> | |
| 222 | + </div> | |
| 223 | + <div class="uk-width-7-10 pl5"> | |
| 224 | + <select name="endStation" required class="ct_focus"> | |
| 225 | + {{each routes as r i}} | |
| 226 | + <option value="{{r.stationCode}}" {{if r.stationCode==sch.zdzCode}}selected{{/if}}> | |
| 227 | + {{r.stationName}} | |
| 228 | + </option> | |
| 229 | + {{/each}} | |
| 230 | + </select> | |
| 231 | + </div> | |
| 232 | + </div> | |
| 233 | + <div class="uk-grid"> | |
| 234 | + <div class="uk-width-3-10"> | |
| 235 | + <div class="uk-form-row"> | |
| 236 | + <label class="uk-form-label">烂班里程</label> | |
| 237 | + </div> | |
| 238 | + </div> | |
| 239 | + <div class="uk-width-7-10 pl5"> | |
| 240 | + <input type="text" name="mileage" required> | |
| 241 | + </div> | |
| 242 | + </div> | |
| 243 | + <div class="uk-grid"> | |
| 244 | + <div class="uk-width-3-10"> | |
| 245 | + <div class="uk-form-row"> | |
| 246 | + <label class="uk-form-label">开始时间</label> | |
| 247 | + </div> | |
| 248 | + </div> | |
| 249 | + <div class="uk-width-7-10 pl5"> | |
| 250 | + <input type="time" name="startDate" required disabled> | |
| 251 | + </div> | |
| 252 | + </div> | |
| 253 | + <div class="uk-grid" style="height: 30px;"> | |
| 254 | + </div> | |
| 255 | + </script> | |
| 256 | + | |
| 257 | + <div class="ct-bottom-drawer"> | |
| 258 | + <div class="ct-bottom-drawer-body"></div> | |
| 259 | + </div> | |
| 260 | + | |
| 261 | + <script> | |
| 262 | + (function () { | |
| 263 | + var modal = '#add-sub-task-range_turn-modal', | |
| 264 | + sch, nextSch, stationRoutes, information, timeLocStations; | |
| 265 | + var adjustExps = ['配车', '保养', '故障', '肇事', '路阻', '纠纷', '缺人', '客稀', '缺车', '气候', '援外', '吊慢', '抽减', '其他']; | |
| 266 | + | |
| 267 | + var csf = $('form[curr_service_form]', modal); | |
| 268 | + var nsf = $('form[next_service_form]', modal); | |
| 269 | + var cdf = $('form[curr_destroy_form]', modal); | |
| 270 | + var ndf = $('form[next_destroy_form]', modal); | |
| 271 | + | |
| 272 | + //掉头站点 | |
| 273 | + var turnStation, turnStationName; | |
| 274 | + $(modal).on('init', function (e, data) { | |
| 275 | + sch = data.sch; | |
| 276 | + nextSch = gb_schedule_table.getNextSch(sch); | |
| 277 | + | |
| 278 | + //主任务信息 | |
| 279 | + $('.main-sch-panel.curr', modal).html(template('range_turn_main_sch-temp', sch)); | |
| 280 | + $('.main-sch-panel.next', modal).html(template('range_turn_main_sch-temp', nextSch)); | |
| 281 | + | |
| 282 | + //站点路由 | |
| 283 | + stationRoutes = gb_common.groupBy(gb_data_basic.stationRoutes(sch.xlBm).sort(function (a, b) { | |
| 284 | + return a.stationRouteCode - b.stationRouteCode; | |
| 285 | + }), 'directions'); | |
| 286 | + | |
| 287 | + var currData = {sch: sch, routes: stationRoutes[sch.xlDir]} | |
| 288 | + , nextData = {sch: nextSch, routes: stationRoutes[nextSch.xlDir]}; | |
| 289 | + //营运1 | |
| 290 | + csf.html(template('range_turn_child_service-temp', currData)); | |
| 291 | + disabledField(csf, 'startStation'); | |
| 292 | + //营运结束时间 | |
| 293 | + $('[name=endDate]', csf).on('input', synchroDate); | |
| 294 | + | |
| 295 | + //营运2 | |
| 296 | + nsf.html(template('range_turn_child_service-temp', nextData)); | |
| 297 | + disabledField(nsf, 'endDate'); | |
| 298 | + //烂班1 | |
| 299 | + cdf.html(template('range_turn_child_destroy-temp', currData)); | |
| 300 | + disabledField(cdf, 'endStation'); | |
| 301 | + //烂班2 | |
| 302 | + ndf.html(template('range_turn_child_destroy-temp', nextData)); | |
| 303 | + $('[name=startStation]', ndf).val(nextSch.qdzCode); | |
| 304 | + //烂班2终点改变 | |
| 305 | + $('[name=endStation]', ndf).on('change', reCalcSecond); | |
| 306 | + //营运2起点改变 | |
| 307 | + $('[name=startStation]', nsf).on('change', reCalcSecond); | |
| 308 | + | |
| 309 | + //掉头站点 | |
| 310 | + var opts = ''; | |
| 311 | + $.each(currData.routes, function () { | |
| 312 | + opts += '<option value="' + this.stationCode + '">' + this.stationName + '</option>'; | |
| 313 | + }); | |
| 314 | + $('#turnStationSelect', modal).append(opts); | |
| 315 | + opts = ''; | |
| 316 | + $.each(adjustExps, function () { | |
| 317 | + opts += '<option value="' + this + '">' + this + '</option>'; | |
| 318 | + }); | |
| 319 | + //掉头原因 | |
| 320 | + $('#turnReason', modal).append(opts); | |
| 321 | + | |
| 322 | + //线路标准 | |
| 323 | + information = gb_data_basic.getLineInformation(sch.xlBm); | |
| 324 | + //本地存储的站点耗时 | |
| 325 | + getLocStationsSpace(); | |
| 326 | + | |
| 327 | + var dataArray = []; | |
| 328 | + var fs = $('.sub-task-card form', modal).formValidation({ | |
| 329 | + framework: 'uikit', | |
| 330 | + locale: 'zh_CN' | |
| 331 | + }); | |
| 332 | + fs.on('success.form.fv', function (e) { | |
| 333 | + e.preventDefault(); | |
| 334 | + dataArray.push($.extend($(this).serializeJSON(), getDisabledVal(this), | |
| 335 | + {remarks: $('#turnReason', modal).val(), destroyReason: $('#turnReason', modal).val()})); | |
| 336 | + $(this).data('valid', true); | |
| 337 | + | |
| 338 | + if (allValidSuccess()) { | |
| 339 | + var i = 0; | |
| 340 | + (function () { | |
| 341 | + var f = arguments.callee; | |
| 342 | + if (i >= dataArray.length) { | |
| 343 | + /** | |
| 344 | + * 为班次添加备注 | |
| 345 | + */ | |
| 346 | + var remarks = '掉头' + $('[name=endDate]', csf).val() + ' 因 ' + $('#turnReason', modal).val() + '在' + $('[name=endStation] option:selected', csf).text() + '掉头'; | |
| 347 | + gb_schedule_table.addRemarks([sch, nextSch], remarks); | |
| 348 | + UIkit.modal(modal).hide(); | |
| 349 | + $('#schedule-lj_zrw-modal .main-schedule-table').trigger('refresh', {sch: sch}); | |
| 350 | + return; | |
| 351 | + } | |
| 352 | + var data = dataArray[i]; | |
| 353 | + gb_common.$post('/childTask', data, function (rs) { | |
| 354 | + notify_succ('子任务添加成功'); | |
| 355 | + gb_schedule_table.updateSchedule(rs.t); | |
| 356 | + i++; | |
| 357 | + f(); | |
| 358 | + }); | |
| 359 | + })(); | |
| 360 | + } | |
| 361 | + }); | |
| 362 | + | |
| 363 | + //校验不过 | |
| 364 | + fs.on('err.field.fv', function () { | |
| 365 | + $('#submitChildTaskBtn', modal).removeClass('disabled').removeAttr('disabled'); | |
| 366 | + }); | |
| 367 | + | |
| 368 | + //submit | |
| 369 | + $('#submitChildTaskBtn', modal).on('click', function () { | |
| 370 | + if ($('#turnReason', modal).val() == '') { | |
| 371 | + return notify_err('你必须选择掉头原因!'); | |
| 372 | + } | |
| 373 | + | |
| 374 | + $(this).addClass('disabled').attr('disabled', 'disabled'); | |
| 375 | + dataArray = []; | |
| 376 | + fs.data('valid', false); | |
| 377 | + fs.formValidation('validate'); | |
| 378 | + }); | |
| 379 | + | |
| 380 | + //掉头站切换 | |
| 381 | + $('#turnStationSelect', modal).on('change', function () { | |
| 382 | + turnStation = $(this).val(); | |
| 383 | + turnStationName = $('option:selected', this).text(); | |
| 384 | + reClac(); | |
| 385 | + }); | |
| 386 | + }); | |
| 387 | + | |
| 388 | + function disabledField(f, itemName) { | |
| 389 | + $('[name=' + itemName + ']', f).attr('disabled', 'disabled'); | |
| 390 | + } | |
| 391 | + | |
| 392 | + function allValidSuccess() { | |
| 393 | + var flag = true; | |
| 394 | + $('.sub-task-card form:visible', modal).each(function (i, f) { | |
| 395 | + if (!$(f).data('valid')) { | |
| 396 | + flag = false; | |
| 397 | + return false; | |
| 398 | + } | |
| 399 | + }); | |
| 400 | + return flag; | |
| 401 | + } | |
| 402 | + | |
| 403 | + //获取表单disabled 项的值 | |
| 404 | + function getDisabledVal(f) { | |
| 405 | + var rs = {}; | |
| 406 | + $('input,select', f).each(function () { | |
| 407 | + if ($(this).attr('disabled')) { | |
| 408 | + rs[$(this).attr('name')] = $(this).val(); | |
| 409 | + } | |
| 410 | + }); | |
| 411 | + return rs; | |
| 412 | + } | |
| 413 | + | |
| 414 | + function reClac() { | |
| 415 | + if (!turnStation || turnStation == '') | |
| 416 | + return; | |
| 417 | + | |
| 418 | + var mileage, et, ets; | |
| 419 | + | |
| 420 | + $('#turnStationSelect', modal).val(turnStation); | |
| 421 | + //营运1终点 | |
| 422 | + $('[name=endStation]', csf).val(turnStation); | |
| 423 | + calcFormMileage(csf, sch.xlDir);//里程 | |
| 424 | + //结束时间 | |
| 425 | + ets = calcFirstEndDate(); | |
| 426 | + | |
| 427 | + //烂班1起点 | |
| 428 | + $('[name=startStation]', cdf).val(turnStation); | |
| 429 | + calcFormMileage(cdf, sch.xlDir); | |
| 430 | + //开始时间 | |
| 431 | + $('[name=startDate]', cdf).val(ets); | |
| 432 | + //烂班2终点 | |
| 433 | + try { | |
| 434 | + $('[name=endStation]', ndf).val(searchParallelStation()); | |
| 435 | + calcFormMileage(ndf, nextSch.xlDir); | |
| 436 | + } catch (e) { | |
| 437 | + } | |
| 438 | + //开始时间 | |
| 439 | + $('[name=startDate]', ndf).val(ets); | |
| 440 | + | |
| 441 | + //营运2起点 | |
| 442 | + try { | |
| 443 | + $('[name=startStation]', nsf).val(searchParallelStation()); | |
| 444 | + calcFormMileage(nsf, nextSch.xlDir); | |
| 445 | + } catch (e) { | |
| 446 | + } | |
| 447 | + //开始时间 | |
| 448 | + $('[name=startDate]', nsf).val(ets); | |
| 449 | + //结束时间 | |
| 450 | + calcSecondEndDate(); | |
| 451 | + } | |
| 452 | + | |
| 453 | + function calcFirstEndDate() { | |
| 454 | + var mileage = parseInt($('[name=mileage]', csf).val()); | |
| 455 | + var et = sch.dfsjT + (mileage / sch.jhlc * sch.bcsj * 60 * 1000); | |
| 456 | + var ets = et > sch.zdsjT ? sch.zdsj : moment(et).format('HH:mm'); | |
| 457 | + $('[name=endDate]', csf).val(ets); | |
| 458 | + return ets; | |
| 459 | + } | |
| 460 | + | |
| 461 | + function calcSecondEndDate() { | |
| 462 | + var mileage = parseInt($('[name=mileage]', nsf).val()); | |
| 463 | + var ets = moment($('[name=startDate]', nsf).val(), 'HH:mm') | |
| 464 | + .add(mileage / nextSch.jhlc * nextSch.bcsj * 60, 'seconds') | |
| 465 | + .format('HH:mm'); | |
| 466 | + $('[name=endDate]', nsf).val(ets); | |
| 467 | + return ets; | |
| 468 | + } | |
| 469 | + | |
| 470 | + //返回另一个走向对应的站点 | |
| 471 | + function searchParallelStation() { | |
| 472 | + var routes = stationRoutes[nextSch.xlDir] | |
| 473 | + , len = routes.length; | |
| 474 | + | |
| 475 | + for (var i = 0; i < len; i++) { | |
| 476 | + if (routes[i].stationName == turnStationName) | |
| 477 | + return routes[i].stationCode; | |
| 478 | + } | |
| 479 | + } | |
| 480 | + | |
| 481 | + //计算第二个班次 | |
| 482 | + function reCalcSecond() { | |
| 483 | + var code = $(this).val() | |
| 484 | + , updown = nextSch.xlDir; | |
| 485 | + | |
| 486 | + $('[name=endStation]', ndf).val(code); | |
| 487 | + calcFormMileage(ndf, updown); | |
| 488 | + | |
| 489 | + $('[name=startStation]', nsf).val(code); | |
| 490 | + calcFormMileage(nsf, updown); | |
| 491 | + //结束时间 | |
| 492 | + calcSecondEndDate(); | |
| 493 | + } | |
| 494 | + | |
| 495 | + //同步时间 | |
| 496 | + function synchroDate() { | |
| 497 | + var date = $(this).val(); | |
| 498 | + $('[name=startDate]', cdf).val(date); | |
| 499 | + $('[name=startDate]', ndf).val(date); | |
| 500 | + $('[name=startDate]', nsf).val(date); | |
| 501 | + calcSecondEndDate(); | |
| 502 | + } | |
| 503 | + | |
| 504 | + function calcFormMileage(f, updown) { | |
| 505 | + var s = $('[name=startStation]', f).val() | |
| 506 | + , e = $('[name=endStation]', f).val(); | |
| 507 | + | |
| 508 | + $('[name=mileage]', f).val(calcMileage(s, e, updown)); | |
| 509 | + } | |
| 510 | + | |
| 511 | + function calcMileage(s, e, updown) { | |
| 512 | + var mileage = 0, flag, code; | |
| 513 | + if (timeLocStations) { | |
| 514 | + //空间坐标计算的站距 | |
| 515 | + $.each(timeLocStations[updown == 0 ? 'up' : 'down'], function () { | |
| 516 | + code = this.station['STATION_CODE']; | |
| 517 | + if (flag) | |
| 518 | + mileage = gb_common.accAdd(mileage, this.toDistanceGl); | |
| 519 | + if (code == s) | |
| 520 | + flag = true; | |
| 521 | + if (code == e) | |
| 522 | + return false; | |
| 523 | + }); | |
| 524 | + } | |
| 525 | + else { | |
| 526 | + //从原始站点路由字段里取值 | |
| 527 | + $.each(stationRoutes[updown], function () { | |
| 528 | + code = this['stationCode']; | |
| 529 | + if (flag) | |
| 530 | + mileage = gb_common.accAdd(mileage, this.distances); | |
| 531 | + if (code == s) | |
| 532 | + flag = true; | |
| 533 | + if (code == e) | |
| 534 | + return false; | |
| 535 | + }); | |
| 536 | + } | |
| 537 | + return mileage; | |
| 538 | + } | |
| 539 | + | |
| 540 | + //从本地localStorage获取站间距数据 | |
| 541 | + function getLocStationsSpace() { | |
| 542 | + try { | |
| 543 | + timeLocStations = window.localStorage.getItem('control_route_distance_' + sch.xlBm); | |
| 544 | + if (timeLocStations) | |
| 545 | + timeLocStations = JSON.parse(timeLocStations).stations; | |
| 546 | + } catch (e) { | |
| 547 | + console.log(e); | |
| 548 | + } | |
| 549 | + } | |
| 550 | + | |
| 551 | + //站间距计算后刷新 | |
| 552 | + $(modal).on('refresh_station_space', function () { | |
| 553 | + getLocStationsSpace(); | |
| 554 | + reClac(); | |
| 555 | + }); | |
| 556 | + | |
| 557 | + //------ 下抽屉 ------ | |
| 558 | + $('#betweenStationRangeCalc', modal).on('click', function () { | |
| 559 | + var id = $(this).data('drawer-id'); | |
| 560 | + switchBtmDrawer(id, '/real_control_v2/fragments/line_schedule/context_menu/sub_task/station_route_spacing_chart.html'); | |
| 561 | + }); | |
| 562 | + | |
| 563 | + var btmDrawer = $('.ct-bottom-drawer', modal); | |
| 564 | + //打开事件 | |
| 565 | + btmDrawer.on('drawer_show', function () { | |
| 566 | + var url = $(this).data('url'); | |
| 567 | + if (!url) { | |
| 568 | + alert('无效的地址'); | |
| 569 | + } | |
| 570 | + | |
| 571 | + var drawerPanel = $(this).data('name'); | |
| 572 | + $('.ct-bottom-drawer-body', btmDrawer).load(url, function () { | |
| 573 | + $('#' + drawerPanel).trigger('drawer-init', {sch: sch}); | |
| 574 | + }); | |
| 575 | + }); | |
| 576 | + | |
| 577 | + function switchBtmDrawer(id, url) { | |
| 578 | + if (btmDrawer.hasClass('open') && btmDrawer.data('name') == id) { | |
| 579 | + btmDrawer.removeClass('open'); | |
| 580 | + btmDrawer.removeData('name').removeData('url'); | |
| 581 | + } | |
| 582 | + else { | |
| 583 | + btmDrawer.addClass('open'); | |
| 584 | + btmDrawer.data('name', id).data('url', url).trigger('drawer_show'); | |
| 585 | + } | |
| 586 | + } | |
| 587 | + })(); | |
| 588 | + </script> | |
| 589 | +</div> | |
| 0 | 590 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/js/home/line_panel.js
| ... | ... | @@ -31,7 +31,7 @@ var gb_home_line_panel = (function() { |
| 31 | 31 | |
| 32 | 32 | cb && cb(); |
| 33 | 33 | }); |
| 34 | - } | |
| 34 | + }; | |
| 35 | 35 | |
| 36 | 36 | var gps_refresh_event = function(addArr, upArr, upDownChange) { |
| 37 | 37 | //marker |
| ... | ... | @@ -94,7 +94,7 @@ var gb_home_line_panel = (function() { |
| 94 | 94 | if(t.sch){ |
| 95 | 95 | $(cells[5]).text(t.sch.zdzName); |
| 96 | 96 | $(cells[6]).text(t.sch.zdsj); |
| 97 | - $(cells[7]).text(t.sch.jName); | |
| 97 | + $(cells[7]).text(t.sch.jGh + '/' + t.sch.jName); | |
| 98 | 98 | } |
| 99 | 99 | }; |
| 100 | 100 | ... | ... |
src/main/resources/static/real_control_v2/js/line_schedule/sch_table.js
| ... | ... | @@ -9,7 +9,7 @@ var gb_schedule_table = (function () { |
| 9 | 9 | var car_yfwf_map = {}; |
| 10 | 10 | var schedule_sort = function (s1, s2) { |
| 11 | 11 | return s1.dfsjT - s2.dfsjT; |
| 12 | - } | |
| 12 | + }; | |
| 13 | 13 | |
| 14 | 14 | var show = function (cb) { |
| 15 | 15 | //从服务器获取班次数据 |
| ... | ... | @@ -421,7 +421,7 @@ var gb_schedule_table = (function () { |
| 421 | 421 | dl.addClass('dl-last-sch'); |
| 422 | 422 | |
| 423 | 423 | $('dd.fcsjActualCell', dl).append(temps['last-sch-sunken-temp'](lastSch)); |
| 424 | - } | |
| 424 | + }; | |
| 425 | 425 | |
| 426 | 426 | //清除线路下指定班次的 末班标记 |
| 427 | 427 | var removeMarkers = function (lineCode, array) { |
| ... | ... | @@ -435,11 +435,47 @@ var gb_schedule_table = (function () { |
| 435 | 435 | $(this).removeClass('dl-last-sch').find('.last-sch-sunken').remove(); |
| 436 | 436 | } |
| 437 | 437 | }); |
| 438 | - } | |
| 438 | + }; | |
| 439 | 439 | |
| 440 | 440 | var schDestroyFilter = function (a) { |
| 441 | 441 | return a.status != -1; |
| 442 | - } | |
| 442 | + }; | |
| 443 | + | |
| 444 | + /* 下一个班次 */ | |
| 445 | + var getNextSch = function (sch) { | |
| 446 | + var array = gb_common.get_vals(line2Schedule[sch.xlBm]).filter(function (a) { | |
| 447 | + return a.clZbh == sch.clZbh; | |
| 448 | + }).sort(schedule_sort); | |
| 449 | + | |
| 450 | + for (var i = 0, item; item = array[i++];) { | |
| 451 | + if (array[i].id == sch.id) { | |
| 452 | + return i < array.length ? array[i + 1] : null; | |
| 453 | + } | |
| 454 | + } | |
| 455 | + }; | |
| 456 | + | |
| 457 | + /** 添加备注信息 */ | |
| 458 | + var addRemarks = function (list, remarks) { | |
| 459 | + //if(!list || list) | |
| 460 | + var i = 0, sch; | |
| 461 | + | |
| 462 | + (function () { | |
| 463 | + var f = arguments.callee; | |
| 464 | + if(i >= list.length){ | |
| 465 | + return; | |
| 466 | + } | |
| 467 | + sch = list[i]; | |
| 468 | + gb_common.$post('/realSchedule/addRemarks', {id: sch.id, remarks: remarks}, function (rs) { | |
| 469 | + if(rs.t){ | |
| 470 | + sch = rs.t; | |
| 471 | + line2Schedule[sch.xlBm][sch.id] = sch; | |
| 472 | + updateDom(sch); | |
| 473 | + i++; | |
| 474 | + f(); | |
| 475 | + } | |
| 476 | + }); | |
| 477 | + })(); | |
| 478 | + }; | |
| 443 | 479 | |
| 444 | 480 | return { |
| 445 | 481 | show: show, |
| ... | ... | @@ -454,6 +490,8 @@ var gb_schedule_table = (function () { |
| 454 | 490 | }, |
| 455 | 491 | scroToDl: scroToDl, |
| 456 | 492 | reset_drag_active_all: reset_drag_active_all, |
| 457 | - getDl: getDl | |
| 493 | + getDl: getDl, | |
| 494 | + getNextSch: getNextSch, | |
| 495 | + addRemarks: addRemarks | |
| 458 | 496 | }; |
| 459 | 497 | })(); | ... | ... |
src/main/resources/static/real_control_v2/js/main.js