Commit 66e42e2a28762bb6123ca12b8af0a2ccab00c006
1 parent
af4467ff
ylb
Showing
2 changed files
with
21 additions
and
49 deletions
src/main/java/com/bsth/service/oil/impl/YlbServiceImpl.java
| ... | ... | @@ -373,7 +373,10 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS |
| 373 | 373 | if(t.getJcsx()==1){ |
| 374 | 374 | Double jcyl=t.getCzyl(); |
| 375 | 375 | zyl=jcyl+jzl-yl; |
| 376 | - Double yh=Double.parseDouble(df.format(zyl*(t.getZlc()/zlc))); | |
| 376 | + Double yh=0.0; | |
| 377 | + if(zlc>0&&t.getZlc()>0){ | |
| 378 | + yh=Double.parseDouble(df.format(zyl*(t.getZlc()/zlc))); | |
| 379 | + } | |
| 377 | 380 | t.setYh(yh); |
| 378 | 381 | nextJzyl=t.getJzl()+t.getCzyl()-yh; |
| 379 | 382 | t.setJzyl(Double.parseDouble(df.format(nextJzyl))); | ... | ... |
src/main/resources/static/pages/oil/list.html
| ... | ... | @@ -10,7 +10,7 @@ |
| 10 | 10 | <li><span class="active">进出场存油量</span></li> |
| 11 | 11 | </ul> |
| 12 | 12 | |
| 13 | -<div class="row" id="liaolei_oil_list"> | |
| 13 | +<div class="row" id="ll_oil_list"> | |
| 14 | 14 | <div class="col-md-12"> |
| 15 | 15 | <!-- Begin: life time stats --> |
| 16 | 16 | <div class="portlet light portlet-fit portlet-datatable bordered"> |
| ... | ... | @@ -214,7 +214,7 @@ |
| 214 | 214 | <script> |
| 215 | 215 | $(function () { |
| 216 | 216 | //var id = 15; |
| 217 | - //$('.in_carpark_jzyl[data-id='+id+']', '#liaolei_oil_list') | |
| 217 | + //$('.in_carpark_jzyl[data-id='+id+']', '#ll_oil_list') | |
| 218 | 218 | |
| 219 | 219 | $("#checkYl").on('click', function () { |
| 220 | 220 | console.log("核对加注量"); |
| ... | ... | @@ -264,14 +264,16 @@ |
| 264 | 264 | }) |
| 265 | 265 | //拆分 |
| 266 | 266 | $("#sortButton").on('click', function () { |
| 267 | - console.log("拆分油量"); | |
| 268 | 267 | if ($("#rq").val() != "") { |
| 269 | 268 | var id = $('input.icheck:checked').data('id'); |
| 269 | + | |
| 270 | 270 | if (typeof(id) == 'undefined') { |
| 271 | 271 | layer.msg("请选择一行进行拆分"); |
| 272 | 272 | } else { |
| 273 | 273 | //获取输入的进场存油 |
| 274 | - var jzyl = $("#jzyl" + id).html(); | |
| 274 | + var jzyl = $('.in_carpark_jzyl[data-id='+id+']', '#ll_oil_list').html(); | |
| 275 | + // $("#jzyl" + id).html(); | |
| 276 | + console.log(jzyl); | |
| 275 | 277 | var params = {}; |
| 276 | 278 | params['jzyl'] = jzyl; |
| 277 | 279 | params['id'] = id; |
| ... | ... | @@ -357,12 +359,10 @@ |
| 357 | 359 | if (p) |
| 358 | 360 | params = p; |
| 359 | 361 | //更新时间排序 |
| 360 | - console.log(params); | |
| 361 | 362 | params['order'] = 'nbbm'; |
| 362 | 363 | params['page'] = page; |
| 363 | 364 | params['rq'] = $("#rq").val(); |
| 364 | 365 | var i = layer.load(2); |
| 365 | - console.log(params); | |
| 366 | 366 | $get('/ylb', params, function (data) { |
| 367 | 367 | $.each(data.content, function (i, obj) { |
| 368 | 368 | obj.rq = moment(obj.rq).format("YYYY-MM-DD"); |
| ... | ... | @@ -379,7 +379,7 @@ |
| 379 | 379 | } |
| 380 | 380 | layer.close(i); |
| 381 | 381 | |
| 382 | - startOptJzylLink($('#liaolei_oil_list .in_carpark_jzyl')); | |
| 382 | + startOptJzylLink($('#ll_oil_list .in_carpark_jzyl')); | |
| 383 | 383 | }); |
| 384 | 384 | } |
| 385 | 385 | |
| ... | ... | @@ -466,47 +466,16 @@ |
| 466 | 466 | }); |
| 467 | 467 | |
| 468 | 468 | //搜索线路 |
| 469 | - $('#xlbm').select2({ | |
| 470 | - placeholder: '搜索线路...', | |
| 471 | - ajax: { | |
| 472 | - url: '/realSchedule/findLine', | |
| 473 | - type: 'post', | |
| 474 | - dataType: 'json', | |
| 475 | - delay: 150, | |
| 476 | - data: function (params) { | |
| 477 | - return {line: params.term}; | |
| 478 | - }, | |
| 479 | - processResults: function (data) { | |
| 480 | - return { | |
| 481 | - results: data | |
| 482 | - }; | |
| 483 | - }, | |
| 484 | - cache: true | |
| 485 | - }, | |
| 486 | - templateResult: function (repo) { | |
| 487 | - if (repo.loading) return repo.text; | |
| 488 | - var h = '<span>' + repo.text + '</span>'; | |
| 489 | - return h; | |
| 490 | - }, | |
| 491 | - escapeMarkup: function (markup) { | |
| 492 | - return markup; | |
| 493 | - }, | |
| 494 | - minimumInputLength: 1, | |
| 495 | - templateSelection: function (repo) { | |
| 496 | - return repo.text; | |
| 497 | - }, | |
| 498 | - language: { | |
| 499 | - noResults: function () { | |
| 500 | - return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>'; | |
| 501 | - }, | |
| 502 | - inputTooShort: function (e) { | |
| 503 | - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>'; | |
| 504 | - }, | |
| 505 | - searching: function () { | |
| 506 | - return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>'; | |
| 507 | - } | |
| 508 | - } | |
| 509 | - }); | |
| 469 | + $.get('/basic/lineCode2Name',function(result){ | |
| 470 | + var data=[]; | |
| 471 | + | |
| 472 | + for(var code in result){ | |
| 473 | + data.push({id: code, text: result[code]}); | |
| 474 | + } | |
| 475 | + console.log(data); | |
| 476 | + initPinYinSelect2('#xlbm',data,''); | |
| 477 | + | |
| 478 | + }) | |
| 510 | 479 | |
| 511 | 480 | $('#nbbm').select2({ |
| 512 | 481 | placeholder: '搜索车辆...', | ... | ... |