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,7 +373,10 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | ||
| 373 | if(t.getJcsx()==1){ | 373 | if(t.getJcsx()==1){ |
| 374 | Double jcyl=t.getCzyl(); | 374 | Double jcyl=t.getCzyl(); |
| 375 | zyl=jcyl+jzl-yl; | 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 | t.setYh(yh); | 380 | t.setYh(yh); |
| 378 | nextJzyl=t.getJzl()+t.getCzyl()-yh; | 381 | nextJzyl=t.getJzl()+t.getCzyl()-yh; |
| 379 | t.setJzyl(Double.parseDouble(df.format(nextJzyl))); | 382 | t.setJzyl(Double.parseDouble(df.format(nextJzyl))); |
src/main/resources/static/pages/oil/list.html
| @@ -10,7 +10,7 @@ | @@ -10,7 +10,7 @@ | ||
| 10 | <li><span class="active">进出场存油量</span></li> | 10 | <li><span class="active">进出场存油量</span></li> |
| 11 | </ul> | 11 | </ul> |
| 12 | 12 | ||
| 13 | -<div class="row" id="liaolei_oil_list"> | 13 | +<div class="row" id="ll_oil_list"> |
| 14 | <div class="col-md-12"> | 14 | <div class="col-md-12"> |
| 15 | <!-- Begin: life time stats --> | 15 | <!-- Begin: life time stats --> |
| 16 | <div class="portlet light portlet-fit portlet-datatable bordered"> | 16 | <div class="portlet light portlet-fit portlet-datatable bordered"> |
| @@ -214,7 +214,7 @@ | @@ -214,7 +214,7 @@ | ||
| 214 | <script> | 214 | <script> |
| 215 | $(function () { | 215 | $(function () { |
| 216 | //var id = 15; | 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 | $("#checkYl").on('click', function () { | 219 | $("#checkYl").on('click', function () { |
| 220 | console.log("核对加注量"); | 220 | console.log("核对加注量"); |
| @@ -264,14 +264,16 @@ | @@ -264,14 +264,16 @@ | ||
| 264 | }) | 264 | }) |
| 265 | //拆分 | 265 | //拆分 |
| 266 | $("#sortButton").on('click', function () { | 266 | $("#sortButton").on('click', function () { |
| 267 | - console.log("拆分油量"); | ||
| 268 | if ($("#rq").val() != "") { | 267 | if ($("#rq").val() != "") { |
| 269 | var id = $('input.icheck:checked').data('id'); | 268 | var id = $('input.icheck:checked').data('id'); |
| 269 | + | ||
| 270 | if (typeof(id) == 'undefined') { | 270 | if (typeof(id) == 'undefined') { |
| 271 | layer.msg("请选择一行进行拆分"); | 271 | layer.msg("请选择一行进行拆分"); |
| 272 | } else { | 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 | var params = {}; | 277 | var params = {}; |
| 276 | params['jzyl'] = jzyl; | 278 | params['jzyl'] = jzyl; |
| 277 | params['id'] = id; | 279 | params['id'] = id; |
| @@ -357,12 +359,10 @@ | @@ -357,12 +359,10 @@ | ||
| 357 | if (p) | 359 | if (p) |
| 358 | params = p; | 360 | params = p; |
| 359 | //更新时间排序 | 361 | //更新时间排序 |
| 360 | - console.log(params); | ||
| 361 | params['order'] = 'nbbm'; | 362 | params['order'] = 'nbbm'; |
| 362 | params['page'] = page; | 363 | params['page'] = page; |
| 363 | params['rq'] = $("#rq").val(); | 364 | params['rq'] = $("#rq").val(); |
| 364 | var i = layer.load(2); | 365 | var i = layer.load(2); |
| 365 | - console.log(params); | ||
| 366 | $get('/ylb', params, function (data) { | 366 | $get('/ylb', params, function (data) { |
| 367 | $.each(data.content, function (i, obj) { | 367 | $.each(data.content, function (i, obj) { |
| 368 | obj.rq = moment(obj.rq).format("YYYY-MM-DD"); | 368 | obj.rq = moment(obj.rq).format("YYYY-MM-DD"); |
| @@ -379,7 +379,7 @@ | @@ -379,7 +379,7 @@ | ||
| 379 | } | 379 | } |
| 380 | layer.close(i); | 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,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 | $('#nbbm').select2({ | 480 | $('#nbbm').select2({ |
| 512 | placeholder: '搜索车辆...', | 481 | placeholder: '搜索车辆...', |