Commit 4f24b1f9afb1249e5e8d5459cec8d821637e481d
1 parent
70d5cecb
首末班误点班次
Showing
1 changed file
with
265 additions
and
0 deletions
src/main/resources/static/pages/forms/statement/firstAndLastBus_delay.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 | +</style> | ||
| 19 | + | ||
| 20 | +<div class="page-head"> | ||
| 21 | + <div class="page-title"> | ||
| 22 | + <h1>线路首末班准点率</h1> | ||
| 23 | + </div> | ||
| 24 | +</div> | ||
| 25 | + | ||
| 26 | +<div class="row"> | ||
| 27 | + <div class="col-md-12"> | ||
| 28 | + <div class="portlet light porttlet-fit bordered"> | ||
| 29 | + <div class="portlet-title"> | ||
| 30 | + <form id="history" class="form-inline" action=""> | ||
| 31 | + <div style="display: inline-block;margin-left: 28px;" id="company1"> | ||
| 32 | + <span class="item-label" style="width: 80px;">公司: </span> | ||
| 33 | + <select class="form-control" name="company" id="company" style="width: 160px;"></select> | ||
| 34 | + </div> | ||
| 35 | + <div style="display: inline-block;margin-left: 24px;" id="subCompany1"> | ||
| 36 | + <span class="item-label" style="width: 80px;">分公司: </span> | ||
| 37 | + <select class="form-control" name="subCompany" id="subCompany" style="width: 160px;"></select> | ||
| 38 | + </div> | ||
| 39 | + <div style="display: inline-block;margin-left: 10px;"> | ||
| 40 | + <span class="item-label" style="width: 80px;">线路: </span> | ||
| 41 | + <select class="form-control" name="line" id="line" style="width: 160px;"></select> | ||
| 42 | + </div> | ||
| 43 | + <div style="margin-top: 10px"></div> | ||
| 44 | + <div style="display: inline-block;margin-left: 0px;"> | ||
| 45 | + <span class="item-label" style="width: 80px;">开始时间: </span> | ||
| 46 | + <input class="form-control" type="text" id="startDate" style="width: 160px;"/> | ||
| 47 | + </div> | ||
| 48 | + <div style="display: inline-block;margin-left: 10px;"> | ||
| 49 | + <span class="item-label" style="width: 80px;">结束时间: </span> | ||
| 50 | + <input class="form-control" type="text" id="endDate" style="width: 160px;"/> | ||
| 51 | + </div> | ||
| 52 | + <div class="form-group" style="margin-left: 10px;"> | ||
| 53 | + <input class="btn btn-default" type="button" id="query" value="筛选"/> | ||
| 54 | + <input class="btn btn-default" type="button" id="export" value="导出"/> | ||
| 55 | + </div> | ||
| 56 | + </form> | ||
| 57 | + </div> | ||
| 58 | + <div class="portlet-body"> | ||
| 59 | + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px"> | ||
| 60 | + <table class="table table-bordered table-hover table-checkable" id="forms"> | ||
| 61 | + <thead> | ||
| 62 | + <tr class="hidden"> | ||
| 63 | + <th align="center">序号</th> | ||
| 64 | + <th>日期</th> | ||
| 65 | + <th>分公司</th> | ||
| 66 | + <th>线路</th> | ||
| 67 | + <th>首末班次</th> | ||
| 68 | + <th>计发</th> | ||
| 69 | + <th>实发</th> | ||
| 70 | + <th>误差</th> | ||
| 71 | + <th>调度路单备注</th> | ||
| 72 | + </tr> | ||
| 73 | + </thead> | ||
| 74 | + <tbody> | ||
| 75 | + | ||
| 76 | + </tbody> | ||
| 77 | + </table> | ||
| 78 | + </div> | ||
| 79 | + </div> | ||
| 80 | + </div> | ||
| 81 | + </div> | ||
| 82 | +</div> | ||
| 83 | + | ||
| 84 | +<script type="text/javascript" src="js/jquery.table2excel.min.js"></script> | ||
| 85 | +<script> | ||
| 86 | + $(function(){ | ||
| 87 | + $('#export').attr('disabled', "true"); | ||
| 88 | + | ||
| 89 | + // 关闭左侧栏 | ||
| 90 | + if (!$('body').hasClass('page-sidebar-closed')) | ||
| 91 | + $('.menu-toggler.sidebar-toggler').click(); | ||
| 92 | + | ||
| 93 | + | ||
| 94 | + var d = new Date(); | ||
| 95 | + d.setTime(d.getTime() - 1*1000*60*60*24); | ||
| 96 | + var year = d.getFullYear(); | ||
| 97 | + var month = d.getMonth() + 1; | ||
| 98 | + var day = d.getDate(); | ||
| 99 | + if(month < 10) | ||
| 100 | + month = "0" + month; | ||
| 101 | + if(day < 10) | ||
| 102 | + day = "0" + day; | ||
| 103 | + var dateTime = year + "-" + month + "-" + day; | ||
| 104 | + $("#startDate,#endDate").datetimepicker({ | ||
| 105 | + format : 'YYYY-MM-DD', | ||
| 106 | + locale : 'zh-cn', | ||
| 107 | + maxDate : dateTime | ||
| 108 | + }); | ||
| 109 | + $("#startDate,#endDate").val(dateTime); | ||
| 110 | + | ||
| 111 | + var fage=false; | ||
| 112 | + var xlList; | ||
| 113 | + var obj = []; | ||
| 114 | + | ||
| 115 | + $.get('/report/lineList',function(result){ | ||
| 116 | + xlList=result; | ||
| 117 | + $.get('/user/companyData', function(result){ | ||
| 118 | + obj = result; | ||
| 119 | + var options = ''; | ||
| 120 | + for(var i = 0; i < obj.length; i++){ | ||
| 121 | + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; | ||
| 122 | + } | ||
| 123 | + | ||
| 124 | + if(obj.length ==0){ | ||
| 125 | + $("#company1").css('display','none'); | ||
| 126 | + }else if(obj.length ==1){ | ||
| 127 | + $("#company1").css('display','none'); | ||
| 128 | + if(obj[0].children.length == 1 || obj[0].children.length ==0) | ||
| 129 | + $('#subCompany1').css('display','none'); | ||
| 130 | + } | ||
| 131 | + $('#company').html(options); | ||
| 132 | + updateCompany(); | ||
| 133 | + }); | ||
| 134 | + }) | ||
| 135 | + $("#company").on("change",updateCompany); | ||
| 136 | + function updateCompany(){ | ||
| 137 | + var company = $('#company').val(); | ||
| 138 | + var options = ''; | ||
| 139 | + for(var i = 0; i < obj.length; i++){ | ||
| 140 | + if(obj[i].companyCode == company){ | ||
| 141 | + var children = obj[i].children; | ||
| 142 | + for(var j = 0; j < children.length; j++){ | ||
| 143 | + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>'; | ||
| 144 | + } | ||
| 145 | + } | ||
| 146 | + } | ||
| 147 | + $('#subCompany').html(options); | ||
| 148 | + } | ||
| 149 | + | ||
| 150 | + var tempData = {}; | ||
| 151 | + $.get('/report/lineList',function(xlList){ | ||
| 152 | + var data = []; | ||
| 153 | + data.push({id: " ", text: "全部线路"}); | ||
| 154 | + $.get('/user/companyData', function(result){ | ||
| 155 | + for(var i = 0; i < result.length; i++){ | ||
| 156 | + var companyCode = result[i].companyCode; | ||
| 157 | + var children = result[i].children; | ||
| 158 | + for(var j = 0; j < children.length; j++){ | ||
| 159 | + var code = children[j].code; | ||
| 160 | + for(var k=0;k < xlList.length;k++ ){ | ||
| 161 | + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){ | ||
| 162 | + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]}); | ||
| 163 | + tempData[xlList[k]["xlbm"]] = companyCode+":"+code; | ||
| 164 | + } | ||
| 165 | + } | ||
| 166 | + } | ||
| 167 | + } | ||
| 168 | + initPinYinSelect2('#line',data,''); | ||
| 169 | + | ||
| 170 | + }); | ||
| 171 | + }); | ||
| 172 | + | ||
| 173 | + $("#line").on("change", function(){ | ||
| 174 | + if($("#line").val() == " "){ | ||
| 175 | + $("#company").attr("disabled", false); | ||
| 176 | + $("#subCompany").attr("disabled", false); | ||
| 177 | + } else { | ||
| 178 | + var temp = tempData[$("#line").val()].split(":"); | ||
| 179 | + $("#company").val(temp[0]); | ||
| 180 | + updateCompany(); | ||
| 181 | + $("#subCompany").val(temp[1]); | ||
| 182 | + $("#company").attr("disabled", true); | ||
| 183 | + $("#subCompany").attr("disabled", true); | ||
| 184 | + } | ||
| 185 | + }); | ||
| 186 | + | ||
| 187 | + $("#query").on("click",jsDoQuery); | ||
| 188 | + | ||
| 189 | + var company = $("#company").val(); | ||
| 190 | + var subCompany = $("#subCompany").val(); | ||
| 191 | + var line = $("#line").val(); | ||
| 192 | + var startDate = $("#startDate").val(); | ||
| 193 | + var endDate = $("#endDate").val(); | ||
| 194 | + function jsDoQuery(pagination){ | ||
| 195 | + if($("#startDate").val() == null || $("#startDate").val().trim().length == 0){ | ||
| 196 | + layer.msg("请选择时间!"); | ||
| 197 | + return; | ||
| 198 | + } | ||
| 199 | + if($("#endDate").val() == null || $("#endDate").val().trim().length == 0){ | ||
| 200 | + layer.msg("请选择时间!"); | ||
| 201 | + return; | ||
| 202 | + } | ||
| 203 | + var i = layer.load(2); | ||
| 204 | + var params = {}; | ||
| 205 | + company = $("#company").val(); | ||
| 206 | + subCompany = $("#subCompany").val(); | ||
| 207 | + line = $("#line").val(); | ||
| 208 | + startDate = $("#startDate").val(); | ||
| 209 | + endDate = $("#endDate").val(); | ||
| 210 | + if(line == " ") | ||
| 211 | + line = ""; | ||
| 212 | + params['company'] = company; | ||
| 213 | + params['subCompany'] = subCompany; | ||
| 214 | + params['line'] = line; | ||
| 215 | + params['startDate'] = startDate; | ||
| 216 | + params['endDate'] = endDate; | ||
| 217 | + params['type'] = "query"; | ||
| 218 | + $("#forms .hidden").removeClass("hidden"); | ||
| 219 | + $("#map tr").addClass("hidden"); | ||
| 220 | + $("#sumMap tr").addClass("hidden"); | ||
| 221 | + $get('/pcpc/firstAndLastBus_sum', params, function(result){ | ||
| 222 | + // 把数据填充到模版中 | ||
| 223 | + var tbodyHtml = template('list_firstAndLastBus_delay',{list:result[result.length - 1].map}); | ||
| 224 | + // 把渲染好的模版html文本追加到表格中 | ||
| 225 | + $('#forms tbody').html(tbodyHtml); | ||
| 226 | + | ||
| 227 | + if(result.length == 0) | ||
| 228 | + $("#export").attr('disabled',"true"); | ||
| 229 | + else | ||
| 230 | + $("#export").removeAttr("disabled"); | ||
| 231 | + | ||
| 232 | + layer.close(i); | ||
| 233 | + }); | ||
| 234 | + } | ||
| 235 | + | ||
| 236 | + $("#export").on("click",function(){ | ||
| 237 | + $("#forms").table2excel({ | ||
| 238 | + exclue: ".noExl", | ||
| 239 | + name: "Excel Document Name.xlsx", | ||
| 240 | + filename: "首末班误点班次", | ||
| 241 | + exclude_img: true, | ||
| 242 | + exclude_links: true, | ||
| 243 | + exclude_inputs: true | ||
| 244 | + }); | ||
| 245 | + }); | ||
| 246 | + | ||
| 247 | + | ||
| 248 | + }); | ||
| 249 | + | ||
| 250 | +</script> | ||
| 251 | +<script type="text/html" id="list_firstAndLastBus_delay"> | ||
| 252 | + {{each list as obj i}} | ||
| 253 | + <tr> | ||
| 254 | + <td>{{obj.no}}</td> | ||
| 255 | + <td>{{obj.date}}</td> | ||
| 256 | + <td>{{obj.subCompany}}</td> | ||
| 257 | + <td>{{obj.line}}</td> | ||
| 258 | + <td>{{obj.firstOrLast}}</td> | ||
| 259 | + <td>{{obj.jhfc}}</td> | ||
| 260 | + <td>{{obj.sjfc}}</td> | ||
| 261 | + <td> {{obj.delay}}</td> | ||
| 262 | + <td>{{obj.remarks1}}</td> | ||
| 263 | + </tr> | ||
| 264 | + {{/each}} | ||
| 265 | +</script> | ||
| 0 | \ No newline at end of file | 266 | \ No newline at end of file |