Commit b669e0cdb0c162ac81c90d4db9fb3f35060aada7

Authored by 潘钊
1 parent 7a5a1e9a

update...

src/main/java/com/bsth/controller/realcontrol/ScheduleRealInfoController.java
... ... @@ -549,9 +549,9 @@ public class ScheduleRealInfoController extends BaseController<ScheduleRealInfo,
549 549 public List<String> dateArray(@RequestParam(defaultValue = "0") int c){
550 550 List<String> rs = new ArrayList<>();
551 551  
552   - long t = new Date().getTime();
  552 + long t = System.currentTimeMillis();
553 553 if(c != 1)
554   - t -= ONE_DAY - (1000 * 60 * 60 * 2);
  554 + t -= (ONE_DAY + (1000 * 60 * 60 * 2));
555 555 for(int i = 0; i < 3; i ++){
556 556 rs.add(fmtyyyyMMdd.print(t));
557 557 t -= ONE_DAY;
... ...
src/main/resources/static/pages/history_sch/edit/history_sch_maintain.html
1 1 <div class="uk-modal " id="history-sch-maintain-modal" style="">
2   - <div class="uk-modal-dialog" style="width: 95%;">
  2 + <div class="uk-modal-dialog" style="width: 95%;margin: 20px auto;">
3 3 <a href="" class="uk-modal-close uk-close"></a>
4 4 <div class="uk-modal-header">
5 5 <h2>历史路单维护</h2>
... ... @@ -37,7 +37,7 @@
37 37 <input type="text" name="jGh_like" placeholder="驾驶员" style="width: 80px;">
38 38 </div>
39 39 <button class="uk-button">检索</button>
40   - <a class="add_lp_link" ><i class="uk-icon-plus"></i> 临加路牌</a>
  40 + <a class="add_lp_link" title="先点击检索后再临加路牌"><i class="uk-icon-plus"></i> 临加路牌</a>
41 41 </fieldset>
42 42 </form>
43 43 </div>
... ... @@ -131,7 +131,7 @@
131 131 $('.h-s-time', modal).html(tsStr);
132 132 clearLpSelect();
133 133 //reLoadLp=true;
134   - jsQuery();
  134 + //jsQuery();
135 135 });
136 136 });
137 137  
... ... @@ -176,6 +176,8 @@
176 176 data.subCompanyId=null;
177 177 var rq = $('.h-s-time li.uk-active', modal).text();
178 178 data.scheduleDateStr_eq = rq;
  179 + if(!data.xlBm_eq)
  180 + return notify_err('请选择线路...');
179 181 if(data.jGh_like.indexOf('/')!=-1){
180 182 var jsy=data.jGh_like.split('/');
181 183 data.jGh_like=jsy[0];
... ... @@ -226,6 +228,9 @@
226 228 $('.history-sch-wrap', modal).perfectScrollbar('update');
227 229  
228 230 cb && cb();
  231 +
  232 + //初始化依赖数据
  233 + gb_data_basic.initData(data.xlBm_eq);
229 234 });
230 235 }
231 236  
... ... @@ -376,9 +381,10 @@
376 381 });
377 382  
378 383 var lpName = '临' + (index + 1);
  384 + var lineSelect = $('[name=xlBm_eq]', modal);
379 385 var rq = $('.h-s-time li.uk-active', modal).text(),
380   - lineName = $('.h-s-line li.uk-active', modal).text(),
381   - lineCode = $('.h-s-line li.uk-active', modal).data('id');
  386 + lineName = lineSelect[0].options[lineSelect[0].selectedIndex].text,//$('.h-s-line li.uk-active', modal).text(),
  387 + lineCode = lineSelect.val();
382 388  
383 389 var sch = {
384 390 scheduleDateStr: rq,
... ... @@ -467,6 +473,9 @@
467 473 }
468 474 $('[name=xlBm_eq]', f).html(opts);
469 475 });
  476 +
  477 + $('[name=xlBm_eq]', f).on('change', clearLpSelect);
  478 + //clearLpSelect
