Commit c141728f1ded1f2bb4d71aa7b8cc822bb98f4b1f

Authored by 娄高锋
1 parent 8779dbb9

导出

src/main/resources/static/pages/report/oil/oilListMonth.html
... ... @@ -37,7 +37,7 @@
37 37 </div>
38 38 <div class="form-group">
39 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 41 </div>
42 42 </form>
43 43 </div>
... ... @@ -115,18 +115,36 @@
115 115 initPinYinSelect2('#line',data,'');
116 116  
117 117 })
  118 +
118 119 //查询
119 120 $("#query").on('click',function(){
  121 + if($("#date").val() == null || $("#date").val().trim().length == 0){
  122 + layer.msg("请选择日期!");
  123 + return;
  124 + }
120 125 var line = $("#line").val();
121 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 131 var oilListMonth = template('oilListMonth',{list:result});
127 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 149 </script>
132 150 <script type="text/html" id="oilListMonth">
... ...