approveplan_viewplaninfo.jsp

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

JSP
710
字号
<%@ page contentType="text/html; charset=GBK" %>
<%@ page import="java.util.Iterator" %>
<%@ page import="java.util.List" %>
<%@ page import="java.sql.Date" %>
<%@ page import="com.icss.cnpc.plan.vo.PlanInfo" %>
<%@ page import="com.icss.cnpc.plan.vo.TempPlanInfo" %>
<%@ page import="com.icss.cnpc.plan.vo.PerformTaskVO" %>
<%@ page import="com.icss.cnpc.plan.vo.ApproveRecordInfo" %>
<%@ page import="com.icss.cnpc.plan.vo.AuditedOrgInfo" %>
<%@ page import="com.icss.cnpc.plan.vo.TempplanAuditedorgInfo" %>
<%@ page import="com.icss.cnpc.plan.vo.TeammemberInfo" %>
<%@ page import="com.icss.cnpc.util.*" %>

<%
    response.setHeader("Pragma", "No-cache");
    response.setHeader("Cache-Control", "no-cache");
    response.setDateHeader("Expires", 0);
%>
<!--描述:审核(批)页面

调用一:查看原计划
调用ViewPlanInfoServlet
传入参数PlanNo

调用二:提交审核(批)结果
ApprovePlanServlet2,提交审核(批)结果
传入参数PlanNo,AppResult,AppAdvise

接收:
PlanState,TempPlanInfo,PlanInfo

显示控制:
1。如果PlanState=起草审核(批)则TempPlanInfo为NULL,计划元素取自PlanInfo,无"查看原计划"项
2。如果PlanState=调整审核(批)则在显示计划元素之前先比较原计划和临时计划,如果一样则显示正常色,如果不同则显示成红色(代表调整项)
3。

对应Demo页面:plan_approve2.html
-->
<%
	List Planlist=(List)request.getAttribute("Planlist");
	String state=(String)request.getAttribute("state");
	String planno=(String)request.getAttribute("planno");
	String taskno=(String)request.getAttribute("taskno");
	
	PlanInfo plan=null;
	TempPlanInfo tempplan=null;
	List tAuditedOrgList=null;
	List pAuditedOrgList=null;
	boolean compare=false;
	if(Planlist!=null && Planlist.size()!=0)
	{
		for(int i=0;i<Planlist.size();i++)
		{
			if(i==0)
				plan=(PlanInfo)Planlist.get(i);
			if(i==1)
			{
				if(state.equals("7") || state.equals("8"))
				{
					tempplan=(TempPlanInfo)Planlist.get(1);
					compare=true;
				}
			}
		}
	}
	List ApproveRecordList=plan.getApproveRecordList();
	List teammemberList=plan.getTeammemberList();
	if(compare)
	{
		tAuditedOrgList=tempplan.getAuditedOrgList();
		pAuditedOrgList=plan.getAuditedOrgList();
	}
	else
		pAuditedOrgList=plan.getAuditedOrgList();
