Commit 0fa1353cea7ba59dc16eb51b40f65591ac292ac2

Authored by 廖磊
1 parent b048feff

添加调度日报 待发时间比较

src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
@@ -4968,6 +4968,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf @@ -4968,6 +4968,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf
4968 String state = map.get("state").toString(); 4968 String state = map.get("state").toString();
4969 String type = map.get("type").toString(); 4969 String type = map.get("type").toString();
4970 String genre =map.get("genre").toString(); 4970 String genre =map.get("genre").toString();
  4971 + String df="";
  4972 + if(map.get("df")!=null){
  4973 + df=map.get("df").toString();
  4974 + }
  4975 +
4971 List<Map<String, Object>> dataList2 = new ArrayList<Map<String, Object>>(); 4976 List<Map<String, Object>> dataList2 = new ArrayList<Map<String, Object>>();
4972 List<Map<String, Object>> dataList3 = new ArrayList<Map<String, Object>>(); 4977 List<Map<String, Object>> dataList3 = new ArrayList<Map<String, Object>>();
4973 List<Map<String, Object>> list1 = this.statisticsDaily(line, date, xlName, null); 4978 List<Map<String, Object>> list1 = this.statisticsDaily(line, date, xlName, null);
@@ -5121,16 +5126,31 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -5121,16 +5126,31 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
5121 tempMap.put("fcsjActual" + x, fcsjActuralstr); 5126 tempMap.put("fcsjActual" + x, fcsjActuralstr);
5122 String fcsjk = ""; 5127 String fcsjk = "";
5123 String fcsjm = ""; 5128 String fcsjm = "";
  5129 + String dfsjk ="";
  5130 + String dfsjm="";
5124 if (!fcsjActural.equals("")) { 5131 if (!fcsjActural.equals("")) {
5125 - String[] zdsj_s = schedule.getFcsj().split(":"); 5132 + String[] fcsj_s = schedule.getFcsj().split(":");
5126 String[] fcsjActural_s = fcsjActural.split(":"); 5133 String[] fcsjActural_s = fcsjActural.split(":");
5127 - Long zdsj_ = Long.parseLong(zdsj_s[0]) * 60 + Long.parseLong(zdsj_s[1]); 5134 + Long fcsj_ = Long.parseLong(fcsj_s[0]) * 60 + Long.parseLong(fcsj_s[1]);
5128 Long fcsjActural_ = Long.parseLong(fcsjActural_s[0]) * 60 + Long.parseLong(fcsjActural_s[1]); 5135 Long fcsjActural_ = Long.parseLong(fcsjActural_s[0]) * 60 + Long.parseLong(fcsjActural_s[1]);
5129 - if ((zdsj_ - fcsjActural_) > 0) {  
5130 - fcsjk = String.valueOf(zdsj_ - fcsjActural_); 5136 + if ((fcsj_ - fcsjActural_) > 0) {
  5137 + fcsjk = String.valueOf(fcsj_ - fcsjActural_);
5131 } else { 5138 } else {
5132 - fcsjm = String.valueOf(fcsjActural_ - zdsj_); 5139 + fcsjm = String.valueOf(fcsjActural_ - fcsj_);
5133 } 5140 }
  5141 + String[] dfsj_s =schedule.getDfsj().split(":");
  5142 + Long dfsj_ = Long.parseLong(dfsj_s[0]) * 60 + Long.parseLong(dfsj_s[1]);
  5143 + if ((dfsj_ - fcsjActural_) > 0) {
  5144 + dfsjk = String.valueOf(dfsj_ - fcsjActural_);
  5145 + } else {
  5146 + dfsjm = String.valueOf(fcsjActural_ - dfsj_);
  5147 + }
  5148 +
  5149 + }
  5150 + if(df.equals("df")){
  5151 + tempMap.put("dfsj"+x,schedule.getDfsj());
  5152 + tempMap.put("dfsjk" + x, dfsjk);
  5153 + tempMap.put("dfsjm" + x, dfsjm.equals("0")?"":dfsjm);
5134 } 5154 }
5135 tempMap.put("fcsjk" + x, fcsjk); 5155 tempMap.put("fcsjk" + x, fcsjk);
5136 tempMap.put("fcsjm" + x, fcsjm.equals("0")?"":fcsjm); 5156 tempMap.put("fcsjm" + x, fcsjm.equals("0")?"":fcsjm);
@@ -5150,6 +5170,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -5150,6 +5170,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
5150 tempMap.put("fcsjActual1", ""); 5170 tempMap.put("fcsjActual1", "");
5151 tempMap.put("fcsjk1", ""); 5171 tempMap.put("fcsjk1", "");
5152 tempMap.put("fcsjm1", ""); 5172 tempMap.put("fcsjm1", "");
  5173 + if(df.equals("df")){
  5174 + tempMap.put("dfsj1","");
  5175 + tempMap.put("dfsjk1" , "");
  5176 + tempMap.put("dfsjm1" , "");
  5177 + }
