Commit 52dd1a8223cfe70dcbde52764bdc25824f9e992b

Authored by 娄高锋
1 parent f4d790dc

LGF 导出

src/main/resources/static/pages/forms/mould/statisticsDaily_.xls 0 → 100644
No preview for this file type
src/main/resources/static/pages/forms/mould/waybill_qingpu.xls
No preview for this file type
src/main/resources/static/pages/forms/statement/statisticsDaily .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>
... ... @@ -156,6 +156,8 @@
156 156  
157 157 <script>
158 158 $(function(){
  159 + $('#export').attr('disabled', "true");
  160 +
159 161 // 关闭左侧栏
160 162 if (!$('body').hasClass('page-sidebar-closed'))
161 163 $('.menu-toggler.sidebar-toggler').click();
... ... @@ -176,17 +178,32 @@
176 178 })
177 179  
178 180  
  181 + var line = $("#line").val();
  182 + var xlName = $("#select2-line-container").html();
  183 + var date = $("#date").val();
179 184 $("#query").on("click",function(){
180   - var line = $("#line").val();
181   - var xlName = $("#select2-line-container").html();
182   - var date = $("#date").val();
183   - $get('/realSchedule/statisticsDaily',{line:line,date:date,xlName:xlName},function(result){
  185 + line = $("#line").val();
  186 + xlName = $("#select2-line-container").html();
  187 + date = $("#date").val();
  188 + $get('/realSchedule/statisticsDaily',{line:line,date:date,xlName:xlName,type:"query"},function(result){
184 189 // 把数据填充到模版中
185 190 var tbodyHtml = template('statisticsDaily',{list:result});
186 191 // 把渲染好的模版html文本追加到表格中
187 192 $('#forms .statisticsDaily').html(tbodyHtml);
  193 +
  194 + if(result.length == 0)
  195 + $("#export").attr('disabled',"true");
  196 + else
  197 + $("#export").removeAttr("disabled");
188 198 });
189 199 });
  200 +
  201 + $("#export").on("click",function(){
  202 + $get('/realSchedule/statisticsDaily',{line:line,date:date,xlName:xlName,type:"export"},function(result){
  203 + window.open("/downloadFile/download?fileName=统计日报"+moment(date).format("YYYYMMDD"));
  204 + });
  205 + });
  206 +
190 207 });
191 208 </script>
192 209 <script type="text/html" id="statisticsDaily">
... ...