equipment_code_use_add.jsp
资源名称:NetOffice.rar [点击查看]
上传用户:guhaomin
上传日期:2007-06-10
资源大小:23203k
文件大小:11k
源码类别:
电子政务应用
开发平台:
Java
- <%@ taglib uri="/vnex.tld" prefix="vnex" %>
- <%@ taglib uri="/vnex_organization.tld" prefix="org" %>
- <%@ taglib uri="/vnex_hr.tld" prefix="hr" %>
- <%@ page import="java.lang.*"%>
- <%@ page import="java.sql.Timestamp" %>
- <%@ page import="java.util.Calendar" %>
- <%@ page import="com.vnex.intranet.util.TimeStamp" %>
- <%@ page import="com.vnex.intranet.util.FieldUtil" %>
- <jsp:useBean id="equipmentProxy" class="com.vnex.intranet.equipment.proxy.EquipmentProxyBean" scope="session" />
- <jsp:useBean id="codeUse" class="com.vnex.intranet.equipment.value.EquipmentUseRecordValueBean" scope="session" />
- <jsp:useBean id="equipmentInfo" class="com.vnex.intranet.equipment.value.EquipmentValueBean" scope="page" />
- <jsp:useBean id="useValue" class="com.vnex.intranet.equipment.value.EquipmentUseRecordValueBean" scope="session" />
- <jsp:setProperty name="useValue" property="*" />
- <%
- String start = "";
- HttpSession sess= request.getSession(false);
- if (request.getParameter("start") != null)
- {
- start = request.getParameter("start");
- sess.setAttribute("start3",start);
- }
- start = (String)sess.getAttribute("start3");
- String batchId = request.getParameter("batchId");
- equipmentInfo = equipmentProxy.findEquipmentDetailByBatch(Integer.parseInt(batchId));
- Timestamp lastDay = equipmentInfo.getBuyDate();
- Calendar cal = TimeStamp.convertTimestampToCalendar(lastDay);
- String strLastDay = "" + cal.get(Calendar.YEAR) + "-";
- if (cal.get(Calendar.MONTH) < 10)
- strLastDay = strLastDay + "0" + cal.get(Calendar.MONTH) + "-";
- else
- strLastDay = strLastDay + cal.get(Calendar.MONTH) + "-";
- if (cal.get(Calendar.DAY_OF_MONTH) < 10)
- strLastDay = strLastDay + "0" + cal.get(Calendar.DAY_OF_MONTH);
- else
- strLastDay = strLastDay + cal.get(Calendar.DAY_OF_MONTH);
- session.removeAttribute("useValue");
- if (request.getParameter("ctn") != null)
- {
- if (request.getParameter("ctn").equals("1"))
- useValue = codeUse;
- }
- if (request.getParameter("useDeptId") == null)
- {
- useValue.setUseDeptId(-2);
- }
- %>
- <script Language="JavaScript" src="/vnex/util/Popup.js"></script>
- <script language="JavaScript" src="/vnex/util/validate.js"></script>
- <script Language="JavaScript">
- function change(form)
- {
- form.action="/mainctrl/equipmentCodeUseAdd?batchId=<%=batchId%>&keyword=<%=request.getParameter("keyword")%>";
- form.submit();
- }
- function isDataValid(form)
- {
- if ( form.equipmentCode.value.length == 0 || form.equipmentCode.value.length > 25 )
- {
- alert ("请输入固定资产编号必须是1-25个字符!");
- form.equipmentCode.focus();
- return false;
- }
- if (form.useDeptId.value == "-2")
- {
- alert ("请选择使用部门!");
- form.useDeptId.focus();
- return false;
- }
- if (form.usePersonId.value == "-1")
- {
- alert ("请选择使用人!");
- form.usePersonId.focus();
- return false;
- }
- if ( form.startDay.value.length == 0 )
- {
- alert ("请选择日期!");
- return false;
- }
- if ("<%=strLastDay%>" > form.startDay.value)
- {
- alert("固定资产的购买时间是<%=strLastDay%>,n请选择一个在此日期之后的日期!");
- return false;
- }
- if ( form.place.value.length > 50 )
- {
- alert ("请输入固定资产的放置地点应小于50个字符!");
- form.place.focus();
- return false;
- }
- return true;
- }
- function toAddSuccess(form)
- {
- if (! isDataValid(form))
- return false;
- form.action="/mainctrl/equipmentCodeUseAddSuccess?batchId=<%=batchId%>&keyword=<%=request.getParameter("keyword")%>&ctn=0&cache=true&start=<%=start%>";
- form.submit();
- }
- function toContinueAdd(form)
- {
- if (! isDataValid(form))
- return false;
- form.action="/mainctrl/equipmentCodeUseAddSuccess?batchId=<%=batchId%>&keyword=<%=request.getParameter("keyword")%>&ctn=1&cache=true&start=<%=start%>";
- form.submit();
- }
- function toUseList(form)
- {
- form.action="/mainctrl/equipmentBatchSearchResult?cache=true&start=<%=start%>";
- form.submit();
- }
- </script>
- <HTML>
- <jsp:include page="/vnex/page/FORM_HEAD.jsp" />
- <BODY text=#000000 vLink=#000000 aLink=#000000 link=#000000 bgColor=#ffffff topMargin=20 leftmargin="0" marginwidth="0" marginheight="0">
- <script language="JavaScript1.2" src="/vnex/menu/dockmenu_office.js"></script>
- <script language="JavaScript1.2" src="/vnex/menu/dockmenu.js"></script>
- <DIV align=center>
- <form name="form1" method="post" action="">
- <TABLE class=outter cellSpacing=0 cellPadding=0 width=600 border=0>
- <TBODY>
- <jsp:include page="/vnex/page/TTOA_TABLE_TOP.jsp" />
- <TR>
- <TD colSpan=3 align="center"><br>
- <table width="600" border="1" cellspacing="1" bordercolor="#666666">
- <tr bgcolor="#FAFAFA">
- <td>
- <table width="600" border="0" cellspacing="0" cellpadding="2">
- <tr>
- <td colspan="3" height="15" bgcolor="#666666"><font class="strongw"><a href="/mainctrl/home/index"><font color="#FFFFFF">首页</font></a>>><a href="/mainctrl/office/main"><font color="#FFFFFF">办公室管理</font></a>>><a href="/mainctrl/equipmentSearchResult"><font color="#FFFFFF">固定资产管理</font></a>>>增加编码和使用者</font>
- </td>
- </tr>
- </table>
- <table class=title width="600" border="0" cellspacing="1" cellpadding="2">
- <tr bgcolor="#fafafa">
- <td width="115" >
- <font class="strong"> 固定资产批号:</font>
- </td>
- <td width="477">
- <%=batchId%>
- </td>
- </tr>
- <tr bgcolor="#e0e0e0">
- <td width="115"><font class="strong"> 名称:</font></td>
- <td width="477">
- <%=FieldUtil.filterScriptTag(equipmentInfo.getEquipmentName())%>
- </td>
- </tr>
- <tr bgcolor="#fafafa">
- <td width="115" ><font class="strong"> 型号:</font></td>
- <td width="477" >
- <%=FieldUtil.filterScriptTag(equipmentInfo.getModel())%>
- </td>
- </tr>
- <tr bgcolor="#e0e0e0">
- <td width="115">
- <font class="strong"> 编号:</font>
- </td>
- <td width="477">
- <input type="text" name="equipmentCode" class="file" size="24" value = "<%=FieldUtil.filterQuotTag(useValue.getEquipmentCode())%>"> * (注:带*为必填内容)</td>
- </tr>
- <tr bgcolor="#fafafa">
- <td width="115">
- <font class="strong"> 使用部门: </font>
- </td>
- <td width="477">
- <select name="useDeptId" class=choice onChange=change(form1)>
- <option value="-2">-请选择-</option>
- <org:DivisionList noRoot="false">
- <vnex:items select='<%= useValue.getUseDeptId()+"" %>' >
- <option value=<org:DivisionAttribute attribute="id"/> <org:DivisionAttribute attribute="isSelected"/> >
- <org:DivisionAttribute attribute="levelStr"/>+<org:DivisionAttribute attribute="name"/>
- </option>
- </vnex:items>
- </org:DivisionList>
- </select> *
- </td>
- </tr>
- <tr>
- <td width="115" bgcolor="#e0e0e0">
- <font class="strong"> 使用者: </font>
- </td>
- <td width="477" bgcolor="#e0e0e0">
- <select name="usePersonId">
- <option value=-1>-请选择-</option>
- <hr:EmployeeList divisionId='<%= useValue.getUseDeptId()%>'>
- <vnex:items select ='<%= useValue.getUsePersonId()+""%>'>
- <option value="<hr:EmployeeAttribute attribute="id" />" <hr:EmployeeAttribute attribute="isSelected"/> >
- <hr:EmployeeAttribute attribute='<%= null %>' />
- </option>
- </vnex:items>
- </hr:EmployeeList>
- </select> *
- </td>
- </tr>
- <tr bgcolor="#fafafa">
- <td width="115" >
- <font class="strong"> 起用时间: </font>
- </td>
- <td width="477">
- <input type="text" name="startDay" readonly size="24" class="text" value="<%= useValue.getStartDay()%>" >
- <img src="/vnex/util/datetime.gif" style="cursor:hand;" align="absmiddle" alt="选择日期" onClick="fPopUpCalendarDlg(startDay);return false"> *
- </td>
- </tr>
- <tr>
- <td width="115" bgcolor="#e0e0e0">
- <font class="strong"> 放置地点:</font><font class="strong"> </font>
- </td>
- <td width="477" bgcolor="#e0e0e0">
- <input type="text" name="place" class="file" size="24" value = "<%=FieldUtil.filterQuotTag(useValue.getPlace())%>">
- </td>
- </tr>
- <tr bgcolor="#fafafa" align="center">
- <td colspan="2" height="30">
- <input type="button" name="Submit4" value="继续增加" class="file" onClick="toContinueAdd(form1)">
- <input type="button" name="Submit" value="保存" class="file" onclick="toAddSuccess(form1)">
- <input type="reset" name="Submit3" value="重置" class="file" >
- <input type="button" name="Submit2" class="file" value="放弃" onclick="toUseList(form1)">
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- <table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td height="3"><img src="a.gif" width="1" height="1"></td>
- </tr>
- <tr>
- <td background="/vnex/MacOS/hr.gif"><img src="/vnex/MacOS/hr.gif" width="1" height="2"></td>
- </tr>
- <tr>
- <td height="3"><img src="a.gif" width="1" height="1"></td>
- </tr>
- </table>
- <jsp:include page="/vnex/page/TTOA_HELP.jsp" />
- </TD>
- </TR>
- <jsp:include page="/vnex/page/TTOA_TABLE_BOTTOM.jsp" />
- </TBODY>
- </TABLE>
- <BR>
- <jsp:include page="/vnex/page/TTOA_PRODUCER_LOGO.jsp" />
- </form>
- </DIV>
- </BODY>
- </HTML>