5153 tempMap.put("remarks1", ""); 5178 tempMap.put("remarks1", "");
5154 } 5179 }
5155 if (tempMap.get("lpName2") == null) { 5180 if (tempMap.get("lpName2") == null) {
@@ -5163,6 +5188,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -5163,6 +5188,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
5163 tempMap.put("fcsjActual2", ""); 5188 tempMap.put("fcsjActual2", "");
5164 tempMap.put("fcsjk2", ""); 5189 tempMap.put("fcsjk2", "");
5165 tempMap.put("fcsjm2", ""); 5190 tempMap.put("fcsjm2", "");
  5191 + if(df.equals("df")){
  5192 + tempMap.put("dfsj2","");
  5193 + tempMap.put("dfsjk2" , "");
  5194 + tempMap.put("dfsjm2" , "");
  5195 + }
5166 tempMap.put("remarks2", ""); 5196 tempMap.put("remarks2", "");
5167 } 5197 }
5168 dataList3.add(tempMap); 5198 dataList3.add(tempMap);
@@ -5209,6 +5239,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -5209,6 +5239,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
5209 sdfSimple = new SimpleDateFormat("yyyyMM"); 5239 sdfSimple = new SimpleDateFormat("yyyyMM");
5210 sourcePath = path + "mould/scheduleDaily_m.xls"; 5240 sourcePath = path + "mould/scheduleDaily_m.xls";
5211 } 5241 }
  5242 + if(df.equals("df")){
  5243 + sourcePath =path + "mould/scheduleDaily_df.xls";
  5244 + }
