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

电子政务应用

开发平台:

Java

  1. <%@ taglib uri="/vnex.tld" prefix="vnex" %>
  2. <%@ taglib uri="/vnex_organization.tld" prefix="org" %>
  3. <%@ taglib uri="/vnex_hr.tld" prefix="hr" %>
  4. <%@ page import="java.lang.*"%>
  5. <%@ page import="java.sql.Timestamp" %>
  6. <%@ page import="java.util.Calendar" %>
  7. <%@ page import="com.vnex.intranet.util.TimeStamp" %>
  8. <%@ page import="com.vnex.intranet.util.FieldUtil" %>
  9. <jsp:useBean id="equipmentProxy" class="com.vnex.intranet.equipment.proxy.EquipmentProxyBean" scope="session" /> 
  10. <jsp:useBean id="codeUse" class="com.vnex.intranet.equipment.value.EquipmentUseRecordValueBean" scope="session" /> 
  11. <jsp:useBean id="equipmentInfo" class="com.vnex.intranet.equipment.value.EquipmentValueBean" scope="page" />
  12. <jsp:useBean id="useValue" class="com.vnex.intranet.equipment.value.EquipmentUseRecordValueBean" scope="session" />
  13. <jsp:setProperty name="useValue" property="*" />
  14. <%
  15. String start = "";
  16. HttpSession sess= request.getSession(false);
  17. if (request.getParameter("start") != null)
  18. {
  19. start = request.getParameter("start");
  20. sess.setAttribute("start3",start);
  21. }
  22. start = (String)sess.getAttribute("start3");
  23. String batchId = request.getParameter("batchId");
  24. equipmentInfo = equipmentProxy.findEquipmentDetailByBatch(Integer.parseInt(batchId));
  25. Timestamp lastDay = equipmentInfo.getBuyDate();
  26. Calendar cal = TimeStamp.convertTimestampToCalendar(lastDay);
  27. String strLastDay = "" + cal.get(Calendar.YEAR) + "-";
  28. if (cal.get(Calendar.MONTH) < 10)
  29.    strLastDay = strLastDay + "0" +  cal.get(Calendar.MONTH) + "-";
  30. else 
  31. strLastDay = strLastDay + cal.get(Calendar.MONTH) + "-";
  32. if (cal.get(Calendar.DAY_OF_MONTH) < 10)
  33. strLastDay = strLastDay + "0" +  cal.get(Calendar.DAY_OF_MONTH);
  34. else
  35. strLastDay = strLastDay  +  cal.get(Calendar.DAY_OF_MONTH);
  36. session.removeAttribute("useValue");
  37. if (request.getParameter("ctn") != null)
  38. {
  39. if (request.getParameter("ctn").equals("1"))
  40. useValue = codeUse;
  41. }
  42. if (request.getParameter("useDeptId") == null)
  43. {
  44. useValue.setUseDeptId(-2);
  45. }
  46. %>
  47. <script Language="JavaScript" src="/vnex/util/Popup.js"></script>
  48. <script language="JavaScript" src="/vnex/util/validate.js"></script>
  49. <script Language="JavaScript">
  50. function change(form)
  51. {
  52. form.action="/mainctrl/equipmentCodeUseAdd?batchId=<%=batchId%>&keyword=<%=request.getParameter("keyword")%>";
  53. form.submit();
  54. }
  55. function isDataValid(form)
  56. {
  57. if ( form.equipmentCode.value.length == 0 || form.equipmentCode.value.length > 25 )
  58. {
  59. alert ("请输入固定资产编号必须是1-25个字符!");
  60. form.equipmentCode.focus();
  61. return false;
  62. }
  63. if (form.useDeptId.value == "-2")
  64. {
  65. alert ("请选择使用部门!");
  66. form.useDeptId.focus();
  67. return false;
  68. }
  69. if (form.usePersonId.value == "-1")
  70. {
  71. alert ("请选择使用人!");
  72. form.usePersonId.focus();
  73. return false;
  74. }
  75. if ( form.startDay.value.length == 0 )
  76. {
  77. alert ("请选择日期!");
  78. return false;
  79. }
  80. if ("<%=strLastDay%>" > form.startDay.value)
  81. {
  82. alert("固定资产的购买时间是<%=strLastDay%>,n请选择一个在此日期之后的日期!");
  83. return false;
  84. }
  85. if ( form.place.value.length > 50 )
  86. {
  87. alert ("请输入固定资产的放置地点应小于50个字符!");
  88. form.place.focus();
  89. return false;
  90. }
  91. return true;
  92. }
  93. function toAddSuccess(form)
  94. {
  95. if (! isDataValid(form))
  96. return false;
  97. form.action="/mainctrl/equipmentCodeUseAddSuccess?batchId=<%=batchId%>&keyword=<%=request.getParameter("keyword")%>&ctn=0&cache=true&start=<%=start%>";
  98. form.submit();
  99. }
  100. function toContinueAdd(form)
  101. {
  102. if (! isDataValid(form))
  103. return false;
  104. form.action="/mainctrl/equipmentCodeUseAddSuccess?batchId=<%=batchId%>&keyword=<%=request.getParameter("keyword")%>&ctn=1&cache=true&start=<%=start%>";
  105. form.submit();
  106. }
  107. function toUseList(form)
  108. {
  109. form.action="/mainctrl/equipmentBatchSearchResult?cache=true&start=<%=start%>";
  110. form.submit();
  111. }
  112. </script>
  113. <HTML>
  114. <jsp:include page="/vnex/page/FORM_HEAD.jsp" />
  115. <BODY text=#000000 vLink=#000000 aLink=#000000 link=#000000 bgColor=#ffffff topMargin=20 leftmargin="0" marginwidth="0" marginheight="0">
  116. <script language="JavaScript1.2" src="/vnex/menu/dockmenu_office.js"></script>
  117. <script language="JavaScript1.2" src="/vnex/menu/dockmenu.js"></script>
  118. <DIV align=center>
  119. <form name="form1" method="post" action="">
  120.     <TABLE class=outter cellSpacing=0 cellPadding=0 width=600 border=0>
  121.     <TBODY>
  122.     <jsp:include page="/vnex/page/TTOA_TABLE_TOP.jsp" />
  123.     <TR> 
  124.         <TD colSpan=3 align="center"><br>
  125.           <table width="600" border="1" cellspacing="1" bordercolor="#666666">
  126.             <tr bgcolor="#FAFAFA"> 
  127.               <td> 
  128.                 <table width="600" border="0" cellspacing="0" cellpadding="2">
  129.                   <tr>
  130.                     <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>
  131.                     </td>
  132.                   </tr>
  133.                 </table>
  134.                 <table class=title width="600" border="0" cellspacing="1" cellpadding="2">
  135.                   
  136.                   <tr bgcolor="#fafafa"> 
  137.                     <td width="115" > 
  138.                       <font  class="strong">&nbsp;固定资产批号:</font>
  139.                     </td>
  140.                     <td width="477"> 
  141.                       <%=batchId%>
  142.                     </td>
  143.                   </tr>
  144.                   <tr bgcolor="#e0e0e0"> 
  145.                     <td width="115"><font  class="strong">&nbsp;名称:</font></td>
  146.                     <td width="477"> 
  147.                       <%=FieldUtil.filterScriptTag(equipmentInfo.getEquipmentName())%>
  148.                       </td>
  149.                   </tr>
  150.                   <tr bgcolor="#fafafa"> 
  151.                     <td width="115" ><font  class="strong">&nbsp;型号:</font></td>
  152.                     <td width="477" > 
  153.                       <%=FieldUtil.filterScriptTag(equipmentInfo.getModel())%>
  154.                       </td>
  155.                   </tr>
  156.                   <tr bgcolor="#e0e0e0"> 
  157.                     <td width="115"> 
  158.                       <font  class="strong">&nbsp;编号:</font>
  159.                     </td>
  160.                     <td width="477"> 
  161.                       <input type="text" name="equipmentCode" class="file" size="24" value = "<%=FieldUtil.filterQuotTag(useValue.getEquipmentCode())%>">&nbsp;*&nbsp;(注:带*为必填内容)</td>
  162.                   </tr>
  163.                   <tr bgcolor="#fafafa">
  164.                     <td width="115"> 
  165.                       <font  class="strong">&nbsp;使用部门: </font>
  166.                     </td>
  167.                     <td width="477"> 
  168.                        <select name="useDeptId" class=choice onChange=change(form1)>
  169.                        <option value="-2">-请选择-</option>
  170.                     <org:DivisionList noRoot="false">
  171.                     <vnex:items select='<%= useValue.getUseDeptId()+"" %>' >
  172.                     <option value=<org:DivisionAttribute attribute="id"/> <org:DivisionAttribute attribute="isSelected"/> >
  173.                     <org:DivisionAttribute attribute="levelStr"/>+<org:DivisionAttribute attribute="name"/>
  174.                     </option>
  175.                     </vnex:items>
  176.                     </org:DivisionList>
  177.                     </select>&nbsp;*
  178.                       </td>
  179.                   </tr>
  180.                   <tr>
  181.                     <td width="115" bgcolor="#e0e0e0"> 
  182.                       <font  class="strong">&nbsp;使用者: </font>
  183.                     </td>
  184.                     <td width="477" bgcolor="#e0e0e0"> 
  185.                        <select name="usePersonId">
  186.                      <option value=-1>-请选择-</option>
  187.                     <hr:EmployeeList divisionId='<%= useValue.getUseDeptId()%>'>                          
  188.             <vnex:items  select ='<%= useValue.getUsePersonId()+""%>'>
  189.             <option value="<hr:EmployeeAttribute attribute="id" />" <hr:EmployeeAttribute attribute="isSelected"/> >
  190.             <hr:EmployeeAttribute attribute='<%= null %>' />
  191.             </option>
  192.             </vnex:items>            
  193.             </hr:EmployeeList>             
  194.             </select>&nbsp;*
  195.                       </td>
  196.                   </tr>
  197.                   <tr bgcolor="#fafafa">
  198.                     <td width="115" > 
  199.                       <font  class="strong">&nbsp;起用时间: </font>
  200.                     </td>
  201.                     <td width="477"> 
  202.                        <input type="text" name="startDay" readonly size="24" class="text" value="<%= useValue.getStartDay()%>" >
  203.                        <img src="/vnex/util/datetime.gif" style="cursor:hand;" align="absmiddle" alt="选择日期" onClick="fPopUpCalendarDlg(startDay);return false">&nbsp;*
  204.                     </td>
  205.                   </tr>
  206.                   <tr> 
  207.                     <td width="115" bgcolor="#e0e0e0"> 
  208.                       <font  class="strong">&nbsp;放置地点:</font><font class="strong"> </font>
  209.                     </td>
  210.                     <td width="477" bgcolor="#e0e0e0"> 
  211.                        <input type="text" name="place" class="file" size="24" value = "<%=FieldUtil.filterQuotTag(useValue.getPlace())%>">
  212.                       </td>
  213.                   </tr>
  214.                   <tr bgcolor="#fafafa" align="center"> 
  215.                     <td colspan="2" height="30"> 
  216.                       <input type="button" name="Submit4" value="继续增加" class="file" onClick="toContinueAdd(form1)"> 
  217.                       &nbsp;&nbsp;<input type="button" name="Submit" value="保存" class="file"  onclick="toAddSuccess(form1)"> 
  218.                       &nbsp;&nbsp;<input type="reset" name="Submit3" value="重置" class="file" > 
  219.                       &nbsp;&nbsp;<input type="button" name="Submit2" class="file" value="放弃" onclick="toUseList(form1)"> 
  220.                     </td>
  221.                   </tr>
  222.                 </table>
  223.               </td>
  224.             </tr>
  225.           </table>
  226.           <table width="100%" border="0" cellspacing="0" cellpadding="0">
  227.              <tr> 
  228.               <td height="3"><img src="a.gif" width="1" height="1"></td>
  229.             </tr>
  230.             <tr> 
  231.               <td background="/vnex/MacOS/hr.gif"><img src="/vnex/MacOS/hr.gif" width="1" height="2"></td>
  232.             </tr>
  233.              <tr> 
  234.               <td height="3"><img src="a.gif" width="1" height="1"></td>
  235.             </tr> 
  236.           </table>
  237.           <jsp:include page="/vnex/page/TTOA_HELP.jsp" />
  238.        </TD>
  239.      </TR>
  240.      <jsp:include page="/vnex/page/TTOA_TABLE_BOTTOM.jsp" />
  241.     </TBODY> 
  242.   </TABLE>
  243.     <BR>
  244.   <jsp:include page="/vnex/page/TTOA_PRODUCER_LOGO.jsp" />
  245.   </form>
  246. </DIV>
  247. </BODY>
  248. </HTML>