equipment_batch_add.jsp
上传用户:guhaomin
上传日期:2007-06-10
资源大小:23203k
文件大小:15k
源码类别:

电子政务应用

开发平台:

Java

  1. <%@ page errorPage="/vnex/ErrorPage.jsp" %>
  2. <%@ page import="java.lang.*"%>
  3. <%@ page import="java.util.Collection"%>
  4. <%@ page import="java.util.Iterator"%>
  5. <%@ page import="java.util.Vector"%>
  6. <%@ page import="com.vnex.intranet.util.FieldUtil"%>
  7. <%@ page import="com.vnex.intranet.equipment.value.UserValueBean"%>
  8. <%@ taglib uri="/vnex.tld" prefix="vnex" %>
  9. <%@ taglib uri="/vnex_organization.tld" prefix="org" %>
  10. <%@ taglib uri="/vnex_hr.tld" prefix="hr" %>
  11. <jsp:useBean id="equipmentProxy" class="com.vnex.intranet.equipment.proxy.EquipmentProxyBean" scope="session" /> 
  12. <jsp:useBean id="equipmentValue" class="com.vnex.intranet.equipment.value.EquipmentValueBean" scope="session" /> 
  13. <jsp:useBean id="equipmentValueBatch" class="com.vnex.intranet.equipment.value.EquipmentValueBean" scope="session" /> 
  14. <jsp:setProperty name="equipmentValue" property="*" />
  15. <%!
  16. Collection list = null;
  17. Collection list2 = null;
  18. Collection listUsePerson = null;
  19. Collection listBuyPerson = null;
  20. Iterator ite = null;
  21. UserValueBean user = null;
  22. int i = -1;
  23. %> 
  24. <%
  25. if (equipmentValue.getTerm() == -1)
  26. equipmentValue.setTerm(0);
  27. if (equipmentValue.getQuantity() == -1)
  28. equipmentValue.setQuantity(1);
  29. if (request.getParameter("categoryId") != null )
  30. equipmentValue.setCategoryId(new Integer(request.getParameter("categoryId")).intValue());
  31. if (request.getParameter("categoryName") != null)
  32. equipmentValue.setCategoryName(request.getParameter("categoryName"));
  33. session.removeAttribute("equipmentValue");
  34. if (request.getParameter("ctn") != null)
  35. {
  36. if (request.getParameter("ctn").equals("1"))
  37. equipmentValue = equipmentValueBatch;
  38. }
  39. %> 
  40. <script Language="JavaScript" src="/vnex/util/Popup.js"></script>
  41. <script language="JavaScript" src="/vnex/util/validate.js"></script>
  42. <script language=JavaScript>
  43. function isNumberValid()
  44. {
  45. if (!(isFloat(myForm.price.value)))
  46. {
  47. alert("价格必须必须是数字!");
  48. myForm.price.focus();
  49. return false;
  50. }
  51. else
  52. {
  53. if (Number(myForm.price.value) > 99999999.99 || Number(myForm.price.value)< 0)
  54.     {
  55.      alert("价格必须在0和99999999.99之间");
  56.      myForm.price.focus();
  57.      return false;
  58.     }
  59. }
  60. if (!(isInteger(myForm.term.value)))
  61. {
  62. alert("使用期限必须是整数!");
  63. myForm.term.focus();
  64. return false;
  65. }
  66. else
  67. {
  68. if (Number(myForm.term.value) > 99999 || Number(myForm.term.value)< 0)
  69.     {
  70.      alert("使用期限必须在0和99999之间");
  71.      myForm.term.focus();
  72.      return false;
  73.     }
  74. }
  75. if (!(isInteger(myForm.quantity.value)))
  76. {
  77. alert("数量必须是整数!");
  78. myForm.quantity.focus();
  79. return false;
  80. }
  81. else
  82. {
  83. if (Number(myForm.quantity.value) > 99999999 || Number(myForm.quantity.value)< 1)
  84.     {
  85.      alert("数量必须在1和99999999之间");
  86.      myForm.quantity.focus();
  87.      return false;
  88.     }
  89. }
  90. return true;
  91. }
  92. function isDataValid()
  93. {
  94. if (! isNumberValid())
  95. return false;
  96. if ( myForm.categoryId.value.length <= 0 || myForm.categoryName.value.length == 0)
  97. {
  98. alert("请选择分类!");
  99. myForm.categoryId.value = "";
  100. myForm.categoryName.value = "";
  101. return false;
  102. }
  103. if (myForm.equipmentName.value.length <= 0 || myForm.equipmentName.value.length > 25)
  104. {
  105. alert("固定资产的名称是1-25个字符!");
  106. myForm.equipmentName.focus();
  107. return false;
  108. }
  109. if (myForm.purpose.value.length > 50)
  110. {
  111. alert("固定资产的用途应少于50个字符!");
  112. myForm.purpose.focus();
  113. return false;
  114. }
  115. if (myForm.model.value.length > 50)
  116. {
  117. alert("固定资产的型号应少于50个字符!");
  118. myForm.model.focus();
  119. return false;
  120. }
  121. if (myForm.configure.value.length > 125)
  122. {
  123. alert("固定资产的配置应少于125个字符!");
  124. myForm.configure.focus();
  125. return false;
  126. }
  127. if (myForm.supplier.value.length > 50)
  128. {
  129. alert("固定资产的提供者应少于50个字符!");
  130. myForm.supplier.focus();
  131. return false;
  132. }
  133. if (myForm.remark.value.length > 125)
  134. {
  135. alert("固定资产的说明应少于125个字符!");
  136. myForm.remark.focus();
  137. return false;
  138. }
  139. if (myForm.buyDeptId.value == "-2")
  140. {
  141. alert ("请选择购买部门!");
  142. myForm.buyDeptId.focus();
  143. return false;
  144. }
  145. if (myForm.buyPersonId.value == "-1")
  146. {
  147. alert ("请选择购买人!");
  148. myForm.buyPersonId.focus();
  149. return false;
  150. }
  151. var price=0.0;
  152. price = myForm.price.value;
  153. if (price <= 0)
  154. {
  155. alert("价格必须大于0");
  156. myForm.price.focus();
  157. return false;
  158. }
  159. if (myForm.beginDay.value == "")
  160. {
  161. alert("请选择购买日期!");
  162. myForm.beginDay.focus();
  163. return false;
  164. }
  165. return true;
  166. }
  167. function change(select)
  168. {
  169. if (isNumberValid())
  170. {
  171. myForm.action="/mainctrl/equipmentBatchAdd";
  172. myForm.submit();
  173. }
  174. }
  175. function toSuccess()
  176. {
  177. if (isDataValid())
  178. {
  179. myForm.action="/mainctrl/equipmentBatchAddSuccess?ctn=0";
  180. myForm.submit();
  181. }
  182. }
  183. function toContinueAdd()
  184. {
  185. if (isDataValid())
  186. {
  187. myForm.action="/mainctrl/equipmentBatchAddSuccess?ctn=1";
  188. myForm.submit();
  189. }
  190. }
  191. function toCategory()
  192. {
  193. if (isNumberValid())
  194. {
  195. myForm.action="/mainctrl/equipmentSave?pageName=equipmentBatchAdd";
  196. myForm.submit();
  197. }
  198. }
  199. function includeInvalid(str)
  200. {
  201. if (str.indexOf("'") == -1)
  202. {
  203. return false;
  204. }
  205. else
  206. {
  207. alert("包括非法字符’" );
  208. return true;
  209. }
  210. }
  211. function toSearch()
  212. {
  213. if (!(includeInvalid(searchForm.keyword.value)))
  214. {
  215. searchForm.action="/mainctrl/equipmentSearchResult";
  216. searchForm.submit();
  217. }
  218. }
  219. </script>
  220. <HTML><jsp:include page="/vnex/page/FORM_HEAD.jsp" />
  221. <BODY text=#000000 vLink=#000000 aLink=#000000 link=#000000 bgColor=#ffffff topMargin=20 leftmargin="0" marginwidth="0" marginheight="0">
  222. <script language="JavaScript1.2" src="/vnex/menu/dockmenu_office.js"></script>
  223. <script language="JavaScript1.2" src="/vnex/menu/dockmenu.js"></script>
  224. <DIV align=center>
  225. <form name="myForm" method="post" action="">
  226.     <TABLE class=outter cellSpacing=0 cellPadding=0 width=600 border=0>
  227.     <TBODY>
  228.     <jsp:include page="/vnex/page/TTOA_TABLE_TOP.jsp" />
  229.     <TR> 
  230.         <TD colSpan=3 align="center"><br>
  231.           <table width="600" border="1" cellspacing="1" bordercolor="#666666">
  232.             <tr bgcolor="#FAFAFA"> 
  233.               <td> 
  234.                 <table width="600" border="0" cellspacing="0" cellpadding="2">
  235.                   <tr>
  236.                     <td colspan="3" height="15" bgcolor="#666666"><font class="strongw"><a href="/mainctrl/home/index"><font color="#FFFFFF">首页</font></a>&gt;&gt;<a href="/mainctrl/office/main"><font color="#FFFFFF">办公室管理</font></a>&gt;&gt;<a href="/mainctrl/equipmentSearchResult"><font color="#FFFFFF">固定资产管理</font></a>&gt;&gt;固定资产批量增加</font>
  237.                     </td>
  238.                   </tr>
  239.                 </table>
  240.                 <table class=title width="600" border="0" cellspacing="1" cellpadding="2">
  241.                   <tr bgcolor="#fafafa">
  242.                     <td width="131"> 
  243.                       <font class="strong" >&nbsp;资产类别:</font>
  244.                     </td>
  245.                     <td width="463"> 
  246.                       <input type="hidden"  name="categoryId" size="8" class="file" value="<%= equipmentValue.getCategoryId()%>">                      
  247.                       <input type="text" name="categoryName" size="24" class="file" readonly value="<%= FieldUtil.filterQuotTag(equipmentValue.getCategoryName())%>">
  248.                       <input type="button" name="Submit3" value="选择" class="file" onClick= toCategory()>&nbsp;*&nbsp;(注:带*为必填内容)
  249.                     </td>
  250.                   </tr>
  251.                   <tr bgcolor="#e0e0e0">                     
  252.                     <td width="109"> 
  253.                       <div align="left"><font class="strong" >&nbsp;名称:</font> </div>
  254.                     </td>
  255.                     <td colspan="2" width="295"> 
  256.                       <input type="text" name="equipmentName" size="24" class="file" value="<%= FieldUtil.filterQuotTag(equipmentValue.getEquipmentName())%>">&nbsp;*
  257.                     </td>
  258.                   </tr>
  259.                   <tr bgcolor="#fafafa">                     
  260.                     <td width="109"> 
  261.                       <div align="left"><font  class="strong">&nbsp;用途: </font></div>
  262.                     </td>
  263.                     <td colspan="2" width="295"><font  class="strong"> 
  264.                       <input type="text" name="purpose" size="24" class="file" value="<%= FieldUtil.filterQuotTag(equipmentValue.getPurpose())%>">
  265.                       </font></td>
  266.                   </tr>
  267.                   <tr bgcolor="#e0e0e0">                     
  268.                     <td width="109"> 
  269.                       <div align="left"><font  class="strong"><font  class="strong">&nbsp;型号:<font  class="strong"> 
  270.                         </font> </font></font></div>
  271.                     </td>
  272.                     <td colspan="2" width="295"><font  class="strong"><font  class="strong"> 
  273.                       <input type="text" name="model" class="file" size="24" value="<%= FieldUtil.filterQuotTag(equipmentValue.getModel())%>">
  274.                       </font></font></td>
  275.                   </tr>
  276.                   
  277.                   <tr bgcolor="#fafafa">                    
  278.                     <td width="109"><font  class="strong">&nbsp;配置</font>:</td>
  279.                     <td colspan="2" width="295"><font  class="strong"><font  class="strong"> 
  280.                       <input type="text" name="configure" class="file" size="24" value="<%= FieldUtil.filterQuotTag(equipmentValue.getConfigure())%>">
  281.                       </font></font></td>
  282.                   </tr>
  283.                   
  284.                   <tr bgcolor="#e0e0e0">                    
  285.                     <td width="109"> 
  286.                       <div align="left"><font  class="strong">&nbsp;购买价格</font>:</div>
  287.                     </td>
  288.                     <td colspan="2" width="295"><font  class="strong"><font  class="strong"> 
  289.                       <input type="text" name="price" class="file" size="24" value="<%= equipmentValue.getPrice()%>">
  290.                       </font></font>元&nbsp;*</td>
  291.                   </tr>
  292.                   <tr bgcolor="#fafafa">
  293.                     <td width="109"> 
  294.                       <div align="left"><font  class="strong">&nbsp;购买日期</font>:</div>
  295.                     </td>
  296.                     <td colspan="2" width="295"> 
  297.                       <div align="left">
  298.                           <input type="text" name="beginDay" readonly size="24" class="text" value="<%= equipmentValue.getBeginDay()%>" >
  299.                           <img src="/vnex/util/datetime.gif" style="cursor:hand;" align="absmiddle" alt="选择日期" onClick="fPopUpCalendarDlg(beginDay);return false">&nbsp;*
  300.                       </div> 
  301.                     </td>
  302.                   </tr>
  303.                   <tr bgcolor="#e0e0e0"> 
  304.                     <td width="109"><font  class="strong">&nbsp;购买者:</font></td>
  305.                     <td colspan="2" width="295"> 
  306.                     <select name="buyDeptId" class=choice onChange=change(this)>
  307.                     <option value="-2">-请选择-</option>
  308.                     <org:DivisionList noRoot="false">
  309.                     <vnex:items select='<%= equipmentValue.getBuyDeptId()+"" %>' >
  310.                     <option value=<org:DivisionAttribute attribute="id"/> <org:DivisionAttribute attribute="isSelected"/> >
  311.                     <org:DivisionAttribute attribute="levelStr"/>+<org:DivisionAttribute attribute="name"/>
  312.                     </option>
  313.                     </vnex:items>
  314.                     </org:DivisionList>
  315.                     </select>&nbsp;*
  316.                     
  317.                     <select name="buyPersonId">
  318.             <option value=-1>-请选择-</option>
  319.                     <hr:EmployeeList divisionId='<%= equipmentValue.getBuyDeptId()%>'>             
  320.             <vnex:items  select ='<%= equipmentValue.getBuyPersonId()+""%>'>
  321.             <option value="<hr:EmployeeAttribute attribute="id" />" <hr:EmployeeAttribute attribute="isSelected"/> >
  322.             <hr:EmployeeAttribute attribute='<%= null %>' />
  323.             </option>
  324.             </vnex:items>            
  325.            </hr:EmployeeList>
  326.            </select>&nbsp;*            
  327.            
  328.                     </td>
  329.                   </tr>
  330.                   <tr bgcolor="#fafafa"> 
  331.                     <td width="109"><font  class="strong">&nbsp;供应者:</font></td>
  332.                     <td colspan="2" width="295"><font  class="strong"><font  class="strong"> 
  333.                       <input type="text" name="supplier" class="file" size="24" value="<%= FieldUtil.filterQuotTag(equipmentValue.getSupplier())%>">
  334.                       </font></font></td>
  335.                   </tr>
  336.                   <tr bgcolor="#e0e0e0">
  337.                     <td width="109"><font  class="strong">&nbsp;数量:</font></td>
  338.                     <td colspan="2" width="295"><font  class="strong"><font  class="strong"> 
  339.                       <input type="text" name="quantity" class="file" size="24" value="<%= equipmentValue.getQuantity()%>">
  340.                       </font></font></td>
  341.                   </tr>
  342.                   
  343.                   <tr bgcolor="#fafafa">                     
  344.                     <td width="109"> 
  345.                       <div align="left"><font  class="strong">&nbsp;估计使用年限</font>:</div>
  346.                     </td>
  347.                     <td colspan="2" width="295"><font size="2"><font face="宋体"> 
  348.                       </font><font size="2"><font  class="strong"><font  class="strong"> 
  349.                       <input type="text" name="term" class="file" size="24" value="<%= equipmentValue.getTerm()%>">
  350.                       </font></font><font face="宋体">月</font></font><font face="宋体"> 
  351.                       </font></font></td>
  352.                   </tr>
  353.                   <tr bgcolor="#e0e0e0">
  354.                     <td width="131"> 
  355.                       <font  class="strong">&nbsp;其他说明:</font>
  356.                     </td>
  357.                     <td width="463">
  358.                         <textarea name="remark" cols="59" rows="5"><%= FieldUtil.filterQuotTag(equipmentValue.getRemark())%></textarea>
  359.                       </td>
  360.                         </div>
  361.                     </td>
  362.                   </tr>
  363.                   <tr  bgcolor="#fafafa" height="30"> 
  364.                     <td colspan="4"> 
  365.                       <div align="center"> 
  366.                         <input type="button" name="Button2" value="继续增加" class="file" style="width: 60px" onclick=toContinueAdd() >&nbsp;&nbsp;
  367.                         <input type="button" name="Button1" value="保存" class="file" onclick=toSuccess() >&nbsp;&nbsp;                        
  368.                         <input type="reset" name="Button4" value="重置" class="file"  >&nbsp;&nbsp;
  369.                         <input type="button" name="Button3" value="放弃" class="file" onClick="location='/mainctrl/equipmentSearchResult'" >
  370.                     </td>
  371.                   </tr>
  372.                 </table>
  373.               </td>
  374.             </tr>
  375.           </table>
  376.           <jsp:include page="/vnex/page/TTOA_HELP.jsp" />
  377.        </TD>
  378.      </TR>
  379.      <jsp:include page="/vnex/page/TTOA_TABLE_BOTTOM.jsp" />
  380.     </TBODY> 
  381.   </TABLE>
  382.     <BR>
  383.   <jsp:include page="/vnex/page/TTOA_PRODUCER_LOGO.jsp" />
  384. </form>
  385. </DIV>
  386. </BODY>
  387. </HTML>