equipment_add.jsp
资源名称:NetOffice.rar [点击查看]
上传用户:guhaomin
上传日期:2007-06-10
资源大小:23203k
文件大小:17k
源码类别:
电子政务应用
开发平台:
Java
- <%@ page errorPage="/vnex/ErrorPage.jsp" %>
- <%@ page import="java.lang.*"%>
- <%@ page import="java.util.Collection"%>
- <%@ page import="java.util.Iterator"%>
- <%@ page import="java.util.Vector"%>
- <%@ page import="com.vnex.intranet.util.FieldUtil"%>
- <%@ page import="com.vnex.intranet.equipment.value.UserValueBean"%>
- <%@ taglib uri="/vnex.tld" prefix="vnex" %>
- <%@ taglib uri="/vnex_organization.tld" prefix="org" %>
- <%@ taglib uri="/vnex_hr.tld" prefix="hr" %>
- <jsp:useBean id="equipmentProxy" class="com.vnex.intranet.equipment.proxy.EquipmentProxyBean" scope="session" />
- <jsp:useBean id="equipmentValue" class="com.vnex.intranet.equipment.value.EquipmentValueBean" scope="session" />
- <jsp:useBean id="equipmentValueAdd" class="com.vnex.intranet.equipment.value.EquipmentValueBean" scope="session" />
- <jsp:setProperty name="equipmentValue" property="*" />
- <%!
- Collection list = null;
- Collection list2 = null;
- Collection listUsePerson = null;
- Collection listBuyPerson = null;
- Iterator ite = null;
- UserValueBean user = null;
- int i = -1;
- %>
- <%
- if (equipmentValue.getTerm() == -1)
- equipmentValue.setTerm(0);
- if (equipmentValue.getQuantity() == -1)
- equipmentValue.setQuantity(0);
- if (request.getParameter("categoryId") != null )
- equipmentValue.setCategoryId(new Integer(request.getParameter("categoryId")).intValue());
- if (request.getParameter("categoryName") != null)
- equipmentValue.setCategoryName(request.getParameter("categoryName"));
- if (request.getParameter("ctn") != null)
- {
- if (request.getParameter("ctn").equals("1"))
- equipmentValue = equipmentValueAdd;
- }
- String deptId = equipmentValue.getUseDeptId()+"";
- if (request.getParameter("useDeptId") == null)
- {
- equipmentValue.setUseDeptId(-2);
- }
- if (request.getParameter("buyDeptId") == null)
- {
- equipmentValue.setBuyDeptId(-2);
- }
- %>
- <script Language="JavaScript" src="/vnex/util/Popup.js"></script>
- <script language="JavaScript" src="/vnex/util/validate.js"></script>
- <script language=JavaScript>
- function isNumberValid()
- {
- if (!(isFloat(myForm.price.value)))
- {
- alert("价格必须必须是数字!");
- myForm.price.focus();
- return false;
- }
- else
- {
- if (Number(myForm.price.value) > 99999999.99 || Number(myForm.price.value)< 0)
- {
- alert("价格必须在0和99999999.99之间")
- myForm.price.focus();
- return false;
- }
- }
- if (!(isInteger(myForm.term.value)))
- {
- alert("使用期限必须是整数!");
- myForm.term.focus();
- return false;
- }
- else
- {
- if (Number(myForm.term.value) > 99999 || Number(myForm.term.value)< 0)
- {
- alert("使用期限必须在0和99999之间");
- myForm.term.focus();
- return false;
- }
- }
- return true;
- }
- function isDataValid()
- {
- if (! isNumberValid())
- return false;
- if ( myForm.categoryId.value.length <= 0 || myForm.categoryName.value.length == 0)
- {
- alert("请选择分类!");
- myForm.categoryId.value = "";
- myForm.categoryName.value = "";
- return false;
- }
- if (myForm.equipmentName.value.length <= 0 || myForm.equipmentName.value.length > 25||!stripWhitespace(myForm.equipmentName.value))
- {
- alert("固定资产的名称是1-25个字符且不能为空!");
- myForm.equipmentName.focus();
- return false;
- }
- if (myForm.purpose.value.length > 50)
- {
- alert("固定资产的用途应少于50个字符!");
- myForm.purpose.focus();
- return false;
- }
- if (myForm.model.value.length > 50)
- {
- alert("固定资产的型号应少于50个字符!");
- myForm.model.focus();
- return false;
- }
- if (myForm.equipmentCode.value.length > 25 || myForm.equipmentCode.value.length < 1)
- {
- alert("固定资产的编号应该是1-25个字符!");
- myForm.equipmentCode.focus();
- return false;
- }
- if (myForm.configure.value.length > 125)
- {
- alert("固定资产的配置应少于125个字符!");
- myForm.configure.focus();
- return false;
- }
- if (myForm.supplier.value.length > 50)
- {
- alert("固定资产的提供者应少于50个字符!");
- myForm.supplier.focus();
- return false;
- }
- if (myForm.place.value.length > 50)
- {
- alert("固定资产的地点应少于50个字符!");
- myForm.place.focus();
- return false;
- }
- if (myForm.remark.value.length > 125)
- {
- alert("固定资产的说明应少于125个字符!");
- myForm.remark.focus();
- return false;
- }
- if (myForm.useDeptId.value == "-2")
- {
- alert ("请选择使用部门!");
- myForm.useDeptId.focus();
- return false;
- }
- if (myForm.usePersonId.value == "-1")
- {
- alert ("请选择使用人!");
- myForm.usePersonId.focus();
- return false;
- }
- if (myForm.buyDeptId.value == "-2")
- {
- alert ("请选择购买部门!");
- myForm.buyDeptId.focus();
- return false;
- }
- if (myForm.buyPersonId.value == "-1")
- {
- alert ("请选择购买人!");
- myForm.buyPersonId.focus();
- return false;
- }
- var price=0.0;
- price = myForm.price.value;
- if (price <= 0)
- {
- alert("价格必须大于0");
- myForm.price.focus();
- return false;
- }
- if (myForm.beginDay.value == "")
- {
- alert("请选择购买日期!");
- return false;
- }
- return true;
- }
- function change(select)
- {
- if (isNumberValid())
- {
- myForm.action="/mainctrl/equipmentAdd";
- myForm.submit();
- }
- }
- function toSuccess()
- {
- if (isDataValid())
- {
- myForm.action="/mainctrl/equipmentAddSuccess?ctn=0";
- myForm.submit();
- }
- }
- function toContinueAdd()
- {
- if (isDataValid())
- {
- myForm.action="/mainctrl/equipmentAddSuccess?ctn=1";
- myForm.submit();
- }
- }
- function toCategory()
- {
- if (isNumberValid())
- {
- <%
- session.removeAttribute("equipmentValue");
- %>
- myForm.action="/mainctrl/equipmentSave?pageName=equipmentAdd";
- myForm.submit();
- }
- }
- function includeInvalid(str)
- {
- if (str.indexOf("'") == -1)
- {
- return false;
- }
- else
- {
- alert("包括非法字符’" );
- return true;
- }
- }
- function toSearch()
- {
- if (!(includeInvalid(searchForm.keyword.value)))
- {
- searchForm.action="/mainctrl/equipmentSearchResult";
- searchForm.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="myForm" 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="131">
- <font class="strong" > 资产类别:</font>
- </td>
- <td width="463">
- <input type="hidden" name="categoryId" size="8" class="file" value="<%= equipmentValue.getCategoryId()%>">
- <input type="text" name="categoryName" size="24" class="file" readonly value="<%= FieldUtil.filterQuotTag(equipmentValue.getCategoryName())%>">
- <input type="button" name="Submit3" value="选择" class="file" onClick= toCategory()> * (注:带*为必填内容)
- </td>
- </tr>
- <tr bgcolor="#e0e0e0">
- <td width="131">
- <font class="strong" > 名称:</font>
- </td>
- <td width="463">
- <input type="text" name="equipmentName" size="24" class="file" value="<%= FieldUtil.filterQuotTag(equipmentValue.getEquipmentName())%>"> *
- </td>
- </tr>
- <tr bgcolor="#fafafa">
- <td width="131">
- <font class="strong"> 用途: </font>
- </td>
- <td width="463">
- <input type="text" name="purpose" size="24" class="file" value="<%= FieldUtil.filterQuotTag(equipmentValue.getPurpose())%>">
- </td>
- </tr>
- <tr bgcolor="#e0e0e0">
- <td width="131">
- <font class="strong"> 型号:</font>
- </td>
- <td width="463">
- <input type="text" name="model" size="24" class="file" value="<%= FieldUtil.filterQuotTag(equipmentValue.getModel())%>">
- </td>
- </tr>
- <tr bgcolor="#fafafa">
- <td width="131"><font class="strong"> 资产编号:</font></td>
- <td width="463">
- <input type="text" name="equipmentCode" size="24" class="file" value="<%= FieldUtil.filterQuotTag(equipmentValue.getEquipmentCode())%>"> *
- </td>
- </tr>
- <tr bgcolor="#e0e0e0">
- <td width="131"><font class="strong"> 配置:</font></td>
- <td width="463">
- <input type="text" name="configure" size="24" class="file" value="<%= FieldUtil.filterQuotTag(equipmentValue.getConfigure())%>">
- </td>
- </tr>
- <tr bgcolor="#fafafa">
- <td width="131">
- <font class="strong"> 使用者:</font>
- </td>
- <td width="463">
- <select name="useDeptId" class=choice onChange=change(this)>
- <option value=-2>-请选择-</option>
- <org:DivisionList noRoot="false">
- <vnex:items select='<%=deptId%>' >
- <option value=<org:DivisionAttribute attribute="id"/> <org:DivisionAttribute attribute="isSelected"/> >
- <org:DivisionAttribute attribute="levelStr"/>+<org:DivisionAttribute attribute="name"/>
- </option>
- </vnex:items>
- </org:DivisionList>
- </select> *
- <select name="usePersonId">
- <option value=-1>-请选择-</option>
- <hr:EmployeeList divisionId='<%= equipmentValue.getUseDeptId()%>'>
- <vnex:items select ='<%= equipmentValue.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="#e0e0e0">
- <td width="131">
- <font class="strong"> 购买价格:</font>
- </td>
- <td width="463">
- <input type="text" name="price" class="file" size="24" value="<%= equipmentValue.getPrice()%>"> *
- 元</td>
- </tr>
- <tr bgcolor="#fafafa">
- <td width="131">
- <font class="strong"> 购买日期:</font>
- </td>
- <td width="463">
- <div align="left">
- <input type="text" name="beginDay" readonly size="24" class="text" value="<%= equipmentValue.getBeginDay()%>" >
- <img src="/vnex/util/datetime.gif" style="cursor:hand;" align="absmiddle" alt="选择日期" onClick="fPopUpCalendarDlg(beginDay);return false"> *
- </div>
- </td>
- </tr>
- <tr bgcolor="#e0e0e0">
- <td width="131"><font class="strong"> 购买者:</font></td>
- <td width="463">
- <select name="buyDeptId" class=choice onChange=change(this)>
- <option value="-2">-请选择-</option>
- <org:DivisionList noRoot="false">
- <vnex:items select='<%= equipmentValue.getBuyDeptId()+"" %>' >
- <option value=<org:DivisionAttribute attribute="id"/> <org:DivisionAttribute attribute="isSelected"/> >
- <org:DivisionAttribute attribute="levelStr"/>+<org:DivisionAttribute attribute="name"/>
- </option>
- </vnex:items>
- </org:DivisionList>
- </select> *
- <select name="buyPersonId">
- <option value=-1>-请选择-</option>
- <hr:EmployeeList divisionId='<%= equipmentValue.getBuyDeptId()%>'>
- <vnex:items select ='<%= equipmentValue.getBuyPersonId()+""%>'>
- <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="131"><font class="strong"> 供应者:</font></td>
- <td width="463">
- <input type="text" name="supplier" size="24" class="file" value="<%= FieldUtil.filterQuotTag(equipmentValue.getSupplier())%>">
- </td>
- </tr>
- <tr bgcolor="#e0e0e0">
- <td width="131">
- <font class="strong"> 放置地点:</font>
- </td>
- <td width="463">
- <input type="text" name="place" size="24" class="file" value="<%= FieldUtil.filterQuotTag(equipmentValue.getPlace())%>">
- </td>
- </tr>
- <tr bgcolor="#fafafa">
- <td width="131">
- <font class="strong"> 估计使用年限:</font>
- </td>
- <td width="463"><font size="2"><font face="宋体">
- </font><font size="2"><font class="strong"><font class="strong">
- <input type="text" name="term" class="file" size="24" value="<%= equipmentValue.getTerm()%>">
- </font></font><font face="宋体">月</font></font><font face="宋体">
- </font></font></td>
- </tr>
- <tr bgcolor="#e0e0e0">
- <td width="131">
- <font class="strong"> 其他说明:</font>
- </td>
- <td width="463">
- <textarea name="remark" cols="59" rows="5"><%= FieldUtil.filterQuotTag(equipmentValue.getRemark())%></textarea>
- </td>
- </tr>
- <tr bgcolor="#fafafa" align="center">
- <td colspan="2" height="30">
- <input type="button" name="Button" value="保存" class="file" onclick=toSuccess() >
- <input type="reset" name="reset" value="重置" class="file" >
- <input type="button" name="Button3" value="放弃" class="file" onClick="location='/mainctrl/equipmentSearchResult'">
- </td>
- </tr>
- </table>
- </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>