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

电子政务应用

开发平台:

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="com.vnex.intranet.pub.BaseJdbcDAO" %>
  5. <%@ page import="com.vnex.intranet.util.TimeStamp" %>
  6. <%@ page import="java.sql.Timestamp" %>
  7. <%@ page import="java.util.Calendar" %>
  8. <jsp:useBean id="equipmentProxy" class="com.vnex.intranet.equipment.proxy.EquipmentProxyBean" scope="session" /> 
  9. <jsp:useBean id="useValue" class="com.vnex.intranet.equipment.value.EquipmentUseRecordValueBean" scope="session" />
  10. <jsp:setProperty name="useValue" property="*" />
  11. <%
  12. String equipmentId = request.getParameter("equipmentId");
  13. String equipmentCode = request.getParameter("equipmentCode");
  14. int month=-1;
  15. Timestamp lastDay = equipmentProxy.findLastUseDate(Integer.parseInt(equipmentId));
  16. Calendar cal = TimeStamp.convertTimestampToCalendar(lastDay);
  17. String strLastDay = "" + cal.get(Calendar.YEAR) + "-";
  18. month = cal.get(Calendar.MONTH)+1;
  19. if (month < 10)
  20.    strLastDay = strLastDay + "0" +  month + "-";
  21. else 
  22. strLastDay = strLastDay + month + "-";
  23. if (cal.get(Calendar.DAY_OF_MONTH) < 10)
  24. strLastDay = strLastDay + "0" +  cal.get(Calendar.DAY_OF_MONTH);
  25. else
  26. strLastDay = strLastDay  +  cal.get(Calendar.DAY_OF_MONTH);
  27. session.removeAttribute("useValue");
  28. %>
  29. <script Language="JavaScript" src="/vnex/util/Popup.js"></script>
  30. <script language="JavaScript" src="/vnex/util/validate.js"></script>
  31. <script language="javaScript">
  32. function toUseAddSuccess(form)
  33. {
  34. if ( form.startDay.value.length == 0 )
  35. {
  36. alert ("请选择日期!");
  37. return false;
  38. }
  39. if ("<%=strLastDay%>" > form.startDay.value)
  40. {
  41. alert("现在最后一个使用者的开始日期是<%=strLastDay%>,n请选择一个在此日期之后的日期!");
  42. return false;
  43. }
  44. if (form.useDeptId.value == "-2")
  45. {
  46. alert("请选择使用部门!");
  47. form.useDeptId.focus();
  48. return false;
  49. }
  50. if (form.usePersonId.value == "-1")
  51. {
  52. alert ("请选择使用人!");
  53. form.usePersonId.focus();
  54. return false;
  55. }
  56. form.action="/mainctrl/equipmentUseAddSuccess?equipmentId=<%=equipmentId%>&equipmentCode=<%=equipmentCode%>";
  57. form.submit();
  58. }
  59. function toUseList(form)
  60. {
  61. form.action="/mainctrl/equipmentUseList?equipmentId=<%=equipmentId%>&equipmentCode=<%=equipmentCode%>";
  62. form.submit();
  63. }
  64. function change(form)
  65. {
  66. form.action="/mainctrl/equipmentUseAdd?equipmentId=<%=equipmentId%>&equipmentCode=<%=equipmentCode%>";
  67. form.submit();
  68. }
  69. </script>
  70. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  71. <HTML>
  72. <jsp:include page="/vnex/page/FORM_HEAD.jsp" /> 
  73. <BODY text=#000000 vLink=#000000 aLink=#000000 link=#000000 bgColor=#ffffff topMargin=20 leftmargin="0" marginwidth="0" marginheight="0">
  74. <script language="JavaScript1.2" src="/vnex/menu/dockmenu_office.js"></script>
  75. <script language="JavaScript1.2" src="/vnex/menu/dockmenu.js"></script>
  76. <DIV align=center>
  77. <form name="form1" method="post" action="">
  78.    
  79.     <TABLE class=outter cellSpacing=0 cellPadding=0 width=600 border=0>
  80.     <TBODY> 
  81.     <jsp:include page="/vnex/page/TTOA_TABLE_TOP.jsp" />
  82.     <TR> 
  83.         <TD colSpan=3 align="center"><br>  
  84.           <!--个人信息开始 -->
  85.           <table width="600" border="1" cellspacing="1" bordercolor="#666666">
  86.             <tr bgcolor="#fafafa"> 
  87.               <td> 
  88.                 <table class=title width="600" border="0" cellspacing="1" cellpadding="2">
  89.                   
  90.                   <tr bgcolor="#666666"> 
  91.                     <td  colspan="2" height="15"><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;<a href="/mainctrl/equipmentDetail?equipmentId=<%= equipmentId%>"><font color="#FFFFFF">固定资产详细信息</font></a>&gt;&gt;添加使用记录</font>
  92.                   </tr>
  93.                   <tr> 
  94.                     <td width="115" bgcolor="#e0e0e0"> 
  95.                       <font  class="strong">&nbsp;开始使用日期:</font>
  96.                     </td>
  97.                     <td width="477" bgcolor="#e0e0e0"> 
  98.                       <input type="text" name="startDay" readonly size="30" class="text" value="<%= useValue.getStartDay()%>" >
  99.                       <img src="/vnex/util/datetime.gif" style="cursor:hand;" align="absmiddle" alt="选择日期" onClick="fPopUpCalendarDlg(startDay);return false">&nbsp;*&nbsp;(注:带*为必填内容)
  100.                     </td>
  101.                   </tr>
  102.                   <tr> 
  103.                     <td width="115" bgcolor="#fafafa"><font  class="strong">&nbsp;使用部门:</font></td>
  104.                     <td width="477" bgcolor="#fafafa">                    
  105.                         <select name="useDeptId" class=choice onChange=change(form1)>
  106.                         <option value="-2">-请选择-</option>
  107.                     <org:DivisionList noRoot="false">
  108.                     <vnex:items select='<%= useValue.getUseDeptId()+"" %>' >
  109.                     <option value=<org:DivisionAttribute attribute="id"/> <org:DivisionAttribute attribute="isSelected"/> >
  110.                     <org:DivisionAttribute attribute="levelStr"/>+<org:DivisionAttribute attribute="name"/>
  111.                     </option>
  112.                     </vnex:items>
  113.                     </org:DivisionList>
  114.                     </select>&nbsp;*
  115.                     </td>
  116.                   </tr>
  117.                   <tr> 
  118.                     <td width="115" bgcolor="#e0e0e0"><font  class="strong">&nbsp;使用者:</font></td>
  119.                     <td width="477" bgcolor="#e0e0e0"> 
  120.                        <select name="usePersonId">
  121.                      <option value=-1>-请选择-</option>
  122.                     <hr:EmployeeList divisionId='<%= useValue.getUseDeptId()%>'>                          
  123.             <vnex:items  select ='<%= useValue.getUsePersonId()+""%>'>
  124.             <option value="<hr:EmployeeAttribute attribute="id" />" <hr:EmployeeAttribute attribute="isSelected"/> >
  125.             <hr:EmployeeAttribute attribute='<%= null %>' />
  126.             </option>
  127.             </vnex:items>            
  128.             </hr:EmployeeList>             
  129.             </select>
  130.                       </td>
  131.                   </tr>
  132.                   <tr bgcolor="#fafafa" align="center"> 
  133.                     <td colspan="2" height="30"> 
  134.                       <input type="button" name="Submit" value="保存" class="file"  onclick="toUseAddSuccess(form1)">
  135.                       &nbsp;&nbsp;<input type="reset" name="Submit3" value="重置" class="file" > 
  136.                         &nbsp;&nbsp;<input type="button" name="Submit2" class="file" value="放弃" onclick="toUseList(form1)">  
  137.                     </td>
  138.                   </tr>
  139.                 </table>
  140.               </td>
  141.             </tr>
  142.           </table>
  143.             
  144.           
  145.           <jsp:include page="/vnex/page/TTOA_HELP.jsp" />
  146.        </TD>
  147.      </TR>
  148.      <jsp:include page="/vnex/page/TTOA_TABLE_BOTTOM.jsp" />
  149.     </TBODY> 
  150.   </TABLE>
  151.     <BR>
  152.   <jsp:include page="/vnex/page/TTOA_PRODUCER_LOGO.jsp" />
  153. </form>
  154. </DIV>
  155. </BODY>
  156. </HTML>