Commit 96d5f4cc3bafeb0900c64e9e2e60b5cbf5bbdab0
1 parent
711bda5e
1.
Showing
7 changed files
with
3565 additions
and
0 deletions
src/main/resources/static/pages/electricity/list/add_.html
0 → 100644
| 1 | +<div class="page-head"> | ||
| 2 | + <div class="page-title"> | ||
| 3 | + <h1>进出站电量量信息编辑</h1> | ||
| 4 | + </div> | ||
| 5 | +</div> | ||
| 6 | + | ||
| 7 | +<ul class="page-breadcrumb breadcrumb"> | ||
| 8 | + <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li> | ||
| 9 | + <li><span class="active">电子路单</span> <i class="fa fa-circle"></i></li> | ||
| 10 | + <li><a href="list_.html" data-pjax>电耗管理</a> <i class="fa fa-circle"></i></li> | ||
| 11 | + <li><span class="active">进出站电量信息编辑</span></li> | ||
| 12 | +</ul> | ||
| 13 | + | ||
| 14 | +<div class="portlet light bordered"> | ||
| 15 | + <div class="portlet-title"> | ||
| 16 | + <div class="caption"> | ||
| 17 | + <i class="icon-equalizer font-red-sunglo"></i> <span | ||
| 18 | + class="caption-subject font-red-sunglo bold uppercase">表单</span> | ||
| 19 | + </div> | ||
| 20 | + </div> | ||
| 21 | + <div class="portlet-body form"> | ||
| 22 | + <form action="/addYlb" class="form-horizontal" id="ylb_add_form" > | ||
| 23 | + | ||
| 24 | + <div class="alert alert-danger display-hide"> | ||
| 25 | + <button class="close" data-close="alert"></button> | ||
| 26 | + 您的输入有误,请检查下面的输入项 | ||
| 27 | + </div> | ||
| 28 | + <input type="hidden" value="0" name="yhlx" /> | ||
| 29 | + <div class="form-body"> | ||
| 30 | + <div class="form-group"> | ||
| 31 | + <label class="col-md-3 control-label">公司</label> | ||
| 32 | + <div class="col-md-4"> | ||
| 33 | + <select class="form-control" name="ssgsdm" id="ssgsdm" ></select> | ||
| 34 | + </div> | ||
| 35 | + </div> | ||
| 36 | + <div class="form-group"> | ||
| 37 | + <label class="col-md-3 control-label">分公司</label> | ||
| 38 | + <div class="col-md-4"> | ||
| 39 | + <select class="form-control" name="fgsdm" id="fgsdm" ></select> | ||
| 40 | + </div> | ||
| 41 | + </div> | ||
| 42 | + <div class="form-group"> | ||
| 43 | + <label class="col-md-3 control-label">线路</label> | ||
| 44 | + <div class="col-md-4"> | ||
| 45 | + <select class="form-control" name="xlbm" id="xlbm" ></select> | ||
| 46 | + </div> | ||
| 47 | + </div> | ||
| 48 | + <div class="form-group"> | ||
| 49 | + <label class="col-md-3 control-label">内部编码</label> | ||
| 50 | + <div class="col-md-4"> | ||
| 51 | + <select class="form-control" name="nbbm" id="nbbm" ></select> | ||
| 52 | + </div> | ||
| 53 | + </div> | ||
| 54 | + <div class="form-group"> | ||
| 55 | + <label class="col-md-3 control-label">日期</label> | ||
| 56 | + <div class="col-md-4"> | ||
| 57 | + <input type="text" class="form-control" name="rq" id="date"> | ||
| 58 | + <label>跨天营运</label> | ||
| 59 | + <select id="sfkt" name="sfkt"> | ||
| 60 | + <option value="0">否</option> | ||
| 61 | + <option value="1">是</option> | ||
| 62 | + </select> | ||
| 63 | + </div> | ||
| 64 | + </div> | ||
| 65 | + <div class="form-group"> | ||
| 66 | + <label class="col-md-3 control-label">开始营运时间</label> | ||
| 67 | + <div class="col-md-4"> | ||
| 68 | + <input type="time" class="form-control" name="jhsj" > | ||
| 69 | + <span class="help-block"> 如:12:12</span> | ||
| 70 | + </div> | ||
| 71 | + </div> | ||
| 72 | + <div class="form-group"> | ||
| 73 | + <label class="col-md-3 control-label">驾驶员</label> | ||
| 74 | + <div class="col-md-4"> | ||
| 75 | + <select class="form-control" name="jsy" id="jsy"> </select> | ||
| 76 | + </div> | ||
| 77 | + </div> | ||
| 78 | + | ||
| 79 | + <div class="form-group"> | ||
| 80 | + <label class="col-md-3 control-label">出场里程</label> | ||
| 81 | + <div class="col-md-4"> | ||
| 82 | + <input type="text" value="0" class="form-control" name="czlc" onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')" | ||
| 83 | + onafterpaste="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')"> | ||
| 84 | + </div> | ||
| 85 | + </div> | ||
| 86 | + | ||
| 87 | + <div class="form-group"> | ||
| 88 | + <label class="col-md-3 control-label">出场电量%</label> | ||
| 89 | + <div class="col-md-4"> | ||
| 90 | + <input type="text" value="100" class="form-control" name="czcd" onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')" | ||
| 91 | + onafterpaste="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')"> | ||
| 92 | + </div> | ||
| 93 | + </div> | ||
| 94 | + | ||
| 95 | + <div class="form-group"> | ||
| 96 | + <label class="col-md-3 control-label">充电量</label> | ||
| 97 | + <div class="col-md-4"> | ||
| 98 | + <input type="text" value="0" class="form-control" name="cdl" onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')" | ||
| 99 | + onafterpaste="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')"> | ||
| 100 | + </div> | ||
| 101 | + </div> | ||
| 102 | + | ||
| 103 | + <div class="form-group"> | ||
| 104 | + <label class="col-md-3 control-label">进场电量%</label> | ||
| 105 | + <div class="col-md-4"> | ||
| 106 | + <input type="text" value="100" class="form-control" name="jzcd" onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')" | ||
| 107 | + onafterpaste="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')"> | ||
| 108 | + </div> | ||
| 109 | + </div> | ||
| 110 | + | ||
| 111 | + <div class="form-group"> | ||
| 112 | + <label class="col-md-3 control-label">耗电量</label> | ||
| 113 | + <div class="col-md-4"> | ||
| 114 | + <input type="text" value="0" class="form-control" name="hd" onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')" | ||
| 115 | + onafterpaste="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')"> | ||
| 116 | + </div> | ||
| 117 | + </div> | ||
| 118 | + | ||
| 119 | + <div class="form-group"> | ||
| 120 | + <label class="col-md-3 control-label">尿素</label> | ||
| 121 | + <div class="col-md-4"> | ||
| 122 | + <input type="text" value="0" class="form-control" name="ns" onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')" | ||
| 123 | + onafterpaste="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')"> | ||
| 124 | + </div> | ||
| 125 | + </div> | ||
| 126 | + | ||
| 127 | + <div class="form-group"> | ||
| 128 | + <label class="col-md-3 control-label">进场里程</label> | ||
| 129 | + <div class="col-md-4"> | ||
| 130 | + <input type="text" value="0" class="form-control" name="jzlc" onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')" | ||
| 131 | + onafterpaste="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')"> | ||
| 132 | + </div> | ||
| 133 | + </div> | ||
| 134 | + <div class="form-group"> | ||
| 135 | + <label class="col-md-3 control-label">损耗原因</label> | ||
| 136 | + <div class="col-md-4"> | ||
| 137 | + <select class="form-control" name="shyy"> | ||
| 138 | + <option value='0'>请选择</option> | ||
| 139 | + <option value='1'>票务用油</option> | ||
| 140 | + <option value='2'>保养用油</option> | ||
| 141 | + <option value='3'>报废车用油</option> | ||
| 142 | + <option value='4'>其它用油</option> | ||
| 143 | + <option value='5'>人保部</option> | ||
| 144 | + <option value='6'>车队</option> | ||
| 145 | + <option value='7'>车间(高保)</option> | ||
| 146 | + <option value='8'>车间(小修)</option> | ||
| 147 | + </select> | ||
| 148 | + </div> | ||
| 149 | + </div> | ||
| 150 | + <div class="form-group"> | ||
| 151 | + <label class="col-md-3 control-label">损耗电量</label> | ||
| 152 | + <div class="col-md-4"> | ||
| 153 | + <input type="text" value="0" class="form-control" name="sh" onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')" | ||
| 154 | + onafterpaste="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')"> | ||
| 155 | + </div> | ||
| 156 | + </div> | ||
| 157 | + <div class="form-group"> | ||
| 158 | + <label class="col-md-3 control-label">行驶总里程</label> | ||
| 159 | + <div class="col-md-4"> | ||
| 160 | + <input type="text" value="0" class="form-control" name="zlc" onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')" | ||
| 161 | + onafterpaste="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')"> | ||
| 162 | + </div> | ||
| 163 | + </div> | ||
| 164 | + | ||
| 165 | + | ||
| 166 | + </div> | ||
| 167 | + <div class="form-actions"> | ||
| 168 | + <div class="row"> | ||
| 169 | + <div class="col-md-offset-3 col-md-4"> | ||
| 170 | + <button type="submit" class="btn green" ><i class="fa fa-check"></i> 提交</button> | ||
| 171 | + <a type="button" class="btn default" href="list.html" data-pjax><i class="fa fa-times"></i> 取消</a> | ||
| 172 | + </div> | ||
| 173 | + </div> | ||
| 174 | + </div> | ||
| 175 | + </form> | ||
| 176 | + <!-- END FORM--> | ||
| 177 | + </div> | ||
| 178 | +</div> | ||
| 179 | +<script> | ||
| 180 | +(function(){ | ||
| 181 | + var fage=false; | ||
| 182 | + var obj = []; | ||
| 183 | + var xlList; | ||
| 184 | + $.get('/report/lineList',function(result){ | ||
| 185 | + xlList=result; | ||
| 186 | + $.get('/user/companyData', function(result){ | ||
| 187 | + obj = result; | ||
| 188 | + var options = ''; | ||
| 189 | + for(var i = 0; i < obj.length; i++){ | ||
| 190 | + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; | ||
| 191 | + } | ||
| 192 | + $('#ssgsdm').html(options); | ||
| 193 | + | ||
| 194 | + updateCompany(); | ||
| 195 | + }); | ||
| 196 | + }); | ||
| 197 | + | ||
| 198 | + $("#ssgsdm").on("change",updateCompany); | ||
| 199 | + function updateCompany(){ | ||
| 200 | + var company = $('#ssgsdm').val(); | ||
| 201 | + var options = ''; | ||
| 202 | + for(var i = 0; i < obj.length; i++){ | ||
| 203 | + if(obj[i].companyCode == company){ | ||
| 204 | + var children = obj[i].children; | ||
| 205 | + for(var j = 0; j < children.length; j++){ | ||
| 206 | + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>'; | ||
| 207 | + } | ||
| 208 | + } | ||
| 209 | + } | ||
| 210 | + $('#fgsdm').html(options); | ||
| 211 | + initXl(); | ||
| 212 | + selectNbbm(); | ||
| 213 | + selectJsy(); | ||
| 214 | + } | ||
| 215 | + $("#fgsdm").on("change",initXl); | ||
| 216 | + function initXl(){ | ||
| 217 | + var data=[]; | ||
| 218 | + if(fage){ | ||
| 219 | + $("#xlbm").select2("destroy").html(''); | ||
| 220 | + } | ||
| 221 | + var fgs=$('#fgsdm').val(); | ||
| 222 | + var gs=$('#ssgsdm').val(); | ||
| 223 | + for(var i=0;i<xlList.length;i++){ | ||
| 224 | + if(gs!=""){ | ||
| 225 | + if(fgs!=""){ | ||
| 226 | + if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){ | ||
| 227 | + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]}); | ||
| 228 | + } | ||
| 229 | + }else{ | ||
| 230 | + if(xlList[i]["gsbm"]==gs){ | ||
| 231 | + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]}); | ||
| 232 | + } | ||
| 233 | + } | ||
| 234 | + } | ||
| 235 | + } | ||
| 236 | + initPinYinSelect2('#xlbm',data,''); | ||
| 237 | + fage=true; | ||
| 238 | + selectNbbm(); | ||
| 239 | + selectJsy(); | ||
| 240 | + } | ||
| 241 | + $("#date").datetimepicker({ | ||
| 242 | + format : 'YYYY-MM-DD', | ||
| 243 | + locale : 'zh-cn' | ||
| 244 | + }); | ||
| 245 | + | ||
| 246 | + function selectNbbm(){ | ||
| 247 | + $('#nbbm').select2({ | ||
| 248 | + placeholder: '搜索车辆...', | ||
| 249 | + ajax: { | ||
| 250 | + url: '/report/carList', | ||
| 251 | + dataType: 'json', | ||
| 252 | + delay: 150, | ||
| 253 | + data: function(params){ | ||
| 254 | + return{nbbm: params.term, | ||
| 255 | + gsbm:$('#ssgsdm').val(), | ||
| 256 | + fgsbm:$('#fgsdm').val(), | ||
| 257 | + xlbm:"" | ||
| 258 | + }; | ||
| 259 | + }, | ||
| 260 | + processResults: function (data) { | ||
| 261 | + return { | ||
| 262 | + results: data | ||
| 263 | + }; | ||
| 264 | + }, | ||
| 265 | + cache: true | ||
| 266 | + }, | ||
| 267 | + templateResult: function(repo){ | ||
| 268 | + if (repo.loading) return repo.text; | ||
| 269 | + var h = '<span>'+repo.text+'</span>'; | ||
| 270 | + h += (repo.lineName?' <span class="select2-desc">'+repo.lineName+'</span>':''); | ||
| 271 | + return h; | ||
| 272 | + }, | ||
| 273 | + escapeMarkup: function (markup) { return markup; }, | ||
| 274 | + minimumInputLength: 1, | ||
| 275 | + templateSelection: function(repo){ | ||
| 276 | + return repo.text; | ||
| 277 | + }, | ||
| 278 | + language: { | ||
| 279 | + noResults: function(){ | ||
| 280 | + return '<span style="color:red;font-size: 12px;">没有搜索到车辆!</span>'; | ||
| 281 | + }, | ||
| 282 | + inputTooShort : function(e) { | ||
| 283 | + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入自编号搜索车辆</span>'; | ||
| 284 | + }, | ||
| 285 | + searching : function() { | ||
| 286 | + return '<span style="color:gray;font-size: 12px;"> 正在搜索车辆...</span>'; | ||
| 287 | + } | ||
| 288 | + } | ||
| 289 | + }) | ||
| 290 | + } | ||
| 291 | + | ||
| 292 | + | ||
| 293 | + function selectJsy(){ | ||
| 294 | + $('#jsy').select2({ | ||
| 295 | + placeholder: '搜索驾驶员...', | ||
| 296 | + ajax: { | ||
| 297 | + url: '/report/userList', | ||
| 298 | + dataType: 'json', | ||
| 299 | + delay: 150, | ||
| 300 | + data: function(params){ | ||
| 301 | + return{jsy: params.term,gsbm:$('#ssgsdm').val()}; | ||
| 302 | + }, | ||
| 303 | + processResults: function (data) { | ||
| 304 | + return { | ||
| 305 | + results: data | ||
| 306 | + }; | ||
| 307 | + }, | ||
| 308 | + cache: true | ||
| 309 | + }, | ||
| 310 | + templateResult: function(repo){ | ||
| 311 | + if (repo.loading) return repo.text; | ||
| 312 | + var h = '<span>'+repo.text+'</span>'; | ||
| 313 | + return h; | ||
| 314 | + }, | ||
| 315 | + escapeMarkup: function (markup) { return markup; }, | ||
| 316 | + minimumInputLength: 1, | ||
| 317 | + templateSelection: function(repo){ | ||
| 318 | + return repo.text; | ||
| 319 | + }, | ||
| 320 | + language: { | ||
| 321 | + noResults: function(){ | ||
| 322 | + return '<span style="color:red;font-size: 12px;">没有搜索到驾驶员!</span>'; | ||
| 323 | + }, | ||
| 324 | + inputTooShort : function(e) { | ||
| 325 | + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入工号搜索驾驶员</span>'; | ||
| 326 | + }, | ||
| 327 | + searching : function() { | ||
| 328 | + return '<span style="color:gray;font-size: 12px;"> 正在搜索驾驶员...</span>'; | ||
| 329 | + } | ||
| 330 | + } | ||
| 331 | + }); | ||
| 332 | + } | ||
| 333 | + $(function(){ | ||
| 334 | + /* $get('/role/all',null,function(result){ | ||
| 335 | + $.each(result,function(i,obj){ | ||
| 336 | + $("#role").append("<option value='"+obj.id+"'>"+obj.roleName+"</option>"); | ||
| 337 | + }); | ||
| 338 | + }); */ | ||
| 339 | + | ||
| 340 | + var form = $('#ylb_add_form'); | ||
| 341 | + var error = $('.alert-danger', form); | ||
| 342 | + | ||
| 343 | + //表单 validate | ||
| 344 | + form.validate({ | ||
| 345 | + errorElement : 'span', | ||
| 346 | + errorClass : 'help-block help-block-error', | ||
| 347 | + focusInvalid : false, | ||
| 348 | + rules : { | ||
| 349 | + 'xlbm' : { | ||
| 350 | + required : true, | ||
| 351 | + maxlength: 25 | ||
| 352 | + }, | ||
| 353 | + 'nbbm' : { | ||
| 354 | + required : true, | ||
| 355 | + maxlength: 25 | ||
| 356 | + }, | ||
| 357 | + 'rq' : { | ||
| 358 | + required : true, | ||
| 359 | + maxlength: 25 | ||
| 360 | + }, | ||
| 361 | + 'jsy' : { | ||
| 362 | + required : true, | ||
| 363 | + maxlength: 20 | ||
| 364 | + } | ||
| 365 | + }, | ||
| 366 | + invalidHandler : function(event, validator) { | ||
| 367 | + error.show(); | ||
| 368 | + App.scrollTo(error, -200); | ||
| 369 | + }, | ||
| 370 | + | ||
| 371 | + highlight : function(element) { | ||
| 372 | + $(element).closest('.form-group').addClass('has-error'); | ||
| 373 | + }, | ||
| 374 | + | ||
| 375 | + unhighlight : function(element) { | ||
| 376 | + $(element).closest('.form-group').removeClass('has-error'); | ||
| 377 | + }, | ||
| 378 | + | ||
| 379 | + success : function(label) { | ||
| 380 | + label.closest('.form-group').removeClass('has-error'); | ||
| 381 | + }, | ||
| 382 | + | ||
| 383 | + submitHandler : function(f) { | ||
| 384 | + var params = form.serializeJSON(); | ||
| 385 | + error.hide(); | ||
| 386 | + var nbbm=$("#nbbm").val(); | ||
| 387 | + var date=$("#date").val(); | ||
| 388 | + var jsy=$("#jsy").val(); | ||
| 389 | + var xlbm=$("#xlbm").val(); | ||
| 390 | + var gsdm=$("#ssgsdm").val(); | ||
| 391 | + var map={}; | ||
| 392 | + map["nbbm"]=nbbm; | ||
| 393 | + map["date"]=date; | ||
| 394 | + map["jsy"]=jsy; | ||
| 395 | + map["xlbm"]=xlbm; | ||
| 396 | + map["rq"]=date; | ||
| 397 | + map["ssgsdm_like"]=gsdm; | ||
| 398 | + //检查一下用户是否存在 | ||
| 399 | + var i = layer.load(2); | ||
| 400 | + $get('/ylb/checkDate', map, function(fage){ | ||
| 401 | + if(fage=="2"){ | ||
| 402 | + layer.msg('只能操作三天内数据.'); | ||
| 403 | + layer.close(i); | ||
| 404 | + }else{ | ||
| 405 | + $get('/dlb/checkJsy', map, function(fage){ | ||
| 406 | + if(fage=="0"){ | ||
| 407 | + layer.msg('该驾驶员当天已存在.'); | ||
| 408 | + layer.close(i); | ||
| 409 | + }else{ | ||
| 410 | + $post('/dlb/saveDlb', params, function(){ | ||
| 411 | + layer.close(i); | ||
| 412 | + layer.msg('添加信息成功.'); | ||
| 413 | + loadPage('list.html'); | ||
| 414 | + }); | ||
| 415 | + } | ||
| 416 | + }); | ||
| 417 | + } | ||
| 418 | + }) | ||
| 419 | + } | ||
| 420 | + }); | ||
| 421 | + }); | ||
| 422 | +})(); | ||
| 423 | +</script> | ||
| 0 | \ No newline at end of file | 424 | \ No newline at end of file |
src/main/resources/static/pages/electricity/list/list_.html
0 → 100644
| 1 | +<div class="page-head"> | ||
| 2 | + <div class="page-title"> | ||
| 3 | + <h1>电耗管理</h1> | ||
| 4 | + </div> | ||
| 5 | +</div> | ||
| 6 | + | ||
| 7 | +<ul class="page-breadcrumb breadcrumb"> | ||
| 8 | + <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li> | ||
| 9 | + <li><span class="active">电子路单</span> <i class="fa fa-circle"></i></li> | ||
| 10 | + <li><span class="active">电耗管理</span></li> | ||
| 11 | +</ul> | ||
| 12 | + | ||
| 13 | +<div class="row" id="dl_oil_list"> | ||
| 14 | + <div class="col-md-12"> | ||
| 15 | + <!-- Begin: life time stats --> | ||
| 16 | + <div class="portlet light portlet-fit portlet-datatable bordered"> | ||
| 17 | + <div class="portlet-title"> | ||
| 18 | + <div class="caption"> | ||
| 19 | + <i class="fa fa-fire-extinguisher"></i> <span | ||
| 20 | + class="caption-subject font-dark sbold uppercase">进出场存电量表</span> | ||
| 21 | + </div> | ||
| 22 | + <div class="actions"> | ||
| 23 | + <button type="button" class="btn btn-circle blue" id="saveButton"><i class="fa fa-minus-square"></i> | ||
| 24 | + 保存 | ||
| 25 | + </button> | ||
| 26 | + <a class="btn btn-circle blue" href="add_.html" data-pjax><i class="fa fa-plus"></i> 添加</a> | ||
| 27 | + <button type="button" class="btn btn-circle blue" id="removeButton"><i class="fa fa-trash-o"></i> 删除</button> | ||
| 28 | + | ||
| 29 | + <button type="button" class="btn btn-circle blue" id="obtain"><i class="fa fa-hourglass-half"></i> | ||
| 30 | + 获取加/存电信息 | ||
| 31 | + </button> | ||
| 32 | + <button type="button" class="btn btn-circle blue" id="checkDl"><i class="fa fa-gg-circle"></i> | ||
| 33 | + 核对加注量(有加电无里程) | ||
| 34 | + </button> | ||
| 35 | + <button class="btn btn-circle blue" | ||
| 36 | + id="export"> <i class="fa fa-file-excel-o"></i> | ||
| 37 | + 导出Excel | ||
| 38 | + </button> | ||
| 39 | + </div> | ||
| 40 | + </div> | ||
| 41 | + <div class="portlet-body"> | ||
| 42 | + <div class="table-container" style="margin-top: 10px"> | ||
| 43 | + <table | ||
| 44 | + class="table table-striped table-bordered table-hover table-checkable" | ||
| 45 | + id="datatable_dlb"> | ||
| 46 | + <thead > | ||
| 47 | + <tr role="row" class="filter"> | ||
| 48 | + <td colspan="2"> | ||
| 49 | + <div style="float: right; " > 公司</div> | ||
| 50 | + </td> | ||
| 51 | + <td colspan="3"> | ||
| 52 | + <div style="float: left;width: 150px"> | ||
| 53 | + <select class="form-control" name="ssgsdm_like" | ||
| 54 | + id="ylbListGsdmId"></select> | ||
| 55 | + </div> | ||
| 56 | + </td> | ||
| 57 | + <td colspan="2"> | ||
| 58 | + <div style="float: right; " > 分公司</div> | ||
| 59 | + </td> | ||
| 60 | + <td colspan="3"> | ||
| 61 | + <div style="float: left;"> | ||
| 62 | + <select class="form-control" name="fgsdm_like" | ||
| 63 | + id="ylbListFgsdmId" style="width: 150px"></select> | ||
| 64 | + </div> | ||
| 65 | + </td> | ||
| 66 | + <td > | ||
| 67 | + <div style="float: right; ">日期</div> | ||
| 68 | + </td> | ||
| 69 | + <td colspan="2"> | ||
| 70 | + <div style="float: left;"> | ||
| 71 | + <input type="text" style="width: 120px" name="rq" id="rq" /> | ||
| 72 | + </div> | ||
| 73 | + </td> | ||
| 74 | + <td rowspan="2" colspan="2"> | ||
| 75 | + <div style="float: left;"> | ||
| 76 | + <button | ||
| 77 | + class="btn btn-sm green btn-outline filter-submit margin-bottom" | ||
| 78 | + style="margin-right: 0px"> | ||
| 79 | + <i class="fa fa-search"></i> 搜索 | ||
| 80 | + </button> <!-- <button class="btn btn-sm red btn-outline filter-cancel" style="margin-right:0px"> --> | ||
| 81 | + <!-- <i class="fa fa-times"></i> 重置 --> | ||
| 82 | + <!-- </button> --> | ||
| 83 | + | ||
| 84 | + </div> | ||
| 85 | + </td> | ||
| 86 | + </tr> | ||
| 87 | + <tr class="filter2"> | ||
| 88 | + <td colspan="2"> | ||
| 89 | + <div style="float: right; "> 线路</div> | ||
| 90 | + </td> | ||
| 91 | + <td colspan="3"> | ||
| 92 | + <div style="float: left;"> | ||
| 93 | + <select class="form-control" name="xlbm_like" id="xlbm" | ||
| 94 | + style="width: 150px;"></select> | ||
| 95 | + </div> | ||
| 96 | + </td> | ||
| 97 | + <td colspan="2"> | ||
| 98 | + <div style="float: right;"> 内部编码</div> | ||
| 99 | + </td> | ||
| 100 | + <td colspan="3"> | ||
| 101 | + <div style="float: left;"> | ||
| 102 | + <select class="form-control" name="nbbm_eq" id="nbbm" | ||
| 103 | + style="width: 120px;"></select> | ||
| 104 | + </div> | ||
| 105 | + <div style="float: left;"> | ||
| 106 | + <button class="btn btn-sm #000 btn-outline filter-cancel" | ||
| 107 | + style="margin-right: 0px"> | ||
| 108 | + <i class="fa fa-times"></i> | ||
| 109 | + </button> | ||
| 110 | + </div> | ||
| 111 | + </td> | ||
| 112 | + <td > | ||
| 113 | + <div style="float: right;"> | ||
| 114 | + 类型 | ||
| 115 | + </div> | ||
| 116 | + </td> | ||
| 117 | + <td colspan="2"> | ||
| 118 | + <div style="float: left;"> | ||
| 119 | + <select class="form-control" name="sxtj"> | ||
| 120 | + <option value="0">全部</option> | ||
| 121 | + <option value="1">一车一单</option> | ||
| 122 | + <option value="2">一车多单</option> | ||
| 123 | + <option value="3">有充电没里程</option> | ||
| 124 | + <option value="4">有里程没充电</option> | ||
| 125 | + </select> | ||
| 126 | + </div> | ||
| 127 | + | ||
| 128 | + </td> | ||
| 129 | + </tr> | ||
| 130 | + <tr> | ||
| 131 | + <td colspan="17"> | ||
| 132 | + <div style="float: left;"> | ||
| 133 | + 总计 | ||
| 134 | + | ||
| 135 | + 充电量: <label id="sumJzl"></label> | ||
| 136 | + | ||
| 137 | + 耗电量: <label id="sumYh"></label> | ||
| 138 | + | ||
| 139 | + 损耗电量: <label id="sumSh"></label> | ||
| 140 | + </div> | ||
| 141 | + </td> | ||
| 142 | + </tr> | ||
| 143 | + <tr role="row" class="heading"> | ||
| 144 | + <th width="2%">#</th> | ||
| 145 | + <th width="8%">日期</th> | ||
| 146 | + <th width="5%">公司</th> | ||
| 147 | + <th width="8%">线路</th> | ||
| 148 | + <th width="5%">自编号</th> | ||
| 149 | + <th width="6%">驾驶员</th> | ||
| 150 | + <th width="4%">充电量</th> | ||
| 151 | + <th width="6%">出场存电</th> | ||
| 152 | + <th width="6%">进场存电</th> | ||
| 153 | + <th width="5%">耗电</th> | ||
| 154 | + <th width="5%">耗损原因</th> | ||
| 155 | + <th width="4%">耗损电量</th> | ||
| 156 | + <th width="4%">当日总里程</th> | ||
| 157 | + <th width="4%">数据类型</th> | ||
| 158 | + <th width="4%">百公里电耗</th> | ||
| 159 | +<!-- <th width="5%">操作</th> --> | ||
| 160 | + </tr> | ||
| 161 | + </thead> | ||
| 162 | + <tbody></tbody> | ||
| 163 | + </table> | ||
| 164 | + <div style="text-align: right;"> | ||
| 165 | + <ul id="pagination" class="pagination"></ul> | ||
| 166 | + </div> | ||
| 167 | + </div> | ||
| 168 | + </div> | ||
| 169 | + </div> | ||
| 170 | + </div> | ||
| 171 | +</div> | ||
| 172 | + | ||
| 173 | +<script id="dlb_list_temp" type="text/html"> | ||
| 174 | + {{each list as obj i}} | ||
| 175 | + <tr> | ||
| 176 | + <td style="vertical-align: middle;"> | ||
| 177 | + <input type="checkbox" name="id" class="group-checkable icheck" data-id="{{obj.id}}"> | ||
| 178 | + </td> | ||
| 179 | + <td> | ||
| 180 | + {{obj.rq}} | ||
| 181 | + </td> | ||
| 182 | + <td> | ||
| 183 | + {{obj.gsname}} | ||
| 184 | + </td> | ||
| 185 | + <td> | ||
| 186 | + {{obj.xlname}} | ||
| 187 | + </td> | ||
| 188 | + <td> | ||
| 189 | + <lable data-id="{{obj.id}}" class="in_carpark_nbbm">{{obj.nbbm}}</lable> | ||
| 190 | + | ||
| 191 | + </td> | ||
| 192 | + <td> | ||
| 193 | + {{if obj.jsy=='' || obj.jsy==null }} | ||
| 194 | + <input data-id="{{obj.id}}" style=" width:100%" type="text" class="in_carpark_jsy" ></input> | ||
| 195 | + <button class="btn btn-sm blue btn-jsyUpdate" style=" width:100%" data-id="{{obj.id}}">填写工号</button> | ||
| 196 | + {{else}} | ||
| 197 | + {{obj.jsy}}/{{obj.name}} | ||
| 198 | + {{/if}} | ||
| 199 | + </td> | ||
| 200 | + <td> | ||
| 201 | + | ||
| 202 | + <lable data-id="{{obj.id}}" class="in_carpark_cdl"> {{obj.cdl}}</lable> | ||
| 203 | + </td> | ||
| 204 | + <td> | ||
| 205 | + | ||
| 206 | + <input data-id="{{obj.id}}" href="javascript:;" class="in_carpark_czcd" | ||
| 207 | + type="text" value=" {{obj.czcd}}" style=" width:40px;float:left" | ||
| 208 | +onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')" | ||
| 209 | + onafterpaste="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')" /> | ||
| 210 | + <lable style="float:left">%<lable> | ||
| 211 | + </td> | ||
| 212 | + <td> | ||
| 213 | + <input data-id="{{obj.id}}" href="javascript:;" class="in_carpark_jzcd" | ||
| 214 | + type="text" value=" {{obj.jzcd}}" style=" width:40px;float:left" | ||
| 215 | +onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')" | ||
| 216 | + onafterpaste="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')" /> | ||
| 217 | + <lable style="float:left">%<lable> | ||
| 218 | + </td> | ||
| 219 | + <td> | ||
| 220 | +<input data-id="{{obj.id}}" href="javascript:;" class="in_carpark_hd" readOnly="true" | ||
| 221 | + type="text" value=" {{obj.hd}}" style=" width:45px;float:left" | ||
| 222 | +onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')" | ||
| 223 | + onafterpaste="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')" /> | ||
| 224 | + </td> | ||
| 225 | + <td> | ||
| 226 | + <select data-id="{{obj.id}}" class="in_carpark_shyy" style=" width:80px"> | ||
| 227 | + <option value='0' {{if obj.shyy==0}} selected = 'selected' {{/if}}>请选择</option> | ||
| 228 | + <option value='1' {{if obj.shyy==1}} selected = 'selected' {{/if}}>票务用电</option> | ||
| 229 | + <option value='2' {{if obj.shyy==2}} selected = 'selected' {{/if}}>保养用电</option> | ||
| 230 | + <option value='3' {{if obj.shyy==3}} selected = 'selected' {{/if}}>报废车用电</option> | ||
| 231 | + <option value='4' {{if obj.shyy==4}} selected = 'selected' {{/if}}>其它用电</option> | ||
| 232 | + <option value='5' {{if obj.shyy==5}} selected = 'selected' {{/if}}>人保部</option> | ||
| 233 | + <option value='6' {{if obj.shyy==6}} selected = 'selected' {{/if}}>车队</option> | ||
| 234 | + <option value='7' {{if obj.shyy==7}} selected = 'selected' {{/if}}>车间(高保)</option> | ||
| 235 | + <option value='8' {{if obj.shyy==8}} selected = 'selected' {{/if}}>车间(小修)</option> | ||
| 236 | + </select> | ||
| 237 | + </td> | ||
| 238 | + <td> | ||
| 239 | + <input data-id="{{obj.id}}" href="javascript:;" class="in_carpark_shyl" | ||
| 240 | + value={{obj.sh}} style=" width:40px" type="text" | ||
| 241 | +onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')" | ||
| 242 | + onafterpaste="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')" /> | ||
| 243 | + | ||
| 244 | +</td> | ||
| 245 | + <td> | ||
| 246 | + {{obj.zlc}} | ||
| 247 | + </td> | ||
| 248 | + <td> | ||
| 249 | + <select data-id="{{obj.id}}" class="in_carpark_yhlx"> | ||
| 250 | + <option value='0' {{if obj.yhlx==0}} selected = 'selected' {{/if}}>手录</option> | ||
| 251 | + <option value='1' {{if obj.yhlx==1}} selected = 'selected' {{/if}}>拆分</option> | ||
| 252 | + </select> | ||
| 253 | + </td> | ||
| 254 | + <td> | ||
| 255 | + {{obj.bglyh}} | ||
| 256 | + </td> | ||
| 257 | + </tr> | ||
| 258 | + {{/each}} | ||
| 259 | + {{if list.length == 0}} | ||
| 260 | + <tr> | ||
| 261 | + <td colspan=15><h6 class="muted">没有找到相关数据</h6></td> | ||
| 262 | + </tr> | ||
| 263 | + {{/if}} | ||
| 264 | +</script> | ||
| 265 | + | ||
| 266 | +<script> | ||
| 267 | + $(function () { | ||
| 268 | + var fage=false; | ||
| 269 | + //var id = 15; | ||
| 270 | + //$('.in_carpark_jzcd[data-id='+id+']', '#dl_oil_list') | ||
| 271 | + | ||
| 272 | + $("#checkDl").on('click', function () { | ||
| 273 | + if ($("#rq").val() != "") { | ||
| 274 | + var params=getParamsList(); | ||
| 275 | + $get('/ylb/checkDate',params,function(status){ | ||
| 276 | + if(status=='2'){ | ||
| 277 | + layer.msg('只能操作三天内数据.'); | ||
| 278 | + }else{ | ||
| 279 | + var i = layer.load(2); | ||
| 280 | + $get('/dlb/checkDl', params, function () { | ||
| 281 | + layer.close(i); | ||
| 282 | + jsDoQuery(params, true); | ||
| 283 | + }); | ||
| 284 | + } | ||
| 285 | + }) | ||
| 286 | + } else { | ||
| 287 | + layer.msg('请选择日期.'); | ||
| 288 | + } | ||
| 289 | + }) | ||
| 290 | + | ||
| 291 | + //进场等于出场 | ||
| 292 | + $("#outAndIn").on('click', function () { | ||
| 293 | + console.log("进场油量等于出场油量"); | ||
| 294 | + if ($("#rq").val() != "") { | ||
| 295 | + var params=getParamsList(); | ||
| 296 | + $get('/ylb/checkDate',params,function(status){ | ||
| 297 | + if(status=='2'){ | ||
| 298 | + layer.msg('只能操作三天内数据.'); | ||
| 299 | + }else{ | ||
| 300 | + var i = layer.load(2); | ||
| 301 | + $get('/ylb/outAndIn', params, function () { | ||
| 302 | + layer.close(i); | ||
| 303 | + jsDoQuery(params, true); | ||
| 304 | + }); | ||
| 305 | + } | ||
| 306 | + }) | ||
| 307 | + } else { | ||
| 308 | + layer.msg('请选择日期.'); | ||
| 309 | + } | ||
| 310 | + }); | ||
| 311 | + | ||
| 312 | + | ||
| 313 | + //保存 | ||
| 314 | + $("#saveButton").on('click',function(){ | ||
| 315 | + var params_=getParamsList(); | ||
| 316 | + $get('/ylb/checkDate',params_,function(status){ | ||
| 317 | + if(status=='2'){ | ||
| 318 | + layer.msg('只能操作三天内数据.'); | ||
| 319 | + }else{ | ||
| 320 | + var ylArray = []; | ||
| 321 | + $('input.icheck').each(function(){ | ||
| 322 | + var map = {}; | ||
| 323 | + var id=$(this).data('id'); | ||
| 324 | + var nbbm =$('.in_carpark_nbbm[data-id='+id+']', '#dl_oil_list').html(); | ||
| 325 | + var cdl =$('.in_carpark_cdl[data-id='+id+']', '#dl_oil_list').html(); | ||
| 326 | + if(cdl=="" || cdl ==null){ | ||
| 327 | + cdl=0; | ||
| 328 | + } | ||
| 329 | + var czcd=$('.in_carpark_czcd[data-id='+id+']', '#dl_oil_list').val(); | ||
| 330 | + if(czcd=="" || czcd==null){ | ||
| 331 | + czcd=0; | ||
| 332 | + } | ||
| 333 | + var jzcd=$('.in_carpark_jzcd[data-id='+id+']', '#dl_oil_list').val(); | ||
| 334 | + if(jzcd=="" || jzcd==null){ | ||
| 335 | + jzcd=0; | ||
| 336 | + } | ||
| 337 | + | ||
| 338 | + var sh = $('.in_carpark_shyl[data-id='+id+']', '#dl_oil_list').val(); | ||
| 339 | + if(sh=="" || sh==null){ | ||
| 340 | + sh=0; | ||
| 341 | + } | ||
| 342 | + | ||
| 343 | + var shyy = $('.in_carpark_shyy[data-id='+id+']', '#dl_oil_list').val(); | ||
| 344 | + var hd = $('.in_carpark_hd[data-id='+id+']', '#dl_oil_list').val(); | ||
| 345 | + if(hd=="" || hd==null){ | ||
| 346 | + hd=0; | ||
| 347 | + } | ||
| 348 | + var yhlx = $('.in_carpark_yhlx[data-id='+id+']', '#dl_oil_list').val(); | ||
| 349 | + | ||
| 350 | + map['id']=id; | ||
| 351 | + map['cdl']=cdl; | ||
| 352 | + map['czcd']=czcd; | ||
| 353 | + map['jzcd']=jzcd; | ||
| 354 | + map['sh']=sh; | ||
| 355 | + map['shyy']=shyy; | ||
| 356 | + map['yhlx']=yhlx; | ||
| 357 | + map['nbbm']=nbbm; | ||
| 358 | + map['hd']=hd; | ||
| 359 | + map['rq']=$("#rq").val(); | ||
| 360 | + ylArray.push(map); | ||
| 361 | + }) | ||
| 362 | + var params = {}; | ||
| 363 | + params['dlbList']=JSON.stringify(ylArray); | ||
| 364 | + var i = layer.load(2); | ||
| 365 | + $post('/dlb/saveDlbList', params, function () { | ||
| 366 | + layer.close(i); | ||
| 367 | + var params1 =getParamsList(); | ||
| 368 | + jsDoQuery(params1, true); | ||
| 369 | + }); | ||
| 370 | + } | ||
| 371 | + }) | ||
| 372 | + }) | ||
| 373 | + //拆分 | ||
| 374 | + $("#sortButton").on('click', function () { | ||
| 375 | + if ($("#rq").val() != "") { | ||
| 376 | + var ylArray = []; | ||
| 377 | + var nbbm=""; | ||
| 378 | + var msg=""; | ||
| 379 | + $('input.icheck:checked').each(function(){ | ||
| 380 | + var map = {}; | ||
| 381 | + var id=$(this).data('id'); | ||
| 382 | + var clzbh =$('.in_carpark_nbbm[data-id='+id+']', '#dl_oil_list').html(); | ||
| 383 | + if(nbbm.indexOf(clzbh)>-1){ | ||
| 384 | + if(msg==""){ | ||
| 385 | + msg += clzbh; | ||
| 386 | + }else{ | ||
| 387 | + msg += ","+clzbh; | ||
| 388 | + } | ||
| 389 | + }else{ | ||
| 390 | + nbbm +=clzbh; | ||
| 391 | + var jzyl=$('.in_carpark_jzcd[data-id='+id+']', '#dl_oil_list').val(); | ||
| 392 | + var sh = $('.in_carpark_shyl[data-id='+id+']', '#dl_oil_list').val(); | ||
| 393 | + var shyy = $('.in_carpark_shyy[data-id='+id+']', '#dl_oil_list').val(); | ||
| 394 | + var ns = $('.in_carpark_ns[data-id='+id+']', '#dl_oil_list').val(); | ||
| 395 | + var rylx= $('.in_carpark_rylx[data-id='+id+']', '#dl_oil_list').val(); | ||
| 396 | + map['id']=id; | ||
| 397 | + map['jzyl']=jzyl; | ||
| 398 | + map['sh']=sh; | ||
| 399 | + map['shyy']=shyy; | ||
| 400 | + map['ns']=ns; | ||
| 401 | + map['rylx']=rylx; | ||
| 402 | + ylArray.push(map); | ||
| 403 | + } | ||
| 404 | + | ||
| 405 | + }) ; | ||
| 406 | + if(msg!=""){ | ||
| 407 | + layer.msg('内部编码为:【'+msg +'】的车辆请选择一条数据进行拆分.'); | ||
| 408 | + }else{ | ||
| 409 | + var params = {}; | ||
| 410 | + params['ylbList']=JSON.stringify(ylArray); | ||
| 411 | + var i = layer.load(2); | ||
| 412 | + $post('/ylb/sort', params, function () { | ||
| 413 | + layer.close(i); | ||
| 414 | + var params1 =getParamsList(); | ||
| 415 | + jsDoQuery(params1, true); | ||
| 416 | + }); | ||
| 417 | + | ||
| 418 | + } | ||
| 419 | + | ||
| 420 | + } else { | ||
| 421 | + layer.msg('请选择日期.'); | ||
| 422 | + } | ||
| 423 | + }) | ||
| 424 | + //获取加存信息 | ||
| 425 | + $("#obtain").on('click', function () { | ||
| 426 | + if ($("#rq").val() != "") { | ||
| 427 | + var params=getParamsList(); | ||
| 428 | + $get('/ylb/checkDate',params,function(status){ | ||
| 429 | + if(status=='2'){ | ||
| 430 | + layer.msg('只能操作三天内数据.'); | ||
| 431 | + }else{ | ||
| 432 | + var i = layer.load(2); | ||
| 433 | + $get('/dlb/obtain', params, function () { | ||
| 434 | + layer.close(i); | ||
| 435 | + jsDoQuery(params, true); | ||
| 436 | + }); | ||
| 437 | + } | ||
| 438 | + }) | ||
| 439 | + } else { | ||
| 440 | + layer.msg('请选择日期.'); | ||
| 441 | + } | ||
| 442 | + | ||
| 443 | + }) | ||
| 444 | + $("#rq").datetimepicker({ | ||
| 445 | + format: 'YYYY-MM-DD', | ||
| 446 | + locale: 'zh-cn' | ||
| 447 | + }); | ||
| 448 | + | ||
| 449 | + var page = 0, initPagination; | ||
| 450 | + var icheckOptions = { | ||
| 451 | + radioClass: 'icheckbox_flat-blue', | ||
| 452 | + increaseArea: '20%' | ||
| 453 | + } | ||
| 454 | + | ||
| 455 | + //重置 | ||
| 456 | + $('tr.filter2 .filter-cancel').on('click', function () { | ||
| 457 | + $('tr.filter2 , #nbbm').val('').change(); | ||
| 458 | + }); | ||
| 459 | + | ||
| 460 | + //提交 | ||
| 461 | + $('tr.filter .filter-submit').on('click', function () { | ||
| 462 | + var ylbGsdm=$("#ylbListGsdmId").val(); | ||
| 463 | + var ylbFgsdm=$("#ylbListFgsdmId").val(); | ||
| 464 | + if ($("#rq").val() == "" || $("#rq").val() ==null){ | ||
| 465 | + layer.msg('请选择日期.'); | ||
| 466 | + }else if(ylbGsdm=="" || ylbGsdm==null || ylbFgsdm=="" ||ylbFgsdm==null){ | ||
| 467 | + layer.msg('请选择公司和分公司.'); | ||
| 468 | + }else { | ||
| 469 | + var params = getParamsList(); | ||
| 470 | + | ||
| 471 | + | ||
| 472 | + page = 0; | ||
| 473 | + jsDoQuery(params, true); | ||
| 474 | + } | ||
| 475 | + }); | ||
| 476 | + | ||
| 477 | + function getParamsList(){ | ||
| 478 | + var cells = $('tr.filter')[0].cells | ||
| 479 | + , cells1 = $('tr.filter2')[0].cells,params = {} | ||
| 480 | + , name; | ||
| 481 | + $.each(cells, function (i, cell) { | ||
| 482 | + var items = $('input,select', cell); | ||
| 483 | + for (var j = 0, item; item = items[j++];) { | ||
| 484 | + name = $(item).attr('name'); | ||
| 485 | + if (name) { | ||
| 486 | + params[name] = $(item).val(); | ||
| 487 | + } | ||
| 488 | + } | ||
| 489 | + }); | ||
| 490 | + $.each(cells1, function (i, cell) { | ||
| 491 | + var items = $('input,select', cell); | ||
| 492 | + for (var j = 0, item; item = items[j++];) { | ||
| 493 | + name = $(item).attr('name'); | ||
| 494 | + if (name) { | ||
| 495 | + params[name] = $(item).val(); | ||
| 496 | + } | ||
| 497 | + } | ||
| 498 | + }); | ||
| 499 | + | ||
| 500 | + return params; | ||
| 501 | + } | ||
| 502 | + | ||
| 503 | +// var gsqxdm=""; | ||
| 504 | + | ||
| 505 | + var xlList; | ||
| 506 | + var obj=[]; | ||
| 507 | + $.get('/report/lineList',function(result){ | ||
| 508 | + xlList=result; | ||
| 509 | + $.get('/user/companyData', function(result){ | ||
| 510 | + obj = result; | ||
| 511 | + var options=""; | ||
| 512 | + // = '<option value="">请选择</option>'; | ||
| 513 | + for(var i = 0; i < obj.length; i++){ | ||
| 514 | + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; | ||
| 515 | + // setFgsqx(obj[i].companyCode); | ||
| 516 | + } | ||
| 517 | + $('#ylbListGsdmId').html(options); | ||
| 518 | + updateCompany(); | ||
| 519 | + }); | ||
| 520 | + }) | ||
| 521 | + $("#ylbListGsdmId").on("change",updateCompany); | ||
| 522 | + function updateCompany(){ | ||
| 523 | + var company = $('#ylbListGsdmId').val(); | ||
| 524 | + var options =""; | ||
| 525 | +// = '<option value="">请选择</option>'; | ||
| 526 | + for(var i = 0; i < obj.length; i++){ | ||
| 527 | + if(obj[i].companyCode == company){ | ||
| 528 | + var children = obj[i].children; | ||
| 529 | + for(var j = 0; j < children.length; j++){ | ||
| 530 | + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>'; | ||
| 531 | + } | ||
| 532 | + } | ||
| 533 | + } | ||
| 534 | + $('#ylbListFgsdmId').html(options); | ||
| 535 | + initXl(); | ||
| 536 | + initCl(); | ||
| 537 | + } | ||
| 538 | + /* | ||
| 539 | + * 获取数据 p: 要提交的参数, pagination: 是否重新分页 | ||
| 540 | + */ | ||
| 541 | + function jsDoQuery(p, pagination) { | ||
| 542 | + var params = {}; | ||
| 543 | + if (p) | ||
| 544 | + params = p; | ||
| 545 | + //更新时间排序 | ||
| 546 | + params['order'] = 'nbbm'; | ||
| 547 | + params['page'] = page; | ||
| 548 | + params['rq'] = $("#rq").val(); | ||
| 549 | + | ||
| 550 | + | ||
| 551 | + var l = layer.load(2); | ||
| 552 | + $get('/dlb/dlbList', params, function (data) { | ||
| 553 | + | ||
| 554 | + $.each(data, function (i, obj) { | ||
| 555 | + obj.rq = moment(obj.rq).format("YYYY-MM-DD"); | ||
| 556 | + }); | ||
| 557 | + var bodyHtm = template('dlb_list_temp', {list:data}); | ||
| 558 | + $('#datatable_dlb tbody').html(bodyHtm); | ||
| 559 | + $('.btn-jsyUpdate').on('click', jsyUpdate); | ||
| 560 | + layer.close(l); | ||
| 561 | + $get('/dlb/sumYlb',params,function(returns){ | ||
| 562 | + $("#sumJzl").html(returns.jzl); | ||
| 563 | + $("#sumYh").html(returns.yh); | ||
| 564 | + $("#sumSh").html(returns.sh); | ||
| 565 | + }); | ||
| 566 | + | ||
| 567 | + /* $('input').on('input propertychange',function(){ | ||
| 568 | + var id=$(this).data('id'); | ||
| 569 | + var cdl =$('.in_carpark_cdl[data-id='+id+']', '#dl_oil_list').html(); | ||
| 570 | + if(cdl=="" || cdl ==null){ | ||
| 571 | + cdl=0; | ||
| 572 | + } | ||
| 573 | + var sh = $('.in_carpark_shyl[data-id='+id+']', '#dl_oil_list').val(); | ||
| 574 | + if(sh=="" || sh==null){ | ||
| 575 | + sh=0; | ||
| 576 | + } | ||
| 577 | + | ||
| 578 | + var sub=numSubtr(cdl*1000,sh*1000); | ||
| 579 | + var subValue=0; | ||
| 580 | + if(sub/1000>=0){ | ||
| 581 | + subValue=sub/1000; | ||
| 582 | + } | ||
| 583 | + $('.in_carpark_hd[data-id='+id+']', '#dl_oil_list').val(subValue); | ||
| 584 | + | ||
| 585 | + }); */ | ||
| 586 | + }); | ||
| 587 | + } | ||
| 588 | + | ||
| 589 | + function jsyUpdate(){ | ||
| 590 | + var params=getParamsList(); | ||
| 591 | + var id = $(this).data('id'); | ||
| 592 | + $get('/ylb/checkDate',params,function(status){ | ||
| 593 | + if(status=='2'){ | ||
| 594 | + layer.msg('只能操作三天内数据.'); | ||
| 595 | + }else{ | ||
| 596 | + var jsy=$('.in_carpark_jsy[data-id='+id+']', '#dl_oil_list').val(); | ||
| 597 | + console.log(id+"修改驾驶员:"+jsy); | ||
| 598 | + $get('/dlb/updateJsy',{id:id,jsy:jsy}, function(result){ | ||
| 599 | + layer.msg('修改成功.'); | ||
| 600 | + page = 0; | ||
| 601 | + jsDoQuery(params, true); | ||
| 602 | + }); | ||
| 603 | + } | ||
| 604 | + }) | ||
| 605 | + } | ||
| 606 | + //页面计算防止精度丢失 | ||
| 607 | + var accAdd = function (a, b) { | ||
| 608 | + var c, d, e; | ||
| 609 | + try { | ||
| 610 | + c = a.toString().split(".")[1].length; | ||
| 611 | + } catch (f) { | ||
| 612 | + c = 0; | ||
| 613 | + } | ||
| 614 | + try { | ||
| 615 | + d = b.toString().split(".")[1].length; | ||
| 616 | + } catch (f) { | ||
| 617 | + d = 0; | ||
| 618 | + } | ||
| 619 | + return e = Math.pow(10, Math.max(c, d)), (mul(a, e) + mul(b, e)) / e; | ||
| 620 | + }; | ||
| 621 | + | ||
| 622 | + var numSubtr = function (a, b) { | ||
| 623 | + var c, d, e; | ||
| 624 | + try { | ||
| 625 | + c = a.toString().split(".")[1].length; | ||
| 626 | + } catch (f) { | ||
| 627 | + c = 0; | ||
| 628 | + } | ||
| 629 | + try { | ||
| 630 | + d = b.toString().split(".")[1].length; | ||
| 631 | + } catch (f) { | ||
| 632 | + d = 0; | ||
| 633 | + } | ||
| 634 | + return e = Math.pow(10, Math.max(c, d)), (a * e - b * e) / e; | ||
| 635 | + }; | ||
| 636 | + | ||
| 637 | + function mul(a, b) { | ||
| 638 | + var c = 0, | ||
| 639 | + d = a.toString(), | ||
| 640 | + e = b.toString(); | ||
| 641 | + try { | ||
| 642 | + c += d.split(".")[1].length; | ||
| 643 | + } catch (f) { | ||
| 644 | + } | ||
| 645 | + try { | ||
| 646 | + c += e.split(".")[1].length; | ||
| 647 | + } catch (f) { | ||
| 648 | + } | ||
| 649 | + return Number(d.replace(".", "")) * Number(e.replace(".", "")) / Math.pow(10, c); | ||
| 650 | + } | ||
| 651 | + | ||
| 652 | + //改变状态 | ||
| 653 | + function startOptJzylLink(es) { | ||
| 654 | + es.editable({ | ||
| 655 | + type: 'text', | ||
| 656 | + placement: 'right', | ||
| 657 | + width: 100, | ||
| 658 | + display: false, | ||
| 659 | + validate: function (value) { | ||
| 660 | + if (!value) | ||
| 661 | + return '值不能为空!'; | ||
| 662 | + if (isNaN(value)) | ||
| 663 | + return '只能为数字!'; | ||
| 664 | + if (value < 0) | ||
| 665 | + return '值不能小于0!'; | ||
| 666 | + }, | ||
| 667 | + inputclass: 'form-control input-medium input-edtable-sm' | ||
| 668 | + }) | ||
| 669 | + .on('save', function (e, params) { | ||
| 670 | + $(this).text(params.newValue); | ||
| 671 | + }); | ||
| 672 | + } | ||
| 673 | + | ||
| 674 | + //改变状态 | ||
| 675 | + function startOptShylLink(es) { | ||
| 676 | + es.editable({ | ||
| 677 | + type: 'text', | ||
| 678 | + placement: 'right', | ||
| 679 | + width: 100, | ||
| 680 | + display: false, | ||
| 681 | + validate: function (value) { | ||
| 682 | + if (!value) | ||
| 683 | + return '值不能为空!'; | ||
| 684 | + if (isNaN(value)) | ||
| 685 | + return '只能为数字!'; | ||
| 686 | + if (value < 0) | ||
| 687 | + return '值不能小于0!'; | ||
| 688 | + }, | ||
| 689 | + inputclass: 'form-control input-medium input-edtable-sm' | ||
| 690 | + }) | ||
| 691 | + .on('save', function (e, params) { | ||
| 692 | + $(this).text(params.newValue); | ||
| 693 | + }); | ||
| 694 | + } | ||
| 695 | + function iCheckChange() { | ||
| 696 | + var tr = $(this).parents('tr'); | ||
| 697 | + if (this.checked) | ||
| 698 | + tr.addClass('row-active'); | ||
| 699 | + else | ||
| 700 | + tr.removeClass('row-active'); | ||
| 701 | + | ||
| 702 | + /* if($('#datatable_resource input.icheck:checked').length == 1) | ||
| 703 | + $('#removeButton').removeAttr('disabled'); | ||
| 704 | + else | ||
| 705 | + $('#removeButton').attr('disabled', 'disabled'); */ | ||
| 706 | + } | ||
| 707 | + | ||
| 708 | + function showPagination(data) { | ||
| 709 | + //分页 | ||
| 710 | + $('#pagination').jqPaginator({ | ||
| 711 | + totalPages: data.totalPages, | ||
| 712 | + visiblePages: 6, | ||
| 713 | + currentPage: page + 1, | ||
| 714 | + first: '<li class="first"><a href="javascript:void(0);">首页<\/a><\/li>', | ||
| 715 | + prev: '<li class="prev"><a href="javascript:void(0);">上一页<\/a><\/li>', | ||
| 716 | + next: '<li class="next"><a href="javascript:void(0);">下一页<\/a><\/li>', | ||
| 717 | + last: '<li class="last"><a href="javascript:void(0);">尾页<\/a><\/li>', | ||
| 718 | + page: '<li class="page"><a href="javascript:void(0);">{{page}}<\/a><\/li>', | ||
| 719 | + onPageChange: function (num, type) { | ||
| 720 | + if (initPagination) { | ||
| 721 | + initPagination = false; | ||
| 722 | + return; | ||
| 723 | + } | ||
| 724 | + | ||
| 725 | + var params=getParamsList(); | ||
| 726 | + page = num - 1; | ||
| 727 | + jsDoQuery(params, true); | ||
| 728 | + } | ||
| 729 | + }); | ||
| 730 | + } | ||
| 731 | + | ||
| 732 | + | ||
| 733 | + //删除 | ||
| 734 | + $('#removeButton').on('click', function () { | ||
| 735 | + var params_=getParamsList(); | ||
| 736 | + $get('/ylb/checkDate',params_,function(status){ | ||
| 737 | + if(status=='2'){ | ||
| 738 | + layer.msg('只能操作三天内数据.'); | ||
| 739 | + }else{ | ||
| 740 | + var idArray = []; | ||
| 741 | + var x=0; | ||
| 742 | + $('input.icheck:checked').each(function(){ | ||
| 743 | + x++; | ||
| 744 | + var map ={}; | ||
| 745 | + var id=$(this).data('id'); | ||
| 746 | + map['id']=id; | ||
| 747 | + idArray.push(map); | ||
| 748 | + | ||
| 749 | + }) | ||
| 750 | + var params = {}; | ||
| 751 | + params['ids']=JSON.stringify(idArray); | ||
| 752 | + if (x==0) { | ||
| 753 | + layer.msg("请选择要删除的数据"); | ||
| 754 | + }else{ | ||
| 755 | + if(confirm('确定要删除选中的数据?')) | ||
| 756 | + { | ||
| 757 | + var i = layer.load(2); | ||
| 758 | + $post('/dlb/deleteIds', params, function (result) { | ||
| 759 | + layer.close(i); | ||
| 760 | + var params=getParamsList(); | ||
| 761 | + jsDoQuery(params, true); | ||
| 762 | + }); | ||
| 763 | + } | ||
| 764 | + } | ||
| 765 | + } | ||
| 766 | + }) | ||
| 767 | + }); | ||
| 768 | + | ||
| 769 | + | ||
| 770 | + $("#ylbListFgsdmId").on("change",initXl); | ||
| 771 | + function initXl(){ | ||
| 772 | + var data=[]; | ||
| 773 | + data.push({id: " ", text: "全部线路"}); | ||
| 774 | + if(fage){ | ||
| 775 | + $("#xlbm").select2("destroy").html(''); | ||
| 776 | + } | ||
| 777 | + var fgs=$('#ylbListFgsdmId').val(); | ||
| 778 | + var gs=$('#ylbListGsdmId').val(); | ||
| 779 | + for(var i=0;i<xlList.length;i++){ | ||
| 780 | + if(gs!=""){ | ||
| 781 | + if(fgs!=""){ | ||
| 782 | + if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){ | ||
| 783 | + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]}); | ||
| 784 | + } | ||
| 785 | + }else{ | ||
| 786 | + if(xlList[i]["gsbm"]==gs){ | ||
| 787 | + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]}); | ||
| 788 | + } | ||
| 789 | + } | ||
| 790 | + } | ||
| 791 | + } | ||
| 792 | + initPinYinSelect2('#xlbm',data,''); | ||
| 793 | + fage=true; | ||
| 794 | + } | ||
| 795 | + $("#xlbm").on("change",initCl); | ||
| 796 | + function initCl(){ | ||
| 797 | + $('#nbbm').select2({ | ||
| 798 | + placeholder: '搜索车辆...', | ||
| 799 | + ajax: { | ||
| 800 | + url: '/report/carList', | ||
| 801 | + dataType: 'json', | ||
| 802 | + delay: 150, | ||
| 803 | + data: function (params) { | ||
| 804 | + return {nbbm: params.term, | ||
| 805 | + gsbm:$('#ylbListGsdmId').val(), | ||
| 806 | + fgsbm:$('#ylbListFgsdmId').val(), | ||
| 807 | + xlbm:$('#xlbm').val()}; | ||
| 808 | + }, | ||
| 809 | + processResults: function (data) { | ||
| 810 | + return { | ||
| 811 | + results: data | ||
| 812 | + }; | ||
| 813 | + }, | ||
| 814 | + cache: true | ||
| 815 | + }, | ||
| 816 | + templateResult: function (repo) { | ||
| 817 | + if (repo.loading) return repo.text; | ||
| 818 | + var h = '<span>' + repo.text + '</span>'; | ||
| 819 | + h += (repo.lineName ? ' <span class="select2-desc">' + repo.lineName + '</span>' : ''); | ||
| 820 | + return h; | ||
| 821 | + }, | ||
| 822 | + escapeMarkup: function (markup) { | ||
| 823 | + return markup; | ||
| 824 | + }, | ||
| 825 | + minimumInputLength: 1, | ||
| 826 | + templateSelection: function (repo) { | ||
| 827 | + return repo.text; | ||
| 828 | + }, | ||
| 829 | + language: { | ||
| 830 | + noResults: function () { | ||
| 831 | + return '<span style="color:red;font-size: 12px;">没有搜索到车辆!</span>'; | ||
| 832 | + }, | ||
| 833 | + inputTooShort: function (e) { | ||
| 834 | + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入自编号搜索车辆</span>'; | ||
| 835 | + }, | ||
| 836 | + searching: function () { | ||
| 837 | + return '<span style="color:gray;font-size: 12px;"> 正在搜索车辆...</span>'; | ||
| 838 | + } | ||
| 839 | + } | ||
| 840 | + }); | ||
| 841 | + } | ||
| 842 | +// } | ||
| 843 | + | ||
| 844 | + | ||
| 845 | +//导出 | ||
| 846 | + | ||
| 847 | + $("#export").on("click", function () { | ||
| 848 | + if ($("#rq").val() != "") { | ||
| 849 | + var params=getParamsList(); | ||
| 850 | + $post('/dlb/listExport', params, function (result) { | ||
| 851 | + window.open("/downloadFile/download?fileName="+$("#rq").val()+"进出场存电量" ); | ||
| 852 | + }); | ||
| 853 | + } else { | ||
| 854 | + layer.msg('请选择日期.'); | ||
| 855 | + } | ||
| 856 | + }); | ||
| 857 | + | ||
| 858 | + }); | ||
| 859 | +</script> | ||
| 0 | \ No newline at end of file | 860 | \ No newline at end of file |
src/main/resources/static/pages/history_sch/edit/history_sch_maintain_.html
0 → 100644
| 1 | +<div class="uk-modal " id="history-sch-maintain-modal" style=""> | ||
| 2 | + <div class="uk-modal-dialog" style="width: 99%;height:99%;margin: 2px auto;"> | ||
| 3 | + <!--<a href="" class="uk-modal-close uk-close"></a>--> | ||
| 4 | + <div class="uk-modal-header"> | ||
| 5 | + <h2>历史路单维护</h2> | ||
| 6 | + </div> | ||
| 7 | + | ||
| 8 | + <div style="padding-left: 12px;margin: 20px 0"> | ||
| 9 | + <ul class="uk-subnav uk-subnav-pill h-s-time"> | ||
| 10 | + </ul> | ||
| 11 | + </div> | ||
| 12 | + | ||
| 13 | + <div class="uk-panel uk-panel-box uk-panel-box-primary"> | ||
| 14 | + <form class="uk-form search-form"> | ||
| 15 | + <fieldset data-uk-margin> | ||
| 16 | + <span class="horizontal-field">公司</span> | ||
| 17 | + <select name="companyId" style="width: 110px;"></select> | ||
| 18 | + <span class="horizontal-field">分公司</span> | ||
| 19 | + <select name="subCompanyId" style="width: 110px;"></select> | ||
| 20 | + <span class="horizontal-field">线路</span> | ||
| 21 | + <select name="xlBm_eq" style="width: 120px;"></select> | ||
| 22 | + <span class="horizontal-field">路牌</span> | ||
| 23 | + <select name="lpName_eq" style="width: 80px;"></select> | ||
| 24 | + <span class="horizontal-field">上下行</span> | ||
| 25 | + <select name="xlDir_eq"> | ||
| 26 | + <option value="">全部</option> | ||
| 27 | + <option value="0">上行</option> | ||
| 28 | + <option value="1">下行</option> | ||
| 29 | + </select> | ||
| 30 | + | ||
| 31 | + <span class="horizontal-field">车辆</span> | ||
| 32 | + <div class="uk-autocomplete uk-form autocomplete-cars"> | ||
| 33 | + <input type="text" name="clZbh_like" placeholder="自编号" style="width: 80px;"> | ||
| 34 | + </div> | ||
| 35 | + <span class="horizontal-field">驾驶员</span> | ||
| 36 | + <div class="uk-autocomplete uk-form autocomplete-jsy"> | ||
| 37 | + <input type="text" name="jGh_like" placeholder="驾驶员" style="width: 80px;"> | ||
| 38 | + </div> | ||
| 39 | + <button class="uk-button">检索</button> | ||
| 40 | + <a class="add_lp_link" title="先点击检索后再临加路牌"><i class="uk-icon-plus"></i> 临加路牌</a> | ||
| 41 | + <button id="reCountBtn" class="uk-button uk-button-danger uk-button-mini" style="position: absolute;right: 12px;bottom: 14px;"> | ||
| 42 | + 重新统计</button> | ||
| 43 | + </fieldset> | ||
| 44 | + </form> | ||
| 45 | + </div> | ||
| 46 | + | ||
| 47 | + <div class="ct_table_wrap ct_table_no_border history-sch-wrap" style="height: 510px;"> | ||
| 48 | + <div class="ct_table history-sch-table"> | ||
| 49 | + <div class="ct_table_head"> | ||
| 50 | + <dl> | ||
| 51 | + <dt>序号</dt> | ||
| 52 | + <dt>路牌</dt> | ||
| 53 | + <dt>车辆</dt> | ||
| 54 | + <dt>驾驶员</dt> | ||
| 55 | + <dt>起点</dt> | ||
| 56 | + <dt>终点</dt> | ||
| 57 | + <dt>计发</dt> | ||
| 58 | + <dt>待发</dt> | ||
| 59 | + <dt>实发</dt> | ||
| 60 | + <dt>终点实达</dt> | ||
| 61 | + <dt>备注</dt> | ||
| 62 | + </dl> | ||
| 63 | + </div> | ||
| 64 | + <div class="ct_table_body"> | ||
| 65 | + </div> | ||
| 66 | + </div> | ||
| 67 | + </div> | ||
| 68 | + | ||
| 69 | + <div class="load-panel"> | ||
| 70 | + <i class="uk-icon-spinner uk-icon-spin"></i> | ||
| 71 | + 正在加载数据 | ||
| 72 | + </div> | ||
| 73 | + </div> | ||
| 74 | + | ||
| 75 | + <script id="history-sch-maintain-table-temp" type="text/html"> | ||
| 76 | + {{each list as sch i}} | ||
| 77 | + <dl data-id="{{sch.id}}"> | ||
| 78 | + <dd>{{i + 1}}</dd> | ||
| 79 | + <dd>{{sch.lpName}}</dd> | ||
| 80 | + <dd>{{sch.clZbh}}</dd> | ||
| 81 | + <dd>{{sch.jGh}}/{{sch.jName}}</dd> | ||
| 82 | + <dd title="{{sch.qdzName}}">{{sch.qdzName}}</dd> | ||
| 83 | + <dd title="{{sch.zdzName}}">{{sch.zdzName}}</dd> | ||
| 84 | + <dd>{{sch.fcsj}} | ||
| 85 | + {{if sch.bcType == "out"}} | ||
| 86 | + <span class="uk-badge uk-badge-success">出场</span> | ||
| 87 | + {{else if sch.bcType == "in"}} | ||
| 88 | + <span class="uk-badge uk-badge-warning">进场</span> | ||
| 89 | + {{else if sch.bcType == "venting"}} | ||
| 90 | + <span class="uk-badge uk-badge-danger">直放</span> | ||
| 91 | + {{else if sch.bcType == "major"}} | ||
| 92 | + <span class="uk-badge uk-badge-danger">放站</span> | ||
| 93 | + {{else if sch.bcType == "region"}} | ||
| 94 | + <span class="uk-badge sch_region">区间</span> | ||
| 95 | + {{else if sch.bcType == "ldks"}} | ||
| 96 | + <span class="uk-badge sch_ldks">空驶</span> | ||
| 97 | + {{/if}} | ||
| 98 | + {{if sch.sflj}} | ||
| 99 | + <span class="uk-badge uk-badge-danger">临加</span> | ||
| 100 | + {{/if}} | ||
| 101 | + {{if sch.cTasks.length > 0}} | ||
| 102 | + <span class="uk-badge uk-badge-notification">{{sch.cTasks.length}}</span> | ||
| 103 | + {{/if}}</dd> | ||
| 104 | + <dd> | ||
| 105 | + {{sch.dfsj}} | ||
| 106 | + {{if sch.status==-1}} | ||
| 107 | + <span class="uk-badge uk-badge-danger">烂班</span> | ||
| 108 | + {{/if}} | ||
| 109 | + </dd> | ||
| 110 | + <dd>{{sch.fcsjActual}}<span class="fcsj-diff">{{sch.fcsj_diff}}</span></dd> | ||
| 111 | + <dd>{{sch.zdsjActual}}</dd> | ||
| 112 | + <dd title="{{sch.remarks}}">{{sch.remarks}}</dd> | ||
| 113 | + </dl> | ||
| 114 | + {{/each}} | ||
| 115 | + </script> | ||
| 116 | + | ||
| 117 | + <script> | ||
| 118 | + (function () { | ||
| 119 | + var modal = '#history-sch-maintain-modal'; | ||
| 120 | + | ||
| 121 | + //滚动条 | ||
| 122 | + $('.history-sch-wrap', modal).perfectScrollbar({suppressScrollX: true}); | ||
| 123 | + //history-sch-wrap | ||
| 124 | + $(modal).on('init', function (e, data) { | ||
| 125 | + e.stopPropagation(); | ||
| 126 | + $.get('/realSchedule/dateArray', function (rs) { | ||
| 127 | + //日期tab | ||
| 128 | + var tsStr = ''; | ||
| 129 | + $.each(rs, function (i) { | ||
| 130 | + tsStr += '<li ' + (i == 0 ? 'class="uk-active"' : '') + '><a>' + this + '</a></li>'; | ||
| 131 | + }); | ||
| 132 | + | ||
| 133 | + $('.h-s-time', modal).html(tsStr); | ||
| 134 | + clearLpSelect(); | ||
| 135 | + //reLoadLp=true; | ||
| 136 | + //jsQuery(); | ||
| 137 | + }); | ||
| 138 | + }); | ||
| 139 | + | ||
| 140 | + $(modal).on('refresh', function (e, data) { | ||
| 141 | + if(data){ | ||
| 142 | + var lpName = data.lpName; | ||
| 143 | + if(is_new_temp_lp(lpName)){ | ||
| 144 | + $('[name=lpName_eq]', modal).append('<option value="'+lpName+'" selected>'+lpName+'</option>'); | ||
| 145 | + } | ||
| 146 | + } | ||
| 147 | + jsQuery(); | ||
| 148 | + }); | ||
| 149 | + | ||
| 150 | + $(modal).on('click', '.h-s-time li,.h-s-line li', function () { | ||
| 151 | + if(loading) | ||
| 152 | + return; | ||
| 153 | + $(this).parent().find('li.uk-active').removeClass('uk-active'); | ||
| 154 | + $(this).addClass('uk-active'); | ||
| 155 | + clearLpSelect(); | ||
| 156 | + //检索之前将滚动条置顶 | ||
| 157 | + $('.history-sch-wrap', modal)[0].scrollTop = 0; | ||
| 158 | + jsQuery(); | ||
| 159 | + }); | ||
| 160 | + | ||
| 161 | + $('.search-form', modal).on('submit', function (e) { | ||
| 162 | + try { | ||
| 163 | + //检索之前将滚动条置顶 | ||
| 164 | + $('.history-sch-wrap', modal)[0].scrollTop = 0; | ||
| 165 | + jsQuery(); | ||
| 166 | + }catch(e){ | ||
| 167 | + console.log(e); | ||
| 168 | + } | ||
| 169 | + return false; | ||
| 170 | + }); | ||
| 171 | + | ||
| 172 | + var reLoadLp; | ||
| 173 | + var nbbmArray,jsyArray,lpArray,loading; | ||
| 174 | + var schArray;//主键映射 | ||
| 175 | + function jsQuery(cb) { | ||
| 176 | + var data = $('.search-form', modal).serializeJSON(); | ||
| 177 | + data.companyId=null; | ||
| 178 | + data.subCompanyId=null; | ||
| 179 | + var rq = $('.h-s-time li.uk-active', modal).text(); | ||
| 180 | + data.scheduleDateStr_eq = rq; | ||
| 181 | + if(!data.xlBm_eq) | ||
| 182 | + return notify_err('请选择线路...'); | ||
| 183 | + if(data.jGh_like.indexOf('/')!=-1){ | ||
| 184 | + var jsy=data.jGh_like.split('/'); | ||
| 185 | + data.jGh_like=jsy[0]; | ||
| 186 | + data.jName_like=jsy[1]; | ||
| 187 | + } | ||
| 188 | + | ||
| 189 | + $('.load-panel', modal).show(); | ||
| 190 | + loading=true; | ||
| 191 | + $.get('/realSchedule/all', data, function (rs) { | ||
| 192 | + rs.sort(schedule_sort); | ||
| 193 | + //可搜索的车辆自编号和驾驶员 | ||
| 194 | + nbbmArray=[]; | ||
| 195 | + jsyArray=[]; | ||
| 196 | + lpArray = []; | ||
| 197 | + schArray = {}; | ||
| 198 | + $.each(rs, function () { | ||
| 199 | + nbbmArray.push({value: this.clZbh}); | ||
| 200 | + jsyArray.push({value: this.jGh+'/'+this.jName, | ||
| 201 | + fullChars: pinyin.getFullChars(this.jName).toUpperCase(), | ||
| 202 | + camelChars: pinyin.getCamelChars(this.jName)}); | ||
| 203 | + lpArray.push({value: this.lpName}); | ||
| 204 | + calc_sch_real_shift(this); | ||
| 205 | + schArray[this.id] = this; | ||
| 206 | + }); | ||
| 207 | + | ||
| 208 | + var tbodyStr = template('history-sch-maintain-table-temp', {list: rs}); | ||
| 209 | + $('.history-sch-table .ct_table_body', modal).html(tbodyStr); | ||
| 210 | + //value | ||
| 211 | + nbbmArray=distinctByField(nbbmArray); | ||
| 212 | + jsyArray=distinctByField(jsyArray); | ||
| 213 | + lpArray=distinctByField(lpArray); | ||
| 214 | + | ||
| 215 | + if(reLoadLp){ | ||
| 216 | + //路牌下拉框 | ||
| 217 | + var ops = '<option value="">全部</option>'; | ||
| 218 | + $.each(lpArray, function () { | ||
| 219 | + ops += '<option value="'+this.value+'">'+this.value+'</option>'; | ||
| 220 | + }); | ||
| 221 | + $('[name=lpName_eq]', modal).html(ops); | ||
| 222 | + reLoadLp = false; | ||
| 223 | + } | ||
| 224 | + | ||
| 225 | + //lpName_eq | ||
| 226 | + $('.load-panel', modal).hide(); | ||
| 227 | + loading=false; | ||
| 228 | + | ||
| 229 | + //更新滚动条高度 | ||
| 230 | + $('.history-sch-wrap', modal).perfectScrollbar('update'); | ||
| 231 | + | ||
| 232 | + cb && cb(); | ||
| 233 | + | ||
| 234 | + //初始化依赖数据 | ||
| 235 | + gb_data_basic.initData(data.xlBm_eq); | ||
| 236 | + }); | ||
| 237 | + } | ||
| 238 | + | ||
| 239 | + function clearLpSelect() { | ||
| 240 | + $('[name=lpName_eq]', modal).val('').html(''); | ||
| 241 | + reLoadLp = true; | ||
| 242 | + } | ||
| 243 | + | ||
| 244 | + //nbbm autocomplete | ||
| 245 | + var carAutoCom=$('.autocomplete-cars', modal); | ||
| 246 | + UIkit.autocomplete(carAutoCom, { | ||
| 247 | + minLength: 1, | ||
| 248 | + delay: 50, | ||
| 249 | + source: function(release) { | ||
| 250 | + var q = $('input', carAutoCom).val().toUpperCase() | ||
| 251 | + ,rs = [], | ||
| 252 | + count = 0; | ||
| 253 | + $.each(nbbmArray, function () { | ||
| 254 | + if(this.value.indexOf(q) != -1){ | ||
| 255 | + rs.push(this); | ||
| 256 | + count++; | ||
| 257 | + } | ||
| 258 | + if (count >= 15) | ||
| 259 | + return false; | ||
| 260 | + }); | ||
| 261 | + release && release(rs); | ||
| 262 | + } | ||
| 263 | + }); | ||
| 264 | + | ||
| 265 | + //jsy autocomplete | ||
| 266 | + var jsyAutoCom=$('.autocomplete-jsy', modal); | ||
| 267 | + UIkit.autocomplete(jsyAutoCom, { | ||
| 268 | + minLength: 1, | ||
| 269 | + delay: 50, | ||
| 270 | + source: function(release) { | ||
| 271 | + var q = $('input', jsyAutoCom).val().toUpperCase() | ||
| 272 | + ,rs = [], | ||
| 273 | + count = 0; | ||
| 274 | + | ||
| 275 | + $.each(jsyArray, function() { | ||
| 276 | + if (this.value.indexOf(q) != -1 || this.fullChars.indexOf(q) != -1 || this.camelChars.indexOf(q) != -1){ | ||
| 277 | + rs.push(this); | ||
| 278 | + count++; | ||
| 279 | + } | ||
| 280 | + | ||
| 281 | + if (count >= 10) | ||
| 282 | + return false; | ||
| 283 | + }); | ||
| 284 | + release && release(rs); | ||
| 285 | + } | ||
| 286 | + }); | ||
| 287 | + | ||
| 288 | + function schedule_sort(s1, s2) { | ||
| 289 | + return (s1.realExecDate+s1.fcsj).localeCompare(s2.realExecDate+s2.fcsj); | ||
| 290 | + } | ||
| 291 | + | ||
| 292 | + function distinctByField(arr, f){ | ||
| 293 | + if(!f) | ||
| 294 | + f = 'value'; | ||
| 295 | + var rs = {}; | ||
| 296 | + $.each(arr, function () { | ||
| 297 | + rs[this[f]]=this; | ||
| 298 | + }); | ||
| 299 | + return gb_common.get_vals(rs); | ||
| 300 | + } | ||
| 301 | + | ||
| 302 | + gb_ct_table.fixedHead($('.ct_table_wrap', modal)); | ||
| 303 | + | ||
| 304 | + //班次点击 | ||
| 305 | + $(modal).on('click contextmenu', '.history-sch-table .ct_table_body dl', function() { | ||
| 306 | + $(this).parent().find('.active').removeClass('active'); | ||
| 307 | + $(this).addClass('active'); | ||
| 308 | + }); | ||
| 309 | + | ||
| 310 | + var modal_opts = {center: false,bgclose: false, modal: false}; | ||
| 311 | + var folder = '/real_control_v2/fragments/north/nav/history_sch'; | ||
| 312 | + var callbackHandler={ | ||
| 313 | + edit: function(id){ | ||
| 314 | + open_modal(folder + '/editor.html', {id: id, parentModal: modal}, modal_opts); | ||
| 315 | + }, | ||
| 316 | + add: function (id) { | ||
| 317 | + open_modal(folder + '/h_add_temp_sch.html', { | ||
| 318 | + sch: schArray[id] | ||
| 319 | + }, modal_opts); | ||
| 320 | + }, | ||
| 321 | + delete: function (id) { | ||
| 322 | + var sch = schArray[id]; | ||
| 323 | + if (!sch || !sch.sflj) | ||
| 324 | + return notify_err('只能删除临加班次!'); | ||
| 325 | + var str = '<h3>确定要删除临加班次<span style="color:red;margin: 0 5px;">' + sch.clZbh + '( ' + sch.dfsj + ' )</span>?</h3><h5 style="color: #6c6c6c;font-size: 12px;">班次删除后,调度指令会保留</h5>'; | ||
| 326 | + alt_confirm(str, function () { | ||
| 327 | + gb_common.$del('/realSchedule/history/' + sch.id, function (rs) { | ||
| 328 | + if($('.history-sch-table .ct_table_body dl', modal).length == 1){ | ||
| 329 | + $('[name=lpName_eq]', modal).val(''); | ||
| 330 | + reLoadLp = true; | ||
| 331 | + } | ||
| 332 | + | ||
| 333 | + jsQuery(); | ||
| 334 | + }); | ||
| 335 | + }, '确定删除'); | ||
| 336 | + } | ||
| 337 | + }; | ||
| 338 | + | ||
| 339 | + //计算实发时间差值 | ||
| 340 | + var calc_sch_real_shift = function (sch) { | ||
| 341 | + if (sch.fcsjActualTime) { | ||
| 342 | + var diff = parseInt((sch.fcsjActualTime - sch.dfsjT) / 1000 / 60); | ||
| 343 | + if (diff > 0) | ||
| 344 | + sch.fcsj_diff = '( +' + diff + ' )'; | ||
| 345 | + else if (diff < 0) | ||
| 346 | + sch.fcsj_diff = '( ' + diff + ' )'; | ||
| 347 | + else | ||
| 348 | + sch.fcsj_diff = ''; | ||
| 349 | + } | ||
| 350 | + }; | ||
| 351 | + | ||
| 352 | + //右键菜单 | ||
| 353 | + $.contextMenu({ | ||
| 354 | + selector: modal+' .history-sch-table .ct_table_body dl', | ||
| 355 | + className: 'schedule-ct-menu', | ||
| 356 | + callback: function(key, options) { | ||
| 357 | + var id = $('.context-menu-active', modal).data('id'); | ||
| 358 | + callbackHandler[key] && callbackHandler[key](id); | ||
| 359 | + }, | ||
| 360 | + items: { | ||
| 361 | + 'edit': { | ||
| 362 | + name: '编辑' | ||
| 363 | + }, | ||
| 364 | + 'add': { | ||
| 365 | + name: '新增临加班次' | ||
| 366 | + }, | ||
| 367 | + 'delete':{ | ||
| 368 | + name: '删除' | ||
| 369 | + } | ||
| 370 | + } | ||
| 371 | + }); | ||
| 372 | + | ||
| 373 | + //临加路牌 | ||
| 374 | + $('.add_lp_link', modal).on('click', function () { | ||
| 375 | + var index = 0, max; | ||
| 376 | + $.each(lpArray, function (i, obj) { | ||
| 377 | + var lp = obj.value; | ||
| 378 | + if (lp.indexOf('临') != -1) { | ||
| 379 | + max = lp.substr(lp.indexOf('临') + 1); | ||
| 380 | + if (!isNaN(max)) | ||
| 381 | + index = parseInt(max); | ||
| 382 | + } | ||
| 383 | + }); | ||
| 384 | + | ||
| 385 | + var lpName = '临' + (index + 1); | ||
| 386 | + var lineSelect = $('[name=xlBm_eq]', modal); | ||
| 387 | + var rq = $('.h-s-time li.uk-active', modal).text(), | ||
| 388 | + lineName = lineSelect[0].options[lineSelect[0].selectedIndex].text,//$('.h-s-line li.uk-active', modal).text(), | ||
| 389 | + lineCode = lineSelect.val(); | ||
| 390 | + | ||
| 391 | + var sch = { | ||
| 392 | + scheduleDateStr: rq, | ||
| 393 | + xlBm: lineCode, | ||
| 394 | + xlName: lineName, | ||
| 395 | + lpName: lpName | ||
| 396 | + }; | ||
| 397 | + | ||
| 398 | + open_modal(folder + '/h_add_temp_sch.html', { | ||
| 399 | + sch: sch | ||
| 400 | + }, modal_opts); | ||
| 401 | + }); | ||
| 402 | + | ||
| 403 | + /** | ||
| 404 | + * 是否是临加路牌 | ||
| 405 | + * @param lpName | ||
| 406 | + */ | ||
| 407 | + function is_new_temp_lp(lpName) { | ||
| 408 | + if(lpName.indexOf('临') ==-1) | ||
| 409 | + return false; | ||
| 410 | + | ||
| 411 | + for(var i=0,obj;obj=lpArray[i++];){ | ||
| 412 | + if(obj.value==lpName) | ||
| 413 | + return false; | ||
| 414 | + } | ||
| 415 | + | ||
| 416 | + return true; | ||
| 417 | + } | ||
| 418 | + | ||
| 419 | + | ||
| 420 | + var f = $('.search-form', modal); | ||
| 421 | + var ep = EventProxy.create('query_comps', 'query_lines', function () { | ||
| 422 | + $('[name=companyId]', f).trigger('change');//公司change | ||
| 423 | + }); | ||
| 424 | + var comps; | ||
| 425 | + //构建公司级联下拉框 | ||
| 426 | + $.get('/user/companyData', function (rs) { | ||
| 427 | + comps = rs; | ||
| 428 | + var opts = ''; | ||
| 429 | + for(var i=0,obj;obj=comps[i++];){ | ||
| 430 | + opts += '<option value="'+obj.companyCode+'">'+obj.companyName+'</option>'; | ||
| 431 | + } | ||
| 432 | + $('[name=companyId]', f).html(opts); | ||
| 433 | + ep.emit('query_comps'); | ||
| 434 | + }); | ||
| 435 | + var lineMapps; | ||
| 436 | + //加载线路信息 | ||
| 437 | + $.get('/line/all', {'destroy_eq': 0}, function (rs) { | ||
| 438 | + rs.sort(function (a, b) { | ||
| 439 | + return a.name.localeCompare(b.name); | ||
| 440 | + }); | ||
| 441 | + lineMapps={}; | ||
| 442 | + var k; | ||
| 443 | + $.each(rs, function () { | ||
| 444 | + k = this.company+'_'+this.brancheCompany; | ||
| 445 | + if(!lineMapps[k]) | ||
| 446 | + lineMapps[k]=[]; | ||
| 447 | + lineMapps[k].push(this); | ||
| 448 | + }); | ||
| 449 | + | ||
| 450 | + ep.emit('query_lines'); | ||
| 451 | + }); | ||
| 452 | + | ||
| 453 | + $('[name=companyId]', f).on('change', function () { | ||
| 454 | + var code = $(this).val(), subs=[]; | ||
| 455 | + $.each(comps, function () { | ||
| 456 | + if(this.companyCode==code) | ||
| 457 | + subs=this.children; | ||
| 458 | + }); | ||
| 459 | + | ||
| 460 | + var opts=''; | ||
| 461 | + $.each(subs, function () { | ||
| 462 | + opts += '<option value="'+this.code+'">'+this.name+'</option>'; | ||
| 463 | + }); | ||
| 464 | + $('[name=subCompanyId]', f).html(opts).trigger('change'); | ||
| 465 | + }); | ||
| 466 | + | ||
| 467 | + $('[name=subCompanyId]', f).on('change', function () { | ||
| 468 | + var k = $('[name=companyId]', f).val() + '_' + $(this).val(); | ||
| 469 | + var array = lineMapps[k]; | ||
| 470 | + var opts = ''; | ||
| 471 | + if(array){ | ||
| 472 | + $.each(array, function () { | ||
| 473 | + opts += '<option value="'+this.lineCode+'">'+this.name+'</option>'; | ||
| 474 | + }); | ||
| 475 | + } | ||
| 476 | + $('[name=xlBm_eq]', f).html(opts); | ||
| 477 | + }); | ||
| 478 | + | ||
| 479 | + $('[name=xlBm_eq]', f).on('change', clearLpSelect); | ||
| 480 | + //clearLpSelect | ||
| 481 | + | ||
| 482 | + | ||
| 483 | + /** | ||
| 484 | + * 重新统计 | ||
| 485 | + */ | ||
| 486 | + $('#reCountBtn', modal).on('click', function () { | ||
| 487 | + var lineSelect = $('[name=xlBm_eq]', modal); | ||
| 488 | + var rq = $('.h-s-time li.uk-active', modal).text(), | ||
| 489 | + lineName = lineSelect[0].options[lineSelect[0].selectedIndex].text,//$('.h-s-line li.uk-active', modal).text(), | ||
| 490 | + lineCode = lineSelect.val(); | ||
| 491 | + | ||
| 492 | + var that = this; | ||
| 493 | + alt_confirm('确定要重新统计 ' + lineName + '('+rq+')的数据吗?',function () { | ||
| 494 | + $(that).attr('disabled', 'disabled'); | ||
| 495 | + $(that).prepend('<i class="uk-icon-spinner uk-icon-spin"></i>'); | ||
| 496 | + | ||
| 497 | + | ||
| 498 | + var reCountEp = EventProxy.create('ylbUpdate', 'calcWaybill', 'scheduleDetail', function () { | ||
| 499 | + $('i.uk-icon-spin', that).remove(); | ||
| 500 | + $(that).removeAttr('disabled'); | ||
| 501 | + notify_succ('重新统计成功!'); | ||
| 502 | + }); | ||
| 503 | + | ||
| 504 | + //统计路单 -娄高峰 | ||
| 505 | + gb_common.$get('/calcWaybill/generateNew', {date:rq, line: lineCode}, function () { | ||
| 506 | + reCountEp.emitLater('calcWaybill'); | ||
| 507 | + }); | ||
| 508 | + | ||
| 509 | + //统计油 -廖磊 | ||
| 510 | + gb_common.$post('/ylb/updateHistory', {date:rq, line: lineCode}, function () { | ||
| 511 | + reCountEp.emitLater('ylbUpdate'); | ||
| 512 | + }); | ||
| 513 | + | ||
| 514 | + //重新统计班次明细 | ||
| 515 | + gb_common.$post('/sch/reCalc/scheduleDetail', {date:rq, line: lineCode}, function () { | ||
| 516 | + reCountEp.emitLater('scheduleDetail'); | ||
| 517 | + }); | ||
| 518 | + | ||
| 519 | + }, '我确定'); | ||
| 520 | + }); | ||
| 521 | + })(); | ||
| 522 | + </script> | ||
| 523 | +</div> | ||
| 0 | \ No newline at end of file | 524 | \ No newline at end of file |
src/main/resources/static/pages/history_sch/edit/main_page_.html
0 → 100644
| 1 | +<!DOCTYPE html> | ||
| 2 | +<html lang="zh-cn"> | ||
| 3 | + | ||
| 4 | +<head> | ||
| 5 | + <meta charset="UTF-8"> | ||
| 6 | + <!-- uikit core style--> | ||
| 7 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/css/uikit.gradient.min.css" /> | ||
| 8 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/notify.gradient.min.css" /> | ||
| 9 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/tooltip.gradient.min.css" /> | ||
| 10 | + <link rel="stylesheet" | ||
| 11 | + href="/real_control_v2/assets/plugins/uikit-2.27.1/components/autocomplete.gradient.min.css" /> | ||
| 12 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/accordion.gradient.min.css" /> | ||
| 13 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/slidenav.gradient.min.css" /> | ||
| 14 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/sticky.gradient.min.css" /> | ||
| 15 | + | ||
| 16 | + <!-- main style --> | ||
| 17 | + <link rel="stylesheet" href="/pages/history_sch/edit/css/main.css" /> | ||
| 18 | + <!-- north style --> | ||
| 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"/> | ||
| 22 | + | ||
| 23 | + <!-- custom table --> | ||
| 24 | + <link rel="stylesheet" href="/real_control_v2/css/ct_table.css" merge="custom_style"/> | ||
| 25 | + <!-- jquery contextMenu style --> | ||
| 26 | + <link rel="stylesheet" href="/real_control_v2/assets/css/jquery.contextMenu.min.css" merge="plugins"/> | ||
| 27 | + <!-- formvalidation style --> | ||
| 28 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/formvalidation/formValidation.min.css" merge="plugins"/> | ||
| 29 | + | ||
| 30 | + <link rel="stylesheet" href="/real_control_v2/css/modal_extend.css" merge="custom_style"/> | ||
| 31 | + <!-- perfect-scrollbar style --> | ||
| 32 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.css" merge="plugins"/> | ||
| 33 | + <style> | ||
| 34 | + .uk-modal.ct_move_modal .uk-modal-header { | ||
| 35 | + cursor: default; | ||
| 36 | + user-select: none; | ||
| 37 | + } | ||
| 38 | + .uk-modal.ct_move_modal .uk-modal-dialog { | ||
| 39 | + position: relative !important; | ||
| 40 | + margin: 50px auto !important; | ||
| 41 | + } | ||
| 42 | + </style> | ||
| 43 | +</head> | ||
| 44 | + | ||
| 45 | +<body> | ||
| 46 | +<div class="ct_page" > | ||
| 47 | +</div> | ||
| 48 | +<!-- jquery --> | ||
| 49 | +<script src="/real_control_v2/assets/js/jquery.min.js"></script> | ||
| 50 | +<!-- jquery actual --> | ||
| 51 | +<script src="/real_control_v2/assets/js/jquery.actual.min.js" merge="plugins"></script> | ||
| 52 | +<!-- jquery.serializejson JSON序列化插件 --> | ||
| 53 | +<script src="/assets/plugins/jquery.serializejson.js" merge="plugins"></script> | ||
| 54 | +<!-- moment.js 日期处理类库 --> | ||
| 55 | +<script src="/real_control_v2/assets/plugins/moment/moment.min.js"></script> | ||
| 56 | +<script src="/real_control_v2/assets/plugins/moment/zh-cn.js"></script> | ||
| 57 | + | ||
| 58 | +<!-- flatpickr --> | ||
| 59 | +<script src="/real_control_v2/assets/plugins/flatpickr/flatpickr.min.js" merge="plugins"></script> | ||
| 60 | +<script src="/real_control_v2/assets/plugins/flatpickr/l10n/zh.js" merge="plugins"></script> | ||
| 61 | + | ||
| 62 | +<!-- perfect-scrollbar --> | ||
| 63 | +<script src="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.jquery.js" merge="plugins"></script> | ||
| 64 | +<!-- common js --> | ||
| 65 | +<script src="/real_control_v2/js/common.js"></script> | ||
| 66 | +<!-- art-template 模版引擎 --> | ||
| 67 | +<script src="/assets/plugins/template.js" merge="plugins"></script> | ||
| 68 | +<!-- d3 --> | ||
| 69 | +<script src="/assets/js/d3.min.js"></script> | ||
| 70 | +<!-- EventProxy --> | ||
| 71 | +<script src="/assets/js/eventproxy.js"></script> | ||
| 72 | +<!-- uikit core --> | ||
| 73 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/uikit.min.js" merge="uikit_js"></script> | ||
| 74 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/notify.min.js" merge="uikit_js"></script> | ||
| 75 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/pagination.min.js" merge="uikit_js"></script> | ||
| 76 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/tooltip.min.js" merge="uikit_js"></script> | ||
| 77 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/autocomplete.min.js" merge="uikit_js"></script> | ||
| 78 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/accordion.min.js" merge="uikit_js"></script> | ||
| 79 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/timepicker.min.js" merge="uikit_js"></script> | ||
| 80 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/lightbox.min.js" merge="uikit_js"></script> | ||
| 81 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/sticky.min.js" merge="uikit_js"></script> | ||
| 82 | + | ||
| 83 | +<!-- jquery contextMenu --> | ||
| 84 | +<script src="/real_control_v2/assets/js/jquery.contextMenu.min.js" merge="plugins"></script> | ||
| 85 | +<script src="/real_control_v2/assets/js/jquery.ui.position.min.js" merge="plugins"></script> | ||
| 86 | +<!-- formvalidation- --> | ||
| 87 | +<script src="/real_control_v2/assets/plugins/formvalidation/formValidation.min.js" merge="plugins"></script> | ||
| 88 | +<script src="/real_control_v2/assets/plugins/formvalidation/zh_CN.js" merge="plugins"></script> | ||
| 89 | +<script src="/real_control_v2/assets/plugins/formvalidation/uikit.min.js" merge="plugins"></script> | ||
| 90 | +<!-- js tree --> | ||
| 91 | +<script src="/real_control_v2/assets/plugins/jstree/jstree.min.js" merge="plugins"></script> | ||
| 92 | +<!-- simple pinyin --> | ||
| 93 | +<script src="/assets/plugins/pinyin.js" merge="plugins"></script> | ||
| 94 | +<!-- qtip --> | ||
| 95 | +<script src="/real_control_v2/assets/plugins/qtip/jquery.qtip.min.js" merge="plugins"></script> | ||
| 96 | +<!-- layer 3.0.3 --> | ||
| 97 | +<script src="/real_control_v2/assets/plugins/layer3.0.3/layer.js" merge="plugins"></script> | ||
| 98 | + | ||
| 99 | +<!-- custom table js --> | ||
| 100 | +<script src="/real_control_v2/js/utils/ct_table.js" merge="custom_js"></script> | ||
| 101 | +<script src="/pages/history_sch/edit/js/modal_extend.js" merge="custom_js"></script> | ||
| 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> | ||
| 106 | +<script> | ||
| 107 | + | ||
| 108 | + (function () { | ||
| 109 | + open_modal('/pages/history_sch/edit/history_sch_maintain_.html', {}, { | ||
| 110 | + center: false, | ||
| 111 | + bgclose: false | ||
| 112 | + }); | ||
| 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 | + }; | ||
| 147 | + | ||
| 148 | + var alt_confirm = function (content, succ, okBtn, noCenter) { | ||
| 149 | + var modalEl = UIkit.modal.confirm(content, function () { | ||
| 150 | + succ && succ(); | ||
| 151 | + modalEl.hide(); | ||
| 152 | + }, { | ||
| 153 | + labels: { | ||
| 154 | + Ok: okBtn, | ||
| 155 | + Cancel: '取消' | ||
| 156 | + } | ||
| 157 | + , center: !noCenter | ||
| 158 | + }); | ||
| 159 | + }; | ||
| 160 | +</script> | ||
| 161 | +</body> | ||
| 162 | +</html> | ||
| 0 | \ No newline at end of file | 163 | \ No newline at end of file |
src/main/resources/static/pages/history_sch/edit/wrap_.html
0 → 100644
src/main/resources/static/pages/oil/add_.html
0 → 100644
| 1 | +<div class="page-head"> | ||
| 2 | + <div class="page-title"> | ||
| 3 | + <h1>进出站油量信息编辑</h1> | ||
| 4 | + </div> | ||
| 5 | +</div> | ||
| 6 | + | ||
| 7 | +<ul class="page-breadcrumb breadcrumb"> | ||
| 8 | + <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li> | ||
| 9 | + <li><span class="active">电子路单</span> <i class="fa fa-circle"></i></li> | ||
| 10 | + <li><a href="list_ph_.html" data-pjax>油耗管理</a> <i class="fa fa-circle"></i></li> | ||
| 11 | + <li><span class="active">进出站油量信息编辑</span></li> | ||
| 12 | +</ul> | ||
| 13 | + | ||
| 14 | +<div class="portlet light bordered"> | ||
| 15 | + <div class="portlet-title"> | ||
| 16 | + <div class="caption"> | ||
| 17 | + <i class="icon-equalizer font-red-sunglo"></i> <span | ||
| 18 | + class="caption-subject font-red-sunglo bold uppercase">表单</span> | ||
| 19 | + </div> | ||
| 20 | + </div> | ||
| 21 | + <div class="portlet-body form"> | ||
| 22 | + <form class="form-horizontal" id="ylb_add_form" > | ||
| 23 | + | ||
| 24 | + <div class="alert alert-danger display-hide"> | ||
| 25 | + <button class="close" data-close="alert"></button> | ||
| 26 | + 您的输入有误,请检查下面的输入项 | ||
| 27 | + </div> | ||
| 28 | + <input type="hidden" value="0" name="yhlx" /> | ||
| 29 | + <div class="form-body"> | ||
| 30 | + <div class="form-group"> | ||
| 31 | + <label class="col-md-3 control-label">公司</label> | ||
| 32 | + <div class="col-md-4"> | ||
| 33 | + <select class="form-control" name="ssgsdm" id="ssgsdm" ></select> | ||
| 34 | + </div> | ||
| 35 | + </div> | ||
| 36 | + <div class="form-group"> | ||
| 37 | + <label class="col-md-3 control-label">分公司</label> | ||
| 38 | + <div class="col-md-4"> | ||
| 39 | + <select class="form-control" name="fgsdm" id="fgsdm" ></select> | ||
| 40 | + </div> | ||
| 41 | + </div> | ||
| 42 | + <div class="form-group"> | ||
| 43 | + <label class="col-md-3 control-label">线路</label> | ||
| 44 | + <div class="col-md-4"> | ||
| 45 | + <select class="form-control" name="xlbm" id="xlbm" ></select> | ||
| 46 | + </div> | ||
| 47 | + </div> | ||
| 48 | + <div class="form-group"> | ||
| 49 | + <label class="col-md-3 control-label">内部编码</label> | ||
| 50 | + <div class="col-md-4"> | ||
| 51 | + <select class="form-control" name="nbbm" id="nbbm" ></select> | ||
| 52 | + </div> | ||
| 53 | + </div> | ||
| 54 | + <div class="form-group"> | ||
| 55 | + <label class="col-md-3 control-label">日期</label> | ||
| 56 | + <div class="col-md-4"> | ||
| 57 | + <input type="text" class="form-control" name="rq" id="date"> | ||
| 58 | + </div> | ||
| 59 | + </div> | ||
| 60 | + <div class="form-group"> | ||
| 61 | + <label class="col-md-3 control-label">开始营运日期</label> | ||
| 62 | + <div class="col-md-4"> | ||
| 63 | + <input type="time" class="form-control" name="jhsj" > | ||
| 64 | + <span class="help-block"> 如:12:12</span> | ||
| 65 | + </div> | ||
| 66 | + </div> | ||
| 67 | + <div class="form-group"> | ||
| 68 | + <label class="col-md-3 control-label">驾驶员</label> | ||
| 69 | + <div class="col-md-4"> | ||
| 70 | + <select class="form-control" name="jsy" id="jsy"> </select> | ||
| 71 | + </div> | ||
| 72 | + </div> | ||
| 73 | + | ||
| 74 | + <div class="form-group"> | ||
| 75 | + <label class="col-md-3 control-label">出场里程</label> | ||
| 76 | + <div class="col-md-4"> | ||
| 77 | + <input type="text" value="0" class="form-control" name="czlc" onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')" | ||
| 78 | + onafterpaste="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')"> | ||
| 79 | + </div> | ||
| 80 | + </div> | ||
| 81 | + | ||
| 82 | + <div class="form-group"> | ||
| 83 | + <label class="col-md-3 control-label">出场油量</label> | ||
| 84 | + <div class="col-md-4"> | ||
| 85 | + <input type="text" value="0" class="form-control" name="czyl" onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')" | ||
| 86 | + onafterpaste="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')"> | ||
| 87 | + </div> | ||
| 88 | + </div> | ||
| 89 | + | ||
| 90 | + <div class="form-group"> | ||
| 91 | + <label class="col-md-3 control-label">加油量</label> | ||
| 92 | + <div class="col-md-4"> | ||
| 93 | + <input type="text" value="0" class="form-control" name="jzl" onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')" | ||
| 94 | + onafterpaste="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')"> | ||
| 95 | + </div> | ||
| 96 | + </div> | ||
| 97 | + | ||
| 98 | + <div class="form-group"> | ||
| 99 | + <label class="col-md-3 control-label">进场油量</label> | ||
| 100 | + <div class="col-md-4"> | ||
| 101 | + <input type="text" value="0" class="form-control" name="jzyl" onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')" | ||
| 102 | + onafterpaste="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')"> | ||
| 103 | + </div> | ||
| 104 | + </div> | ||
| 105 | + | ||
| 106 | + <div class="form-group"> | ||
| 107 | + <label class="col-md-3 control-label">油耗</label> | ||
| 108 | + <div class="col-md-4"> | ||
| 109 | + <input type="text" value="0" class="form-control" name="yh" onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')" | ||
| 110 | + onafterpaste="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')"> | ||
| 111 | + </div> | ||
| 112 | + </div> | ||
| 113 | + | ||
| 114 | + <div class="form-group"> | ||
| 115 | + <label class="col-md-3 control-label">燃油类型</label> | ||
| 116 | + <div class="col-md-4"> | ||
| 117 | + <select name="rylx" class="form-control"> | ||
| 118 | + <option value='0'>0号柴油</option> | ||
| 119 | + <option value='1'>负10号柴油</option> | ||
| 120 | + </select> | ||
| 121 | + </div> | ||
| 122 | + </div> | ||
| 123 | + | ||
| 124 | + <div class="form-group"> | ||
| 125 | + <label class="col-md-3 control-label">尿素</label> | ||
| 126 | + <div class="col-md-4"> | ||
| 127 | + <input type="text" value="0" class="form-control" name="ns" onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')" | ||
| 128 | + onafterpaste="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')"> | ||
| 129 | + </div> | ||
| 130 | + </div> | ||
| 131 | + | ||
| 132 | + <div class="form-group"> | ||
| 133 | + <label class="col-md-3 control-label">进场里程</label> | ||
| 134 | + <div class="col-md-4"> | ||
| 135 | + <input type="text" value="0" class="form-control" name="jzlc" onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')" | ||
| 136 | + onafterpaste="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')"> | ||
| 137 | + </div> | ||
| 138 | + </div> | ||
| 139 | + <div class="form-group"> | ||
| 140 | + <label class="col-md-3 control-label">损耗原因</label> | ||
| 141 | + <div class="col-md-4"> | ||
| 142 | + <select class="form-control" name="shyy"> | ||
| 143 | + <option value='0'>请选择</option> | ||
| 144 | + <option value='1'>票务用油</option> | ||
| 145 | + <option value='2'>保养用油</option> | ||
| 146 | + <option value='3'>报废车用油</option> | ||
| 147 | + <option value='4'>其它用油</option> | ||
| 148 | + <option value='5'>人保部</option> | ||
| 149 | + <option value='6'>车队</option> | ||
| 150 | + <option value='7'>车间(高保)</option> | ||
| 151 | + <option value='8'>车间(小修)</option> | ||
| 152 | + </select> | ||
| 153 | + </div> | ||
| 154 | + </div> | ||
| 155 | + <div class="form-group"> | ||
| 156 | + <label class="col-md-3 control-label">损耗油量</label> | ||
| 157 | + <div class="col-md-4"> | ||
| 158 | + <input type="text" value="0" class="form-control" name="sh" onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')" | ||
| 159 | + onafterpaste="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')"> | ||
| 160 | + </div> | ||
| 161 | + </div> | ||
| 162 | + <div class="form-group"> | ||
| 163 | + <label class="col-md-3 control-label">行驶总里程</label> | ||
| 164 | + <div class="col-md-4"> | ||
| 165 | + <input type="text" value="0" class="form-control" name="zlc" onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')" | ||
| 166 | + onafterpaste="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')"> | ||
| 167 | + </div> | ||
| 168 | + </div> | ||
| 169 | + | ||
| 170 | + | ||
| 171 | + </div> | ||
| 172 | + <div class="form-actions"> | ||
| 173 | + <div class="row"> | ||
| 174 | + <div class="col-md-offset-3 col-md-4"> | ||
| 175 | + <button type="submit" class="btn green" ><i class="fa fa-check"></i> 提交</button> | ||
| 176 | + <a type="button" class="btn default" href="list_ph.html" data-pjax><i class="fa fa-times"></i> 取消</a> | ||
| 177 | + </div> | ||
| 178 | + </div> | ||
| 179 | + </div> | ||
| 180 | + </form> | ||
| 181 | + <!-- END FORM--> | ||
| 182 | + </div> | ||
| 183 | +</div> | ||
| 184 | +<script> | ||
| 185 | +(function(){ | ||
| 186 | + var fage=false; | ||
| 187 | + var obj = []; | ||
| 188 | + var xlList; | ||
| 189 | + $.get('/report/lineList',function(result){ | ||
| 190 | + xlList=result; | ||
| 191 | + $.get('/user/companyData', function(result){ | ||
| 192 | + obj = result; | ||
| 193 | + var options = ''; | ||
| 194 | + for(var i = 0; i < obj.length; i++){ | ||
| 195 | + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; | ||
| 196 | + } | ||
| 197 | + $('#ssgsdm').html(options); | ||
| 198 | + | ||
| 199 | + updateCompany(); | ||
| 200 | + }); | ||
| 201 | + }); | ||
| 202 | + | ||
| 203 | + $("#ssgsdm").on("change",updateCompany); | ||
| 204 | + function updateCompany(){ | ||
| 205 | + var company = $('#ssgsdm').val(); | ||
| 206 | + var options = ''; | ||
| 207 | + for(var i = 0; i < obj.length; i++){ | ||
| 208 | + if(obj[i].companyCode == company){ | ||
| 209 | + var children = obj[i].children; | ||
| 210 | + for(var j = 0; j < children.length; j++){ | ||
| 211 | + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>'; | ||
| 212 | + } | ||
| 213 | + } | ||
| 214 | + } | ||
| 215 | + $('#fgsdm').html(options); | ||
| 216 | + initXl(); | ||
| 217 | + selectNbbm(); | ||
| 218 | + selectJsy(); | ||
| 219 | + } | ||
| 220 | + $("#fgsdm").on("change",initXl); | ||
| 221 | + function initXl(){ | ||
| 222 | + var data=[]; | ||
| 223 | + if(fage){ | ||
| 224 | + $("#xlbm").select2("destroy").html(''); | ||
| 225 | + } | ||
| 226 | + var fgs=$('#fgsdm').val(); | ||
| 227 | + var gs=$('#ssgsdm').val(); | ||
| 228 | + for(var i=0;i<xlList.length;i++){ | ||
| 229 | + if(gs!=""){ | ||
| 230 | + if(fgs!=""){ | ||
| 231 | + if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){ | ||
| 232 | + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]}); | ||
| 233 | + } | ||
| 234 | + }else{ | ||
| 235 | + if(xlList[i]["gsbm"]==gs){ | ||
| 236 | + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]}); | ||
| 237 | + } | ||
| 238 | + } | ||
| 239 | + } | ||
| 240 | + } | ||
| 241 | + initPinYinSelect2('#xlbm',data,''); | ||
| 242 | + fage=true; | ||
| 243 | + selectNbbm(); | ||
| 244 | + selectJsy(); | ||
| 245 | + } | ||
| 246 | + $("#date").datetimepicker({ | ||
| 247 | + format : 'YYYY-MM-DD', | ||
| 248 | + locale : 'zh-cn' | ||
| 249 | + }); | ||
| 250 | + | ||
| 251 | + function selectNbbm(){ | ||
| 252 | + $('#nbbm').select2({ | ||
| 253 | + placeholder: '搜索车辆...', | ||
| 254 | + ajax: { | ||
| 255 | + url: '/report/carList', | ||
| 256 | + dataType: 'json', | ||
| 257 | + delay: 150, | ||
| 258 | + data: function(params){ | ||
| 259 | + return{nbbm: params.term, | ||
| 260 | + gsbm:$('#ssgsdm').val(), | ||
| 261 | + fgsbm:$('#fgsdm').val(), | ||
| 262 | + xlbm:"" | ||
| 263 | + }; | ||
| 264 | + }, | ||
| 265 | + processResults: function (data) { | ||
| 266 | + return { | ||
| 267 | + results: data | ||
| 268 | + }; | ||
| 269 | + }, | ||
| 270 | + cache: true | ||
| 271 | + }, | ||
| 272 | + templateResult: function(repo){ | ||
| 273 | + if (repo.loading) return repo.text; | ||
| 274 | + var h = '<span>'+repo.text+'</span>'; | ||
| 275 | + h += (repo.lineName?' <span class="select2-desc">'+repo.lineName+'</span>':''); | ||
| 276 | + return h; | ||
| 277 | + }, | ||
| 278 | + escapeMarkup: function (markup) { return markup; }, | ||
| 279 | + minimumInputLength: 1, | ||
| 280 | + templateSelection: function(repo){ | ||
| 281 | + return repo.text; | ||
| 282 | + }, | ||
| 283 | + language: { | ||
| 284 | + noResults: function(){ | ||
| 285 | + return '<span style="color:red;font-size: 12px;">没有搜索到车辆!</span>'; | ||
| 286 | + }, | ||
| 287 | + inputTooShort : function(e) { | ||
| 288 | + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入自编号搜索车辆</span>'; | ||
| 289 | + }, | ||
| 290 | + searching : function() { | ||
| 291 | + return '<span style="color:gray;font-size: 12px;"> 正在搜索车辆...</span>'; | ||
| 292 | + } | ||
| 293 | + } | ||
| 294 | + }) | ||
| 295 | + } | ||
| 296 | + | ||
| 297 | + | ||
| 298 | + function selectJsy(){ | ||
| 299 | + $('#jsy').select2({ | ||
| 300 | + placeholder: '搜索驾驶员...', | ||
| 301 | + ajax: { | ||
| 302 | + url: '/report/userList', | ||
| 303 | + dataType: 'json', | ||
| 304 | + delay: 150, | ||
| 305 | + data: function(params){ | ||
| 306 | + return{jsy: params.term,gsbm:$('#ssgsdm').val()}; | ||
| 307 | + }, | ||
| 308 | + processResults: function (data) { | ||
| 309 | + return { | ||
| 310 | + results: data | ||
| 311 | + }; | ||
| 312 | + }, | ||
| 313 | + cache: true | ||
| 314 | + }, | ||
| 315 | + templateResult: function(repo){ | ||
| 316 | + if (repo.loading) return repo.text; | ||
| 317 | + var h = '<span>'+repo.text+'</span>'; | ||
| 318 | + return h; | ||
| 319 | + }, | ||
| 320 | + escapeMarkup: function (markup) { return markup; }, | ||
| 321 | + minimumInputLength: 1, | ||
| 322 | + templateSelection: function(repo){ | ||
| 323 | + return repo.text; | ||
| 324 | + }, | ||
| 325 | + language: { | ||
| 326 | + noResults: function(){ | ||
| 327 | + return '<span style="color:red;font-size: 12px;">没有搜索到驾驶员!</span>'; | ||
| 328 | + }, | ||
| 329 | + inputTooShort : function(e) { | ||
| 330 | + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入工号搜索驾驶员</span>'; | ||
| 331 | + }, | ||
| 332 | + searching : function() { | ||
| 333 | + return '<span style="color:gray;font-size: 12px;"> 正在搜索驾驶员...</span>'; | ||
| 334 | + } | ||
| 335 | + } | ||
| 336 | + }); | ||
| 337 | + } | ||
| 338 | + $(function(){ | ||
| 339 | + /* $get('/role/all',null,function(result){ | ||
| 340 | + $.each(result,function(i,obj){ | ||
| 341 | + $("#role").append("<option value='"+obj.id+"'>"+obj.roleName+"</option>"); | ||
| 342 | + }); | ||
| 343 | + }); */ | ||
| 344 | + | ||
| 345 | + var form = $('#ylb_add_form'); | ||
| 346 | + var error = $('.alert-danger', form); | ||
| 347 | + | ||
| 348 | + //表单 validate | ||
| 349 | + form.validate({ | ||
| 350 | + errorElement : 'span', | ||
| 351 | + errorClass : 'help-block help-block-error', | ||
| 352 | + focusInvalid : false, | ||
| 353 | + rules : { | ||
| 354 | + 'xlbm' : { | ||
| 355 | + required : true, | ||
| 356 | + maxlength: 25 | ||
| 357 | + }, | ||
| 358 | + 'nbbm' : { | ||
| 359 | + required : true, | ||
| 360 | + maxlength: 25 | ||
| 361 | + }, | ||
| 362 | + 'rq' : { | ||
| 363 | + required : true, | ||
| 364 | + maxlength: 25 | ||
| 365 | + }, | ||
| 366 | + 'jsy' : { | ||
| 367 | + required : true, | ||
| 368 | + maxlength: 20 | ||
| 369 | + } | ||
| 370 | + }, | ||
| 371 | + invalidHandler : function(event, validator) { | ||
| 372 | + error.show(); | ||
| 373 | + App.scrollTo(error, -200); | ||
| 374 | + }, | ||
| 375 | + | ||
| 376 | + highlight : function(element) { | ||
| 377 | + $(element).closest('.form-group').addClass('has-error'); | ||
| 378 | + }, | ||
| 379 | + | ||
| 380 | + unhighlight : function(element) { | ||
| 381 | + $(element).closest('.form-group').removeClass('has-error'); | ||
| 382 | + }, | ||
| 383 | + | ||
| 384 | + success : function(label) { | ||
| 385 | + label.closest('.form-group').removeClass('has-error'); | ||
| 386 | + }, | ||
| 387 | + | ||
| 388 | + submitHandler : function(f) { | ||
| 389 | + var params = form.serializeJSON(); | ||
| 390 | + error.hide(); | ||
| 391 | + var nbbm=$("#nbbm").val(); | ||
| 392 | + var date=$("#date").val(); | ||
| 393 | + var jsy=$("#jsy").val(); | ||
| 394 | + var xlbm=$("#xlbm").val(); | ||
| 395 | + var gsdm=$("#ssgsdm").val(); | ||
| 396 | + var map={}; | ||
| 397 | + map["nbbm"]=nbbm; | ||
| 398 | + map["date"]=date; | ||
| 399 | + map["jsy"]=jsy; | ||
| 400 | + map["xlbm"]=xlbm; | ||
| 401 | + map["date"]=date; | ||
| 402 | + map["rq"]=date; | ||
| 403 | + map["ssgsdm_like"]=gsdm; | ||
| 404 | + //检查一下用户是否存在 | ||
| 405 | + var i = layer.load(2); | ||
| 406 | + $get('/ylb/checkDate', map, function(fage){ | ||
| 407 | + if(fage=="2"){ | ||
| 408 | + layer.msg('只能操作三天内数据.'); | ||
| 409 | + layer.close(i); | ||
| 410 | + }else{ | ||
| 411 | + $get('/ylb/checkJsy', map, function(fage){ | ||
| 412 | + if(fage=="0"){ | ||
| 413 | + layer.msg('该驾驶员当天已存在.'); | ||
| 414 | + layer.close(i); | ||
| 415 | + }else{ | ||
| 416 | + $post('/ylb/saveYlb', params, function(){ | ||
| 417 | + layer.msg('添加信息成功.'); | ||
| 418 | + layer.close(i); | ||
| 419 | + loadPage('list_ph.html'); | ||
| 420 | + }); | ||
| 421 | + } | ||
| 422 | + }); | ||
| 423 | + } | ||
| 424 | + }) | ||
| 425 | + } | ||
| 426 | + }); | ||
| 427 | + }); | ||
| 428 | +})(); | ||
| 429 | +</script> | ||
| 0 | \ No newline at end of file | 430 | \ No newline at end of file |
src/main/resources/static/pages/oil/list_ph_.html
0 → 100644
| 1 | +<style type="text/css"> | ||
| 2 | + #ylbtable table>tr> td { | ||
| 3 | + white-space: nowrap; | ||
| 4 | + overflow: hidden; | ||
| 5 | + text-overflow: ellipsis; | ||
| 6 | + } | ||
| 7 | + | ||
| 8 | +</style> | ||
| 9 | + <div class="page-head"> | ||
| 10 | + <div class="page-title"> | ||
| 11 | + <h1>油耗管理</h1> | ||
| 12 | + </div> | ||
| 13 | + </div> | ||
| 14 | + | ||
| 15 | + <ul class="page-breadcrumb breadcrumb"> | ||
| 16 | + <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li> | ||
| 17 | + <li><span class="active">电子路单</span> <i class="fa fa-circle"></i></li> | ||
| 18 | + <li><span class="active">油耗管理</span></li> | ||
| 19 | + </ul> | ||
| 20 | + <div id="ll_oil_list" | ||
| 21 | + class=" row col-md-12 portlet light porttlet-fit portlet-datatable bordered" style="height: calc(100% - 100px);background-color: #fff"> | ||
| 22 | + <!-- Begin: life time stats --> | ||
| 23 | + <div class="portlet-title" > | ||
| 24 | + <div class="caption"> | ||
| 25 | + <i class="fa fa-fire-extinguisher"></i> <span | ||
| 26 | + class="caption-subject font-dark sbold uppercase">油耗管理</span> | ||
| 27 | + </div> | ||
| 28 | + <div class="actions"> | ||
| 29 | + <a class="btn btn-circle blue" href="add_.html" data-pjax><i | ||
| 30 | + class="fa fa-plus"></i> 添加</a> | ||
| 31 | + <button type="button" class="btn btn-circle blue removeButton" id="removeButton"> | ||
| 32 | + <i class="fa fa-trash-o"></i> 删除 | ||
| 33 | + </button> | ||
| 34 | + <button type="button" class="btn btn-circle blue sortButton" id="sortButton"> | ||
| 35 | + <i class="fa fa-minus-square"></i> 拆分 | ||
| 36 | + </button> | ||
| 37 | + <button type="button" class="btn btn-circle blue saveButton" id="saveButton"> | ||
| 38 | + <i class="fa fa-check-circle"></i> 保存 | ||
| 39 | + </button> | ||
| 40 | + <!-- <button type="button" class="btn btn-circle red" disabled="disabled" id="removeButton"><i class="fa fa-trash"></i> 删除用户</button> --> | ||
| 41 | + <div class="btn-group"> | ||
| 42 | + <a class="btn red btn-outline btn-circle" href="javascript:;" | ||
| 43 | + data-toggle="dropdown"> <i class="fa fa-share"></i> <span | ||
| 44 | + class="hidden-xs"> 系统工具 </span> <i class="fa fa-angle-down"></i> | ||
| 45 | + </a> | ||
| 46 | + <ul class="dropdown-menu pull-right" id="datatable_ajax_tools"> | ||
| 47 | + <li><a href="javascript:;" data-action="0" class="tool-action" | ||
| 48 | + id="obtain"> <i class="fa fa-hourglass-half"></i> 获取加/存油信息 | ||
| 49 | + </a></li> | ||
| 50 | + <li><a href="javascript:;" data-action="1" class="tool-action" | ||
| 51 | + id="outAndIn"> <i class="fa fa-pencil"></i> 油耗计算(进场=出场) | ||
| 52 | + </a></li> | ||
| 53 | + <li><a href="javascript:;" id="checkYl" data-action="3" | ||
| 54 | + class="tool-action"> <i class="fa fa-gg-circle"></i> | ||
| 55 | + 核对加注量(有加油无里程) | ||
| 56 | + </a></li> | ||
| 57 | + <li class="divider"></li> | ||
| 58 | + <li><a href="javascript:;" data-action="3" class="tool-action" | ||
| 59 | + id="export"> <i class="fa fa-file-excel-o"></i> 导出Excel | ||
| 60 | + </a></li> | ||
| 61 | + | ||
| 62 | +<!-- <li class="divider"></li> --> | ||
| 63 | +<!-- <li><a href="javascript:;" data-action="3" class="tool-action" --> | ||
| 64 | +<!-- id="cxtj"> <i class="fa fa-file-excel-o"></i> 重新统计 --> | ||
| 65 | +<!-- </a></li> --> | ||
| 66 | + </ul> | ||
| 67 | + </div> | ||
| 68 | + </div> | ||
| 69 | + <div> | ||
| 70 | + <table | ||
| 71 | + class="table table-striped table-bordered table-hover table-checkable" | ||
| 72 | + id="datatable_ylb" style="table-layout: fixed;margin-bottom: 0px"> | ||
| 73 | + <thead> | ||
| 74 | + <tr role="row" class="filter"> | ||
| 75 | + <td colspan="2"> | ||
| 76 | + <div style="float: right;"> 公司 </div> | ||
| 77 | + </td> | ||
| 78 | + <td colspan="3"> | ||
| 79 | + <div style="float: left; width: 150px"> | ||
| 80 | + <select class="form-control" name="ssgsdm_like" | ||
| 81 | + id="ylbListGsdmId"></select> | ||
| 82 | + </div> | ||
| 83 | + </td> | ||
| 84 | + <td colspan="2"> | ||
| 85 | + <div style="float: right;"> 分公司 </div> | ||
| 86 | + </td> | ||
| 87 | + <td colspan="4"> | ||
| 88 | + <div style="float: left;"> | ||
| 89 | + <select class="form-control" name="fgsdm_like" | ||
| 90 | + id="ylbListFgsdmId" style="width: 150px"></select> | ||
| 91 | + </div> | ||
| 92 | + </td> | ||
| 93 | + <td> | ||
| 94 | + <div style="float: right;">日期</div> | ||
| 95 | + </td> | ||
| 96 | + <td colspan="3"> | ||
| 97 | + <div style="float: left;"> | ||
| 98 | + <input type="text" style="width: 120px" name="rq" id="rq" /> | ||
| 99 | + </div> | ||
| 100 | + </td> | ||
| 101 | + <td rowspan="2" colspan="2"> | ||
| 102 | + <div style="float: left;"> | ||
| 103 | + | ||
| 104 | + <button | ||
| 105 | + class="btn btn-sm green btn-outline filter-submit margin-bottom" | ||
| 106 | + style="margin-right: 0px"> | ||
| 107 | + <i class="fa fa-search"></i> 搜索 | ||
| 108 | + </button> | ||
| 109 | + <!-- <button class="btn btn-sm red btn-outline filter-cancel" style="margin-right:0px"> --> | ||
| 110 | + <!-- <i class="fa fa-times"></i> 重置 --> | ||
| 111 | + <!-- </button> --> | ||
| 112 | + | ||
| 113 | + </div> | ||
| 114 | + </td> | ||
| 115 | + </tr> | ||
| 116 | + <tr class="filter2"> | ||
| 117 | + <td colspan="2"> | ||
| 118 | + <div style="float: right;"> 线路</div> | ||
| 119 | + </td> | ||
| 120 | + <td colspan="3"> | ||
| 121 | + <div style="float: left;"> | ||
| 122 | + <select class="form-control" name="xlbm_like" id="xlbm" | ||
| 123 | + style="width: 150px;"></select> | ||
| 124 | + </div> | ||
| 125 | + </td> | ||
| 126 | + <td colspan="2"> | ||
| 127 | + <div style="float: right;"> 内部编码</div> | ||
| 128 | + </td> | ||
| 129 | + <td colspan="4"> | ||
| 130 | + <div style="float: left;"> | ||
| 131 | + <select class="form-control" name="nbbm_eq" id="nbbm" | ||
| 132 | + style="width: 120px;"></select> | ||
| 133 | + </div> | ||
| 134 | + <div style="float: left;"> | ||
| 135 | + <button class="btn btn-sm #000 btn-outline filter-cancel" | ||
| 136 | + style="margin-right: 0px"> | ||
| 137 | + <i class="fa fa-times"></i> | ||
| 138 | + </button> | ||
| 139 | + </div> | ||
| 140 | + </td> | ||
| 141 | + <td> | ||
| 142 | + <div style="float: right;">类型</div> | ||
| 143 | + </td> | ||
| 144 | + <td colspan="3"> | ||
| 145 | + <div style="float: left;"> | ||
| 146 | + <select class="form-control" name="sxtj"> | ||
| 147 | + <option value="0">全部</option> | ||
| 148 | + <option value="1">一车一单</option> | ||
| 149 | + <option value="2">一车多单</option> | ||
| 150 | + <option value="3">有加油没里程</option> | ||
| 151 | + <option value="4">有里程没加油</option> | ||
| 152 | + </select> | ||
| 153 | + </div> | ||
| 154 | + | ||
| 155 | + </td> | ||
| 156 | + </tr> | ||
| 157 | + <tr> | ||
| 158 | + <td colspan="17"> | ||
| 159 | + <div style="float: left;"> | ||
| 160 | + 总计 加注量: <label id="sumJzl"></label> | ||
| 161 | + 耗油量: <label id="sumYh"></label> | ||
| 162 | + 损耗量: <label id="sumSh"></label> | ||
| 163 | + </div> | ||
| 164 | + </td> | ||
| 165 | + </tr> | ||
| 166 | + | ||
| 167 | + </thead> | ||
| 168 | + | ||
| 169 | + </table> | ||
| 170 | + </div> | ||
| 171 | + </div> | ||
| 172 | + | ||
| 173 | + <div id="ylbtable" class="portlet-body table-container " style="height: calc(100% + 100px);overflow: hidden;position: absolute;background: #fff;"> | ||
| 174 | + | ||
| 175 | + <table | ||
| 176 | + class="table table-striped table-bordered table-hover table-checkable" | ||
| 177 | + style="table-layout: fixed;margin-bottom: 0px;"> | ||
| 178 | + <thead> | ||
| 179 | + <tr role="row" class="heading"> | ||
| 180 | + <td width="40px"> | ||
| 181 | + <input type="checkbox" id="selectAll" class="group-checkable" > | ||
| 182 | + </td> | ||
| 183 | + <td width="40px">序号</td> | ||
| 184 | + <td width="8%">日期</td> | ||
| 185 | + <td width="5%">公司</td> | ||
| 186 | + <td width="8%">线路</td> | ||
| 187 | + <td width="5%">自编号</td> | ||
| 188 | + <td width="7%">驾驶员</td> | ||
| 189 | + <td width="4%">加油量</td> | ||
| 190 | + <td width="5%">出场存油</td> | ||
| 191 | + <td width="5%">进场存油</td> | ||
| 192 | + <td width="5%">油耗</td> | ||
| 193 | + <td width="8%">燃油类型</td> | ||
| 194 | + <td width="4%">尿素</td> | ||
| 195 | + <td width="8%">耗损原因</td> | ||
| 196 | + <td width="5%">耗损油量</td> | ||
| 197 | + <td width="5%">当日总里程</td> | ||
| 198 | + <td width="5%">数据类型</td> | ||
| 199 | + <td >百公里油耗</td> | ||
| 200 | + </tr> | ||
| 201 | + </thead> | ||
| 202 | + </table> | ||
| 203 | + <div id="datatable_ylb_body_div" style="display: block;position:absolute;overflow: auto;height: calc(100% - 80px);"> | ||
| 204 | + <table | ||
| 205 | + class="table table-striped table-bordered table-hover table-checkable" | ||
| 206 | + id="datatable_ylb_body" | ||
| 207 | + style="table-layout: fixed; overflow: auto; "> | ||
| 208 | + <tbody></tbody> | ||
| 209 | + </table> | ||
| 210 | + <div style="text-align: right;margin-right: 50px"> | ||
| 211 | + <a class="btn btn-circle " href="add.html" data-pjax><i | ||
| 212 | + class="fa fa-plus"></i> 添加</a> | ||
| 213 | + <button type="button" class="btn btn-circle removeButton" > | ||
| 214 | + <i class="fa fa-trash-o"></i> 删除 | ||
| 215 | + </button> | ||
| 216 | + <button type="button" class="btn btn-circle sortButton"> | ||
| 217 | + <i class="fa fa-minus-square"></i> 拆分 | ||
| 218 | + </button> | ||
| 219 | + <button type="button" class="btn btn-circle saveButton" > | ||
| 220 | + <i class="fa fa-check-circle"></i> 保存 | ||
| 221 | + </button> | ||
| 222 | + </div> | ||
| 223 | + </div> | ||
| 224 | + | ||
| 225 | + | ||
| 226 | + <div style="text-align: right;"> | ||
| 227 | + <ul id="pagination" class="pagination"></ul> | ||
| 228 | + </div> | ||
| 229 | + </div> | ||
| 230 | + </div> | ||
| 231 | +<script id="ylb_list_temp" type="text/html"> | ||
| 232 | + {{each list as obj i}} | ||
| 233 | + <tr> | ||
| 234 | + <td style="vertical-align: middle;" width="40px"> | ||
| 235 | + <input type="checkbox" name="id" class="group-checkable icheck" data-id="{{obj.id}}"> | ||
| 236 | + </td> | ||
| 237 | + <td width="40px">{{i+1}}</td> | ||
| 238 | + <td width="8%"> | ||
| 239 | + {{obj.rq}} | ||
| 240 | + </td> | ||
| 241 | + <td width="5%"> | ||
| 242 | + {{obj.fgsname}} | ||
| 243 | + </td> | ||
| 244 | + <td width="8%"> | ||
| 245 | + {{obj.xlname}} | ||
| 246 | + </td> | ||
| 247 | + <td width="5%"> | ||
| 248 | + <lable data-id="{{obj.id}}" class="in_carpark_nbbm">{{obj.nbbm}}</lable> | ||
| 249 | + | ||
| 250 | + </td> | ||
| 251 | + <td width="7%"> | ||
| 252 | + {{if obj.jsy=='' || obj.jsy==null }} | ||
| 253 | + <input data-id="{{obj.id}}" style=" width:100%" type="text" class="in_carpark_jsy" ></input> | ||
| 254 | + <button class="btn btn-sm blue btn-jsyUpdate" style=" width:100%" data-id="{{obj.id}}">填写工号</button> | ||
| 255 | + {{else}} | ||
| 256 | + {{obj.jsy}}/{{obj.name}} | ||
| 257 | + {{/if}} | ||
| 258 | + | ||
| 259 | + </td> | ||
| 260 | + <td width="4%"> | ||
| 261 | + <lable data-id="{{obj.id}}" class="in_carpark_jzl"> {{obj.jzl}}</lable> | ||
| 262 | + </td> | ||
| 263 | + <td width="5%"> | ||
| 264 | + | ||
| 265 | + <input data-id="{{obj.id}}" id="{{(i+1)}}_1" href="javascript:;" class="in_carpark_czyl yl_sxzy" | ||
| 266 | + type="text" value=" {{obj.czyl}}" style=" width:100%" | ||
| 267 | +onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')" | ||
| 268 | + onafterpaste="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')"> | ||
| 269 | + </td> | ||
| 270 | + <td width="5%"> | ||
| 271 | + <input data-id="{{obj.id}}" id="{{(i+1)}}_2" href="javascript:;" class="in_carpark_jzyl yl_sxzy" | ||
| 272 | + type="text" value=" {{obj.jzyl}}" style=" width:100%" | ||
| 273 | +onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')" | ||
| 274 | + onafterpaste="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')"> | ||
| 275 | + </td> | ||
| 276 | + <td width="5%"> | ||
| 277 | + | ||
| 278 | + <input data-id="{{obj.id}}" id="{{(i+1)}}_3" href="javascript:;" class="in_carpark_yh yl_sxzy" | ||
| 279 | + type="text" value="{{obj.yh}}" style=" width:100%" readOnly="true" /> | ||
| 280 | + </td> | ||
| 281 | + <td width="8%"> | ||
| 282 | + <select data-id="{{obj.id}}" class="in_carpark_rylx" style=" width:100%" > | ||
| 283 | + <option value='0' {{if obj.rylx==0}} selected = 'selected' {{/if}}>0号柴油</option> | ||
| 284 | + <option value='1' {{if obj.rylx==1}} selected = 'selected' {{/if}}>负10号柴油</option> | ||
| 285 | + </select> | ||
| 286 | + </td> | ||
| 287 | + <td width="4%"> | ||
| 288 | + <input data-id="{{obj.id}}" href="javascript:;" | ||
| 289 | + class="in_carpark_ns yl_sxzy" id="{{(i+1)}}_4" type="text" value=" {{obj.ns}}" style=" width:100%" | ||
| 290 | +onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')" | ||
| 291 | + onafterpaste="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')"> | ||
| 292 | + </td> | ||
| 293 | + <td width="8%"> | ||
| 294 | + <select data-id="{{obj.id}}" class="in_carpark_shyy" style=" width:100%" > | ||
| 295 | + <option value='0' {{if obj.shyy==0}} selected = 'selected' {{/if}}>请选择</option> | ||
| 296 | + <option value='1' {{if obj.shyy==1}} selected = 'selected' {{/if}}>票务用油</option> | ||
| 297 | + <option value='2' {{if obj.shyy==2}} selected = 'selected' {{/if}}>保养用油</option> | ||
| 298 | + <option value='3' {{if obj.shyy==3}} selected = 'selected' {{/if}}>报废车用油</option> | ||
| 299 | + <option value='4' {{if obj.shyy==4}} selected = 'selected' {{/if}}>其它用油</option> | ||
| 300 | + <option value='5' {{if obj.shyy==5}} selected = 'selected' {{/if}}>人保部</option> | ||
| 301 | + <option value='6' {{if obj.shyy==6}} selected = 'selected' {{/if}}>车队</option> | ||
| 302 | + <option value='7' {{if obj.shyy==7}} selected = 'selected' {{/if}}>车间(高保)</option> | ||
| 303 | + <option value='8' {{if obj.shyy==8}} selected = 'selected' {{/if}}>车间(小修)</option> | ||
| 304 | + </select> | ||
| 305 | + </td> | ||
| 306 | + <td width="5%"> | ||
| 307 | + <input data-id="{{obj.id}}" id="{{(i+1)}}_5" href="javascript:;" class="in_carpark_shyl yl_sxzy" | ||
| 308 | + value={{obj.sh}} style=" width:100%" type="text" | ||
| 309 | +onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')" | ||
| 310 | + onafterpaste="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')" /> | ||
| 311 | + | ||
| 312 | +</td> | ||
| 313 | + <td width="5%"> | ||
| 314 | + {{obj.zlc}} | ||
| 315 | + </td> | ||
| 316 | + <td width="5%"> | ||
| 317 | + <select data-id="{{obj.id}}" class="in_carpark_yhlx"> | ||
| 318 | + <option value='0' {{if obj.yhlx==0}} selected = 'selected' {{/if}}>手录</option> | ||
| 319 | + <option value='1' {{if obj.yhlx==1}} selected = 'selected' {{/if}}>拆分</option> | ||
| 320 | + </select> | ||
| 321 | + </td> | ||
| 322 | + <td > | ||
| 323 | + {{obj.bglyh}} | ||
| 324 | + </td> | ||
| 325 | + </tr> | ||
| 326 | + {{/each}} | ||
| 327 | + {{if list.length == 0}} | ||
| 328 | + <tr> | ||
| 329 | + <td colspan=17><h6 class="muted">没有找到相关数据</h6></td> | ||
| 330 | + </tr> | ||
| 331 | + {{/if}} | ||
| 332 | +</script> | ||
| 333 | + | ||
| 334 | +<script> | ||
| 335 | + $(function () { | ||
| 336 | + var fage=false; | ||
| 337 | + //var id = 15; | ||
| 338 | + //$('.in_carpark_jzyl[data-id='+id+']', '#ll_oil_list') | ||
| 339 | + | ||
| 340 | + | ||
| 341 | + $("#checkYl").on('click', function () { | ||
| 342 | + //console.log("核对加注量"); | ||
| 343 | + if ($("#rq").val() != "") { | ||
| 344 | + var params=getParamsList(); | ||
| 345 | + $get('/ylb/checkDate',params,function(status){ | ||
| 346 | + if(status=='2'){ | ||
| 347 | + layer.msg('只能操作三天内数据.'); | ||
| 348 | + }else{ | ||
| 349 | + var i = layer.load(2); | ||
| 350 | + $get('/ylb/checkYl', params, function () { | ||
| 351 | + layer.close(i); | ||
| 352 | + jsDoQuery(params, true); | ||
| 353 | + }); | ||
| 354 | + } | ||
| 355 | + }) | ||
| 356 | + | ||
| 357 | + } else { | ||
| 358 | + layer.msg('请选择日期.'); | ||
| 359 | + } | ||
| 360 | + }) | ||
| 361 | + | ||
| 362 | + //进场等于出场 | ||
| 363 | + $("#outAndIn").on('click', function () { | ||
| 364 | + // console.log("进场油量等于出场油量"); | ||
| 365 | + if ($("#rq").val() != "") { | ||
| 366 | + var params=getParamsList(); | ||
| 367 | + $get('/ylb/checkDate',params,function(status){ | ||
| 368 | + if(status=='2'){ | ||
| 369 | + layer.msg('只能操作三天内数据.'); | ||
| 370 | + }else{ | ||
| 371 | + var i = layer.load(2); | ||
| 372 | + $get('/ylb/outAndIn', params, function () { | ||
| 373 | + layer.close(i); | ||
| 374 | + jsDoQuery(params, true); | ||
| 375 | + }); | ||
| 376 | + } | ||
| 377 | + }) | ||
| 378 | + } else { | ||
| 379 | + layer.msg('请选择日期.'); | ||
| 380 | + } | ||
| 381 | + }); | ||
| 382 | + | ||
| 383 | + //保存 | ||
| 384 | + $(".saveButton").on('click',function(){ | ||
| 385 | + | ||
| 386 | + var params_=getParamsList(); | ||
| 387 | + $get('/ylb/checkDate',params_,function(status){ | ||
| 388 | + if(status=='2'){ | ||
| 389 | + layer.msg('只能操作三天内数据.'); | ||
| 390 | + }else{ | ||
| 391 | + var ylArray = []; | ||
| 392 | + $('input.icheck').each(function(){ | ||
| 393 | + var map = {}; | ||
| 394 | + var id=$(this).data('id'); | ||
| 395 | + var nbbm =$('.in_carpark_nbbm[data-id='+id+']', '#ll_oil_list').html(); | ||
| 396 | + var jzl =$('.in_carpark_jzl[data-id='+id+']', '#ll_oil_list').html(); | ||
| 397 | + if(jzl=="" || jzl ==null){ | ||
| 398 | + jzl=0; | ||
| 399 | + } | ||
| 400 | + var czyl=$('.in_carpark_czyl[data-id='+id+']', '#ll_oil_list').val(); | ||
| 401 | + if(czyl=="" || czyl==null){ | ||
| 402 | + czyl=0; | ||
| 403 | + } | ||
| 404 | + var jzyl=$('.in_carpark_jzyl[data-id='+id+']', '#ll_oil_list').val(); | ||
| 405 | + if(jzyl=="" || jzyl==null){ | ||
| 406 | + jzyl=0; | ||
| 407 | + } | ||
| 408 | + | ||
| 409 | + var sh = $('.in_carpark_shyl[data-id='+id+']', '#ll_oil_list').val(); | ||
| 410 | + if(sh=="" || sh==null){ | ||
| 411 | + sh=0; | ||
| 412 | + } | ||
| 413 | + | ||
| 414 | + var shyy = $('.in_carpark_shyy[data-id='+id+']', '#ll_oil_list').val(); | ||
| 415 | + var ns = $('.in_carpark_ns[data-id='+id+']', '#ll_oil_list').val(); | ||
| 416 | + if(ns=="" || ns==null){ | ||
| 417 | + ns=0; | ||
| 418 | + } | ||
| 419 | + | ||
| 420 | + var rylx= $('.in_carpark_rylx[data-id='+id+']', '#ll_oil_list').val(); | ||
| 421 | + var yhlx = $('.in_carpark_yhlx[data-id='+id+']', '#ll_oil_list').val(); | ||
| 422 | + | ||
| 423 | + map['id']=id; | ||
| 424 | + map['jzl']=jzl; | ||
| 425 | + map['czyl']=czyl; | ||
| 426 | + map['jzyl']=jzyl; | ||
| 427 | + map['sh']=sh; | ||
| 428 | + map['shyy']=shyy; | ||
| 429 | + map['ns']=ns; | ||
| 430 | + map['rylx']=rylx; | ||
| 431 | + map['yhlx']=yhlx; | ||
| 432 | + map['nbbm']=nbbm; | ||
| 433 | + map['rq']=$("#rq").val(); | ||
| 434 | + ylArray.push(map); | ||
| 435 | + }) | ||
| 436 | + var params = {}; | ||
| 437 | + params['ylbList']=JSON.stringify(ylArray); | ||
| 438 | + var i = layer.load(2); | ||
| 439 | + $post('/ylb/saveYlbList', params, function () { | ||
| 440 | + layer.close(i); | ||
| 441 | + var params1 =getParamsList(); | ||
| 442 | + jsDoQuery(params1, true); | ||
| 443 | + }); | ||
| 444 | + } | ||
| 445 | + }) | ||
| 446 | + }) | ||
| 447 | + //拆分 | ||
| 448 | + $(".sortButton").on('click', function () { | ||
| 449 | + if ($("#rq").val() != "") { | ||
| 450 | + var params_=getParamsList(); | ||
| 451 | + $get('/ylb/checkDate',params_,function(status){ | ||
| 452 | + if(status=='2'){ | ||
| 453 | + layer.msg('只能操作三天内数据.'); | ||
| 454 | + }else{ | ||
| 455 | + //拆分前先保存全部 | ||
| 456 | + var ylArray = []; | ||
| 457 | + $('input.icheck').each(function(){ | ||
| 458 | + var map = {}; | ||
| 459 | + var id=$(this).data('id'); | ||
| 460 | + var nbbm =$('.in_carpark_nbbm[data-id='+id+']', '#ll_oil_list').html(); | ||
| 461 | + var jzl =$('.in_carpark_jzl[data-id='+id+']', '#ll_oil_list').html(); | ||
| 462 | + if(jzl=="" || jzl ==null){ | ||
| 463 | + jzl=0; | ||
| 464 | + } | ||
| 465 | + var czyl=$('.in_carpark_czyl[data-id='+id+']', '#ll_oil_list').val(); | ||
| 466 | + if(czyl=="" || czyl==null){ | ||
| 467 | + czyl=0; | ||
| 468 | + } | ||
| 469 | + var jzyl=$('.in_carpark_jzyl[data-id='+id+']', '#ll_oil_list').val(); | ||
| 470 | + if(jzyl=="" || jzyl==null){ | ||
| 471 | + jzyl=0; | ||
| 472 | + } | ||
| 473 | + | ||
| 474 | + var sh = $('.in_carpark_shyl[data-id='+id+']', '#ll_oil_list').val(); | ||
| 475 | + if(sh=="" || sh==null){ | ||
| 476 | + sh=0; | ||
| 477 | + } | ||
| 478 | + | ||
| 479 | + var shyy = $('.in_carpark_shyy[data-id='+id+']', '#ll_oil_list').val(); | ||
| 480 | + var ns = $('.in_carpark_ns[data-id='+id+']', '#ll_oil_list').val(); | ||
| 481 | + if(ns=="" || ns==null){ | ||
| 482 | + ns=0; | ||
| 483 | + } | ||
| 484 | + | ||
| 485 | + var rylx= $('.in_carpark_rylx[data-id='+id+']', '#ll_oil_list').val(); | ||
| 486 | + var yhlx = $('.in_carpark_yhlx[data-id='+id+']', '#ll_oil_list').val(); | ||
| 487 | + | ||
| 488 | + map['id']=id; | ||
| 489 | + map['jzl']=jzl; | ||
| 490 | + map['czyl']=czyl; | ||
| 491 | + map['jzyl']=jzyl; | ||
| 492 | + map['sh']=sh; | ||
| 493 | + map['shyy']=shyy; | ||
| 494 | + map['ns']=ns; | ||
| 495 | + map['rylx']=rylx; | ||
| 496 | + map['yhlx']=yhlx; | ||
| 497 | + map['nbbm']=nbbm; | ||
| 498 | + map['rq']=$("#rq").val(); | ||
| 499 | + ylArray.push(map); | ||
| 500 | + }) | ||
| 501 | + var params = {}; | ||
| 502 | + params['ylbList']=JSON.stringify(ylArray); | ||
| 503 | + | ||
| 504 | + | ||
| 505 | + //拆分操作 | ||
| 506 | + var ylArray2 = []; | ||
| 507 | + var nbbm=""; | ||
| 508 | + var msg=""; | ||
| 509 | + $('input.icheck:checked').each(function(){ | ||
| 510 | + var map = {}; | ||
| 511 | + var id=$(this).data('id'); | ||
| 512 | + var clzbh =$('.in_carpark_nbbm[data-id='+id+']', '#ll_oil_list').html(); | ||
| 513 | + if(nbbm.indexOf(clzbh)>-1){ | ||
| 514 | + if(msg==""){ | ||
| 515 | + msg += clzbh; | ||
| 516 | + }else{ | ||
| 517 | + msg += ","+clzbh; | ||
| 518 | + } | ||
| 519 | + }else{ | ||
| 520 | + nbbm +=clzbh; | ||
| 521 | + var jzyl=$('.in_carpark_jzyl[data-id='+id+']', '#ll_oil_list').val(); | ||
| 522 | + var sh = $('.in_carpark_shyl[data-id='+id+']', '#ll_oil_list').val(); | ||
| 523 | + var shyy = $('.in_carpark_shyy[data-id='+id+']', '#ll_oil_list').val(); | ||
| 524 | + var ns = $('.in_carpark_ns[data-id='+id+']', '#ll_oil_list').val(); | ||
| 525 | + var rylx= $('.in_carpark_rylx[data-id='+id+']', '#ll_oil_list').val(); | ||
| 526 | + map['id']=id; | ||
| 527 | + map['jzyl']=jzyl; | ||
| 528 | + map['sh']=sh; | ||
| 529 | + map['shyy']=shyy; | ||
| 530 | + map['ns']=ns; | ||
| 531 | + map['rylx']=rylx; | ||
| 532 | + ylArray2.push(map); | ||
| 533 | + } | ||
| 534 | + | ||
| 535 | + }) ; | ||
| 536 | + if(msg!=""){ | ||
| 537 | + layer.msg('内部编码为:【'+msg +'】的车辆请选择一条数据进行拆分.'); | ||
| 538 | + }else{ | ||
| 539 | + var params2 = {}; | ||
| 540 | + params2['ylbList']=JSON.stringify(ylArray2); | ||
| 541 | + var i = layer.load(2); | ||
| 542 | + //保存操作 | ||
| 543 | + $post('/ylb/saveYlbList', params, function () { | ||
| 544 | + //拆分操作 | ||
| 545 | + $post('/ylb/sort', params2, function () { | ||
| 546 | + layer.close(i); | ||
| 547 | + var params1 =getParamsList(); | ||
| 548 | + jsDoQuery(params1, true); | ||
| 549 | + }); | ||
| 550 | + }); | ||
| 551 | + } | ||
| 552 | + } | ||
| 553 | + }) | ||
| 554 | + } else { | ||
| 555 | + layer.msg('请选择日期.'); | ||
| 556 | + } | ||
| 557 | + | ||
| 558 | + | ||
| 559 | + }) | ||
| 560 | + | ||
| 561 | + /* //拆分 | ||
| 562 | + $("#sortButton").on('click', function () { | ||
| 563 | + if ($("#rq").val() != "") { | ||
| 564 | + var ylArray = []; | ||
| 565 | + var nbbm=""; | ||
| 566 | + var msg=""; | ||
| 567 | + $('input.icheck:checked').each(function(){ | ||
| 568 | + var map = {}; | ||
| 569 | + var id=$(this).data('id'); | ||
| 570 | + var clzbh =$('.in_carpark_nbbm[data-id='+id+']', '#ll_oil_list').html(); | ||
| 571 | + if(nbbm.indexOf(clzbh)>-1){ | ||
| 572 | + if(msg==""){ | ||
| 573 | + msg += clzbh; | ||
| 574 | + }else{ | ||
| 575 | + msg += ","+clzbh; | ||
| 576 | + } | ||
| 577 | + }else{ | ||
| 578 | + nbbm +=clzbh; | ||
| 579 | + var jzyl=$('.in_carpark_jzyl[data-id='+id+']', '#ll_oil_list').val(); | ||
| 580 | + var sh = $('.in_carpark_shyl[data-id='+id+']', '#ll_oil_list').val(); | ||
| 581 | + var shyy = $('.in_carpark_shyy[data-id='+id+']', '#ll_oil_list').val(); | ||
| 582 | + var ns = $('.in_carpark_ns[data-id='+id+']', '#ll_oil_list').val(); | ||
| 583 | + var rylx= $('.in_carpark_rylx[data-id='+id+']', '#ll_oil_list').val(); | ||
| 584 | + map['id']=id; | ||
| 585 | + map['jzyl']=jzyl; | ||
| 586 | + map['sh']=sh; | ||
| 587 | + map['shyy']=shyy; | ||
| 588 | + map['ns']=ns; | ||
| 589 | + map['rylx']=rylx; | ||
| 590 | + ylArray.push(map); | ||
| 591 | + } | ||
| 592 | + | ||
| 593 | + }) ; | ||
| 594 | + if(msg!=""){ | ||
| 595 | + layer.msg('内部编码为:【'+msg +'】的车辆请选择一条数据进行拆分.'); | ||
| 596 | + }else{ | ||
| 597 | + var params = {}; | ||
| 598 | + params['ylbList']=JSON.stringify(ylArray); | ||
| 599 | + var i = layer.load(2); | ||
| 600 | + $post('/ylb/sort', params, function () { | ||
| 601 | + layer.close(i); | ||
| 602 | + var params1 =getParamsList(); | ||
| 603 | + jsDoQuery(params1, true); | ||
| 604 | + }); | ||
| 605 | + | ||
| 606 | + } | ||
| 607 | + | ||
| 608 | + } else { | ||
| 609 | + layer.msg('请选择日期.'); | ||
| 610 | + } | ||
| 611 | + }) */ | ||
| 612 | + //获取加存信息 | ||
| 613 | + $("#obtain").on('click', function () { | ||
| 614 | + //console.log("获取加存"); | ||
| 615 | + if ($("#rq").val() != "") { | ||
| 616 | + var params=getParamsList(); | ||
| 617 | + $get('/ylb/checkDate',params,function(status){ | ||
| 618 | + if(status=='2'){ | ||
| 619 | + layer.msg('只能操作三天内数据.'); | ||
| 620 | + }else{ | ||
| 621 | + var i = layer.load(2); | ||
| 622 | + $get('/ylb/obtain', params, function () { | ||
| 623 | + layer.close(i); | ||
| 624 | + jsDoQuery(params, true); | ||
| 625 | + }); | ||
| 626 | + } | ||
| 627 | + }) | ||
| 628 | + } else { | ||
| 629 | + layer.msg('请选择日期.'); | ||
| 630 | + } | ||
| 631 | + | ||
| 632 | + }) | ||
| 633 | + $("#rq").datetimepicker({ | ||
| 634 | + format: 'YYYY-MM-DD', | ||
| 635 | + locale: 'zh-cn' | ||
| 636 | + }); | ||
| 637 | + | ||
| 638 | + var page = 0, initPagination; | ||
| 639 | + var icheckOptions = { | ||
| 640 | + radioClass: 'icheckbox_flat-blue', | ||
| 641 | + increaseArea: '20%' | ||
| 642 | + } | ||
| 643 | + | ||
| 644 | + //重置 | ||
| 645 | + $('tr.filter2 .filter-cancel').on('click', function () { | ||
| 646 | + $('tr.filter2 , #nbbm').val('').change(); | ||
| 647 | + }); | ||
| 648 | + | ||
| 649 | + //提交 | ||
| 650 | + $('tr.filter .filter-submit').on('click', function () { | ||
| 651 | + var ylbGsdm=$("#ylbListGsdmId").val(); | ||
| 652 | + var ylbFgsdm=$("#ylbListFgsdmId").val(); | ||
| 653 | + if ($("#rq").val() == "" || $("#rq").val() ==null){ | ||
| 654 | + layer.msg('请选择日期.'); | ||
| 655 | + }else if(ylbGsdm=="" || ylbGsdm==null || ylbFgsdm=="" ||ylbFgsdm==null){ | ||
| 656 | + layer.msg('请选择公司和分公司.'); | ||
| 657 | + }else { | ||
| 658 | + var params = getParamsList(); | ||
| 659 | + page = 0; | ||
| 660 | + jsDoQuery(params, true); | ||
| 661 | + } | ||
| 662 | + }); | ||
| 663 | + | ||
| 664 | + | ||
| 665 | + var xlList; | ||
| 666 | + var obj=[]; | ||
| 667 | + $.get('/report/lineList',function(result){ | ||
| 668 | + xlList=result; | ||
| 669 | + $.get('/user/companyData', function(result){ | ||
| 670 | + obj = result; | ||
| 671 | + var options=""; | ||
| 672 | + for(var i = 0; i < obj.length; i++){ | ||
| 673 | + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; | ||
| 674 | + } | ||
| 675 | + $('#ylbListGsdmId').html(options); | ||
| 676 | + updateCompany(); | ||
| 677 | + }); | ||
| 678 | + }) | ||
| 679 | + $("#ylbListGsdmId").on("change",updateCompany); | ||
| 680 | + function updateCompany(){ | ||
| 681 | + var company = $('#ylbListGsdmId').val(); | ||
| 682 | + var options =""; | ||
| 683 | + for(var i = 0; i < obj.length; i++){ | ||
| 684 | + if(obj[i].companyCode == company){ | ||
| 685 | + var children = obj[i].children; | ||
| 686 | + for(var j = 0; j < children.length; j++){ | ||
| 687 | + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>'; | ||
| 688 | + } | ||
| 689 | + } | ||
| 690 | + } | ||
| 691 | + $('#ylbListFgsdmId').html(options); | ||
| 692 | + initXl(); | ||
| 693 | + initCl(); | ||
| 694 | + } | ||
| 695 | + /* | ||
| 696 | + * 获取数据 p: 要提交的参数, pagination: 是否重新分页 | ||
| 697 | + */ | ||
| 698 | + var moveArray=new Array(); //存放文本框数组 | ||
| 699 | + function jsDoQuery(p, pagination) { | ||
| 700 | + var params = {}; | ||
| 701 | + if (p) | ||
| 702 | + params = p; | ||
| 703 | + //更新时间排序 | ||
| 704 | + params['order'] = 'nbbm'; | ||
| 705 | + params['page'] = page; | ||
| 706 | + params['rq'] = $("#rq").val(); | ||
| 707 | + | ||
| 708 | + var l = layer.load(2); | ||
| 709 | + $get('/ylb/ylbList', params, function (data) { | ||
| 710 | + for(var i=1;i<data.length;i++){ | ||
| 711 | + moveArray[i]=new Array(); | ||
| 712 | + for(var j=1;j<6;j++){ | ||
| 713 | + moveArray[i][j]=i+"_"+j; | ||
| 714 | + } | ||
| 715 | + } | ||
| 716 | + $.each(data, function (i, obj) { | ||
| 717 | + obj.rq = moment(obj.rq).format("YYYY-MM-DD"); | ||
| 718 | + }); | ||
| 719 | + var bodyHtm = template('ylb_list_temp', {list:data}); | ||
| 720 | + | ||
| 721 | + $('#datatable_ylb_body tbody').html(bodyHtm); | ||
| 722 | + $('.btn-jsyUpdate').on('click', jsyUpdate); | ||
| 723 | + $('.yl_sxzy').on('mouseup', yhSxzy); | ||
| 724 | + layer.close(l); | ||
| 725 | + $get('/ylb/sumYlb',params,function(returns){ | ||
| 726 | + $("#sumJzl").html(returns.jzl); | ||
| 727 | + $("#sumYh").html(returns.yh); | ||
| 728 | + $("#sumSh").html(returns.sh); | ||
| 729 | + }); | ||
| 730 | + $('input').on('input propertychange',function(){ | ||
| 731 | + var id=$(this).data('id'); | ||
| 732 | + var jzl =$('.in_carpark_jzl[data-id='+id+']', '#ll_oil_list').html(); | ||
| 733 | + if(jzl=="" || jzl ==null){ | ||
| 734 | + jzl=0; | ||
| 735 | + } | ||
| 736 | + var czyl=$('.in_carpark_czyl[data-id='+id+']', '#ll_oil_list').val(); | ||
| 737 | + if(czyl=="" || czyl==null){ | ||
| 738 | + czyl=0; | ||
| 739 | + } | ||
| 740 | + var jzyl=$('.in_carpark_jzyl[data-id='+id+']', '#ll_oil_list').val(); | ||
| 741 | + if(jzyl=="" || jzyl==null){ | ||
| 742 | + jzyl=0; | ||
| 743 | + } | ||
| 744 | + | ||
| 745 | + var sh = $('.in_carpark_shyl[data-id='+id+']', '#ll_oil_list').val(); | ||
| 746 | + if(sh=="" || sh==null){ | ||
| 747 | + sh=0; | ||
| 748 | + } | ||
| 749 | + var addNum=accAdd(jzl,czyl); | ||
| 750 | + var subNum=jzyl; | ||
| 751 | + var sub=numSubtr(addNum*1000,subNum*1000); | ||
| 752 | + var subValue=0; | ||
| 753 | + if(sub/1000>=0){ | ||
| 754 | + subValue=sub/1000; | ||
| 755 | + } | ||
| 756 | + $('.in_carpark_yh[data-id='+id+']', '#ll_oil_list').val(subValue); | ||
| 757 | + | ||
| 758 | + }); | ||
| 759 | + $('#datatable_ylb_body_div').animate({scrollTop: '0px'}, 800); | ||
| 760 | + }); | ||
| 761 | + } | ||
| 762 | + | ||
| 763 | + | ||
| 764 | + function jsyUpdate(){ | ||
| 765 | + var params=getParamsList(); | ||
| 766 | + $get('/ylb/checkDate',params,function(status){ | ||
| 767 | + var id = $(this).data('id'); | ||
| 768 | + if(status=='2'){ | ||
| 769 | + layer.msg('只能操作三天内数据.'); | ||
| 770 | + }else{ | ||
| 771 | + var jsy=$('.in_carpark_jsy[data-id='+id+']', '#ll_oil_list').val(); | ||
| 772 | + $get('/ylb/updateJsy',{id:id,jsy:jsy}, function(result){ | ||
| 773 | + layer.msg('修改成功.'); | ||
| 774 | + page = 0; | ||
| 775 | + jsDoQuery(params, true); | ||
| 776 | + }); | ||
| 777 | + } | ||
| 778 | + }) | ||
| 779 | + | ||
| 780 | + } | ||
| 781 | + //页面计算防止精度丢失 | ||
| 782 | + var accAdd = function (a, b) { | ||
| 783 | + var c, d, e; | ||
| 784 | + try { | ||
| 785 | + c = a.toString().split(".")[1].length; | ||
| 786 | + } catch (f) { | ||
| 787 | + c = 0; | ||
| 788 | + } | ||
| 789 | + try { | ||
| 790 | + d = b.toString().split(".")[1].length; | ||
| 791 | + } catch (f) { | ||
| 792 | + d = 0; | ||
| 793 | + } | ||
| 794 | + return e = Math.pow(10, Math.max(c, d)), (mul(a, e) + mul(b, e)) / e; | ||
| 795 | + }; | ||
| 796 | + | ||
| 797 | + var numSubtr = function (a, b) { | ||
| 798 | + var c, d, e; | ||
| 799 | + try { | ||
| 800 | + c = a.toString().split(".")[1].length; | ||
| 801 | + } catch (f) { | ||
| 802 | + c = 0; | ||
| 803 | + } | ||
| 804 | + try { | ||
| 805 | + d = b.toString().split(".")[1].length; | ||
| 806 | + } catch (f) { | ||
| 807 | + d = 0; | ||
| 808 | + } | ||
| 809 | + return e = Math.pow(10, Math.max(c, d)), (a * e - b * e) / e; | ||
| 810 | + }; | ||
| 811 | + | ||
| 812 | + function mul(a, b) { | ||
| 813 | + var c = 0, | ||
| 814 | + d = a.toString(), | ||
| 815 | + e = b.toString(); | ||
| 816 | + try { | ||
| 817 | + c += d.split(".")[1].length; | ||
| 818 | + } catch (f) { | ||
| 819 | + } | ||
| 820 | + try { | ||
| 821 | + c += e.split(".")[1].length; | ||
| 822 | + } catch (f) { | ||
| 823 | + } | ||
| 824 | + return Number(d.replace(".", "")) * Number(e.replace(".", "")) / Math.pow(10, c); | ||
| 825 | + } | ||
| 826 | + //改变状态 | ||
| 827 | + function startOptJzylLink(es) { | ||
| 828 | + es.editable({ | ||
| 829 | + type: 'text', | ||
| 830 | + placement: 'right', | ||
| 831 | + width: 100, | ||
| 832 | + display: false, | ||
| 833 | + validate: function (value) { | ||
| 834 | + if (!value) | ||
| 835 | + return '值不能为空!'; | ||
| 836 | + if (isNaN(value)) | ||
| 837 | + return '只能为数字!'; | ||
| 838 | + if (value < 0) | ||
| 839 | + return '值不能小于0!'; | ||
| 840 | + }, | ||
| 841 | + inputclass: 'form-control input-medium input-edtable-sm' | ||
| 842 | + }) | ||
| 843 | + .on('save', function (e, params) { | ||
| 844 | + $(this).text(params.newValue); | ||
| 845 | + }); | ||
| 846 | + } | ||
| 847 | + | ||
| 848 | + //改变状态 | ||
| 849 | + function startOptShylLink(es) { | ||
| 850 | + es.editable({ | ||
| 851 | + type: 'text', | ||
| 852 | + placement: 'right', | ||
| 853 | + width: 100, | ||
| 854 | + display: false, | ||
| 855 | + validate: function (value) { | ||
| 856 | + if (!value) | ||
| 857 | + return '值不能为空!'; | ||
| 858 | + if (isNaN(value)) | ||
| 859 | + return '只能为数字!'; | ||
| 860 | + if (value < 0) | ||
| 861 | + return '值不能小于0!'; | ||
| 862 | + }, | ||
| 863 | + inputclass: 'form-control input-medium input-edtable-sm' | ||
| 864 | + }) | ||
| 865 | + .on('save', function (e, params) { | ||
| 866 | + $(this).text(params.newValue); | ||
| 867 | + }); | ||
| 868 | + } | ||
| 869 | + function iCheckChange() { | ||
| 870 | + var tr = $(this).parents('tr'); | ||
| 871 | + if (this.checked) | ||
| 872 | + tr.addClass('row-active'); | ||
| 873 | + else | ||
| 874 | + tr.removeClass('row-active'); | ||
| 875 | + } | ||
| 876 | + | ||
| 877 | + function showPagination(data) { | ||
| 878 | + //分页 | ||
| 879 | + $('#pagination').jqPaginator({ | ||
| 880 | + totalPages: data.totalPages, | ||
| 881 | + visiblePages: 6, | ||
| 882 | + currentPage: page + 1, | ||
| 883 | + first: '<li class="first"><a href="javascript:void(0);">首页<\/a><\/li>', | ||
| 884 | + prev: '<li class="prev"><a href="javascript:void(0);">上一页<\/a><\/li>', | ||
| 885 | + next: '<li class="next"><a href="javascript:void(0);">下一页<\/a><\/li>', | ||
| 886 | + last: '<li class="last"><a href="javascript:void(0);">尾页<\/a><\/li>', | ||
| 887 | + page: '<li class="page"><a href="javascript:void(0);">{{page}}<\/a><\/li>', | ||
| 888 | + onPageChange: function (num, type) { | ||
| 889 | + if (initPagination) { | ||
| 890 | + initPagination = false; | ||
| 891 | + return; | ||
| 892 | + } | ||
| 893 | + | ||
| 894 | + var params=getParamsList(); | ||
| 895 | + page = num - 1; | ||
| 896 | + jsDoQuery(params, true); | ||
| 897 | + } | ||
| 898 | + }); | ||
| 899 | + } | ||
| 900 | + | ||
| 901 | + //删除 | ||
| 902 | + $('.removeButton').on('click', function () { | ||
| 903 | + var params_=getParamsList(); | ||
| 904 | + $get('/ylb/checkDate',params_,function(status){ | ||
| 905 | + if(status=='2'){ | ||
| 906 | + layer.msg('只能操作三天内数据.'); | ||
| 907 | + }else{ | ||
| 908 | + var idArray = []; | ||
| 909 | + var x=0; | ||
| 910 | + $('input.icheck:checked').each(function(){ | ||
| 911 | + x++; | ||
| 912 | + var map ={}; | ||
| 913 | + var id=$(this).data('id'); | ||
| 914 | + map['id']=id; | ||
| 915 | + idArray.push(map); | ||
| 916 | + | ||
| 917 | + }) | ||
| 918 | + var params = {}; | ||
| 919 | + params['ids']=JSON.stringify(idArray); | ||
| 920 | + if (x==0) { | ||
| 921 | + layer.msg("请选择要删除的数据"); | ||
| 922 | + }else{ | ||
| 923 | + if(confirm('确定要删除选中的数据?')) | ||
| 924 | + { | ||
| 925 | + var i = layer.load(2); | ||
| 926 | + $post('/ylb/deleteIds', params, function (result) { | ||
| 927 | + layer.close(i); | ||
| 928 | + var params=getParamsList(); | ||
| 929 | + jsDoQuery(params, true); | ||
| 930 | + }); | ||
| 931 | + } | ||
| 932 | + } | ||
| 933 | + } | ||
| 934 | + }) | ||
| 935 | + }); | ||
| 936 | + | ||
| 937 | + $("#ylbListFgsdmId").on("change",initXl); | ||
| 938 | + function initXl(){ | ||
| 939 | + var data=[]; | ||
| 940 | + data.push({id: " ", text: "全部线路"}); | ||
| 941 | + if(fage){ | ||
| 942 | + $("#xlbm").select2("destroy").html(''); | ||
| 943 | + } | ||
| 944 | + var fgs=$('#ylbListFgsdmId').val(); | ||
| 945 | + var gs=$('#ylbListGsdmId').val(); | ||
| 946 | + for(var i=0;i<xlList.length;i++){ | ||
| 947 | + if(gs!=""){ | ||
| 948 | + if(fgs!=""){ | ||
| 949 | + if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){ | ||
| 950 | + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]}); | ||
| 951 | + } | ||
| 952 | + }else{ | ||
| 953 | + if(xlList[i]["gsbm"]==gs){ | ||
| 954 | + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]}); | ||
| 955 | + } | ||
| 956 | + } | ||
| 957 | + } | ||
| 958 | + } | ||
| 959 | + initPinYinSelect2('#xlbm',data,''); | ||
| 960 | + fage=true; | ||
| 961 | + } | ||
| 962 | + | ||
| 963 | + $("#xlbm").on("change",initCl); | ||
| 964 | + function initCl(){ | ||
| 965 | + $('#nbbm').select2({ | ||
| 966 | + placeholder: '搜索车辆...', | ||
| 967 | + ajax: { | ||
| 968 | + url: '/report/carList', | ||
| 969 | + dataType: 'json', | ||
| 970 | + delay: 150, | ||
| 971 | + data: function (params) { | ||
| 972 | + return {nbbm: params.term, | ||
| 973 | + gsbm:$('#ylbListGsdmId').val(), | ||
| 974 | + fgsbm:$('#ylbListFgsdmId').val(), | ||
| 975 | + xlbm:$('#xlbm').val()}; | ||
| 976 | + }, | ||
| 977 | + processResults: function (data) { | ||
| 978 | + return { | ||
| 979 | + results: data | ||
| 980 | + }; | ||
| 981 | + }, | ||
| 982 | + cache: true | ||
| 983 | + }, | ||
| 984 | + templateResult: function (repo) { | ||
| 985 | + if (repo.loading) return repo.text; | ||
| 986 | + var h = '<span>' + repo.text + '</span>'; | ||
| 987 | + h += (repo.lineName ? ' <span class="select2-desc">' + repo.lineName + '</span>' : ''); | ||
| 988 | + return h; | ||
| 989 | + }, | ||
| 990 | + escapeMarkup: function (markup) { | ||
| 991 | + return markup; | ||
| 992 | + }, | ||
| 993 | + minimumInputLength: 1, | ||
| 994 | + templateSelection: function (repo) { | ||
| 995 | + return repo.text; | ||
| 996 | + }, | ||
| 997 | + language: { | ||
| 998 | + noResults: function () { | ||
| 999 | + return '<span style="color:red;font-size: 12px;">没有搜索到车辆!</span>'; | ||
| 1000 | + }, | ||
| 1001 | + inputTooShort: function (e) { | ||
| 1002 | + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入自编号搜索车辆</span>'; | ||
| 1003 | + }, | ||
| 1004 | + searching: function () { | ||
| 1005 | + return '<span style="color:gray;font-size: 12px;"> 正在搜索车辆...</span>'; | ||
| 1006 | + } | ||
| 1007 | + } | ||
| 1008 | + }); | ||
| 1009 | + | ||
| 1010 | + } | ||
| 1011 | +// } | ||
| 1012 | + | ||
| 1013 | + $("#cxtj").on("click", function () { | ||
| 1014 | + if ($("#rq").val() != "") { | ||
| 1015 | +// var params=getParamsList(); | ||
| 1016 | + $post('/ylb/updateHistory', {date:'2017-11-07',line:'10708',gsdm:'26',fgsdm:'1'}, function (result) { | ||
| 1017 | + window.open("/downloadFile/download?fileName="+$("#rq").val()+"进出场存油量" ); | ||
| 1018 | + }); | ||
| 1019 | + } else { | ||
| 1020 | + layer.msg('请选择日期.'); | ||
| 1021 | + } | ||
| 1022 | + }); | ||
| 1023 | + | ||
| 1024 | +//导出 | ||
| 1025 | + | ||
| 1026 | + $("#export").on("click", function () { | ||
| 1027 | + if ($("#rq").val() != "") { | ||
| 1028 | + var params=getParamsList(); | ||
| 1029 | + $post('/ylb/listExport', params, function (result) { | ||
| 1030 | + window.open("/downloadFile/download?fileName="+$("#rq").val()+"进出场存油量" ); | ||
| 1031 | + }); | ||
| 1032 | + } else { | ||
| 1033 | + layer.msg('请选择日期.'); | ||
| 1034 | + } | ||
| 1035 | + }); | ||
| 1036 | + | ||
| 1037 | + function checkDate(){ | ||
| 1038 | + var params=getParamsList(); | ||
| 1039 | + | ||
| 1040 | + } | ||
| 1041 | + | ||
| 1042 | + function getParamsList(){ | ||
| 1043 | + var cells = $('tr.filter')[0].cells | ||
| 1044 | + , cells1 = $('tr.filter2')[0].cells,params = {} | ||
| 1045 | + , name; | ||
| 1046 | + $.each(cells, function (i, cell) { | ||
| 1047 | + var items = $('input,select', cell); | ||
| 1048 | + for (var j = 0, item; item = items[j++];) { | ||
| 1049 | + name = $(item).attr('name'); | ||
| 1050 | + if (name) { | ||
| 1051 | + params[name] = $(item).val(); | ||
| 1052 | + } | ||
| 1053 | + } | ||
| 1054 | + }); | ||
| 1055 | + $.each(cells1, function (i, cell) { | ||
| 1056 | + var items = $('input,select', cell); | ||
| 1057 | + for (var j = 0, item; item = items[j++];) { | ||
| 1058 | + name = $(item).attr('name'); | ||
| 1059 | + if (name) { | ||
| 1060 | + params[name] = $(item).val(); | ||
| 1061 | + } | ||
| 1062 | + } | ||
| 1063 | + }); | ||
| 1064 | + | ||
| 1065 | + return params; | ||
| 1066 | + } | ||
| 1067 | + | ||
| 1068 | + //表格滚动条 | ||
| 1069 | + var modal='#ylbtable'; | ||
| 1070 | + //$('#datatable_ylb_body_div', modal).perfectScrollbar({suppressScrollX: true}); | ||
| 1071 | + | ||
| 1072 | + //全选 全不选 | ||
| 1073 | + $("#selectAll").on("click", function () { | ||
| 1074 | + if ($(this).is(":checked")) { | ||
| 1075 | + $("[name=id]:checkbox").prop("checked", true); | ||
| 1076 | +// $("input[name='id']").attr('checked', true) | ||
| 1077 | + } else { | ||
| 1078 | + $("[name=id]:checkbox").prop("checked", false); | ||
| 1079 | +// $("input[name='id']").attr('checked', false); | ||
| 1080 | + } | ||
| 1081 | + }); | ||
| 1082 | + | ||
| 1083 | + | ||
| 1084 | + //键盘上下左右移动 | ||
| 1085 | + var mouseInfo={}; //存放鼠标的当前位置 | ||
| 1086 | + function yhSxzy(){ | ||
| 1087 | + tdid=$(this).attr('id'); | ||
| 1088 | + var rc=tdid.split("_"); | ||
| 1089 | + mouseInfo["row"]=rc[0]; | ||
| 1090 | + mouseInfo["col"]=rc[1]; | ||
| 1091 | + } | ||
| 1092 | + | ||
| 1093 | + document.body.onkeydown=function(e){ //监听鼠标操作 | ||
| 1094 | + e=window.event||e; | ||
| 1095 | + switch(e.keyCode){ | ||
| 1096 | + case 37: //左键 | ||
| 1097 | + moveLeft(); | ||
| 1098 | + break; | ||
| 1099 | + case 38: //向上键 | ||
| 1100 | + moveUp(); | ||
| 1101 | + break; | ||
| 1102 | + case 39: //右键 | ||
| 1103 | + moveRight(); | ||
| 1104 | + break; | ||
| 1105 | + case 40: //向下键 | ||
| 1106 | + moveDown(); | ||
| 1107 | + break; | ||
| 1108 | + default: | ||
| 1109 | + break; | ||
| 1110 | + } | ||
| 1111 | + } | ||
| 1112 | + | ||
| 1113 | + function moveLeft(){ | ||
| 1114 | + var row=mouseInfo["row"]; | ||
| 1115 | + var col=mouseInfo["col"]; | ||
| 1116 | + | ||
| 1117 | + var key=moveArray[row][col-1]; | ||
| 1118 | + if(document.getElementById(key)!=undefined) | ||
| 1119 | + { | ||
| 1120 | + var textFiled=document.getElementById(key); | ||
| 1121 | + textFiled.focus(false, 1000); | ||
| 1122 | + textFiled.select(); | ||
| 1123 | + mouseInfo["col"]=parseInt(col)-1; | ||
| 1124 | + } | ||
| 1125 | + | ||
| 1126 | + } | ||
| 1127 | + function moveRight(){ | ||
| 1128 | + var row=mouseInfo["row"]; | ||
| 1129 | + var col=mouseInfo["col"]; | ||
| 1130 | + | ||
| 1131 | + var key=moveArray[row][parseInt(col)+1]; | ||
| 1132 | + if(document.getElementById(key)!=undefined) | ||
| 1133 | + { | ||
| 1134 | + var textFiled=document.getElementById(key); | ||
| 1135 | + textFiled.focus(false, 1000); | ||
| 1136 | + textFiled.select(); | ||
| 1137 | + mouseInfo["col"]=parseInt(col)+1; | ||
| 1138 | + } | ||
| 1139 | + } | ||
| 1140 | + function moveUp(){ | ||
| 1141 | + var row=mouseInfo["row"]; | ||
| 1142 | + var col=mouseInfo["col"]; | ||
| 1143 | + | ||
| 1144 | + var key=moveArray[parseInt(row)-1][col]; | ||
| 1145 | + if(document.getElementById(key)!=undefined) | ||
| 1146 | + { | ||
| 1147 | + var textFiled=document.getElementById(key); | ||
| 1148 | + textFiled.focus(false, 1000); | ||
| 1149 | + textFiled.select(); | ||
| 1150 | + mouseInfo["row"]=parseInt(row)-1; | ||
| 1151 | + } | ||
| 1152 | + } | ||
| 1153 | + function moveDown(){ | ||
| 1154 | + var row=mouseInfo["row"]; | ||
| 1155 | + var col=mouseInfo["col"]; | ||
| 1156 | + var key=moveArray[parseInt(row)+1][col]; | ||
| 1157 | + if(document.getElementById(key)!=undefined) | ||
| 1158 | + { | ||
| 1159 | + var textFiled=document.getElementById(key); | ||
| 1160 | + textFiled.focus(false, 1000); | ||
| 1161 | + textFiled.select(); | ||
| 1162 | + mouseInfo["row"]=parseInt(row)+1; | ||
| 1163 | + } | ||
| 1164 | + } | ||
| 1165 | + | ||
| 1166 | + }); | ||
| 1167 | +</script> |