Commit 2fa299956b82a6e48f2510ef703f0ad9b67630c6
1 parent
1ab75657
list_ph
Showing
1 changed file
with
612 additions
and
0 deletions
src/main/resources/static/pages/oil/list_ph.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="ll_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 | + <a class="btn btn-circle blue" href="add.html" data-pjax><i class="fa fa-plus"></i> 添加</a> | |
| 24 | + <!-- <button type="button" class="btn btn-circle blue" id="removeButton"><i class="fa fa-trash-o"></i> 删除</button> --> | |
| 25 | + <button type="button" class="btn btn-circle blue" id="sortButton"><i class="fa fa-minus-square"></i> | |
| 26 | + 拆分/保存 | |
| 27 | + </button> | |
| 28 | + <!-- <button type="button" class="btn btn-circle red" disabled="disabled" id="removeButton"><i class="fa fa-trash"></i> 删除用户</button> --> | |
| 29 | + <div class="btn-group"> | |
| 30 | + <a class="btn red btn-outline btn-circle" href="javascript:;" | |
| 31 | + data-toggle="dropdown"> <i class="fa fa-share"></i> <span | |
| 32 | + class="hidden-xs"> 系统工具 </span> <i class="fa fa-angle-down"></i> | |
| 33 | + </a> | |
| 34 | + <ul class="dropdown-menu pull-right" id="datatable_ajax_tools"> | |
| 35 | + <li><a href="javascript:;" data-action="0" | |
| 36 | + class="tool-action" id="obtain"> <i class="fa fa-hourglass-half"></i> 获取加/存油信息 | |
| 37 | + </a></li> | |
| 38 | + <li><a href="javascript:;" data-action="1" | |
| 39 | + class="tool-action" id="outAndIn"> <i class="fa fa-pencil"></i> 油耗计算(进场=出场) | |
| 40 | + </a></li> | |
| 41 | + <li><a href="javascript:;" id="checkYl" data-action="3" | |
| 42 | + class="tool-action"> <i class="fa fa-gg-circle"></i> | |
| 43 | + 核对加注量(有加油无里程) | |
| 44 | + </a></li> | |
| 45 | + <li class="divider"></li> | |
| 46 | + <li><a href="javascript:;" data-action="3" | |
| 47 | + class="tool-action" id="export"> <i class="fa fa-file-excel-o"></i> | |
| 48 | + 导出Excel | |
| 49 | + </a></li> | |
| 50 | + </ul> | |
| 51 | + </div> | |
| 52 | + </div> | |
| 53 | + </div> | |
| 54 | + <div class="portlet-body"> | |
| 55 | + <div class="table-container" style="margin-top: 10px"> | |
| 56 | + <table | |
| 57 | + class="table table-striped table-bordered table-hover table-checkable" | |
| 58 | + id="datatable_ylb"> | |
| 59 | + <thead> | |
| 60 | + <tr role="row" class="filter"> | |
| 61 | + <td> 公司:</td> | |
| 62 | + <td colspan="2"> | |
| 63 | + | |
| 64 | + <select class="form-control" name="ssgsdm_like" id="ylbListGsdmId" ></select> | |
| 65 | + | |
| 66 | + </td> | |
| 67 | + <td> | |
| 68 | + 分公司: | |
| 69 | + </td> | |
| 70 | + <td colspan="2"> | |
| 71 | + | |
| 72 | + <select class="form-control" name="fgsdm_like" id="ylbListFgsdmId" ></select> | |
| 73 | + </td> | |
| 74 | + | |
| 75 | + <td> | |
| 76 | + 日期: | |
| 77 | + </td> | |
| 78 | + <td> | |
| 79 | + <input type="text" style="width: 80px" name="rq" id="rq"/> | |
| 80 | + </td> | |
| 81 | + <td > | |
| 82 | + 线路: | |
| 83 | + </td> | |
| 84 | + <td colspan="3"> | |
| 85 | + <select class="form-control" name="xlbm_eq" id="xlbm" style="width: 120px;"></select> | |
| 86 | + | |
| 87 | + </td> | |
| 88 | + <td > | |
| 89 | + 内部编码: | |
| 90 | + </td> | |
| 91 | + <td colspan="3"> | |
| 92 | + <select class="form-control" name="nbbm_eq" id="nbbm" style="width: 120px;"></select> | |
| 93 | + </td> | |
| 94 | + <td colspan="4"> | |
| 95 | + <button class="btn btn-sm green btn-outline filter-submit margin-bottom" style="margin-right:0px"> | |
| 96 | + <i class="fa fa-search"></i> 搜索 | |
| 97 | + </button> | |
| 98 | + | |
| 99 | + <button class="btn btn-sm red btn-outline filter-cancel" style="margin-right:0px"> | |
| 100 | + <i class="fa fa-times"></i> 重置 | |
| 101 | + </button> | |
| 102 | + | |
| 103 | + </td> | |
| 104 | + </tr> | |
| 105 | + <tr role="row" class="heading"> | |
| 106 | + <th width="2%">#</th> | |
| 107 | + <th width="8%">日期</th> | |
| 108 | + <th width="5%">公司</th> | |
| 109 | + <th width="8%">线路</th> | |
| 110 | + <th width="5%">自编号</th> | |
| 111 | + <th width="6%">驾驶员</th> | |
| 112 | + <th width="4%">加油量</th> | |
| 113 | + <th width="5%">出场公里</th> | |
| 114 | + <th width="4%">进场公里</th> | |
| 115 | + <th width="4%">出场存油</th> | |
| 116 | + <th width="4%">进场存油</th> | |
| 117 | + <th width="5%">油耗</th> | |
| 118 | + <th width="5%">燃油类型</th> | |
| 119 | + <th width="4%">尿素</th> | |
| 120 | + <th width="5%">耗损原因</th> | |
| 121 | + <th width="5%">耗损油量</th> | |
| 122 | + <th width="5%">当日总里程</th> | |
| 123 | + <th width="5%">数据类型</th> | |
| 124 | + <th width="5%">百公里油耗</th> | |
| 125 | + <!-- <th width="5%">操作</th> --> | |
| 126 | + </tr> | |
| 127 | + </thead> | |
| 128 | + <tbody></tbody> | |
| 129 | + </table> | |
| 130 | + <div style="text-align: right;"> | |
| 131 | + <ul id="pagination" class="pagination"></ul> | |
| 132 | + </div> | |
| 133 | + </div> | |
| 134 | + </div> | |
| 135 | + </div> | |
| 136 | + </div> | |
| 137 | +</div> | |
| 138 | + | |
| 139 | +<script id="ylb_list_temp" type="text/html"> | |
| 140 | + {{each list as obj i}} | |
| 141 | + <tr> | |
| 142 | + <td style="vertical-align: middle;"> | |
| 143 | + <input type="radio" name="id" class="group-checkable icheck" data-id="{{obj.id}}"> | |
| 144 | + </td> | |
| 145 | + | |
| 146 | + <td> | |
| 147 | + {{obj.rq}} | |
| 148 | + </td> | |
| 149 | + <td> | |
| 150 | + {{obj.gsname}} | |
| 151 | + </td> | |
| 152 | + <td> | |
| 153 | + {{obj.xlname}} | |
| 154 | + </td> | |
| 155 | + <td> | |
| 156 | + {{obj.nbbm}} | |
| 157 | + </td> | |
| 158 | + <td> | |
| 159 | + {{obj.jsy}} | |
| 160 | + </td> | |
| 161 | + <td> | |
| 162 | + {{obj.jzl}} | |
| 163 | + </td> | |
| 164 | + <td> | |
| 165 | + {{obj.czlc}} | |
| 166 | + </td> | |
| 167 | + <td> | |
| 168 | + {{obj.jzlc}} | |
| 169 | + </td> | |
| 170 | + <td> | |
| 171 | + {{obj.czyl}} | |
| 172 | + </td> | |
| 173 | + <td> | |
| 174 | + <a data-id="{{obj.id}}" href="javascript:;" class="in_carpark_jzyl"> | |
| 175 | + {{obj.jzyl}} | |
| 176 | + </a> | |
| 177 | + </td> | |
| 178 | + <td> | |
| 179 | + {{obj.yh}} | |
| 180 | + </td> | |
| 181 | + <td> | |
| 182 | + {{obj.rylx}} | |
| 183 | + </td> | |
| 184 | + <td> | |
| 185 | + {{obj.ns}} | |
| 186 | + </td> | |
| 187 | + <td> | |
| 188 | + {{obj.shyy}} | |
| 189 | + </td> | |
| 190 | + <td> | |
| 191 | + {{obj.sh}} | |
| 192 | + </td> | |
| 193 | + <td> | |
| 194 | + {{obj.zlc}} | |
| 195 | + </td> | |
| 196 | + <td> | |
| 197 | + {{obj.yhlx}} | |
| 198 | + </td> | |
| 199 | + <td> | |
| 200 | + {{obj.bglyh}} | |
| 201 | + </td> | |
| 202 | + <td> | |
| 203 | + <!--<a class="btn btn-sm blue btn-outline" href="edit.html?no={{obj.id}}" data-pjax><i class="fa fa-edit"></i> 编辑</a>--> | |
| 204 | + </td> | |
| 205 | + </tr> | |
| 206 | + {{/each}} | |
| 207 | + {{if list.length == 0}} | |
| 208 | + <tr> | |
| 209 | + <td colspan=20><h6 class="muted">没有找到相关数据</h6></td> | |
| 210 | + </tr> | |
| 211 | + {{/if}} | |
| 212 | +</script> | |
| 213 | + | |
| 214 | +<script> | |
| 215 | + $(function () { | |
| 216 | + //var id = 15; | |
| 217 | + //$('.in_carpark_jzyl[data-id='+id+']', '#ll_oil_list') | |
| 218 | + | |
| 219 | + $("#checkYl").on('click', function () { | |
| 220 | + console.log("核对加注量"); | |
| 221 | + if ($("#rq").val() != "") { | |
| 222 | + var cells = $('tr.filter')[0].cells | |
| 223 | + , params = {} | |
| 224 | + , name; | |
| 225 | + $.each(cells, function (i, cell) { | |
| 226 | + var items = $('input,select', cell); | |
| 227 | + for (var j = 0, item; item = items[j++];) { | |
| 228 | + name = $(item).attr('name'); | |
| 229 | + if (name) { | |
| 230 | + params[name] = $(item).val(); | |
| 231 | + } | |
| 232 | + } | |
| 233 | + }); | |
| 234 | + $get('/ylb/checkYl', params, function () { | |
| 235 | + jsDoQuery(null, true); | |
| 236 | + }); | |
| 237 | + } else { | |
| 238 | + layer.msg('请选择日期.'); | |
| 239 | + } | |
| 240 | + }) | |
| 241 | + | |
| 242 | + //进场等于出场 | |
| 243 | + $("#outAndIn").on('click', function () { | |
| 244 | + console.log("进场油量等于出场油量"); | |
| 245 | + if ($("#rq").val() != "") { | |
| 246 | + var cells = $('tr.filter')[0].cells | |
| 247 | + , params = {} | |
| 248 | + , name; | |
| 249 | + $.each(cells, function (i, cell) { | |
| 250 | + var items = $('input,select', cell); | |
| 251 | + for (var j = 0, item; item = items[j++];) { | |
| 252 | + name = $(item).attr('name'); | |
| 253 | + if (name) { | |
| 254 | + params[name] = $(item).val(); | |
| 255 | + } | |
| 256 | + } | |
| 257 | + }); | |
| 258 | + $get('/ylb/outAndIn', params, function () { | |
| 259 | + jsDoQuery(null, true); | |
| 260 | + }); | |
| 261 | + } else { | |
| 262 | + layer.msg('请选择日期.'); | |
| 263 | + } | |
| 264 | + }) | |
| 265 | + //拆分 | |
| 266 | + $("#sortButton").on('click', function () { | |
| 267 | + if ($("#rq").val() != "") { | |
| 268 | + var id = $('input.icheck:checked').data('id'); | |
| 269 | + | |
| 270 | + if (typeof(id) == 'undefined') { | |
| 271 | + layer.msg("请选择一行进行拆分"); | |
| 272 | + } else { | |
| 273 | + //获取输入的进场存油 | |
| 274 | + var jzyl = $('.in_carpark_jzyl[data-id='+id+']', '#ll_oil_list').html(); | |
| 275 | + // $("#jzyl" + id).html(); | |
| 276 | + console.log(jzyl); | |
| 277 | + var params = {}; | |
| 278 | + params['jzyl'] = jzyl; | |
| 279 | + params['id'] = id; | |
| 280 | + $get('/ylb/sort', params, function () { | |
| 281 | + jsDoQuery(null, true); | |
| 282 | + }); | |
| 283 | + | |
| 284 | + } | |
| 285 | + } else { | |
| 286 | + layer.msg('请选择日期.'); | |
| 287 | + } | |
| 288 | + }) | |
| 289 | + //获取加存信息 | |
| 290 | + $("#obtain").on('click', function () { | |
| 291 | + console.log("获取加存"); | |
| 292 | + if ($("#rq").val() != "") { | |
| 293 | + var cells = $('tr.filter')[0].cells | |
| 294 | + , params = {} | |
| 295 | + , name; | |
| 296 | + $.each(cells, function (i, cell) { | |
| 297 | + var items = $('input,select', cell); | |
| 298 | + for (var j = 0, item; item = items[j++];) { | |
| 299 | + name = $(item).attr('name'); | |
| 300 | + if (name) { | |
| 301 | + params[name] = $(item).val(); | |
| 302 | + } | |
| 303 | + } | |
| 304 | + }); | |
| 305 | + $get('/ylb/obtain', params, function () { | |
| 306 | + jsDoQuery(params, true); | |
| 307 | + }); | |
| 308 | + } else { | |
| 309 | + layer.msg('请选择日期.'); | |
| 310 | + } | |
| 311 | + | |
| 312 | + }) | |
| 313 | + $("#rq").datetimepicker({ | |
| 314 | + format: 'YYYY-MM-DD', | |
| 315 | + locale: 'zh-cn' | |
| 316 | + }); | |
| 317 | + | |
| 318 | + var page = 0, initPagination; | |
| 319 | + var icheckOptions = { | |
| 320 | + radioClass: 'iradio_square-blue icheck', | |
| 321 | + increaseArea: '20%' | |
| 322 | + } | |
| 323 | + | |
| 324 | + //重置 | |
| 325 | + $('tr.filter .filter-cancel').on('click', function () { | |
| 326 | + $('tr.filter input, select').val('').change(); | |
| 327 | + }); | |
| 328 | + | |
| 329 | + //提交 | |
| 330 | + $('tr.filter .filter-submit').on('click', function () { | |
| 331 | + var ylbGsdm=$("#ylbListGsdmId").val(); | |
| 332 | + var ylbFgsdm=$("#ylbListFgsdmId").val(); | |
| 333 | + if ($("#rq").val() == "" || $("#rq").val() ==null){ | |
| 334 | + layer.msg('请选择日期.'); | |
| 335 | + }else if(ylbGsdm=="" || ylbGsdm==null || ylbFgsdm=="" ||ylbFgsdm==null){ | |
| 336 | + layer.msg('请选择公司和分公司.'); | |
| 337 | + }else { | |
| 338 | + var cells = $('tr.filter')[0].cells | |
| 339 | + , params = {} | |
| 340 | + , name; | |
| 341 | + $.each(cells, function (i, cell) { | |
| 342 | + var items = $('input,select', cell); | |
| 343 | + for (var j = 0, item; item = items[j++];) { | |
| 344 | + name = $(item).attr('name'); | |
| 345 | + if (name) { | |
| 346 | + params[name] = $(item).val(); | |
| 347 | + } | |
| 348 | + } | |
| 349 | + }); | |
| 350 | + page = 0; | |
| 351 | + jsDoQuery(params, true); | |
| 352 | + } | |
| 353 | + }); | |
| 354 | + | |
| 355 | + | |
| 356 | +// var gsqxdm=""; | |
| 357 | + | |
| 358 | + | |
| 359 | + $.get('/user/companyData', function(result){ | |
| 360 | + obj = result; | |
| 361 | + var options=""; | |
| 362 | +// = '<option value="">请选择</option>'; | |
| 363 | + for(var i = 0; i < obj.length; i++){ | |
| 364 | + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; | |
| 365 | +// setFgsqx(obj[i].companyCode); | |
| 366 | + } | |
| 367 | + $('#ylbListGsdmId').html(options); | |
| 368 | + updateCompany(); | |
| 369 | + }); | |
| 370 | + /* function setFgsqx(gs){ | |
| 371 | + var company =gs | |
| 372 | + var options = ''; | |
| 373 | + for(var i = 0; i < obj.length; i++){ | |
| 374 | + if(obj[i].companyCode == company){ | |
| 375 | + var children = obj[i].children; | |
| 376 | + for(var j = 0; j < children.length; j++){ | |
| 377 | + gsqxdm +=company+""+children[j].code+","; | |
| 378 | + } | |
| 379 | + } | |
| 380 | + } | |
| 381 | + } */ | |
| 382 | + $("#ylbListGsdmId").on("change",updateCompany); | |
| 383 | + function updateCompany(){ | |
| 384 | + var company = $('#ylbListGsdmId').val(); | |
| 385 | + var options =""; | |
| 386 | +// = '<option value="">请选择</option>'; | |
| 387 | + for(var i = 0; i < obj.length; i++){ | |
| 388 | + if(obj[i].companyCode == company){ | |
| 389 | + var children = obj[i].children; | |
| 390 | + for(var j = 0; j < children.length; j++){ | |
| 391 | + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>'; | |
| 392 | + } | |
| 393 | + } | |
| 394 | + } | |
| 395 | + $('#ylbListFgsdmId').html(options); | |
| 396 | + } | |
| 397 | + /* | |
| 398 | + * 获取数据 p: 要提交的参数, pagination: 是否重新分页 | |
| 399 | + */ | |
| 400 | + function jsDoQuery(p, pagination) { | |
| 401 | + var params = {}; | |
| 402 | + if (p) | |
| 403 | + params = p; | |
| 404 | + //更新时间排序 | |
| 405 | + params['order'] = 'nbbm'; | |
| 406 | + params['page'] = page; | |
| 407 | + params['rq'] = $("#rq").val(); | |
| 408 | + | |
| 409 | + /* var ylbGsdm=$("#ylbListGsdmId").val(); | |
| 410 | + var ylbFgsdm=$("#ylbListFgsdmId").val(); | |
| 411 | + if(ylbGsdm==''|| ylbGsdm==null){ | |
| 412 | + params['concat(ssgsdm,fgsdm)_in']=gsqxdm; | |
| 413 | + }else{ | |
| 414 | + if(ylbFgsdm==''||ylbFgsdm==null){ | |
| 415 | + var fgsqx1=''; | |
| 416 | + for(var i = 0; i < obj.length; i++){ | |
| 417 | + if(obj[i].companyCode == ylbGsdm){ | |
| 418 | + var children = obj[i].children; | |
| 419 | + for(var j = 0; j < children.length; j++){ | |
| 420 | + fgsqx1 +=children[j].code+","; | |
| 421 | + } | |
| 422 | + } | |
| 423 | + } | |
| 424 | + params['fgsdm_in']=fgsqx1; | |
| 425 | + } | |
| 426 | + } */ | |
| 427 | + var i = layer.load(2); | |
| 428 | + $get('/ylb', params, function (data) { | |
| 429 | + $.each(data.content, function (i, obj) { | |
| 430 | + obj.rq = moment(obj.rq).format("YYYY-MM-DD"); | |
| 431 | + }); | |
| 432 | + var bodyHtm = template('ylb_list_temp', {list: data.content}); | |
| 433 | + | |
| 434 | + $('#datatable_ylb tbody').html(bodyHtm) | |
| 435 | + .find('.icheck').iCheck(icheckOptions) | |
| 436 | + .on('ifChanged', iCheckChange); | |
| 437 | + if (pagination && data.content.length > 0) { | |
| 438 | + //重新分页 | |
| 439 | + initPagination = true; | |
| 440 | + showPagination(data); | |
| 441 | + } | |
| 442 | + layer.close(i); | |
| 443 | + | |
| 444 | + startOptJzylLink($('#ll_oil_list .in_carpark_jzyl')); | |
| 445 | + }); | |
| 446 | + } | |
| 447 | + | |
| 448 | + //改变状态 | |
| 449 | + function startOptJzylLink(es) { | |
| 450 | + es.editable({ | |
| 451 | + type: 'text', | |
| 452 | + placement: 'right', | |
| 453 | + width: 100, | |
| 454 | + display: false, | |
| 455 | + validate: function (value) { | |
| 456 | + if (!value) | |
| 457 | + return '值不能为空!'; | |
| 458 | + if (isNaN(value)) | |
| 459 | + return '只能为数字!'; | |
| 460 | + if (value < 0) | |
| 461 | + return '值不能小于0!'; | |
| 462 | + }, | |
| 463 | + inputclass: 'form-control input-medium input-edtable-sm' | |
| 464 | + }) | |
| 465 | + .on('save', function (e, params) { | |
| 466 | + $(this).text(params.newValue); | |
| 467 | + }); | |
| 468 | + } | |
| 469 | + | |
| 470 | + function iCheckChange() { | |
| 471 | + var tr = $(this).parents('tr'); | |
| 472 | + if (this.checked) | |
| 473 | + tr.addClass('row-active'); | |
| 474 | + else | |
| 475 | + tr.removeClass('row-active'); | |
| 476 | + | |
| 477 | + /* if($('#datatable_resource input.icheck:checked').length == 1) | |
| 478 | + $('#removeButton').removeAttr('disabled'); | |
| 479 | + else | |
| 480 | + $('#removeButton').attr('disabled', 'disabled'); */ | |
| 481 | + } | |
| 482 | + | |
| 483 | + function showPagination(data) { | |
| 484 | + //分页 | |
| 485 | + $('#pagination').jqPaginator({ | |
| 486 | + totalPages: data.totalPages, | |
| 487 | + visiblePages: 6, | |
| 488 | + currentPage: page + 1, | |
| 489 | + first: '<li class="first"><a href="javascript:void(0);">首页<\/a><\/li>', | |
| 490 | + prev: '<li class="prev"><a href="javascript:void(0);">上一页<\/a><\/li>', | |
| 491 | + next: '<li class="next"><a href="javascript:void(0);">下一页<\/a><\/li>', | |
| 492 | + last: '<li class="last"><a href="javascript:void(0);">尾页<\/a><\/li>', | |
| 493 | + page: '<li class="page"><a href="javascript:void(0);">{{page}}<\/a><\/li>', | |
| 494 | + onPageChange: function (num, type) { | |
| 495 | + if (initPagination) { | |
| 496 | + initPagination = false; | |
| 497 | + return; | |
| 498 | + } | |
| 499 | + | |
| 500 | + var cells = $('tr.filter')[0].cells | |
| 501 | + , params = {} | |
| 502 | + , name; | |
| 503 | + $.each(cells, function (i, cell) { | |
| 504 | + var items = $('input,select', cell); | |
| 505 | + for (var j = 0, item; item = items[j++];) { | |
| 506 | + name = $(item).attr('name'); | |
| 507 | + if (name) { | |
| 508 | + params[name] = $(item).val(); | |
| 509 | + } | |
| 510 | + } | |
| 511 | + }); | |
| 512 | + page = num - 1; | |
| 513 | + jsDoQuery(params, true); | |
| 514 | + } | |
| 515 | + }); | |
| 516 | + } | |
| 517 | + | |
| 518 | + | |
| 519 | + //删除 | |
| 520 | + $('#removeButton').on('click', function () { | |
| 521 | + if ($(this).attr('disabled')) | |
| 522 | + return; | |
| 523 | + | |
| 524 | + var id = $('input.icheck:checked').data('id'); | |
| 525 | + removeConfirm('确定要删除选中的数据?', '/resource/' + id, function () { | |
| 526 | + $('tr.filter .filter-submit').click(); | |
| 527 | + }); | |
| 528 | + }); | |
| 529 | + | |
| 530 | + //搜索线路 | |
| 531 | + $.get('/basic/lineCode2Name',function(result){ | |
| 532 | + var data=[]; | |
| 533 | + | |
| 534 | + for(var code in result){ | |
| 535 | + data.push({id: code, text: result[code]}); | |
| 536 | + } | |
| 537 | + console.log(data); | |
| 538 | + initPinYinSelect2('#xlbm',data,''); | |
| 539 | + | |
| 540 | + }) | |
| 541 | + | |
| 542 | + $('#nbbm').select2({ | |
| 543 | + placeholder: '搜索车辆...', | |
| 544 | + ajax: { | |
| 545 | + url: '/realSchedule/sreachVehic', | |
| 546 | + dataType: 'json', | |
| 547 | + delay: 150, | |
| 548 | + data: function (params) { | |
| 549 | + return {nbbm: params.term}; | |
| 550 | + }, | |
| 551 | + processResults: function (data) { | |
| 552 | + return { | |
| 553 | + results: data | |
| 554 | + }; | |
| 555 | + }, | |
| 556 | + cache: true | |
| 557 | + }, | |
| 558 | + templateResult: function (repo) { | |
| 559 | + if (repo.loading) return repo.text; | |
| 560 | + var h = '<span>' + repo.text + '</span>'; | |
| 561 | + h += (repo.lineName ? ' <span class="select2-desc">' + repo.lineName + '</span>' : ''); | |
| 562 | + return h; | |
| 563 | + }, | |
| 564 | + escapeMarkup: function (markup) { | |
| 565 | + return markup; | |
| 566 | + }, | |
| 567 | + minimumInputLength: 1, | |
| 568 | + templateSelection: function (repo) { | |
| 569 | + return repo.text; | |
| 570 | + }, | |
| 571 | + language: { | |
| 572 | + noResults: function () { | |
| 573 | + return '<span style="color:red;font-size: 12px;">没有搜索到车辆!</span>'; | |
| 574 | + }, | |
| 575 | + inputTooShort: function (e) { | |
| 576 | + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入自编号搜索车辆</span>'; | |
| 577 | + }, | |
| 578 | + searching: function () { | |
| 579 | + return '<span style="color:gray;font-size: 12px;"> 正在搜索车辆...</span>'; | |
| 580 | + } | |
| 581 | + } | |
| 582 | + }) | |
| 583 | + | |
| 584 | + | |
| 585 | +//导出 | |
| 586 | + | |
| 587 | + $("#export").on("click", function () { | |
| 588 | + if ($("#rq").val() != "") { | |
| 589 | + var cells = $('tr.filter')[0].cells | |
| 590 | + , params = {} | |
| 591 | + , name; | |
| 592 | + $.each(cells, function (i, cell) { | |
| 593 | + var items = $('input,select', cell); | |
| 594 | + for (var j = 0, item; item = items[j++];) { | |
| 595 | + name = $(item).attr('name'); | |
| 596 | + if (name) { | |
| 597 | + params[name] = $(item).val(); | |
| 598 | + } | |
| 599 | + } | |
| 600 | + }); | |
| 601 | + console.log(params); | |
| 602 | + $post('/ylb/listExport', params, function (result) { | |
| 603 | + console.log(result); | |
| 604 | + window.open("/downloadFile/download?fileName=进出场存油量" + moment($("#rq").val()).format("YYYYMMDD")); | |
| 605 | + }); | |
| 606 | + } else { | |
| 607 | + layer.msg('请选择日期.'); | |
| 608 | + } | |
| 609 | + }); | |
| 610 | + | |
| 611 | + }); | |
| 612 | +</script> | |
| 0 | 613 | \ No newline at end of file | ... | ... |