searchplan.jsp

来自「java jsp教程」· JSP 代码 · 共 375 行 · 第 1/2 页

JSP
375
字号
        <td align="center" ><div align="right">开始时间 从:</div></td>
        <td bgcolor="#a6d0f2" ><div align="left">
          <input name="begintime" type="text" size="18" readonly style="background:white" class="inp1" value="<%=xBegintime%>">
          <img src="<%=root%>/images/calendar.gif" style="cursor:hand;" width="18" height="18" border=0 align="absmiddle" alt="弹出日历下拉菜单" onClick="popUpCalendarDlg(begintime)"> 
        </div></td>
        <td bgcolor="#a6d0f2" ><div align="right">至:</div></td>
        <td bgcolor="#a6d0f2" ><div align="left">
            <input name="endtime" type="text"  size="18" readonly style="background:white" class="inp1" value="<%=xEndtime%>">
          <img src="<%=root%>/images/calendar.gif" style="cursor:hand;" width="18" height="18" border=0 align="absmiddle" alt="弹出日历下拉菜单" onClick="popUpCalendarDlg(endtime)">
          </div></td>
        <td colspan="2" ><div align="center"></div></td>
      </tr>
    </table>
	<div align="center"><br>
	<img src="<%=root%>/images/search.gif" name="Submit" style="cursor:hand;" alt="查    询" class="bt1" onClick="_search()">
	&nbsp;&nbsp;&nbsp;
	<img src="<%=root%>/images/chzh.gif" name="clear" style="cursor:hand;" alt="清空查询条件" class="bt1" onClick="_clear()">
	</div>
  </form>

  <TABLE cellSpacing=0 cellPadding=0 width="98%" align=center border=0>
    <TBODY>
      <TR>
      <%if(search.equals("search")){%>
      <%
      		String defaultorgclause=(String)request.getAttribute("defaultorgclause");
      		System.out.println("defaultorgclause=="+defaultorgclause);
      		
      		//A表为plan表,B表为TPLAN_AUDITEDORG,C表为扩展组织表TEXORGINFO
      		StringBuffer param=new StringBuffer();
      		StringBuffer clause=new StringBuffer();
      		if(xPlanName!=null && !xPlanName.equals(""))//计划名称
      			clause.append(" A.PLANNAME like '%"+xPlanName+"%' and ");
      		if(xplanState!=null && !xplanState.equals(""))//计划状态
      			clause.append(" A.STATE='"+xplanState+"' and ");
      		if(xJhlbCode!=null && !xJhlbCode.equals(""))//计划类别
      			clause.append(" A.PLANTYPEID='"+xJhlbCode+"' and ");
      		if(xPlanYearInt.intValue()!=9999)//计划年度
      			clause.append(" A.PLANYEAR='"+xPlanYearInt+"' and ");
      		if(xAuditedOrgCode!=null && !xAuditedOrgCode.equals(""))//被审单位
      			clause.append(" B.AUDITEDORGID='"+xAuditedOrgCode+"' and ");
      		System.out.println("选择的被审计单位--》"+xAuditedOrgCode);
      		if(xAuditingOrgCode!=null && !xAuditingOrgCode.equals(""))//审计单位
      		{
      			//if(!xAuditingOrgCode.equals("001"))
      			//	clause.append(" A.AUDITINGDEPTCODE='"+xAuditingOrgCode+"' and ");
      			clause.append(" instr(A.AUDITINGDEPTCODE,'" + xAuditingOrgCode + "')=1 and ");
      		}
      		else
      		{
      			if(defaultorgclause!=null && !defaultorgclause.equals(""))
      				clause.append(defaultorgclause+" and ");
      		}
      			
      		if(xBegintime!=null && !xBegintime.equals(""))//开始时间
      			clause.append(" A.BEGAINTIME>=TO_DATE('"+xBegintime+"','YYYY-MM-DD') and ");
      		if(xEndtime!=null && !xEndtime.equals(""))//结束时间
      			clause.append(" A.BEGAINTIME<=TO_DATE('"+xEndtime+"','YYYY-MM-DD') and ");
      			
      		clause.append(" A.STATE in ('4','6','b','c') ");//审批通过,执行中,执行完成、消项
      		clause.append(" order by A.PLANNO,A.STATE");
      		param.append("clause=\""+clause.toString()+"\";");
      		
      		System.out.println("报表查询的条件为:"+param.toString());
      %>
      
        <TD align=middle width="100%" >
			        <report:html name="report1" reportFileName="searchplan.raq" 
					   width="810" 
					   height="600" 
						funcBarLocation="bottom"
						needPageMark="yes"
						separator=" "
						needSaveAsExcel="yes"
						needSaveAsPdf="no"
						needPrint="no"
						firstPageLabel="第一页"
						prevPageLabel="上一页"
						nextPageLabel="下一页"
						lastPageLabel="最后页"
						pageMarkLabel="第{currpage}页/共{totalPage}页"
						printLabel="打印"
						generateParamForm="no"
						displayNoLinkPageMark="yes"
						canModifyBeforePrint="yes"
						params="<%=param.toString()%>"
						submit="提交到服务器"
						needOfflineInput="yes"
						needImportExcel="yes"
						excelPageStyle="0"
						importExcelLabel="导入excel"
				/>
		</TD>
		<%}%>
      </TR>
    </TBODY>
  </TABLE>
  
  <SCRIPT language=JavaScript>