5212 ee.excelReplace(listI, new Object[]{nMap}, sourcePath, 5245 ee.excelReplace(listI, new Object[]{nMap}, sourcePath,
5213 path + "export/" + sdfSimple.format(sdfMonth.parse(date)) + lineName + "调度日报.xls"); 5246 path + "export/" + sdfSimple.format(sdfMonth.parse(date)) + lineName + "调度日报.xls");
5214 } catch (Exception e) { 5247 } catch (Exception e) {
src/main/resources/static/pages/forms/mould/scheduleDaily_df.xls 0 → 100644
No preview for this file type
src/main/resources/static/pages/forms/statement/scheduleDaily.html
@@ -446,7 +446,7 @@ @@ -446,7 +446,7 @@
446 divFrom2 = window.document.getElementById('forms_1'); 446 divFrom2 = window.document.getElementById('forms_1');
447 divFrom2.style.width=divFrom1.offsetWidth+"px"; 447 divFrom2.style.width=divFrom1.offsetWidth+"px";
448 }); 448 });
449 - $.get('/realSchedule/realScheduleList_zrw',{line:line,date:date,type:"query"},function(result){ 449 + $.get('/realSchedule/realScheduleList',{line:line,date:date,type:"query"},function(result){
450 getTime(result); 450 getTime(result);
451 var scheduleDaily_3 = template('scheduleDaily_3',{list:result}); 451 var scheduleDaily_3 = template('scheduleDaily_3',{list:result});
452 $('#forms_2 .scheduleDaily_3').html(scheduleDaily_3); 452 $('#forms_2 .scheduleDaily_3').html(scheduleDaily_3);
src/main/resources/static/pages/forms/statement/scheduleDaily_df.html 0 → 100644
  1 +<style type="text/css">
  2 + .table-bordered {
  3 + border: 1px solid; }
  4 + .table-bordered > thead > tr > th,
  5 + .table-bordered > thead > tr > td,
  6 + .table-bordered > tbody > tr > th,
  7 + .table-bordered > tbody > tr > td,
  8 + .table-bordered > tfoot > tr > th,
  9 + .table-bordered > tfoot > tr > td {
  10 + border: 1px solid;
  11 + text-align: center; }
  12 + .table-bordered > thead > tr > th,
  13 + .table-bordered > thead > tr > td {
  14 + border-bottom-width: 2px; }
  15 +
  16 + .table > tbody + tbody {
  17 + border-top: 1px solid; }
  18 +
  19 +
  20 +
  21 + #ddrbBody tr> td >span{
  22 + word-break: keep-all;white-space:nowrap;
  23 + }
  24 +</style>
  25 +
  26 +<div class="page-head" >
  27 + <div class="page-title">
  28 + <h1>调度日报</h1>
  29 + </div>
  30 +</div>
  31 +
  32 +<!-- <div class="row" > -->
  33 + <div class=" row col-md-12 portlet light porttlet-fit bordered" style="height:calc(100% - 56px)">
  34 +<!-- <div class="" > -->
  35 + <div class="portlet-title">
  36 + <form class="form-inline" action="">
  37 + <div style="display: inline-block; margin-left: 33px;" id="gsdmDiv_ddrb">
  38 + <span class="item-label" style="width: 80px;">公司: </span>
  39 + <select class="form-control" name="company" id="gsdmDdrb" style="width: 180px;"></select>
  40 + </div>
  41 + <div style="display: inline-block; margin-left: 24px;" id="fgsdmDiv_ddrb">
  42 + <span class="item-label" style="width: 80px;">分公司: </span>
  43 + <select class="form-control" name="subCompany" id="fgsdmDdrb" style="width: 180px;"></select>
  44 + </div>
  45 + <div style="margin-top: 2px"></div>
  46 + <div style="display: inline-block;">
  47 + <span class="item-label" style="width: 80px;margin-left: 33px;">线路: </span>
  48 + <select class="form-control" name="line" id="line" style="width: 180px;"></select>
  49 + </div>
  50 + <div style="display: inline-block;margin-left: 38px;">
  51 + <span class="item-label" style="width: 80px;">时间: </span>
  52 + <input class="form-control" type="text" id="date" style="width: 180px;"/>
  53 + </div>
  54 + <div class="form-group">
  55 + <input class="btn btn-default" type="button" id="query" value="查询"/>
  56 +<!-- <input class="btn btn-default" type="button" id="month" value="按月查询"/> -->
  57 + <input class="btn btn-default" type="button" id="export" value="导出"/>
  58 + </div>
  59 + </form>
  60 + </div>
  61 + <div class="portlet-body" id="ddrbBody" style="overflow:auto;height: calc(100% - 80px)">
  62 + <div class="table-container" style="margin-top: 10px;min-width: 906px">
  63 + <label>日期:<span id="rqxs"></span>&nbsp;&nbsp;&nbsp;&nbsp;早高峰:6:31~8:30&nbsp;&nbsp;&nbsp;&nbsp;晚高峰:16:01~18:00</label>
  64 + <br/><label>计划+临加-少驶=<span id="jls"></span>&nbsp;&nbsp;计算机实驶:<span id="jsjss"></span></label>
  65 + &nbsp;&nbsp;当班调派:<span id="dbdp"></span></label>
  66 + <table class="table table-bordered table-hover table-checkable" id="forms">
  67 + <thead>
  68 + <tr>
  69 + <th colspan="40"><label id="xlmc"></label>线路调度日报</th>
  70 + </tr>
  71 + <tr>
  72 + <td rowspan="3"><span>路线</span></td>
  73 + <td colspan="16">全日营运里程(公里)</td>
  74 + <td colspan="15">全日营运班次</td>
  75 + <td colspan="9">大间隔情况</td>
  76 + </tr>
  77 + <tr>
  78 + <td rowspan="2"><span >计划</span></td>
  79 + <td rowspan="2"><span >实驶</span></td>
  80 + <td rowspan="2"><span>少驶公里</span></td>
  81 + <td rowspan="2"><span>少驶班次</span></td>
  82 + <td colspan="11">少驶原因(公里)</td>
  83 + <td rowspan="2"><span >临加公里</span></td>
  84 + <td colspan="3">计划班次</td>
  85 + <td colspan="3">实际班次</td>
  86 + <td colspan="3">临加班次</td>
  87 + <td colspan="3">放站班次</td>
  88 + <td colspan="3">调头班次</td>
  89 + <td colspan="3">发生次数</td>
  90 + <td rowspan="2">最大间隔时间(秒)</td>
  91 + <td colspan="5" rowspan="2">原因</td>
  92 + </tr>
  93 + <tr>
  94 + <td><span>路阻</span></td>
  95 + <td><span>吊慢</span></td>
  96 + <td><span>故障</span></td>
  97 + <td><span>纠纷</span></td>
  98 + <td><span>肇事</span></td>
  99 + <td><span>缺人</span></td>
  100 + <td><span>缺车</span></td>
  101 + <td><span>客稀</span></td>
  102 + <td><span>气候</span></td>
  103 + <td><span>援外</span></td>
  104 + <td><span>其他</span></td>
  105 + <td><span>全日</span></td>
  106 + <td><span>早高峰</span></td>
  107 + <td><span>晚高峰</span></td>
  108 + <td><span>全日</span></td>
  109 + <td><span>早高峰</span></td>
  110 + <td><span>晚高峰</span></td>
  111 + <td><span>全日</span></td>
  112 + <td><span>早高峰</span></td>
  113 + <td><span>晚高峰</span></td>
  114 + <td><span>全日</span></td>
  115 + <td><span>早高峰</span></td>
  116 + <td><span>晚高峰</span></td>
  117 + <td><span>全日</span></td>
  118 + <td><span>早高峰</span></td>
  119 + <td><span>晚高峰</span></td>
  120 + <td><span>全日</span></td>
  121 + <td><span>早高峰</span></td>
  122 + <td><span>晚高峰</span></td>
  123 + </tr>
  124 + </thead>
  125 +
  126 + <tbody class="scheduleDaily_1">
  127 +
  128 + </tbody>
  129 + <tr>
  130 + <td colspan="40">&nbsp;</td>
  131 + </tr>
  132 + </table>
  133 + <!-- <tr>
  134 + <td colspan="40">合计</td>
  135 + </tr>
  136 + <tr>
  137 + <td>售票</td>
  138 + <td colspan="2">1元</td>
  139 + <td colspan="2">2元</td>
  140 + <td colspan="2">3元</td>
  141 + <td colspan="2">4元</td>
  142 + <td colspan="2">5元</td>
  143 + <td colspan="2">6元</td>
  144 + <td colspan="2">7元</td>
  145 + <td colspan="2">8元</td>
  146 + <td colspan="2">9元</td>
  147 + <td colspan="2">10元</td>
  148 + <td colspan="2">&nbsp;</td>
  149 + <td colspan="2">合计张数</td>
  150 + <td colspan="2">&nbsp;</td>
  151 + <td colspan="2">预售票</td>
  152 + <td colspan="2">1元</td>
  153 + <td colspan="2">1.5元</td>
  154 + <td colspan="2">合计张数</td>
  155 + <td colspan="5">&nbsp;</td>
  156 + </tr>
  157 + <tr>
  158 + <td>张数</td>
  159 + <td colspan="2">&nbsp;</td>
  160 + <td colspan="2">&nbsp;</td>
  161 + <td colspan="2">&nbsp;</td>
  162 + <td colspan="2">&nbsp;</td>
  163 + <td colspan="2">&nbsp;</td>
  164 + <td colspan="2">&nbsp;</td>
  165 + <td colspan="2">&nbsp;</td>
  166 + <td colspan="2">&nbsp;</td>
  167 + <td colspan="2">&nbsp;</td>
  168 + <td colspan="2">&nbsp;</td>
  169 + <td colspan="2">&nbsp;</td>
  170 + <td colspan="2">合计金额</td>
  171 + <td colspan="2">&nbsp;</td>
  172 + <td colspan="2">张数</td>
  173 + <td colspan="2">&nbsp;</td>
  174 + <td colspan="2">&nbsp;</td>
  175 + <td colspan="2">合计金额</td>
  176 + <td colspan="5">&nbsp;</td>
  177 + </tr>
  178 + <tr>
  179 + <td colspan="40">&nbsp;</td>
  180 + </tr> -->
  181 + <table class="table table-bordered table-hover table-checkable" id="forms_1">
  182 + <tr>
  183 + <td colspan="2"><label>路牌</label></td>
  184 + <td colspan="2"><label>车号</label></td>
  185 + <td> <label>司早</label></td>
  186 + <td><label>售早</label></td>
  187 + <td><label>司晚</label></td>
  188 + <td><label>售晚</label></td>
  189 + <td colspan="2"><label>路牌</label></td>
  190 + <td colspan="2"><label>车号</label></td>
  191 + <td><label>司早</label></td>
  192 + <td><label>售早</label></td>
  193 + <td><label>司晚</label></td>
  194 + <td><label>售晚</label></td>
  195 + <td colspan="2"><label>路牌</label></td>
  196 + <td colspan="2"><label>车号</label></td>
  197 + <td><label>司早</label></td>
  198 + <td><label>售早</label></td>
  199 + <td><label>司晚</label></td>
  200 + <td><label>售晚</label></td>
  201 + <td colspan="2"><label>路牌</label></td>
  202 + <td colspan="2"><label>车号</label></td>
  203 + <td><label>司早</label></td>
  204 + <td><label>售早</label></td>
  205 + <td><label>司晚</label></td>
  206 + <td><label>售晚</label></td>
  207 + <td colspan="2"><label>路牌</label></td>
  208 + <td colspan="2"><label>车号</label></td>
  209 + <td><label>司早</label></td>
  210 + <td><label>售早</label></td>
  211 + <td><label>司晚</label></td>
  212 + <td><label>售晚</label></td>
  213 + </tr>
  214 + <tbody class="scheduleDaily_2">
  215 +
  216 + </tbody>
  217 + <tr>
  218 + <td colspan="40">&nbsp;</td>
  219 + </tr>
  220 + </table>
  221 + <table class="table table-bordered table-hover table-checkable" id="forms_2">
  222 + <tr>
  223 + <td rowspan="2">路牌</td>
  224 + <td colspan="2" rowspan="2" style="word-break: keep-all;white-space:nowrap;">起点站</td>
  225 + <td colspan="4">到达时间</td>
  226 + <td colspan="4">发车时间</td>
  227 + <td colspan="3">待发时间</td>
  228 + <td colspan="2" rowspan="2">备注</td>
  229 + <td rowspan="2">路牌</td>
  230 + <td colspan="2" rowspan="2" style="word-break: keep-all;white-space:nowrap;">起点站</td>
  231 + <td colspan="4">到达时间</td>
  232 + <td colspan="4">发车时间</td>
  233 + <td colspan="3">待发时间</td>
  234 + <td colspan="2" rowspan="2">备注</td>
  235 + <td rowspan="2">路牌</td>
  236 + <td colspan="2" rowspan="2" style="word-break: keep-all;white-space:nowrap;">起点站</td>
  237 + <td colspan="4">到达时间</td>
  238 + <td colspan="4">发车时间</td>
  239 + <td colspan="3">待发时间</td>
  240 + <td colspan="2" rowspan="2">备注</td>
  241 + </tr>
  242 + <tr>
  243 + <td>应到</td>
  244 + <td>实到</td>
  245 + <td>快</td>
  246 + <td>慢</td>
  247 + <td>应发</td>
  248 + <td>实发</td>
  249 + <td>快</td>
  250 + <td>慢</td>
  251 + <td>待发</td>
  252 + <td>快</td>
  253 + <td>慢</td>
  254 + <td>应到</td>
  255 + <td>实到</td>
  256 + <td>快</td>
  257 + <td>慢</td>
  258 + <td>应发</td>
  259 + <td>实发</td>
  260 + <td>快</td>
  261 + <td>慢</td>
  262 + <td>待发</td>
  263 + <td>快</td>
  264 + <td>慢</td>
  265 + <td>应到</td>
  266 + <td>实到</td>
  267 + <td>快</td>
  268 + <td>慢</td>
  269 + <td>应发</td>
  270 + <td>实发</td>
  271 + <td>快</td>
  272 + <td>慢</td>
  273 + <td>待发</td>
  274 + <td>快</td>
  275 + <td>慢</td>
  276 + </tr>
  277 + <tbody class="scheduleDaily_3">
  278 +
  279 + </tbody>
  280 + </table>
  281 + </div>
  282 + </div>
  283 +<!-- </div> -->
  284 +<!-- </div> -->
  285 +</div>
  286 +
  287 +<script>
  288 + $(function(){
  289 + // 关闭左侧栏
  290 + if (!$('body').hasClass('page-sidebar-closed'))
  291 + $('.menu-toggler.sidebar-toggler').click();
  292 +
  293 + $("#date").datetimepicker({
  294 + format : 'YYYY-MM-DD',
  295 + locale : 'zh-cn'
  296 + });
  297 + var d = new Date();
  298 + var year = d.getFullYear();
  299 + var month = d.getMonth() + 1;
  300 + var day = d.getDate();
  301 + if(month < 10)
  302 + month = "0" + month;
  303 + if(day < 10)
  304 + day = "0" + day;
  305 + $("#date").val(year + "-" + month + "-" + day);
  306 +
  307 +// $("#ddrbBody").height($(window).height()-200);
  308 +
  309 + var divFrom1 = window.document.getElementById('forms');
  310 + var divFrom2 = window.document.getElementById('forms_1');
  311 + var divFrom3 = window.document.getElementById('forms_2');
  312 + divFrom2.style.width=divFrom1.offsetWidth+"px";
  313 + divFrom3.style.width=divFrom1.offsetWidth+"px";
  314 + /* $.get('/basic/lineCode2Name',function(result){
  315 + var data=[];
  316 +
  317 + for(var code in result){
  318 + data.push({id: code, text: result[code]});
  319 + }
  320 + initPinYinSelect2('#line',data,'');
  321 +
  322 + }) */
  323 + var fage=false;
  324 + var obj = [];
  325 + var xlList;
  326 + $.get('/report/lineList',function(result){
  327 + xlList=result;
  328 + $.get('/user/companyData', function(result){
  329 + obj = result;
  330 + var options = '';
  331 + for(var i = 0; i < obj.length; i++){
  332 + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  333 + }
  334 + if(obj.length ==0){
  335 + $("#gsdmDiv_ddrb").css('display','none');
  336 + }else if(obj.length ==1){
  337 + $("#gsdmDiv_ddrb").css('display','none');
  338 + if(obj[0].children.length == 1 || obj[0].children.length ==0)
  339 + $('#fgsdmDiv_ddrb').css('display','none');
  340 + }
  341 + $('#gsdmDdrb').html(options);
  342 + updateCompany();
  343 + });
  344 + })
  345 + $("#gsdmDdrb").on("change",updateCompany);
  346 + function updateCompany(){
  347 + var company = $('#gsdmDdrb').val();
  348 + var options = '';
  349 + for(var i = 0; i < obj.length; i++){
  350 + if(obj[i].companyCode == company){
  351 + var children = obj[i].children;
  352 + for(var j = 0; j < children.length; j++){
  353 + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
  354 + }
  355 + }
  356 + }
  357 + $('#fgsdmDdrb').html(options);
  358 + }
  359 +
  360 +
  361 + var tempData = {};
  362 + $.get('/report/lineList',function(xlList){
  363 + var data = [];
  364 + $.get('/user/companyData', function(result){
  365 + for(var i = 0; i < result.length; i++){
  366 + var companyCode = result[i].companyCode;
  367 + var children = result[i].children;
  368 + for(var j = 0; j < children.length; j++){
  369 + var code = children[j].code;
  370 + for(var k=0;k < xlList.length;k++ ){
  371 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  372 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  373 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  374 + }
  375 + }
  376 + }
  377 + }
  378 + initPinYinSelect2('#line',data,'');
  379 +
  380 + });
  381 + });
  382 +
  383 + $("#line").on("change", function(){
  384 + if($("#line").val() == " "){
  385 + $("#gsdmDdrb").attr("disabled", false);
  386 + $("#fgsdmDdrb").attr("disabled", false);
  387 + } else {
  388 + var temp = tempData[$("#line").val()].split(":");
  389 + $("#gsdmDdrb").val(temp[0]);
  390 + updateCompany();
  391 + $("#fgsdmDdrb").val(temp[1]);
  392 + $("#gsdmDdrb").attr("disabled", true);
  393 + $("#fgsdmDdrb").attr("disabled", true);
  394 + }
  395 + });
  396 +
  397 +
  398 + $('#export').attr('disabled', "true");
  399 +
  400 + var line = $("#line").val();
  401 + var xlName = $("#select2-line-container").html();
  402 + var date = $("#date").val();
  403 +
  404 + function getTime(list){
  405 + $.each(list, function(i, obj) {
  406 + if(obj.zdsj != null && obj.zdsjActual != null ){
  407 + var zdsjActual = (obj.zdsjActual).split(":");
  408 + var zdsj = (obj.zdsj).split(":");
  409 + if(zdsjActual[0]*60+Number(zdsjActual[1]) > zdsj[0]*60+Number(zdsj[1])){
  410 + obj["slow"] = (zdsjActual[0]*60+Number(zdsjActual[1])) - (zdsj[0]*60+Number(zdsj[1]));
  411 + }
  412 + else if(zdsjActual[0]*60+Number(zdsjActual[1]) < zdsj[0]*60+Number(zdsj[1])){
  413 + obj["fast"] = (zdsj[0]*60+Number(zdsj[1])) - (zdsjActual[0]*60+Number(zdsjActual[1]));
  414 + }
  415 + }
  416 +
  417 + if(obj.fcsj != null && obj.fcsjActual != null ){
  418 + var fcsjActual = (obj.fcsjActual).split(":");
  419 + var fcsj = (obj.fcsj).split(":");
  420 + var dfsj= (obj.dfsj).split(":");
  421 + if(fcsjActual[0]*60+Number(fcsjActual[1]) > fcsj[0]*60+Number(fcsj[1])){
  422 + obj["slow0"] = (fcsjActual[0]*60+Number(fcsjActual[1])) - (fcsj[0]*60+Number(fcsj[1]));
  423 + }
  424 + else if(fcsjActual[0]*60+Number(fcsjActual[1]) < fcsj[0]*60+Number(fcsj[1])){
  425 + obj["fast0"] = (fcsj[0]*60+Number(fcsj[1])) - (fcsjActual[0]*60+Number(fcsjActual[1]));
  426 + }
  427 +
  428 + if(fcsjActual[0]*60+Number(fcsjActual[1]) > dfsj[0]*60+Number(dfsj[1])){
  429 + obj["slow1"] = (fcsjActual[0]*60+Number(fcsjActual[1])) - (dfsj[0]*60+Number(dfsj[1]));
  430 + }
  431 + else if(fcsjActual[0]*60+Number(fcsjActual[1]) < dfsj[0]*60+Number(dfsj[1])){
  432 + obj["fast1"] = (dfsj[0]*60+Number(dfsj[1])) - (fcsjActual[0]*60+Number(fcsjActual[1]));
  433 + }
  434 + }
  435 + });
  436 + }
  437 + //查询
  438 + $("#query").on('click',function(){
  439 + line = $("#line").val();
  440 + xlName = $("#select2-line-container").html();
  441 + date = $("#date").val();
  442 + $("#rqxs").html(date);
  443 + if(date == null || date.length == 0){
  444 + layer.msg("请选择时间");
  445 + return;
  446 + }
  447 + $("#xlmc").html(xlName+" "+date+" ");
  448 +// $("#ddrbBody").height($(window).height()-300);
  449 + $("c").html("全日");
  450 + $("#export").removeAttr("disabled");
  451 + var i = layer.load(2);
  452 + $get('/realSchedule/statisticsDaily',{line:line,date:date,xlName:xlName,type:"query"},function(result){
  453 + var scheduleDaily_1 = template('scheduleDaily_1',{list:result});
  454 + $("#jls").html(result[0].jls);
  455 + $("#jsjss").html(result[0].sjgl);
  456 + $("#dbdp").html(result[0].dbdp);
  457 + $('#forms .scheduleDaily_1').html(scheduleDaily_1);
  458 + });
  459 + $.get('/realSchedule/queryUserInfo',{line:line,date:date,state:2,type:"query"},function(result){
  460 + var scheduleDaily_2 = template('scheduleDaily_2',{list:result});
  461 + $('#forms_1 .scheduleDaily_2').html(scheduleDaily_2);
  462 + divFrom1 = window.document.getElementById('forms');
  463 + divFrom2 = window.document.getElementById('forms_1');
  464 + divFrom2.style.width=divFrom1.offsetWidth+"px";
  465 + });
  466 + $.get('/realSchedule/realScheduleList',{line:line,date:date,type:"query"},function(result){
  467 + getTime(result);
  468 + var scheduleDaily_3 = template('scheduleDaily_3',{list:result});
  469 + $('#forms_2 .scheduleDaily_3').html(scheduleDaily_3);
  470 + divFrom1 = window.document.getElementById('forms');
  471 + divFrom3 = window.document.getElementById('forms_2');
  472 + divFrom3.style.width=divFrom1.offsetWidth+"px";
  473 + layer.close(i);
  474 + });
  475 +
  476 + });
  477 +
  478 + //按月查询
  479 + /* $("#month").on('click',function(){
  480 + line = $("#line").val();
  481 + xlName = $("#select2-line-container").html();
  482 + date = $("#date").val();
  483 + if(date == null || date.length == 0){
  484 + layer.msg("请选择时间");
  485 + return;
  486 + }
  487 + date = date.substring(0, 7);
  488 + $("c").html("全月");
  489 + $("#export").removeAttr("disabled");
  490 + $get('/realSchedule/statisticsDaily',{line:line,date:date,xlName:xlName,type:"query"},function(result){
  491 + var scheduleDaily_1 = template('scheduleDaily_1',{list:result});
  492 + $('#forms .scheduleDaily_1').html(scheduleDaily_1);
  493 + });
  494 + $('#forms .scheduleDaily_2').html("");
  495 + $('#forms .scheduleDaily_3').html("");
  496 +
  497 + }); */
  498 +
  499 + $("#export").on("click",function(){
  500 + var params = {};
  501 + if(date == null || date.length == 0){
  502 + layer.msg("请选择时间");
  503 + return;
  504 + }
  505 + var lineName = $('#line option:selected').text();
  506 + params['line'] = line;
  507 + params['lineName'] = lineName;
  508 + params['date'] = date;
  509 + params['xlName'] = xlName;
  510 + params['type'] = "export";
  511 + params['state'] = '2';
  512 + params['genre'] = 'fqp';
  513 + params['df'] = 'df';
  514 + $get('/realSchedule/scheduleDailyExport', params, function(result){
  515 + if(date.length == 10)
  516 + window.open("/downloadFile/download?fileName="+moment(date).format("YYYYMMDD")+"-"+lineName+"-调度日报");
  517 + else
  518 + window.open("/downloadFile/download?fileName="+moment(date).format("YYYYMM")+"-"+lineName+"-调度日报");
  519 + });
  520 + });
  521 +
  522 + });
  523 +</script>
  524 +<script type="text/html" id="scheduleDaily_1">
  525 + {{each list as obj i}}
  526 + <tr >
  527 + <td>{{obj.xlName}}</td>
  528 + <td>{{obj.jhlc}}</td>
  529 + <td>{{obj.sjgl}}</td>
  530 + <td>{{obj.ssgl}}</td>
  531 + <td>{{obj.ssbc}}</td>
  532 + <td>{{obj.ssgl_lz}}</td>
  533 + <td>{{obj.ssgl_dm}}</td>
  534 + <td>{{obj.ssgl_gz}}</td>
  535 + <td>{{obj.ssgl_jf}}</td>
  536 + <td>{{obj.ssgl_zs}}</td>
  537 + <td>{{obj.ssgl_qr}}</td>
  538 + <td>{{obj.ssgl_qc}}</td>
  539 + <td>{{obj.ssgl_kx}}</td>
  540 + <td>{{obj.ssgl_qh}}</td>
  541 + <td>{{obj.ssgl_yw}}</td>
  542 + <td>{{obj.ssgl_other}}</td>
  543 + <td>{{obj.ljgl}}</td>
  544 + <td>{{obj.jhbc}}</td>
  545 + <td>{{obj.jhbc_m}}</td>
  546 + <td>{{obj.jhbc_a}}</td>
  547 + <td>{{obj.sjbc}}</td>
  548 + <td>{{obj.sjbc_m}}</td>
  549 + <td>{{obj.sjbc_a}}</td>
  550 + <td>{{obj.ljbc}}</td>
  551 + <td>{{obj.ljbc_m}}</td>
  552 + <td>{{obj.ljbc_a}}</td>
  553 + <td>{{obj.fzbc}}</td>
  554 + <td>{{obj.fzbc_m}}</td>
  555 + <td>{{obj.fzbc_a}}</td>
  556 + <td>{{obj.dtbc}}</td>
  557 + <td>{{obj.dtbc_m}}</td>
  558 + <td>{{obj.dtbc_a}}</td>
  559 + <td>{{obj.djg}}</td>
  560 + <td>{{obj.djg_m}}</td>
  561 + <td>{{obj.djg_a}}</td>
  562 + <td>{{obj.djg_time}}</td>
  563 + <td colspan="5">&nbsp;</td>
  564 + </tr>
  565 + {{/each}}
  566 + {{if list.length == 0}}
  567 + <tr>
  568 + <td colspan="40"><h6 class="muted">没有找到相关数据</h6></td>
  569 + </tr>
  570 + {{/if}}
  571 +</script>
  572 +<script type="text/html" id="scheduleDaily_2">
  573 + {{each list as obj i}}
  574 + {{if i%5 == 0}}
  575 + <tr>
  576 + {{/if}}
  577 + <td colspan="2">{{obj[3]}}</td>
  578 + <td colspan="2">{{obj[2]}}</td>
  579 + <td>{{obj[1]}}/{{obj[4]}}</td>
  580 + <td>{{if obj[5] !=null}}
  581 + {{obj[5]}}/
  582 + {{obj[6]}}
  583 +
  584 + {{/if}}
  585 + </td>
  586 + <td>&nbsp;</td>
  587 + <td>&nbsp;</td>
  588 + {{if (i+1)%5 == 0}}
  589 + </tr>
  590 + {{/if}}
  591 + {{/each}}
  592 + {{if list.length == 0}}
  593 + <tr>
  594 + <td colspan="40"><h6 class="muted">没有找到相关数据</h6></td>
  595 + </tr>
  596 + {{/if}}
  597 +</script>
  598 +<script type="text/html" id="scheduleDaily_3">
  599 + {{each list as obj i}}
  600 + {{if i%3 == 0}}
  601 + <tr>
  602 + {{/if}}
  603 + <td>{{obj.lpName}}</td>
  604 + <td colspan="2" style="word-break: keep-all;white-space:nowrap;">{{obj.qdzName}}</td>
  605 + <td>{{obj.zdsj}}</td>
  606 + <td>{{obj.zdsjActual}}</td>
  607 + <td>{{obj.fast}}</td>
  608 + <td>{{obj.slow}}</td>
  609 + <td>{{obj.fcsj}}</td>
  610 + <td>{{obj.fcsjActual}}
  611 + {{if obj.bcType== "in"}}
  612 + (进)
  613 + {{/if}}
  614 + {{if obj.bcType== "out"}}
  615 + (出)
  616 + {{/if}}
  617 + </td>
  618 + <td>{{obj.fast0}}</td>
  619 + <td>{{obj.slow0}}
  620 + <td>{{obj.dfsj}}</td>
  621 + <td>{{obj.fast1}}</td>
  622 + <td>{{obj.slow1}}</td>
  623 + </td>
  624 + <td colspan="2" title="{{obj.remark}}">{{obj.remarks}}</td>
  625 + {{if (i+1)%3 == 0}}
  626 + </tr>
  627 + {{/if}}
  628 + {{/each}}
  629 + {{if list.length == 0}}
  630 + <tr>
  631 + <td colspan="40"><h6 class="muted">没有找到相关数据</h6></td>
  632 + </tr>
  633 + {{/if}}
  634 +</script>
0 \ No newline at end of file 635 \ No newline at end of file