Commit 84de745406e5e84e76137f1cd0b32de80b0b22dc
1 parent
79f8cde5
1.班次间隔调整自动填个间隔均值
Showing
2 changed files
with
452 additions
and
442 deletions
src/main/resources/static/real_control_v2/js/line_schedule/context_menu.js
| 1 | -/* line schedule table context menu*/ | |
| 2 | - | |
| 3 | -var gb_schedule_context_menu = (function () { | |
| 4 | - | |
| 5 | - var modal_opts = { | |
| 6 | - center: false, | |
| 7 | - bgclose: false | |
| 8 | - }, | |
| 9 | - folder = '/real_control_v2/fragments/line_schedule/context_menu'; | |
| 10 | - | |
| 11 | - //提前缓存子任务的片段页面 | |
| 12 | - var st_doms={}; | |
| 13 | - $.get(folder + '/sub_task_v2/add_custom.html', function (dom) { | |
| 14 | - st_doms.custom_dom=dom; | |
| 15 | - }); | |
| 16 | - $.get(folder + '/sub_task_v2/add_in_out.html', function (dom) { | |
| 17 | - st_doms.inout_dom=dom; | |
| 18 | - }); | |
| 19 | - $.get(folder + '/sub_task_v2/add_range_turn.html', function (dom) { | |
| 20 | - st_doms.range_dom=dom; | |
| 21 | - }); | |
| 22 | - $.get(folder + '/sub_task_v2/add_range_normal.html', function (dom) { | |
| 23 | - st_doms.range_2_normal_dom=dom; | |
| 24 | - }); | |
| 25 | - //提前缓存临加的片段页面 | |
| 26 | - var add_sch_doms={}, add_sch_doms_v2 = {}; | |
| 27 | - $.get(folder + '/temp_sch/add_normal.html', function (dom) { | |
| 28 | - add_sch_doms.normal_dom=dom; | |
| 29 | - }); | |
| 30 | - $.get(folder + '/temp_sch/add_two_way.html', function (dom) { | |
| 31 | - add_sch_doms.two_way_dom=dom; | |
| 32 | - }); | |
| 33 | - $.get(folder + '/temp_sch/add_park_to_park.html', function (dom) { | |
| 34 | - add_sch_doms.park_to_park_dom=dom; | |
| 35 | - }); | |
| 36 | - $.get(folder + '/temp_sch_v2/add_normal.html', function (dom) { | |
| 37 | - add_sch_doms_v2.normal_dom=dom; | |
| 38 | - }); | |
| 39 | - $.get(folder + '/temp_sch_v2/add_two_way.html', function (dom) { | |
| 40 | - add_sch_doms_v2.two_way_dom=dom; | |
| 41 | - }); | |
| 42 | - $.get(folder + '/temp_sch_v2/add_park_to_park.html', function (dom) { | |
| 43 | - add_sch_doms_v2.park_to_park_dom=dom; | |
| 44 | - }); | |
| 45 | - | |
| 46 | - | |
| 47 | - var callbackHandler = { | |
| 48 | - get_st_doms: function () { | |
| 49 | - return st_doms; | |
| 50 | - }, | |
| 51 | - get_add_sch_doms: function () { | |
| 52 | - return add_sch_doms; | |
| 53 | - }, | |
| 54 | - get_add_sch_doms_v2: function () { | |
| 55 | - return add_sch_doms_v2; | |
| 56 | - }, | |
| 57 | - dftz: function (sch) { | |
| 58 | - if(sch.status > 0){ | |
| 59 | - notify_err((sch.status==1?'已发出':'已执行') + '的班次不能修改待发'); | |
| 60 | - return; | |
| 61 | - } | |
| 62 | - open_modal(folder + '/dftz.html', { | |
| 63 | - sch: sch | |
| 64 | - }, modal_opts); | |
| 65 | - }, | |
| 66 | - multi_tzrc: function (schArray) { | |
| 67 | - open_modal(folder + '/multi_tzrc.html', { | |
| 68 | - list: schArray | |
| 69 | - }, modal_opts); | |
| 70 | - }, | |
| 71 | - multi_dftz: function (schArray) { | |
| 72 | - var list = schArray.filter(function (sch) { | |
| 73 | - return sch.bcType != 'out' && sch.bcType != 'in' && sch.fcsjActual == null; | |
| 74 | - }); | |
| 75 | - if(list.length == 0){ | |
| 76 | - notify_err('没有需要调整的班次!'); | |
| 77 | - return; | |
| 78 | - } | |
| 79 | - open_modal(folder + '/multi_dftz.html', { | |
| 80 | - list: list | |
| 81 | - }, modal_opts); | |
| 82 | - }, | |
| 83 | - jhlb: function (sch) { | |
| 84 | - open_modal(folder + '/jhlb.html', { | |
| 85 | - sch: sch | |
| 86 | - }, modal_opts); | |
| 87 | - }, | |
| 88 | - cxlb: function (sch) { | |
| 89 | - if (!sch.destroy) | |
| 90 | - return notify_err('烂掉的班次才能执行此操作!'); | |
| 91 | - | |
| 92 | - var content = '<h3>确定要撤销<span style="color:red;margin: 0 5px;">' + sch.clZbh + '( ' + sch.dfsj + ' )</span>的烂班设置?</h3>' | |
| 93 | - alt_confirm(content, function () { | |
| 94 | - gb_common.$post('/realSchedule/revokeDestroy', { | |
| 95 | - id: sch.id | |
| 96 | - }, function (rs) { | |
| 97 | - gb_schedule_table.updateSchedule(rs.t); | |
| 98 | - notify_succ('撤销烂班操作成功!'); | |
| 99 | - | |
| 100 | - //calc 应发未发 | |
| 101 | - gb_schedule_table.calc_yfwf_num(sch.xlBm); | |
| 102 | - }); | |
| 103 | - }, '确认撤销'); | |
| 104 | - }, | |
| 105 | - sftz: function (sch) { | |
| 106 | - open_modal(folder + '/sftz.html?r=' + Math.random(), { | |
| 107 | - sch: sch | |
| 108 | - }, modal_opts); | |
| 109 | - }, | |
| 110 | - cxsf: function (sch, cb) { | |
| 111 | - if (!sch.fcsjActual) | |
| 112 | - return notify_err('车辆未实发,无法执行该操作!'); | |
| 113 | - | |
| 114 | - var content = '<h3>确定要撤销<span style="color:red;margin: 0 5px;">' + sch.clZbh + '( ' + sch.dfsj + ' )</span>的实发时间?</h3>' | |
| 115 | - alt_confirm(content, function () { | |
| 116 | - gb_common.$post('/realSchedule/revokeRealOutgo', { | |
| 117 | - id: sch.id | |
| 118 | - }, function (rs) { | |
| 119 | - gb_schedule_table.updateSchedule(rs.ts); | |
| 120 | - notify_succ('撤销实发操作成功!'); | |
| 121 | - //calc 应发未发 | |
| 122 | - gb_schedule_table.calc_yfwf_num(sch.xlBm); | |
| 123 | - | |
| 124 | - cb && cb(); | |
| 125 | - }); | |
| 126 | - }, '确认撤销实发'); | |
| 127 | - }, | |
| 128 | - fcxxwt: function (sch) { | |
| 129 | - open_modal(folder + '/fcxxwt.html?r=' + Math.random(), { | |
| 130 | - sch: sch | |
| 131 | - }, modal_opts); | |
| 132 | - }, | |
| 133 | - lj_zrw: function (sch) { | |
| 134 | - open_modal(folder + '/lj_zrw.html', { | |
| 135 | - sch: sch | |
| 136 | - }, modal_opts); | |
| 137 | - }, | |
| 138 | - tzrc: function (sch) { | |
| 139 | - open_modal(folder + '/tzrc.html', { | |
| 140 | - sch: sch | |
| 141 | - }, modal_opts); | |
| 142 | - }, | |
| 143 | - zlcf: function (sch) { | |
| 144 | - var text = sch.clZbh + '重发调度指令? [路牌: ' + sch.lpName + ' 计划时间:' + sch.fcsj + ' 待发时间:' + sch.dfsj + ']'; | |
| 145 | - alt_confirm(text, function () { | |
| 146 | - //走短语下发 | |
| 147 | - $.post('/directive/dispatch', {id: sch.id}, | |
| 148 | - function (code) { | |
| 149 | - if (code == 0) | |
| 150 | - notify_succ('发送指令成功'); | |
| 151 | - else | |
| 152 | - notify_err('发送指令失败'); | |
| 153 | - }); | |
| 154 | - }, '确定下发指令'); | |
| 155 | - }, | |
| 156 | - jgtz: function (schArray) { | |
| 157 | - //忽略进出场班次 | |
| 158 | - schArray = schArray.filter(function (sch) { | |
| 159 | - return sch.bcType != 'in' && sch.bcType != 'out' && sch.status!=-1; | |
| 160 | - }); | |
| 161 | - | |
| 162 | - var idArr = [], qdz = schArray[0].qdzCode; | |
| 163 | - $.each(schArray, function () { | |
| 164 | - if(this.qdzCode==qdz) | |
| 165 | - idArr.push(this.id); | |
| 166 | - }); | |
| 167 | - | |
| 168 | - var ps = '<div class="ps-help-panel"><small>1、忽略进出场班次</small><small>2、与选中的第一个班次起点站不同的也将被忽略</small><small>3、忽略烂班</small></div>'; | |
| 169 | - var elem = UIkit.modal.prompt('请输入间隔(分钟)' + ps, 0, function (newValue) { | |
| 170 | - if (!isNaN(newValue) && newValue > 0) { | |
| 171 | - gb_common.$post_arr('/realSchedule/spaceAdjust', {ids: idArr, space: newValue}, function (rs) { | |
| 172 | - //刷新数据 | |
| 173 | - //if(rs.t){ | |
| 174 | - // gb_schedule_table.reLoadAndRefresh(rs.t.xlBm); | |
| 175 | - //} | |
| 176 | - gb_schedule_table.updateSchedule(rs.ts); | |
| 177 | - notify_succ('调整间隔成功!'); | |
| 178 | - }); | |
| 179 | - } else | |
| 180 | - notify_err('不合理的间隔时间!'); | |
| 181 | - }, { | |
| 182 | - labels: { | |
| 183 | - Ok: '确定调整', | |
| 184 | - Cancel: '取消' | |
| 185 | - } | |
| 186 | - }); | |
| 187 | - }, | |
| 188 | - lp_change: function (sch) { | |
| 189 | - open_modal(folder + '/lp_change.html', { | |
| 190 | - sch: sch | |
| 191 | - }, modal_opts); | |
| 192 | - }, | |
| 193 | - cxzx: function (sch, cb) { | |
| 194 | - if (!sch.zdsjActual && !sch.fcsjActual) | |
| 195 | - return notify_err('车辆未执行,无法撤销执行!'); | |
| 196 | - | |
| 197 | - var content = '<h3>确定要撤销<span style="color:red;margin: 0 5px;">' + sch.clZbh + '( ' + sch.dfsj + ' )</span>的实达时间?</h3>' | |
| 198 | - alt_confirm(content, function () { | |
| 199 | - gb_common.$post('/realSchedule/revokeRealArrive', { | |
| 200 | - id: sch.id | |
| 201 | - }, function (rs) { | |
| 202 | - gb_schedule_table.updateSchedule(rs.ts); | |
| 203 | - notify_succ('撤销执行成功!'); | |
| 204 | - | |
| 205 | - cb && cb(); | |
| 206 | - }); | |
| 207 | - }, '确认撤销执行'); | |
| 208 | - }, | |
| 209 | - | |
| 210 | - add_sub_task_in: function (sch) { | |
| 211 | - if(sch.bcType == 'out' || sch.bcType == 'in'){ | |
| 212 | - notify_err('暂不能在进出场班次上做回场子任务!'); | |
| 213 | - return; | |
| 214 | - } | |
| 215 | - open_modal(folder + '/sub_task/add_sub_task_inpark.html', { | |
| 216 | - sch: sch | |
| 217 | - }, modal_opts); | |
| 218 | - }, | |
| 219 | - add_sub_task_out: function (sch) { | |
| 220 | - if(sch.bcType == 'out' || sch.bcType == 'in'){ | |
| 221 | - notify_err('暂不能在进出场班次上做出场子任务!'); | |
| 222 | - return; | |
| 223 | - } | |
| 224 | - open_modal(folder + '/sub_task/add_sub_task_outpark.html', { | |
| 225 | - sch: sch | |
| 226 | - }, modal_opts); | |
| 227 | - }, | |
| 228 | - add_sub_task_range_turn: function (sch) { | |
| 229 | - if(sch.bcType == 'out' || sch.bcType == 'in') | |
| 230 | - return notify_err('进出场班次不能做区间掉头!'); | |
| 231 | - if(sch.destroy) | |
| 232 | - return notify_err('没有理由在烂班上做区间调头!!'); | |
| 233 | - open_modal(folder + '/sub_task/add_sub_task_range_turn.html', { | |
| 234 | - sch: sch | |
| 235 | - }, modal_opts); | |
| 236 | - }, | |
| 237 | - add_oil: function (sch) { | |
| 238 | - if(sch.bcType == 'out' || sch.bcType == 'in'){ | |
| 239 | - notify_err('暂不能在进出场班次上做这个操作!'); | |
| 240 | - return; | |
| 241 | - } | |
| 242 | - open_modal(folder + '/sub_task/add_sub_task_oil.html', { | |
| 243 | - sch: sch | |
| 244 | - }, modal_opts); | |
| 245 | - }, | |
| 246 | - wdtz: function (sch) { | |
| 247 | - this.multi_wdtz(sch); | |
| 248 | - }, | |
| 249 | - multi_wdtz: function (schArray) { | |
| 250 | - if (!isArray(schArray)) | |
| 251 | - schArray = [schArray]; | |
| 252 | - | |
| 253 | - var idx='', minute=0; | |
| 254 | - $.each(schArray, function () { | |
| 255 | - if(this.bcType=='in' || this.bcType=='out' || | |
| 256 | - (this.fcsjActual && this.status != 0)){ | |
| 257 | - return true; | |
| 258 | - } | |
| 259 | - else | |
| 260 | - idx += (this.id + ','); | |
| 261 | - minute = this.lateMinute; | |
| 262 | - }); | |
| 263 | - | |
| 264 | - if(!idx || idx==''){ | |
| 265 | - notify_err('没有需要设置误点停靠时间的班次!'); | |
| 266 | - return; | |
| 267 | - } | |
| 268 | - | |
| 269 | - var elem = UIkit.modal.prompt('请输入误点停靠时间(分钟)', minute, function (newValue) { | |
| 270 | - if (!isNaN(newValue) && newValue >= 0) { | |
| 271 | - gb_common.$post_arr('/realSchedule/lateAdjust', {idx: idx, minute: newValue}, function (rs) { | |
| 272 | - console.log('误点调整rs', rs); | |
| 273 | - if(rs.ts){ | |
| 274 | - gb_schedule_table.updateSchedule(rs.ts); | |
| 275 | - notify_succ('成功为' + rs.count + '个班次设置误点停靠时间'); | |
| 276 | - } | |
| 277 | - }); | |
| 278 | - } else | |
| 279 | - notify_err('不合理的停靠时间!'); | |
| 280 | - }, { | |
| 281 | - labels: { | |
| 282 | - Ok: '确定调整', | |
| 283 | - Cancel: '取消' | |
| 284 | - } | |
| 285 | - }); | |
| 286 | - }, | |
| 287 | - add_temp_sch: function (sch) { | |
| 288 | - open_modal(folder + '/temp_sch/main.html', { | |
| 289 | - sch: sch | |
| 290 | - }, modal_opts); | |
| 291 | - }, | |
| 292 | - add_temp_sch_v2: function (sch) { | |
| 293 | - open_modal(folder + '/temp_sch_v2/main.html', { | |
| 294 | - sch: sch | |
| 295 | - }, modal_opts); | |
| 296 | - }, | |
| 297 | - add_sub_task: function (sch) { | |
| 298 | - if ($('#add-sub-task-main-modal').length>0) { | |
| 299 | - layer.msg('已存在正在添加的子任务.'); | |
| 300 | - return; | |
| 301 | - } | |
| 302 | - open_modal(folder + '/sub_task_v2/main.html', { | |
| 303 | - sch: sch | |
| 304 | - }, {center: false, bgclose: false, modal: false}); | |
| 305 | - }, | |
| 306 | - wxsb: function (sch) { | |
| 307 | - open_modal(folder + '/wxsb.html', { | |
| 308 | - sch: sch | |
| 309 | - }, {center: true, bgclose: false, modal: true}); | |
| 310 | - } | |
| 311 | - }; | |
| 312 | - | |
| 313 | - $.contextMenu({ | |
| 314 | - selector: '.line_schedule .ct_table_body dl:not([class="drag-active"])', | |
| 315 | - className: 'schedule-ct-menu', | |
| 316 | - callback: function (key, options) { | |
| 317 | - var $tbody = options.$trigger.parent(), | |
| 318 | - id = $('.context-menu-active', $tbody).data('id'), | |
| 319 | - lineCode = $tbody.parents('li.line_schedule').data('id'), | |
| 320 | - sch = gb_schedule_table.findScheduleByLine(lineCode)[id]; | |
| 321 | - | |
| 322 | - callbackHandler[key] && callbackHandler[key](sch); | |
| 323 | - }, | |
| 324 | - items: { | |
| 325 | - 'dftz': { | |
| 326 | - name: '待发调整' | |
| 327 | - }, | |
| 328 | - 'sep1': '---------', | |
| 329 | - 'jhlb': { | |
| 330 | - name: '计划烂班' | |
| 331 | - }, | |
| 332 | - 'cxlb': { | |
| 333 | - name: '撤销烂班' | |
| 334 | - }, | |
| 335 | - 'sftz': { | |
| 336 | - name: '实发调整' | |
| 337 | - }, | |
| 338 | - 'cxsf': { | |
| 339 | - name: '撤销实发' | |
| 340 | - }, | |
| 341 | - 'cxzx': { | |
| 342 | - name: '撤销执行' | |
| 343 | - }, | |
| 344 | - 'sep2': '---------', | |
| 345 | - 'fcxxwt': { | |
| 346 | - name: '发车信息微调' | |
| 347 | - }, | |
| 348 | - 'sep3': '---------', | |
| 349 | - 'lj_zrw': { | |
| 350 | - name: '临加/子任务' | |
| 351 | - }, | |
| 352 | - 'add_temp_sch': { | |
| 353 | - name: '新增临加班次' | |
| 354 | - }, | |
| 355 | - 'add_sub_task': { | |
| 356 | - name: '新增子任务' | |
| 357 | - }, | |
| 358 | - 'sep4': '---------', | |
| 359 | - 'tzrc': { | |
| 360 | - name: '调整人车' | |
| 361 | - }, | |
| 362 | - 'zlcf': { | |
| 363 | - name: '指令重发' | |
| 364 | - }, | |
| 365 | - 'wdtz': { | |
| 366 | - name: '误点调整' | |
| 367 | - }, | |
| 368 | - 'sep5': '---------', | |
| 369 | - 'lp_change': { | |
| 370 | - name: '路牌对调' | |
| 371 | - }, | |
| 372 | - 'sep6': '---------', | |
| 373 | - 'wxsb': { | |
| 374 | - name: '维修上报' | |
| 375 | - } | |
| 376 | - } | |
| 377 | - }); | |
| 378 | - | |
| 379 | - $.contextMenu({ | |
| 380 | - selector: '.line_schedule .schedule-wrap .card-panel', | |
| 381 | - className: 'schedule-ct-menu', | |
| 382 | - callback: function (key, options) { | |
| 383 | - var $tbody = options.$trigger.parent(), lineCode = $tbody.parents('li.line_schedule').data('id'); | |
| 384 | - | |
| 385 | - callbackHandler[key] && callbackHandler[key]({ xlBm : lineCode }); | |
| 386 | - }, | |
| 387 | - items: { | |
| 388 | - 'add_temp_sch_v2': { | |
| 389 | - name: '新增临加班次' | |
| 390 | - } | |
| 391 | - } | |
| 392 | - }); | |
| 393 | - | |
| 394 | - $.contextMenu({ | |
| 395 | - selector: '.line_schedule .ct_table_body dl.drag-active', | |
| 396 | - className: 'schedule-ct-menu', | |
| 397 | - callback: function (key, options) { | |
| 398 | - var $tbody = options.$trigger.parent(), | |
| 399 | - lineCode = $tbody.parents('li.line_schedule').data('id'), | |
| 400 | - schArray = [], | |
| 401 | - all = gb_schedule_table.findScheduleByLine(lineCode); | |
| 402 | - | |
| 403 | - $tbody.find('dl.drag-active').each(function () { | |
| 404 | - schArray.push(all[$(this).data('id')]); | |
| 405 | - }); | |
| 406 | - | |
| 407 | - callbackHandler[key] && callbackHandler[key](schArray); | |
| 408 | - }, | |
| 409 | - items: { | |
| 410 | - 'multi_dftz': { | |
| 411 | - name: '待发调整' | |
| 412 | - }, | |
| 413 | - 'jgtz': { | |
| 414 | - name: '间隔调整' | |
| 415 | - }, | |
| 416 | - 'multi_tzrc': { | |
| 417 | - name: '调整人车' | |
| 418 | - }, | |
| 419 | - 'multi_wdtz': { | |
| 420 | - name: '误点调整' | |
| 421 | - } | |
| 422 | - } | |
| 423 | - }); | |
| 424 | - | |
| 425 | - return callbackHandler; | |
| 426 | -})(); | |
| 1 | +/* line schedule table context menu*/ | |
| 2 | + | |
| 3 | +var gb_schedule_context_menu = (function () { | |
| 4 | + | |
| 5 | + var modal_opts = { | |
| 6 | + center: false, | |
| 7 | + bgclose: false | |
| 8 | + }, | |
| 9 | + folder = '/real_control_v2/fragments/line_schedule/context_menu'; | |
| 10 | + | |
| 11 | + //提前缓存子任务的片段页面 | |
| 12 | + var st_doms={}; | |
| 13 | + $.get(folder + '/sub_task_v2/add_custom.html', function (dom) { | |
| 14 | + st_doms.custom_dom=dom; | |
| 15 | + }); | |
| 16 | + $.get(folder + '/sub_task_v2/add_in_out.html', function (dom) { | |
| 17 | + st_doms.inout_dom=dom; | |
| 18 | + }); | |
| 19 | + $.get(folder + '/sub_task_v2/add_range_turn.html', function (dom) { | |
| 20 | + st_doms.range_dom=dom; | |
| 21 | + }); | |
| 22 | + $.get(folder + '/sub_task_v2/add_range_normal.html', function (dom) { | |
| 23 | + st_doms.range_2_normal_dom=dom; | |
| 24 | + }); | |
| 25 | + //提前缓存临加的片段页面 | |
| 26 | + var add_sch_doms={}, add_sch_doms_v2 = {}; | |
| 27 | + $.get(folder + '/temp_sch/add_normal.html', function (dom) { | |
| 28 | + add_sch_doms.normal_dom=dom; | |
| 29 | + }); | |
| 30 | + $.get(folder + '/temp_sch/add_two_way.html', function (dom) { | |
| 31 | + add_sch_doms.two_way_dom=dom; | |
| 32 | + }); | |
| 33 | + $.get(folder + '/temp_sch/add_park_to_park.html', function (dom) { | |
| 34 | + add_sch_doms.park_to_park_dom=dom; | |
| 35 | + }); | |
| 36 | + $.get(folder + '/temp_sch_v2/add_normal.html', function (dom) { | |
| 37 | + add_sch_doms_v2.normal_dom=dom; | |
| 38 | + }); | |
| 39 | + $.get(folder + '/temp_sch_v2/add_two_way.html', function (dom) { | |
| 40 | + add_sch_doms_v2.two_way_dom=dom; | |
| 41 | + }); | |
| 42 | + $.get(folder + '/temp_sch_v2/add_park_to_park.html', function (dom) { | |
| 43 | + add_sch_doms_v2.park_to_park_dom=dom; | |
| 44 | + }); | |
| 45 | + | |
| 46 | + | |
| 47 | + var callbackHandler = { | |
| 48 | + get_st_doms: function () { | |
| 49 | + return st_doms; | |
| 50 | + }, | |
| 51 | + get_add_sch_doms: function () { | |
| 52 | + return add_sch_doms; | |
| 53 | + }, | |
| 54 | + get_add_sch_doms_v2: function () { | |
| 55 | + return add_sch_doms_v2; | |
| 56 | + }, | |
| 57 | + dftz: function (sch) { | |
| 58 | + if(sch.status > 0){ | |
| 59 | + notify_err((sch.status==1?'已发出':'已执行') + '的班次不能修改待发'); | |
| 60 | + return; | |
| 61 | + } | |
| 62 | + open_modal(folder + '/dftz.html', { | |
| 63 | + sch: sch | |
| 64 | + }, modal_opts); | |
| 65 | + }, | |
| 66 | + multi_tzrc: function (schArray) { | |
| 67 | + open_modal(folder + '/multi_tzrc.html', { | |
| 68 | + list: schArray | |
| 69 | + }, modal_opts); | |
| 70 | + }, | |
| 71 | + multi_dftz: function (schArray) { | |
| 72 | + var list = schArray.filter(function (sch) { | |
| 73 | + return sch.bcType != 'out' && sch.bcType != 'in' && sch.fcsjActual == null; | |
| 74 | + }); | |
| 75 | + if(list.length == 0){ | |
| 76 | + notify_err('没有需要调整的班次!'); | |
| 77 | + return; | |
| 78 | + } | |
| 79 | + open_modal(folder + '/multi_dftz.html', { | |
| 80 | + list: list | |
| 81 | + }, modal_opts); | |
| 82 | + }, | |
| 83 | + jhlb: function (sch) { | |
| 84 | + open_modal(folder + '/jhlb.html', { | |
| 85 | + sch: sch | |
| 86 | + }, modal_opts); | |
| 87 | + }, | |
| 88 | + cxlb: function (sch) { | |
| 89 | + if (!sch.destroy) | |
| 90 | + return notify_err('烂掉的班次才能执行此操作!'); | |
| 91 | + | |
| 92 | + var content = '<h3>确定要撤销<span style="color:red;margin: 0 5px;">' + sch.clZbh + '( ' + sch.dfsj + ' )</span>的烂班设置?</h3>' | |
| 93 | + alt_confirm(content, function () { | |
| 94 | + gb_common.$post('/realSchedule/revokeDestroy', { | |
| 95 | + id: sch.id | |
| 96 | + }, function (rs) { | |
| 97 | + gb_schedule_table.updateSchedule(rs.t); | |
| 98 | + notify_succ('撤销烂班操作成功!'); | |
| 99 | + | |
| 100 | + //calc 应发未发 | |
| 101 | + gb_schedule_table.calc_yfwf_num(sch.xlBm); | |
| 102 | + }); | |
| 103 | + }, '确认撤销'); | |
| 104 | + }, | |
| 105 | + sftz: function (sch) { | |
| 106 | + open_modal(folder + '/sftz.html?r=' + Math.random(), { | |
| 107 | + sch: sch | |
| 108 | + }, modal_opts); | |
| 109 | + }, | |
| 110 | + cxsf: function (sch, cb) { | |
| 111 | + if (!sch.fcsjActual) | |
| 112 | + return notify_err('车辆未实发,无法执行该操作!'); | |
| 113 | + | |
| 114 | + var content = '<h3>确定要撤销<span style="color:red;margin: 0 5px;">' + sch.clZbh + '( ' + sch.dfsj + ' )</span>的实发时间?</h3>' | |
| 115 | + alt_confirm(content, function () { | |
| 116 | + gb_common.$post('/realSchedule/revokeRealOutgo', { | |
| 117 | + id: sch.id | |
| 118 | + }, function (rs) { | |
| 119 | + gb_schedule_table.updateSchedule(rs.ts); | |
| 120 | + notify_succ('撤销实发操作成功!'); | |
| 121 | + //calc 应发未发 | |
| 122 | + gb_schedule_table.calc_yfwf_num(sch.xlBm); | |
| 123 | + | |
| 124 | + cb && cb(); | |
| 125 | + }); | |
| 126 | + }, '确认撤销实发'); | |
| 127 | + }, | |
| 128 | + fcxxwt: function (sch) { | |
| 129 | + open_modal(folder + '/fcxxwt.html?r=' + Math.random(), { | |
| 130 | + sch: sch | |
| 131 | + }, modal_opts); | |
| 132 | + }, | |
| 133 | + lj_zrw: function (sch) { | |
| 134 | + open_modal(folder + '/lj_zrw.html', { | |
| 135 | + sch: sch | |
| 136 | + }, modal_opts); | |
| 137 | + }, | |
| 138 | + tzrc: function (sch) { | |
| 139 | + open_modal(folder + '/tzrc.html', { | |
| 140 | + sch: sch | |
| 141 | + }, modal_opts); | |
| 142 | + }, | |
| 143 | + zlcf: function (sch) { | |
| 144 | + var text = sch.clZbh + '重发调度指令? [路牌: ' + sch.lpName + ' 计划时间:' + sch.fcsj + ' 待发时间:' + sch.dfsj + ']'; | |
| 145 | + alt_confirm(text, function () { | |
| 146 | + //走短语下发 | |
| 147 | + $.post('/directive/dispatch', {id: sch.id}, | |
| 148 | + function (code) { | |
| 149 | + if (code == 0) | |
| 150 | + notify_succ('发送指令成功'); | |
| 151 | + else | |
| 152 | + notify_err('发送指令失败'); | |
| 153 | + }); | |
| 154 | + }, '确定下发指令'); | |
| 155 | + }, | |
| 156 | + jgtz: function (schArray) { | |
| 157 | + //忽略进出场班次 | |
| 158 | + schArray = schArray.filter(function (sch) { | |
| 159 | + return sch.bcType != 'in' && sch.bcType != 'out' && sch.status!=-1; | |
| 160 | + }); | |
| 161 | + | |
| 162 | + var gap = 0; | |
| 163 | + if (schArray.length > 1) { | |
| 164 | + var first = schArray[0].dfsjT, last = schArray[schArray.length - 1].dfsjT; | |
| 165 | + gap = Math.floor((last - first) / 60000 / (schArray.length - 1)); | |
| 166 | + } | |
| 167 | + | |
| 168 | + var idArr = [], qdz = schArray[0].qdzCode; | |
| 169 | + $.each(schArray, function () { | |
| 170 | + if(this.qdzCode==qdz) | |
| 171 | + idArr.push(this.id); | |
| 172 | + }); | |
| 173 | + | |
| 174 | + var ps = '<div class="ps-help-panel"><small>1、忽略进出场班次</small><small>2、与选中的第一个班次起点站不同的也将被忽略</small><small>3、忽略烂班</small></div>'; | |
| 175 | + var elem = UIkit.modal.prompt('请输入间隔(分钟)' + ps, gap, function (newValue) { | |
| 176 | + if (!isNaN(newValue) && newValue > 0) { | |
| 177 | + gb_common.$post_arr('/realSchedule/spaceAdjust', {ids: idArr, space: newValue}, function (rs) { | |
| 178 | + //刷新数据 | |
| 179 | + //if(rs.t){ | |
| 180 | + // gb_schedule_table.reLoadAndRefresh(rs.t.xlBm); | |
| 181 | + //} | |
| 182 | + gb_schedule_table.updateSchedule(rs.ts); | |
| 183 | + notify_succ('调整间隔成功!'); | |
| 184 | + }); | |
| 185 | + } else | |
| 186 | + notify_err('不合理的间隔时间!'); | |
| 187 | + }, { | |
| 188 | + labels: { | |
| 189 | + Ok: '确定调整', | |
| 190 | + Cancel: '取消' | |
| 191 | + } | |
| 192 | + }); | |
| 193 | + }, | |
| 194 | + lp_change: function (sch) { | |
| 195 | + open_modal(folder + '/lp_change.html', { | |
| 196 | + sch: sch | |
| 197 | + }, modal_opts); | |
| 198 | + }, | |
| 199 | + cxzx: function (sch, cb) { | |
| 200 | + if (!sch.zdsjActual && !sch.fcsjActual) | |
| 201 | + return notify_err('车辆未执行,无法撤销执行!'); | |
| 202 | + | |
| 203 | + var content = '<h3>确定要撤销<span style="color:red;margin: 0 5px;">' + sch.clZbh + '( ' + sch.dfsj + ' )</span>的实达时间?</h3>' | |
| 204 | + alt_confirm(content, function () { | |
| 205 | + gb_common.$post('/realSchedule/revokeRealArrive', { | |
| 206 | + id: sch.id | |
| 207 | + }, function (rs) { | |
| 208 | + gb_schedule_table.updateSchedule(rs.ts); | |
| 209 | + notify_succ('撤销执行成功!'); | |
| 210 | + | |
| 211 | + cb && cb(); | |
| 212 | + }); | |
| 213 | + }, '确认撤销执行'); | |
| 214 | + }, | |
| 215 | + | |
| 216 | + add_sub_task_in: function (sch) { | |
| 217 | + if(sch.bcType == 'out' || sch.bcType == 'in'){ | |
| 218 | + notify_err('暂不能在进出场班次上做回场子任务!'); | |
| 219 | + return; | |
| 220 | + } | |
| 221 | + open_modal(folder + '/sub_task/add_sub_task_inpark.html', { | |
| 222 | + sch: sch | |
| 223 | + }, modal_opts); | |
| 224 | + }, | |
| 225 | + add_sub_task_out: function (sch) { | |
| 226 | + if(sch.bcType == 'out' || sch.bcType == 'in'){ | |
| 227 | + notify_err('暂不能在进出场班次上做出场子任务!'); | |
| 228 | + return; | |
| 229 | + } | |
| 230 | + open_modal(folder + '/sub_task/add_sub_task_outpark.html', { | |
| 231 | + sch: sch | |
| 232 | + }, modal_opts); | |
| 233 | + }, | |
| 234 | + add_sub_task_range_turn: function (sch) { | |
| 235 | + if(sch.bcType == 'out' || sch.bcType == 'in') | |
| 236 | + return notify_err('进出场班次不能做区间掉头!'); | |
| 237 | + if(sch.destroy) | |
| 238 | + return notify_err('没有理由在烂班上做区间调头!!'); | |
| 239 | + open_modal(folder + '/sub_task/add_sub_task_range_turn.html', { | |
| 240 | + sch: sch | |
| 241 | + }, modal_opts); | |
| 242 | + }, | |
| 243 | + add_oil: function (sch) { | |
| 244 | + if(sch.bcType == 'out' || sch.bcType == 'in'){ | |
| 245 | + notify_err('暂不能在进出场班次上做这个操作!'); | |
| 246 | + return; | |
| 247 | + } | |
| 248 | + open_modal(folder + '/sub_task/add_sub_task_oil.html', { | |
| 249 | + sch: sch | |
| 250 | + }, modal_opts); | |
| 251 | + }, | |
| 252 | + wdtz: function (sch) { | |
| 253 | + this.multi_wdtz(sch); | |
| 254 | + }, | |
| 255 | + multi_wdtz: function (schArray) { | |
| 256 | + if (!isArray(schArray)) | |
| 257 | + schArray = [schArray]; | |
| 258 | + | |
| 259 | + var idx='', minute=0; | |
| 260 | + $.each(schArray, function () { | |
| 261 | + if(this.bcType=='in' || this.bcType=='out' || | |
| 262 | + (this.fcsjActual && this.status != 0)){ | |
| 263 | + return true; | |
| 264 | + } | |
| 265 | + else | |
| 266 | + idx += (this.id + ','); | |
| 267 | + minute = this.lateMinute; | |
| 268 | + }); | |
| 269 | + | |
| 270 | + if(!idx || idx==''){ | |
| 271 | + notify_err('没有需要设置误点停靠时间的班次!'); | |
| 272 | + return; | |
| 273 | + } | |
| 274 | + | |
| 275 | + var elem = UIkit.modal.prompt('请输入误点停靠时间(分钟)', minute, function (newValue) { | |
| 276 | + if (!isNaN(newValue) && newValue >= 0) { | |
| 277 | + gb_common.$post_arr('/realSchedule/lateAdjust', {idx: idx, minute: newValue}, function (rs) { | |
| 278 | + console.log('误点调整rs', rs); | |
| 279 | + if(rs.ts){ | |
| 280 | + gb_schedule_table.updateSchedule(rs.ts); | |
| 281 | + notify_succ('成功为' + rs.count + '个班次设置误点停靠时间'); | |
| 282 | + } | |
| 283 | + }); | |
| 284 | + } else | |
| 285 | + notify_err('不合理的停靠时间!'); | |
| 286 | + }, { | |
| 287 | + labels: { | |
| 288 | + Ok: '确定调整', | |
| 289 | + Cancel: '取消' | |
| 290 | + } | |
| 291 | + }); | |
| 292 | + }, | |
| 293 | + add_temp_sch: function (sch) { | |
| 294 | + open_modal(folder + '/temp_sch/main.html', { | |
| 295 | + sch: sch | |
| 296 | + }, modal_opts); | |
| 297 | + }, | |
| 298 | + add_temp_sch_v2: function (sch) { | |
| 299 | + open_modal(folder + '/temp_sch_v2/main.html', { | |
| 300 | + sch: sch | |
| 301 | + }, modal_opts); | |
| 302 | + }, | |
| 303 | + add_sub_task: function (sch) { | |
| 304 | + if ($('#add-sub-task-main-modal').length>0) { | |
| 305 | + layer.msg('已存在正在添加的子任务.'); | |
| 306 | + return; | |
| 307 | + } | |
| 308 | + open_modal(folder + '/sub_task_v2/main.html', { | |
| 309 | + sch: sch | |
| 310 | + }, {center: false, bgclose: false, modal: false}); | |
| 311 | + }, | |
| 312 | + wxsb: function (sch) { | |
| 313 | + open_modal(folder + '/wxsb.html', { | |
| 314 | + sch: sch | |
| 315 | + }, {center: true, bgclose: false, modal: true}); | |
| 316 | + } | |
| 317 | + }; | |
| 318 | + | |
| 319 | + $.contextMenu({ | |
| 320 | + selector: '.line_schedule .ct_table_body dl:not([class="drag-active"])', | |
| 321 | + className: 'schedule-ct-menu', | |
| 322 | + callback: function (key, options) { | |
| 323 | + var $tbody = options.$trigger.parent(), | |
| 324 | + id = $('.context-menu-active', $tbody).data('id'), | |
| 325 | + lineCode = $tbody.parents('li.line_schedule').data('id'), | |
| 326 | + sch = gb_schedule_table.findScheduleByLine(lineCode)[id]; | |
| 327 | + | |
| 328 | + callbackHandler[key] && callbackHandler[key](sch); | |
| 329 | + }, | |
| 330 | + items: { | |
| 331 | + 'dftz': { | |
| 332 | + name: '待发调整' | |
| 333 | + }, | |
| 334 | + 'sep1': '---------', | |
| 335 | + 'jhlb': { | |
| 336 | + name: '计划烂班' | |
| 337 | + }, | |
| 338 | + 'cxlb': { | |
| 339 | + name: '撤销烂班' | |
| 340 | + }, | |
| 341 | + 'sftz': { | |
| 342 | + name: '实发调整' | |
| 343 | + }, | |
| 344 | + 'cxsf': { | |
| 345 | + name: '撤销实发' | |
| 346 | + }, | |
| 347 | + 'cxzx': { | |
| 348 | + name: '撤销执行' | |
| 349 | + }, | |
| 350 | + 'sep2': '---------', | |
| 351 | + 'fcxxwt': { | |
| 352 | + name: '发车信息微调' | |
| 353 | + }, | |
| 354 | + 'sep3': '---------', | |
| 355 | + 'lj_zrw': { | |
| 356 | + name: '临加/子任务' | |
| 357 | + }, | |
| 358 | + 'add_temp_sch': { | |
| 359 | + name: '新增临加班次' | |
| 360 | + }, | |
| 361 | + 'add_sub_task': { | |
| 362 | + name: '新增子任务' | |
| 363 | + }, | |
| 364 | + 'sep4': '---------', | |
| 365 | + 'tzrc': { | |
| 366 | + name: '调整人车' | |
| 367 | + }, | |
| 368 | + 'zlcf': { | |
| 369 | + name: '指令重发' | |
| 370 | + }, | |
| 371 | + 'wdtz': { | |
| 372 | + name: '误点调整' | |
| 373 | + }, | |
| 374 | + 'sep5': '---------', | |
| 375 | + 'lp_change': { | |
| 376 | + name: '路牌对调' | |
| 377 | + }, | |
| 378 | + 'sep6': '---------', | |
| 379 | + 'wxsb': { | |
| 380 | + name: '维修上报' | |
| 381 | + } | |
| 382 | + } | |
| 383 | + }); | |
| 384 | + | |
| 385 | + $.contextMenu({ | |
| 386 | + selector: '.line_schedule .schedule-wrap .card-panel', | |
| 387 | + className: 'schedule-ct-menu', | |
| 388 | + callback: function (key, options) { | |
| 389 | + var $tbody = options.$trigger.parent(), lineCode = $tbody.parents('li.line_schedule').data('id'); | |
| 390 | + | |
| 391 | + callbackHandler[key] && callbackHandler[key]({ xlBm : lineCode }); | |
| 392 | + }, | |
| 393 | + items: { | |
| 394 | + 'add_temp_sch_v2': { | |
| 395 | + name: '新增临加班次' | |
| 396 | + } | |
| 397 | + } | |
| 398 | + }); | |
| 399 | + | |
| 400 | + $.contextMenu({ | |
| 401 | + selector: '.line_schedule .ct_table_body dl.drag-active', | |
| 402 | + className: 'schedule-ct-menu', | |
| 403 | + callback: function (key, options) { | |
| 404 | + var $tbody = options.$trigger.parent(), | |
| 405 | + lineCode = $tbody.parents('li.line_schedule').data('id'), | |
| 406 | + schArray = [], | |
| 407 | + all = gb_schedule_table.findScheduleByLine(lineCode); | |
| 408 | + | |
| 409 | + $tbody.find('dl.drag-active').each(function () { | |
| 410 | + schArray.push(all[$(this).data('id')]); | |
| 411 | + }); | |
| 412 | + | |
| 413 | + callbackHandler[key] && callbackHandler[key](schArray); | |
| 414 | + }, | |
| 415 | + items: { | |
| 416 | + 'multi_dftz': { | |
| 417 | + name: '待发调整' | |
| 418 | + }, | |
| 419 | + 'jgtz': { | |
| 420 | + name: '间隔调整' | |
| 421 | + }, | |
| 422 | + 'multi_tzrc': { | |
| 423 | + name: '调整人车' | |
| 424 | + }, | |
| 425 | + 'multi_wdtz': { | |
| 426 | + name: '误点调整' | |
| 427 | + } | |
| 428 | + } | |
| 429 | + }); | |
| 430 | + | |
| 431 | + return callbackHandler; | |
| 432 | +})(); | ... | ... |
src/main/resources/static/real_control_v2/js/safe_driv/safeDriv.js
| ... | ... | @@ -113,23 +113,27 @@ var gb_safe_driv = (function () { |
| 113 | 113 | if (!url || url.endsWith('.bin')) return; |
| 114 | 114 | items.push(url); |
| 115 | 115 | }); |
| 116 | - gb_common.$get('/api/minio/preSignedUrl', {objects: items}, function(res) { | |
| 117 | - $(that).remove(); | |
| 118 | - urls = res.urls; | |
| 119 | - items = []; | |
| 120 | - urls.forEach(function (url, idx) { | |
| 121 | - file = url.substring(0, url.indexOf('?')); | |
| 122 | - if (file.endsWith('.png') || file.endsWith('.jpg')) { | |
| 123 | - type = 'image'; | |
| 124 | - } else { | |
| 125 | - type = 'video'; | |
| 116 | + if (items.length > 0) { | |
| 117 | + gb_common.$get('/api/minio/preSignedUrl', {objects: items}, function(res) { | |
| 118 | + $(that).remove(); | |
| 119 | + urls = res.urls; | |
| 120 | + items = []; | |
| 121 | + urls.forEach(function (url, idx) { | |
| 122 | + file = url.substring(0, url.indexOf('?')); | |
| 123 | + if (file.endsWith('.png') || file.endsWith('.jpg')) { | |
| 124 | + type = 'image'; | |
| 125 | + } else { | |
| 126 | + type = 'video'; | |
| 127 | + } | |
| 128 | + items.push({title: '附件' + (idx + 1), source: url, type: type}); | |
| 129 | + }); | |
| 130 | + if (items.length > 0) { | |
| 131 | + UIkit.lightbox.create(items, {keyboard: true}).show(); | |
| 126 | 132 | } |
| 127 | - items.push({title: '附件' + (idx + 1), source: url, type: type}); | |
| 128 | - }); | |
| 129 | - if (items.length > 0) { | |
| 130 | - UIkit.lightbox.create(items, {keyboard: true}).show(); | |
| 131 | - } | |
| 132 | - }) | |
| 133 | + }) | |
| 134 | + } else { | |
| 135 | + $(that).remove(); | |
| 136 | + } | |
| 133 | 137 | break; |
| 134 | 138 | default: |
| 135 | 139 | break; | ... | ... |