function popUpCalendarDlg(ctrlobj) {
	showx = event.screenX - event.offsetX - 4 - 210 ; // + deltaX;
	showy = event.screenY - event.offsetY + 18; // + deltaY;
	newWINwidth = 210 + 4 + 18;
	retval = window.showModalDialog("<%=request.getContextPath()%>/include/date.htm", "", "dialogWidth:220px; dialogHeight:220px; dialogLeft:"+showx+"px; dialogTop:"+showy+"px; status:no; directories:yes;scroll:no;Resizable:no; "  );
	if( retval != null ){
		ctrlobj.value = retval;
	}
}
function selectUnit()
{
	wx=200;
	wy=200;
	urlstr="<%=request.getContextPath()%>/jsp/advancesearch/auditedtree.jsp?nameField=auditedOrgName&idField=auditedOrgCode";
	x=(window.screen.width-wx)/2;
	y=(window.screen.height-wy)/2;
	wposition=",left="+x+",top="+y;
	window.open(urlstr,"选择单位","width="+wx+",height="+wy+",scrollbars=yes,status=no"+wposition); 
}

function selectAuditingUnit() {
	wx=200;
	wy=200;
	urlstr="<%=request.getContextPath()%>/jsp/advancesearch/orgtree.jsp";
	x=(window.screen.width-wx)/2;
	y=(window.screen.height-wy)/2;
	wposition=",left="+x+",top="+y;
	window.open(urlstr,"选择单位","width="+wx+",height="+wy+",scrollbars=yes,status=yes"+wposition); 
}

function _search() {
	if ( Compare_Date(document.form1.begintime.value,document.form1.endtime.value) ) {
			alert("开始时间要小于结束时间");
			return;
	}
	document.form1.action = "<%=root%>/servlet/SearchPlanServlet";
	document.form1.submit();
}

function _clear()
{
	document.form1.planYear.options[0].selected=true;
	document.form1.planState.options[0].selected=true;
	document.form1.planName.value="";
	document.form1.auditedOrgCode.value="";
	document.form1.auditedOrgName.value="";
	document.form1.jhlbCode.value="";
	document.form1.jhlb.value="";
	document.form1.auditingOrgId.value="";
	document.form1.auditingOrgName.value="";
	document.form1.begintime.value="";
	document.form1.endtime.value="";
}

function viewPlanInfo(planno)
{
	wx=600;
	wy=400;
	x=(window.screen.width-wx)/2;
	y=(window.screen.height-wy)/2;
	wposition=",left="+x+",top="+y;
	urlstr="<%=request.getContextPath()%>/servlet/ViewPlanInfoServlet?planno=" + planno;//计划信息
	window.open(urlstr,"查看计划信息","width="+wx+",height="+wy+",scrollbars=yes,status=no"+wposition);
}

function ShowAllAudited(planno)
{
	wx=600;
	wy=400;
	urlstr="<%=request.getContextPath()%>/servlet/GetAllAuditedListOfPlanServlet?planno="+planno;
	x=(window.screen.width-wx)/2;
	y=(window.screen.height-wy)/2;
	wposition=",left="+x+",top="+y;
	window.open(urlstr,"计划的所有被审单位","width="+wx+",height="+wy+",scrollbars=yes,status=no"+wposition);

//	showx = event.screenX - 250; // + deltaX;
//	showy = event.screenY ; // + deltaY;
//	retval = window.showModalDialog("<%=request.getContextPath()%>/servlet/GetAllAuditedListOfPlanServlet?planno="+planno, "计划的所有被审单位", "dialogWidth:250px; dialogHeight:250px; dialogLeft:"+showx+"px; dialogTop:"+showy+"px; status:no; directories:yes;scroll:auto;Resizable:yes; "  );
}
function fillCode(codeField, nameField, codeDiv, code, name)
{
	eval("document.form1." + codeField ).value =code;
	eval("document.form1." + nameField ).value =name;
	document.getElementById(codeDiv).style.display="none";
}
</SCRIPT>
</BODY></HTML>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?