Commit c141728f1ded1f2bb4d71aa7b8cc822bb98f4b1f
1 parent
8779dbb9
导出
Showing
1 changed file
with
23 additions
and
5 deletions
src/main/resources/static/pages/report/oil/oilListMonth.html
| @@ -37,7 +37,7 @@ | @@ -37,7 +37,7 @@ | ||
| 37 | </div> | 37 | </div> |
| 38 | <div class="form-group"> | 38 | <div class="form-group"> |
| 39 | <input class="btn btn-default" type="button" id="query" value="查询"/> | 39 | <input class="btn btn-default" type="button" id="query" value="查询"/> |
| 40 | -<!-- <input class="btn btn-default" type="button" id="export" value="导出"/> --> | 40 | + <input class="btn btn-default" type="button" id="export" value="导出"/> |
| 41 | </div> | 41 | </div> |
| 42 | </form> | 42 | </form> |
| 43 | </div> | 43 | </div> |
| @@ -115,18 +115,36 @@ | @@ -115,18 +115,36 @@ | ||
| 115 | initPinYinSelect2('#line',data,''); | 115 | initPinYinSelect2('#line',data,''); |
| 116 | 116 | ||
| 117 | }) | 117 | }) |
| 118 | + | ||
| 118 | //查询 | 119 | //查询 |
| 119 | $("#query").on('click',function(){ | 120 | $("#query").on('click',function(){ |
| 121 | + if($("#date").val() == null || $("#date").val().trim().length == 0){ | ||
| 122 | + layer.msg("请选择日期!"); | ||
| 123 | + return; | ||
| 124 | + } | ||
| 120 | var line = $("#line").val(); | 125 | var line = $("#line").val(); |
| 121 | var date = $("#date").val(); | 126 | var date = $("#date").val(); |
| 122 | - $get('/ylb/oilListMonth',{line:line,date:date},function(result){ | ||
| 123 | - $.each(result, function(i, obj) { | ||
| 124 | - obj.rq = moment(obj.rq).format("DD"); | ||
| 125 | - }); | 127 | + $get('/ylb/oilListMonth',{line:line,date:date,type:'query'},function(result){ |
| 128 | +// $.each(result, function(i, obj) { | ||
| 129 | +// obj.rq = moment(obj.rq).format("DD"); | ||
| 130 | +// }); | ||
| 126 | var oilListMonth = template('oilListMonth',{list:result}); | 131 | var oilListMonth = template('oilListMonth',{list:result}); |
| 127 | $('#forms tbody').html(oilListMonth); | 132 | $('#forms tbody').html(oilListMonth); |
| 128 | }); | 133 | }); |
| 129 | }); | 134 | }); |
| 135 | + | ||
| 136 | + //导出 | ||
| 137 | + $("#export").on("click",function(){ | ||
| 138 | + if($("#date").val() == null || $("#date").val().trim().length == 0){ | ||
| 139 | + layer.msg("请选择日期!"); | ||
| 140 | + return; | ||
| 141 | + } | ||
| 142 | + var line = $("#line").val(); | ||
| 143 | + var date = $("#date").val(); | ||
| 144 | + $get('/ylb/oilListMonth', {line:line,date:date,type:'export'}, function(result){ | ||
| 145 | + window.open("/downloadFile/download?fileName=月存油报表"+moment(date).format("YYYYMMDD")); | ||
| 146 | + }); | ||
| 147 | + }); | ||
| 130 | }); | 148 | }); |
| 131 | </script> | 149 | </script> |
| 132 | <script type="text/html" id="oilListMonth"> | 150 | <script type="text/html" id="oilListMonth"> |