470 479 })();
471 480 </script>
472 481 </div>
473 482 \ No newline at end of file
... ...
src/main/resources/static/pages/history_sch/edit/js/data_basic.js 0 → 100644
  1 +/* 基础数据管理模块 */
  2 +
  3 +var gb_data_basic = (function () {
  4 +
  5 + var allPersonnel;
  6 + var stationRoutes, lineInformations, codeToLine={};
  7 + var ep = EventProxy.create("all_personnel"
  8 + , function (all_personnel) {
  9 + allPersonnel = all_personnel;
  10 + //gb_main_ep.emitLater('data-basic');
  11 + });
  12 +
  13 +/* //线路标准信息
  14 + gb_common.$get('/lineInformation/line/multi', {lineCodes: line_idx}, function (rs) {
  15 + var informations = {};
  16 + $.each(rs, function () {
  17 + informations[this.line.lineCode] = this;
  18 + delete this['line'];
  19 + });
  20 + ep.emit('lineInformations', informations);
  21 + });*/
  22 +
  23 + //人员信息
  24 + loadAllPersonnel(function (data) {
  25 + ep.emit('all_personnel', data);
  26 + });
  27 + function loadAllPersonnel(cb) {
  28 + $.get('/personnel/all_py', function (rs) {
  29 + //转换成自动补全组件需要的数据
  30 + var data = [], code;
  31 + for(var i =0, p; p = rs[i++];){
  32 + code = p['workId'].indexOf('-')!=-1?p['workId'].split('-')[1]:p['workId'];
  33 + data.push({
  34 + value: code + '/' + p.name,
  35 + fullChars: p.fullChars.toUpperCase(),
  36 + camelChars: p.camelChars.toUpperCase()
  37 + });
  38 + }
  39 + cb && cb(data);
  40 + });
  41 + }
  42 +
  43 + var carparks = {};
  44 + //停车场数据
  45 + gb_common.$get('/realMap/carParkSpatialData', {}, function (rs) {
  46 + rs.list.sort(function (a, b) {
  47 + return a.parkName.localeCompare(b.parkName);
  48 + });
  49 + $.each(rs.list, function () {
  50 + carparks[this.parkCode] = this;
  51 + });
  52 + });
  53 +
  54 + //车辆数据
  55 + var carsArray;
  56 + $.get('/basic/cars?t=' + Math.random(), function (rs) {
  57 + carsArray = rs;
  58 + });
  59 +
  60 + var getCarparkByCode = function (code) {
  61 + return carparks[code];
  62 + };
  63 +
  64 + //line code to name
  65 + $.get('/basic/lineCode2Name', function (rs) {
  66 + ep.emit('lineCode2Name', rs);
  67 + });
  68 +
  69 + var getLineInformation = function (lineCode) {
  70 + return lineInformations[lineCode];
  71 + };
  72 +
  73 + var stationRouteSort = function (a, b) {
  74 + return a.stationRouteCode - b.stationRouteCode;
  75 + };
  76 +
  77 + function findLineByCodes(codeArr) {
  78 + var rs = [];
  79 + $.each(codeArr, function () {
  80 + rs.push(codeToLine[this]);
  81 + });
  82 + return rs;
  83 + }
  84 +
  85 + return {
  86 + getLineInformation: getLineInformation,
  87 + allInformations: function () {
  88 + return {};
  89 + },
  90 + allPersonnel: function () {
  91 + return allPersonnel;
  92 + },
  93 + getSvgAttr: function (lineCode) {
  94 + return svgAttrs[lineCode];
  95 + },
  96 + //刷新员工信息
  97 + refreshAllPersonnel: function (cb) {
  98 + loadAllPersonnel(function (data) {
  99 + allPersonnel = data;
  100 + cb && cb();
  101 + });
  102 + },
  103 + carsArray: function () {
  104 + return carsArray;
  105 + },
  106 + simpleParksArray: function () {
  107 + var map = {};
  108 + for(var code in carparks)
  109 + map[code] = carparks[code].parkName;
  110 + return map;
  111 + },
  112 + getLineInformation: getLineInformation,
  113 + allInformations: function () {
  114 + return lineInformations;
  115 + },
  116 + stationRoutes: function (lineCode) {
  117 + return stationRoutes[lineCode]
  118 + },
  119 + remarksMapps: function () {
  120 + return "";
  121 + },
  122 + findLineByCodes: findLineByCodes,
  123 + //初始化依赖数据
  124 + initData: function (lineCode) {
  125 + var ep = EventProxy.create("stationRoutes", "lineInformations", "codeToLineMap", function (routes, informations, _codeToLine) {
  126 + stationRoutes = routes;
  127 + lineInformations = informations;
  128 + codeToLine[_codeToLine.lineCode] = _codeToLine;
  129 + });
  130 +
  131 + //站点路由
  132 + gb_common.$get('/stationroute/multiLine', {lineIds: lineCode}, function (rs) {
  133 + var list = rs.list;
  134 + var routeData = gb_common.groupBy(list, 'lineCode');
  135 + //排序
  136 + for (var lineCode in routeData) {
  137 + routeData[lineCode].sort(stationRouteSort);
  138 + }
  139 + ep.emitLater('stationRoutes', routeData);
  140 + });
  141 +
  142 + //线路标准信息
  143 + gb_common.$get('/lineInformation/line/multi', {lineCodes: lineCode}, function (rs) {
  144 + var _informations = {};
  145 + $.each(rs, function () {
  146 + _informations[this.line.lineCode] = this;
  147 + delete this['line'];
  148 + });
  149 + ep.emitLater('lineInformations', _informations);
  150 + });
  151 +
  152 + //线路基础信息
  153 + gb_common.$get('/line/' + lineCode, {}, function (rs) {
  154 + ep.emitLater('codeToLineMap', rs);
  155 + });
  156 + }
  157 + };
  158 +})();
