showreport.html 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Insert title here</title>
  6. <script type="text/ecmascript" src="${ctx}/assets/lib/jquery/1.9.1/jquery.js"></script>
  7. <script type="text/javascript" src="${ctx}/assets/static/h-ui/js/H-ui.js"></script>
  8. <link rel="stylesheet" type="text/css" media="screen" href="${ctx}/assets/lib/jqueryui/jquery-ui.css" />
  9. <script type="text/ecmascript" src="${ctx}/assets/lib/jqueryui/jquery-ui.js"></script>
  10. <script type="text/ecmascript" src="${ctx}/assets/lib/timepicker/jquery.ui.datepicker-zh-CN.js.js"></script>
  11. <style type="text/css">
  12. div {
  13. padding: 10px
  14. }
  15. </style>
  16. <script type="text/javascript">
  17. function iFrameHeight() {
  18. var ifm= document.getElementById("ReportFrame");
  19. var subWeb = document.frames ? document.frames["ReportFrame"].document : ifm.contentDocument;
  20. if(ifm != null && subWeb != null) {
  21. ifm.height = subWeb.body.scrollHeight;
  22. }
  23. }
  24. String.prototype.replaceAll = function(s1,s2){
  25.   return this.replace(new RegExp(s1,"gm"),s2);
  26. }
  27. $(function(){
  28. var curr_time = new Date();
  29. var strDate = curr_time.getFullYear()+"-";
  30. strDate += curr_time.getMonth()+1+"-";
  31. strDate += curr_time.getDate()+"-";
  32. strDate += curr_time.getHours()+":";
  33. strDate += curr_time.getMinutes()+":";
  34. strDate += curr_time.getSeconds();
  35. $("#StartDate,#EndDate").datepicker({
  36. id: 'orderDate_datePicker',
  37. dateFormat: 'yy-mm-dd',
  38. //minDate: new Date(2010, 0, 1),
  39. maxDate: new Date(2020, 0, 1),
  40. showOn: 'focus'
  41. });
  42. $("#Statistics").click(function(){
  43. //alert($("#StartDate").val());
  44. var urlBase="${ctx}/myconsole/showReport/";
  45. var param="?StartDate="+$("#StartDate").val()+"&EndDate="+$("#EndDate").val();
  46. var fileName=($("#ReportType").find("option:selected").text()+"_"+$("#StartDate").val()+"_"+$("#EndDate").val()).replaceAll('-','');
  47. $("#ReportFrame").attr("src",urlBase+$("#ReportType").val()+param);
  48. $("#Exportpdf").attr("href",urlBase+$("#ReportType").val()+"-0-"+fileName+param);
  49. $("#Exportdoc").attr("href",urlBase+$("#ReportType").val()+"-1-"+fileName+param);
  50. $("#Exportxls").attr("href",urlBase+$("#ReportType").val()+"-2-"+fileName+param);
  51. });
  52. })
  53. </script>
  54. </head>
  55. <body>
  56. <div>
  57. <label>统计类型</label> <select id="ReportType" class="easyui-combobox" style="width: 200px;">
  58. <#list reports as report>
  59. <option value="${report.keyid}">${report.reportname}</option>
  60. </#list>
  61. </select> <label>开始日期</label> <input id="StartDate" type="text" class="FormElement ui-widget-content ui-corner-all"> <label>结束日期</label>
  62. <input id="EndDate" type="text" class="FormElement ui-widget-content ui-corner-all"> <a id="Statistics" href="#" ><button>统计</button></a>
  63. <a id="Exportpdf" href="#" ><button>导出pdf</button></a> <a id="Exportdoc" href="#" ><button>导出word</button></a> <a
  64. id="Exportxls" href="#" ><button>导出excel</button></a>
  65. </div>
  66. <div>
  67. <iframe id="ReportFrame" src="" style="width: 100%;" onload="iFrameHeight();" frameborder="0"></iframe>
  68. </div>
  69. </body>
  70. </html>