| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222 |
- <%@ page language="java" contentType="text/html; charset=GBK" pageEncoding="GBK"%>
- <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=GBK">
- <title>报表</title>
- <script type=text/javascript src="/shares/js/jquery-1.5.1.min.js"></script>
- <script type="text/javascript" src="/shares/js/constant.js"></script>
- <script type="text/javascript" src="/shares/js/common.js"></script>
- <link href="main.css" rel="stylesheet" type="text/css"></link>
- <link href="${pageContext.request.contextPath}//liger/lib/ligerUI/skins/${sessionScope.css}/css/ligerui-all.css" rel="stylesheet" type="text/css" />
- <script src="${pageContext.request.contextPath}/liger/lib/ligerUI/js/ligerui.all.js" type="text/javascript"></script>
- <script type="text/javascript" src="/shares/datePicker/WdatePicker.js"></script>
- <script type="text/javascript" src="/shares/js/constant.js"></script>
- <script type="text/javascript" src="/shares/js/common.js"></script>
- <script type="text/javascript" src="/shares/js/xdate.js"></script>
- <script type="text/javascript">
- $(function() {
- $("#reportHtml").height(getParentHeight() - 80);
- initDate();
- });
- function exportReport(ext) {
- //begin qianqw 20150511
- submitAUrl("toReprotAction.do?method=" + ext + "&report_id=${report_id}");
- //end
- }
- function pagePrevReport() {
- var pi = $("#pageIndex").val();
- if (pi == "")
- pi = "0";
- pi = parseInt(pi) - 1;
- $("#pageIndex").val(pi);
- submitTargetAUrl(
- "toReprotAction.do?method=toHtml&key=${key}&report_id=${report_id}&pageIndex=" + pi,
- "reportHtml");
- }
- function pageNextReport() {
- var pi = $("#pageIndex").val();
- if (pi == "")
- pi = "0";
- pi = parseInt(pi) + 1;
- $("#pageIndex").val(pi);
- submitTargetAUrl(
- "toReprotAction.do?method=toHtml&key=${key}&report_id=${report_id}&pageIndex=" + pi,
- "reportHtml");
- }
- function searchReport() {
- if(validate()){
- var url = "";
- $(".list_search input[type='text'],.list_search select").each(
- function() {
- var name = $(this).attr("name");
- var value = $(this).val();
- url = url + "&" + name + "=" + encodeURI(value);
- });
- submitTargetAUrl("toReprotAction.do?method=toHtml&key=${key}&report_id=${report_id}&pageIndex=0" + url,
- "reportHtml");
- }
-
- }
-
- /**
- * 点查询时验证
- * 要验证控件的class中加入:
- * 1、valid_notempty 验证非空
- */
- function validate(){
- var rs = true;
- var str = "";
- $(".notempty").each(function(index,value){
- if(this.value == ""){
- str += $(this).parent().prev().children('span').text()+"不能为空\n";
- rs = false;
- }
- });
- if(!rs){
- alert(str);
- }
- return rs;
- }
- /**
- * 初始化日期控件
- * @param type 初始化类型: init_date_monthbegin 本月第一天,
- * init_date_monthend 本月最后一天,
- * init_date_curdate 当前日期
- */
- function initDate(){
- // alert(new Date());
- // alert(getSystemDate());
- $(".init_date_monthbegin").each(function(index,value){
- $(this).val(getCurrentMonthFirst());
- });
- $(".init_date_monthend").each(function(index,value){
- $(this).val(getCurrentMonthLast());
- });
- $(".init_date_curdate").each(function(index,value){
- $(this).val(getCurrentDate());
- });
- $(".init_date_curyear").each(function(index,value){
- $(this).val(getCurrentYean());
- });
- $(".init_date_curyearmonth").each(function(index,value){
- $(this).val(getCurrentYearMonth());
- });
- }
- /**
- *获取当前年月
- */
- function getCurrentYearMonth(){
- var date=new Date();
- var month = date.getMonth()+1;
- if(month<10){
- month = "0"+month;
- }
- var str = date.getFullYear()+"-"+month;
- return str;
- }
- /**
- *获取当前年份
- */
- function getCurrentYean(){
- var myDate = new Date();
- return myDate.getFullYear(); //获取完整的年份(4位,1970-????)
- }
- /**
- *获取当天日期
- */
-
- function getCurrentDate(){
- return getCurrentDate();
- }
-
- /**
- *获取当月第一天
- */
- function getCurrentMonthFirst(){
- var date=new Date();
- date.setDate(1);
- curMonFirst = formatDate(date);
- return curMonFirst.substring(0, curMonFirst.indexOf(" "));
- }
-
- /**
- * 获取当前月的最后一天
- */
- function getCurrentMonthLast(){
- var date=new Date();
- var currentMonth=date.getMonth();
- var nextMonth=++currentMonth;
- var nextMonthFirstDay=new Date(date.getFullYear(),nextMonth,1);
- var oneDay=1000*60*60*24;
- curMonLast = formatDate(new Date(nextMonthFirstDay-oneDay));
- return curMonLast.substring(0, curMonLast.indexOf(" "));
- }
-
-
- var iframeLoaded = function (iframe) {
- if (iframe.src.length > 0) {
- if (!iframe.readyState || iframe.readyState == "complete") {
- var win = iframe.contentWindow;
- var pages = win.document.getElementsByName("pages")[0].value;
- var pageindex = win.document.getElementsByName("pageindex")[0].value;
- processPage(pageindex,pages);
- }
- }
- }
- function processPage(index,pages){
- $("#pageHtml").show();
- var lastPage = pages - 1;
- if(pages<2){
- $("#prevpage").hide();
- $("#nextpage").hide();
- }else if(pages>1&&index==0){
- $("#prevpage").hide();
- $("#nextpage").show();
- }else if(pages>1&&index==lastPage){
- $("#prevpage").show();
- $("#nextpage").hide();
- }else{
- $("#prevpage").show();
- $("#nextpage").show();
- }
- }
- </script>
- </head>
- <body scroll="no">
- <form>
- <div class="container-layout">
- <div id="btn_title" class="form-button">
- <input type="hidden" id="pageIndex" value="${pageIndex}" />
- <input type="button" id="exportPdf" onclick="closeWindow()" class="l-button" value="关闭" />
- <input type="button" id="exportPdf" onclick="exportReport('toPdf')" class="l-button" value="导出PDF" />
- <input type="button" id="exportPdf" onclick="exportReport('toExcel')" class="l-button" value="导出EXCEL" />
- <div style="float: right; margin-right: 5px;display:none;" id="pageHtml">
- <a id="prevpage" onclick="pagePrevReport()" target="reportHtml">上一页</a>
- <a id="nextpage" onclick="pageNextReport()" target="reportHtml">下一页</a>
- </div>
- </div>
- <div class="default_search">
- <c:forEach items="${htmlParams}" var="p">
- <ul class="list_search">
- <li class="title" ><span>${p.title}</span>:</li>
- <li class="text" >${p.value}</li>
- </ul>
- </c:forEach>
- <ul>
- <li class="search-button"><input class="l-button" onclick="searchReport()" name="search" value="查询" type="button"></li>
- </ul>
- </div>
- <div class="forum-container">
- <%-- <iframe style="width: 100%;" frameborder="0" name="reportHtml" id="reportHtml" src="toReprotAction.do?method=toHtml&key=${key}&pageIndex=0"></iframe> --%>
- <iframe onload="iframeLoaded(this)" style="width: 100%;" frameborder="0" name="reportHtml" id="reportHtml" src="toReprotAction.do?method=toHtml&report_id=${report_id}&pageIndex=0"></iframe>
- </div>
- </div>
- </form>
- </body>
- </html>
|