Commit 0ea46b628f3b4d1075b24bc862dc704322811794
1 parent
ecad1f45
修复区间调头公里提示错误问题
Showing
3 changed files
with
59 additions
and
32 deletions
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/sub_task_v2/add_range_turn.html
| @@ -85,10 +85,13 @@ | @@ -85,10 +85,13 @@ | ||
| 85 | }); | 85 | }); |
| 86 | 86 | ||
| 87 | 87 | ||
| 88 | - function addTaskForm() { | 88 | + function addTaskForm(upDownInput) { |
| 89 | var htmlStr = template('sub-task-v2-form-temp', {sch: sch}); | 89 | var htmlStr = template('sub-task-v2-form-temp', {sch: sch}); |
| 90 | var f = $(htmlStr); | 90 | var f = $(htmlStr); |
| 91 | $('.forms', wrap).append(f); | 91 | $('.forms', wrap).append(f); |
| 92 | + | ||
| 93 | + if(upDownInput) | ||
| 94 | + f.append(upDownInput); | ||
| 92 | //字典转换 | 95 | //字典转换 |
| 93 | dictionaryUtils.transformDom($('.nt-dictionary', f)); | 96 | dictionaryUtils.transformDom($('.nt-dictionary', f)); |
| 94 | 97 | ||
| @@ -110,8 +113,8 @@ | @@ -110,8 +113,8 @@ | ||
| 110 | function disabled_form(f) { | 113 | function disabled_form(f) { |
| 111 | //$('input,select',f).attr('disabled', 'disabled'); | 114 | //$('input,select',f).attr('disabled', 'disabled'); |
| 112 | $f('type2', f).attr('disabled', 'disabled'); | 115 | $f('type2', f).attr('disabled', 'disabled'); |
| 113 | - $f('startStation', f).attr('disabled', 'disabled'); | ||
| 114 | - $f('endStation', f).attr('disabled', 'disabled'); | 116 | + //$f('startStation', f).attr('disabled', 'disabled'); |
| 117 | + //$f('endStation', f).attr('disabled', 'disabled'); | ||
| 115 | $f('mileageType', f).attr('disabled', 'disabled'); | 118 | $f('mileageType', f).attr('disabled', 'disabled'); |
| 116 | $f('destroy', f).attr('disabled', 'disabled'); | 119 | $f('destroy', f).attr('disabled', 'disabled'); |
| 117 | return f; | 120 | return f; |
| @@ -138,10 +141,12 @@ | @@ -138,10 +141,12 @@ | ||
| 138 | 141 | ||
| 139 | //烂班1 | 142 | //烂班1 |
| 140 | df1 = destroyForm(disabled_form(addTaskForm())); | 143 | df1 = destroyForm(disabled_form(addTaskForm())); |
| 144 | + | ||
| 145 | + var u_d_input = '<input name="upDown" type="hidden" value="'+nextSch.xlDir+'">'; | ||
| 141 | //烂班2 | 146 | //烂班2 |
| 142 | - df2 = destroyForm(disabled_form(addTaskForm())); | 147 | + df2 = destroyForm(disabled_form(addTaskForm(u_d_input))); |
| 143 | //营运2 | 148 | //营运2 |
| 144 | - f2 = disabled_form(addTaskForm()); | 149 | + f2 = disabled_form(addTaskForm(u_d_input)); |
| 145 | $('.domains', f2).empty(); | 150 | $('.domains', f2).empty(); |
| 146 | 151 | ||
| 147 | 152 | ||
| @@ -149,16 +154,19 @@ | @@ -149,16 +154,19 @@ | ||
| 149 | $f('endStation', f1).val(eCode).trigger('change'); | 154 | $f('endStation', f1).val(eCode).trigger('change'); |
| 150 | //烂班1起点 | 155 | //烂班1起点 |
| 151 | $f('startStation', df1).val(eCode).trigger('change'); | 156 | $f('startStation', df1).val(eCode).trigger('change'); |
| 157 | + | ||
| 158 | + //nextSch | ||
| 159 | + var d_code = searchParallelStation($('#turnStationSelect>option:selected', topf).text()); | ||
| 152 | //烂班2 | 160 | //烂班2 |
| 153 | - $f('startStation', df2).val(sch.zdzCode); | ||
| 154 | - $f('endStation', df2).val(eCode); | ||
| 155 | - $f('mileage', df2).val($f('mileage', df1).val()).trigger('input'); | 161 | + $f('startStation', df2).val(nextSch.qdzCode); |
| 162 | + $f('endStation', df2).val(d_code).trigger('change'); | ||
| 163 | + //$f('mileage', df2).val($f('mileage', df1).val()).trigger('input'); | ||
| 156 | $('[sch_id_inp]', df2).val(nextSch.id); | 164 | $('[sch_id_inp]', df2).val(nextSch.id); |
| 157 | //营运2 | 165 | //营运2 |
| 158 | - $f('startStation', f2).val(eCode); | ||
| 159 | - $f('endStation', f2).val(sch.qdzCode); | ||
| 160 | - $f('startDate',f2).val($f('endDate',f1).val()); | ||
| 161 | - $f('mileage', f2).val($f('mileage', f1).val()).trigger('input'); | 166 | + $f('startStation', f2).val(d_code).trigger('change'); |
| 167 | + $f('endStation', f2).val(nextSch.zdzCode); | ||
| 168 | + //$f('startDate',f2).val($f('endDate',f1).val()); | ||
| 169 | + //$f('mileage', f2).val($f('mileage', f1).val()).trigger('input'); | ||
| 162 | $('[sch_id_inp]', f2).val(nextSch.id); | 170 | $('[sch_id_inp]', f2).val(nextSch.id); |
| 163 | 171 | ||
| 164 | //set css | 172 | //set css |
| @@ -285,6 +293,18 @@ | @@ -285,6 +293,18 @@ | ||
| 285 | }); | 293 | }); |
| 286 | return flag; | 294 | return flag; |
| 287 | } | 295 | } |
| 296 | + | ||
| 297 | + | ||
| 298 | + //返回另一个走向对应的站点 | ||
| 299 | + function searchParallelStation(stationName) { | ||
| 300 | + var routes = stationRoutes[nextSch.xlDir] | ||
| 301 | + , len = routes.length; | ||
| 302 | + | ||
| 303 | + for (var i = 0; i < len; i++) { | ||
| 304 | + if (routes[i].stationName == stationName) | ||
| 305 | + return routes[i].stationCode; | ||
| 306 | + } | ||
| 307 | + } | ||
| 288 | })(); | 308 | })(); |
| 289 | </script> | 309 | </script> |
| 290 | </div> | 310 | </div> |
| 291 | \ No newline at end of file | 311 | \ No newline at end of file |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/sub_task_v2/main.html
| @@ -59,7 +59,7 @@ | @@ -59,7 +59,7 @@ | ||
| 59 | <div class="uk-form-row"> | 59 | <div class="uk-form-row"> |
| 60 | <label class="uk-form-label">起点 </label> | 60 | <label class="uk-form-label">起点 </label> |
| 61 | <div class="uk-form-controls"> | 61 | <div class="uk-form-controls"> |
| 62 | - <select name="startStation" ></select> | 62 | + <select name="startStation" required></select> |
| 63 | </div> | 63 | </div> |
| 64 | </div> | 64 | </div> |
| 65 | </div> | 65 | </div> |
| @@ -67,7 +67,7 @@ | @@ -67,7 +67,7 @@ | ||
| 67 | <div class="uk-form-row"> | 67 | <div class="uk-form-row"> |
| 68 | <label class="uk-form-label">终点</label> | 68 | <label class="uk-form-label">终点</label> |
| 69 | <div class="uk-form-controls"> | 69 | <div class="uk-form-controls"> |
| 70 | - <select name="endStation" ></select> | 70 | + <select name="endStation" required></select> |
| 71 | </div> | 71 | </div> |
| 72 | </div> | 72 | </div> |
| 73 | </div> | 73 | </div> |
| @@ -300,8 +300,10 @@ | @@ -300,8 +300,10 @@ | ||
| 300 | */ | 300 | */ |
| 301 | function reCalcInputs_type() { | 301 | function reCalcInputs_type() { |
| 302 | var f = $(this).parents('.sub_task_form_v2'); | 302 | var f = $(this).parents('.sub_task_form_v2'); |
| 303 | - | ||
| 304 | - var routes = stationRoutes[sch.xlDir] | 303 | + var upDown = sch.xlDir; |
| 304 | + if($('[name=upDown]', f).length>0) | ||
| 305 | + upDown = $('[name=upDown]', f).val(); | ||
| 306 | + var routes = stationRoutes[upDown] | ||
| 305 | , lastCode = routes[routes.length - 1].stationCode | 307 | , lastCode = routes[routes.length - 1].stationCode |
| 306 | , opts = '', park_opts = ''; | 308 | , opts = '', park_opts = ''; |
| 307 | //station options | 309 | //station options |
| @@ -374,7 +376,9 @@ | @@ -374,7 +376,9 @@ | ||
| 374 | upDown = inout_updown(zdzCode, sch); | 376 | upDown = inout_updown(zdzCode, sch); |
| 375 | break; | 377 | break; |
| 376 | default: | 378 | default: |
| 377 | - upDown = sch.xlDir | 379 | + upDown = sch.xlDir; |
| 380 | + if($('[name=upDown]',f).length>0) | ||
| 381 | + upDown = $('[name=upDown]',f).val(); | ||
| 378 | } | 382 | } |
| 379 | 383 | ||
| 380 | //从站到场里获取数据 | 384 | //从站到场里获取数据 |
| @@ -572,22 +576,25 @@ | @@ -572,22 +576,25 @@ | ||
| 572 | if(!st_park_data) | 576 | if(!st_park_data) |
| 573 | return; | 577 | return; |
| 574 | var stp; | 578 | var stp; |
| 575 | - var qdSelect=$f('startStation', f)[0],zdSelect=$f('endStation', f)[0]; | 579 | + try{ |
| 580 | + var qdSelect=$f('startStation', f)[0],zdSelect=$f('endStation', f)[0]; | ||
| 576 | 581 | ||
| 577 | - var qdzName=qdSelect.options[qdSelect.options.selectedIndex].text, | ||
| 578 | - zdzName=zdSelect.options[zdSelect.options.selectedIndex].text, | ||
| 579 | - type2 = $f('type2', f).val(); | 582 | + var qdzName=qdSelect.options[qdSelect.options.selectedIndex].text, |
| 583 | + zdzName=zdSelect.options[zdSelect.options.selectedIndex].text, | ||
| 584 | + type2 = $f('type2', f).val(); | ||
| 580 | 585 | ||
| 581 | - if(type2!=2 && type2!=3) | ||
| 582 | - return; | 586 | + if(type2!=2 && type2!=3) |
| 587 | + return; | ||
| 583 | 588 | ||
| 584 | - $.each(st_park_data, function () { | ||
| 585 | - if((type2==2 && this.stationName==qdzName && this.parkName==zdzName) | ||
| 586 | - || (type2==3 && this.stationName==zdzName && this.parkName==qdzName)){ | ||
| 587 | - stp = this; | ||
| 588 | - return false; | ||
| 589 | - } | ||
| 590 | - }); | 589 | + $.each(st_park_data, function () { |
| 590 | + if((type2==2 && this.stationName==qdzName && this.parkName==zdzName) | ||
| 591 | + || (type2==3 && this.stationName==zdzName && this.parkName==qdzName)){ | ||
| 592 | + stp = this; | ||
| 593 | + return false; | ||
| 594 | + } | ||
| 595 | + }); | ||
| 596 | + }catch (e){ | ||
| 597 | + console.log(e);} | ||
| 591 | 598 | ||
| 592 | return stp; | 599 | return stp; |
| 593 | } | 600 | } |
src/main/resources/static/real_control_v2/js/main.js
| @@ -169,8 +169,8 @@ var disabled_submit_btn = function (form) { | @@ -169,8 +169,8 @@ var disabled_submit_btn = function (form) { | ||
| 169 | function showUpdateDescription() { | 169 | function showUpdateDescription() { |
| 170 | //更新说明 | 170 | //更新说明 |
| 171 | var updateDescription = { | 171 | var updateDescription = { |
| 172 | - date: '2017-07-26', | ||
| 173 | - text: '<h5>1、修复一个临时性的小问题,这个问题导致26号上午,起点站和第2站缓冲区重叠的几条线路发不出去!</h5>' | 172 | + date: '2017-08-13', |
| 173 | + text: '<h5>1、修复了 “子任务-区间调头” 当上下行里程不等时,站间距公里提示错误的问题!</h5>' | ||
| 174 | }; | 174 | }; |
| 175 | 175 | ||
| 176 | var storage = window.localStorage | 176 | var storage = window.localStorage |