... ...
src/main/resources/static/pages/history_sch/edit/main_page.html
... ... @@ -17,6 +17,8 @@
17 17 <link rel="stylesheet" href="/pages/history_sch/edit/css/main.css" />
18 18 <!-- north style -->
19 19 <link rel="stylesheet" href="/real_control_v2/css/north.css" merge="custom_style"/>
  20 + <!-- line style -->
  21 + <link rel="stylesheet" href="/real_control_v2/css/line_schedule.css" merge="custom_style"/>
20 22  
21 23 <!-- custom table -->
22 24 <link rel="stylesheet" href="/real_control_v2/css/ct_table.css" merge="custom_style"/>
... ... @@ -33,6 +35,10 @@
33 35 cursor: default;
34 36 user-select: none;
35 37 }
  38 + .uk-modal.ct_move_modal .uk-modal-dialog {
  39 + position: relative !important;
  40 + margin: 50px auto !important;
  41 + }
36 42 </style>
37 43 </head>
38 44  
... ... @@ -63,8 +69,6 @@
63 69 <script src="/assets/js/d3.min.js"></script>
64 70 <!-- EventProxy -->
65 71 <script src="/assets/js/eventproxy.js"></script>
66   -<!-- main js -->
67   -<script src="/real_control_v2/js/main.js"></script>
68 72 <!-- uikit core -->
69 73 <script src="/real_control_v2/assets/plugins/uikit-2.27.1/uikit.min.js" merge="uikit_js"></script>
70 74 <script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/notify.min.js" merge="uikit_js"></script>
... ... @@ -95,7 +99,10 @@
95 99 <!-- custom table js -->
96 100 <script src="/real_control_v2/js/utils/ct_table.js" merge="custom_js"></script>
97 101 <script src="/pages/history_sch/edit/js/modal_extend.js" merge="custom_js"></script>
98   -
  102 +<!-- 字典相关 -->
  103 +<script src="/assets/js/dictionary.js" merge="custom_js"></script>
  104 +<!-- 数据 -->
  105 +<script src="/pages/history_sch/edit/js/data_basic.js" merge="custom_js"></script>
99 106 <script>
100 107  
101 108 (function () {
... ... @@ -104,6 +111,39 @@
104 111 bgclose: false
105 112 });
106 113 })();
  114 +
  115 + var notify_err = function (t) {
  116 + UIkit.notify("<i class='uk-icon-times'></i> " + t, {
  117 + status: 'danger'
  118 + });
  119 + };
  120 +
  121 + var gb_form_validation_opts = {
  122 + framework: 'uikit',
  123 + locale: 'zh_CN',
  124 + icon: {
  125 + valid: 'uk-icon-check',
  126 + invalid: 'uk-icon-times',
  127 + validating: 'uk-icon-refresh'
  128 + }
  129 + };
  130 +
  131 + var disabled_submit_btn = function (form) {
  132 + var subBtn = $('button[type=submit]', form);
  133 + if (subBtn) {
  134 + subBtn.addClass('disabled').attr('disabled', 'disabled');
  135 + }
  136 + };
  137 +
  138 + var notify_succ = function (t) {
  139 + UIkit.notify("<i class='uk-icon-check'></i> " + t, {
  140 + status: 'success'
  141 + });
  142 + };
  143 +
  144 + var hide_wait_modal = function () {
  145 + UIkit.modal('#gb_wait_modal').hide();
  146 + };
107 147 </script>
108 148 </body>
109 149 </html>
110 150 \ No newline at end of file
... ...
src/main/resources/static/real_control_v2/fragments/north/nav/history_sch/editor.html
... ... @@ -186,9 +186,9 @@
186 186 <a class="uk-button uk-button-success"><i class="uk-icon-pencil-square-o"></i> 添加子任务 <i class="uk-icon-caret-down"></i></a>
187 187 <div class="uk-dropdown" style="text-align: left;">
188 188 <ul class="uk-nav uk-nav-dropdown child_task_list">
189   - <li data-method="add_oil"><a>空驶进出场</a></li>
  189 + <!--<li data-method="add_oil"><a>空驶进出场</a></li>
190 190 <li data-method="in_park"><a>进场</a></li>
191   - <li data-method="out_park"><a>出场</a></li>
  191 + <li data-method="out_park"><a>出场</a></li>-->
192 192 <li data-method="other"><a>自定义</a></li>
193 193 </ul>
194 194 </div>
... ...
src/main/resources/static/real_control_v2/js/north/toolbar.js
... ... @@ -126,7 +126,7 @@ var gb_northToolbar = (function () {
126 126 open_modal('/real_control_v2/fragments/north/nav/cache_data/list.html', {}, modal_opts);
127 127 },
128 128 form_waybill: function () {
129   - gb_embed_form_hanlde.open_modal_form_fragment('/pages/forms/statement/waybill.html', '行车路单');
  129 + gb_embed_form_hanlde.open_modal_form_fragment('/pages/forms/statement/<dd>上行</dd>', '行车路单');
130 130 },
131 131 form_waybillQp: function () {
132 132 gb_embed_form_hanlde.open_modal_form_fragment('/pages/forms/statement/waybillQp.html', '行车路单');
... ...