%>
<script language="javascript">
function appNotPass()
{
	document.form1.appresult.value="0";
}
function appPass()
{
	document.form1.appresult.value="1";
}
function submitAppResult()
{
	if(confirm("您要提交审核结果吗?"))
	{
		document.form1.action="<%=request.getContextPath()%>/servlet/ApprovePlanServlet2";
		document.form1.submit();
	}
}
function viewPlanInfo(planno)
{
	wx=600;
	wy=400;
	urlstr="<%=request.getContextPath()%>/servlet/ViewPlanInfoServlet?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);
}
</script>
<HTML><HEAD><TITLE>审批计划</TITLE>
<link rel="stylesheet" href="<%=request.getContextPath()%>/css/style.css">
<SCRIPT language=JavaScript src="<%=request.getContextPath()%>/common/common.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" src="<%=request.getContextPath()%>/common/calendar.js"></SCRIPT>
<style type="text/css">
<!--
.style1 {font-size: 16px}
.style2 {font-size: 14pt}
-->
</style>
<BODY text=#000000 leftMargin=0 background=../images/grid.gif topMargin=10>
<form name="form1">
<input type="hidden" name="state" value="<%=state%>">
<input type="hidden" name="planno" value="<%=planno%>">
<input type="hidden" name="taskno" value="<%=taskno%>">
<input type="hidden" name="appresult" value="1">
  <TABLE cellSpacing=0 borderColorDark=#dfdfff cellPadding=0
			width="100%" height="98%" align=center bordercolorlight="#003366"
			border=0>
    <TBODY>
      <TR>
        <TD height=40 align=center bgColor=#F7FAFF><TABLE cellSpacing=1 borderColorDark="#dfdfff" cellPadding=2
										width="90%" align=center bgColor=#b3c4db
										borderColorLight="#003366" border=0>
          <TBODY>
            <tr bgcolor="#a6d0f2">
              <TD height=27 colspan="4" align=left><div align="center" class="unnamed2"><font size="4"><strong>意  见  建  议</strong></font></div></td>
            <TR> 
              <TD width="18%" height=21 align=right bgColor=#eef4ff class="unnamed1">意见:</TD>
              <TD width="82%" height=21 align=left bgColor=#eef4ff>
              		<textarea name="appadvise" cols="60" rows="3"></textarea></TD>
            </TR>
            <TR>
              <TD  height=25 align="right"  bgColor=#eef4ff class="unnamed1" ><%if(compare){%>审批:<%}else{%>审核:<%}%> </TD>
              <TD  height=10 align="left" bgColor=#eef4ff >
              		<input type=radio name="pass" value="radiobutton" checked onClick="appPass()">通过
                  <input type=radio name="pass" value="radiobutton" onClick="appNotPass()">不通过
              </td>
            </TR>
            <TR bgcolor="#eef4ff">
              <TD  height=25 align="right" colspan="2" class="unnamed1" ><div align="center">
			  <img src="../images/confirm.gif" style="cursor:hand;" align="absmiddle" alt="提交" onClick="submitAppResult()">
			  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			  <img src="../images/return.gif" style="cursor:hand;" align="absmiddle" alt="返回" onClick="window.history.back()"></div></TD>     
            </TR>
        </TABLE>
        </TD>
      </TR>
      </form>
      <TR align="center" valign="middle">
        <TD height="143" bgColor=#F7FAFF>
		<br>
			  <%
			  				System.out.println("已 有 审 核 意 见   区");
			  				if(ApproveRecordList!=null && ApproveRecordList.size()!=0)
                		{
			  %>
       <TABLE cellSpacing=1 borderColorDark="#dfdfff" cellPadding=2
									width="90%" align=center bgColor=#b3c4db
										borderColorLight="#003366" border=0>
          <tr bgcolor="#a6d0f2">
             <TD height=27 colspan="4" align=left><div align="center" class="unnamed2"><font size="4"><strong>审 核 审 批 记 录</strong></font></div></td>
          </tr>
          <TR>
             <TD width="15%" height=21 align=center bgColor=#eef4ff><div align="center">审核(批)人:</div></TD>
             <TD width="15%" height=21 align=center bgColor=#eef4ff><div align="center">审核(批)结果:</div></TD>
             <TD width="15%" height=21 align=center bgColor=#eef4ff><div align="center">审核(批)日期:</div></TD>
             <TD width="55%" height=21 align=center bgColor=#eef4ff><div align="center">审核(批)意见:</div></TD>
          </TR>
           <%
                			for(Iterator i=ApproveRecordList.iterator();i.hasNext();)
                			{
                				ApproveRecordInfo recordInfo=(ApproveRecordInfo)i.next();
                				String pname=recordInfo.getPersonname();
                				String result=recordInfo.getApproveresult();
                				String cnresult="";
                				if(result.equals("0"))
                					cnresult="不通过";
                				if(result.equals("1"))
                					cnresult="通过";
                				java.sql.Date appdate=recordInfo.getApprovedate();
                				String advise=recordInfo.getApprovenote();
           %>
           <tr>
                <TD  height=10 align="center" bgColor=#eef4ff><%if(pname!=null)out.print(pname);%></td>
                <TD  height=10 align="center" bgColor=#eef4ff><%if(cnresult!=null)out.print(cnresult);%></td>
                <TD  height=10 align="center" bgColor=#eef4ff><%if(appdate!=null)out.print(appdate.toString());%></td>
                <TD  height=10 align="center" bgColor=#eef4ff><%if(advise!=null)out.print(advise);%></td>
              </TR>
           <%}%>
          </TABLE>
					<br>
			<%}%>
          <TABLE cellSpacing=1 borderColorDark="#dfdfff" cellPadding=2
								width="90%" align=center bgColor=#b3c4db
								borderColorLight="#003366" border=0>
              <tr bgcolor="#a6d0f2">
                 <TD height=27 colspan="4" align=left><div align="center" class="unnamed2"><font size="4"><font size="4"><strong><%if(compare){%>调 整 后 的 <%}%>计 划 信 息</strong></font></font></div></td>
              </tr>
              <TR style="display:block">
              <TD  height=30 align="right"  bgColor=#eef4ff class="unnamed1" >项目计划名称:<strong></strong></TD>
                 <TD  height=30 align="left" bgColor=#eef4ff  colspan="3">
                 		<%
                 			System.out.println("项目计划名称:");
                 			String planname=plan.getPlanname();
                 			if(compare)
                 			{
                 				String tplplanname=tempplan.getPlanname();
                 				if(planname!=null && tplplanname!=null && !tplplanname.equals(planname))
                 				{
                 					out.print("<font title='原计划信息:"+planname+"' color='red'>");
                 					out.print(tplplanname);
                 					out.print("</font>");
                 				}
                 				else if(planname!=null)
                 					out.print(planname);
                 			}
                 			else if(planname!=null)
                 					out.print(planname);
                 			
                 		%>
                 	</td>
              </TR>
              <TR>
                 <TD width="18%" height=21 align=right bgColor=#eef4ff class="unnamed1">项目计划编号:<strong></strong></TD>
                 <TD height=21 align=left bgColor=#eef4ff><%=planno%></TD>
                 <TD width="21%"  height=10 align="left" bgColor=#eef4ff >
                 				<div align="right"><span class="unnamed1">计划类别:</span>
                 				</div>
                 </td>
                 <TD width="28%"  height=10 align="left" bgColor=#eef4ff >
                 		<%
                 			System.out.println("计划类别:");
                 			String plantype=plan.getPlantypename();

⌨️ 快捷键说明

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