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

电子政务应用

开发平台:

Java

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  2. <%@ taglib uri="/vnex.tld" prefix="vnex" %>
  3. <%@ taglib uri="/vnex_organization.tld" prefix="org" %>
  4. <%@ taglib uri="/vnex_hr.tld" prefix="hr" %>
  5. <%@ page errorPage="/vnex/ErrorPage.jsp" %>
  6. <%@ page import="java.lang.*"%>
  7. <%@ page import="java.util.Collection"%>
  8. <%@ page import="java.util.Iterator"%>
  9. <%@ page import="java.util.Vector"%>
  10. <%@ page import="java.util.Calendar"%>
  11. <%@ page import="com.vnex.intranet.util.TimeStamp"%>
  12. <%@ page import="com.vnex.intranet.equipment.value.UserValueBean"%>
  13. <%@ page import="com.vnex.intranet.equipment.value.*"%>
  14. <jsp:useBean id="equipmentProxy" class="com.vnex.intranet.equipment.proxy.EquipmentProxyBean" scope="session" /> 
  15. <jsp:useBean id="equipmentASValue" class="com.vnex.intranet.equipment.value.EquipmentValueBean" scope="session" /> 
  16. <jsp:setProperty name="equipmentASValue" property="*" />
  17. <%!
  18. Collection list = null;
  19. Collection list2 = null;
  20. Collection listUsePerson = null;
  21. Collection listBuyPerson = null;
  22. Iterator ite = null;
  23. UserValueBean user = null;
  24. int i = -1;
  25. String fromTime = "";
  26. String toTime = "";
  27. Calendar cal = null;
  28. int m = -1;
  29. int d = -1;
  30. String year = "";
  31. String month = "";
  32. String day = "";
  33. %> 
  34. <%
  35. session.removeAttribute("equipmentASValue");
  36. session.removeAttribute("equipmentValueView");
  37. if (equipmentASValue.getTerm() == -1)
  38. equipmentASValue.setTerm(0);
  39. if (equipmentASValue.getQuantity() == -1)
  40. equipmentASValue.setQuantity(0);
  41. if (request.getParameter("categoryId") != null)
  42. equipmentASValue.setCategoryId(new Integer(request.getParameter("categoryId")).intValue());
  43. if (request.getParameter("categoryName") != null)
  44. equipmentASValue.setCategoryName(request.getParameter("categoryName"));
  45. %> 
  46. <HTML><jsp:include page="/vnex/page/FORM_HEAD.jsp" />
  47. <script Language="JavaScript" src="/vnex/util/Popup.js"></script>
  48. <script language="JavaScript" src="/vnex/validate.js"></script>
  49. <script language=JavaScript>
  50. function isNumberValid()
  51. {
  52. if (!(isFloat(myForm.minPrice.value)) && myForm.minPrice.value != "")
  53. {
  54. alert("价格必须必须是数字!");
  55. return false;
  56. }
  57. if (!(isFloat(myForm.maxPrice.value)) && myForm.maxPrice.value != "")
  58. {
  59. alert("价格必须必须是数字!");
  60. return false;
  61. }
  62. if (!(isInteger(myForm.STerm.value)) && myForm.STerm.value != "")
  63. {
  64. alert("使用期限必须是整数!");
  65. return false;
  66. }
  67. return true;
  68. }
  69. function includeInvalid(str)
  70. {
  71. if (str.indexOf("'") == -1)
  72. return false
  73. else
  74. return true;
  75. }
  76. function isDataValid()
  77. {
  78. if (! isNumberValid())
  79. return false;
  80. var price=0.0;
  81. minprice = myForm.minPrice.value;
  82. if (minprice < 0 && minprice != "")
  83. {
  84. alert("价格必须大于0");
  85. return false;
  86. }
  87. maxprice = myForm.maxPrice.value;
  88. if (maxprice < 0 && maxprice != "")
  89. {
  90. alert("价格必须大于0");
  91. return false;
  92. }
  93. if (minprice != "" && maxprice != "" && minprice > maxprice)
  94. {
  95. alert("最低价格必须小于最高价格");
  96. return false;
  97. }
  98. if (includeInvalid(myForm.equipmentName.value))
  99. {
  100. alert("设备名称包含非法字符");
  101. return false;
  102. }
  103. if (includeInvalid(myForm.equipmentCode.value))
  104. {
  105. alert("资产编号包含非法字符");
  106. return false;
  107. }
  108. if (includeInvalid(myForm.purpose.value))
  109. {
  110. alert("用途包含非法字符");
  111. return false;
  112. }
  113. if (includeInvalid(myForm.model.value))
  114. {
  115. alert("型号包含非法字符");
  116. return false;
  117. }
  118. if (includeInvalid(myForm.configure.value))
  119. {
  120. alert("配置包含非法字符");
  121. return false;
  122. }
  123. if (includeInvalid(myForm.supplier.value))
  124. {
  125. alert("供应者包含非法字符");
  126. return false;
  127. }
  128. if (includeInvalid(myForm.place.value))
  129. {
  130. alert("放置地点包含非法字符");
  131. return false;
  132. }
  133. if (includeInvalid(myForm.categoryName.value))
  134. {
  135. alert("资产类别包含非法字符");
  136. return false;
  137. }
  138. if (myForm.beginDay.value != "" && myForm.endDay.value != "")
  139. {
  140. if (myForm.beginDay.value > myForm.endDay.value)
  141. {
  142. alert("购买日期的选择范围开始日期不应在结束日期之后!");
  143. return false;
  144. }
  145. }
  146. return true;
  147. }
  148. function change(select)
  149. {
  150. if (isNumberValid())
  151. {
  152. myForm.action="/mainctrl/equipmentAdvancedSearch?fromSelf=1";
  153. myForm.submit();
  154. }
  155. }
  156. function toSuccess()
  157. {
  158. if (isDataValid())
  159. {
  160. myForm.action="/mainctrl/equipmentAdvancedSearchResult?set=1";
  161. myForm.submit();
  162. }
  163. }
  164. function toCategory()
  165. {
  166. myForm.action="/mainctrl/equipmentSaveCondition?pageName=equipmentAdvancedSearch";
  167. myForm.submit();
  168. }
  169. function toSearch()
  170. {
  171. searchForm.action="/mainctrl/equipmentSearchResult";
  172. searchForm.submit();
  173. }
  174. </script>
  175. <BODY text=#000000 vLink=#000000 aLink=#000000 link=#000000 bgColor=#ffffff topMargin=20 leftmargin="0" marginwidth="0" marginheight="0">
  176. <script language="JavaScript1.2" src="/vnex/menu/dockmenu_office.js"></script>
  177. <script language="JavaScript1.2" src="/vnex/menu/dockmenu.js"></script>
  178. <DIV align=center>
  179. <form name="myForm" method="post" action="/mailctrl/equipmentAdvancedSearchResult">
  180.    
  181.     <TABLE class=outter cellSpacing=0 cellPadding=0 width=600 border=0>
  182.     <TBODY> 
  183.     <jsp:include page="/vnex/page/TTOA_TABLE_TOP.jsp" />
  184.     <TR> 
  185.         <TD colSpan=3 align="center"><br>
  186.           <table width="600" border="1" cellspacing="1" bordercolor="#666666">
  187.             <tr bgcolor="#fafafa"> 
  188.               <td> 
  189.                 <table class=title width="600" border="0" cellspacing="1" cellpadding="2">
  190.                   <tr> 
  191.                     <td colspan="2" 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></td>
  192.                   </tr>
  193.                   <tr> 
  194.                     <td width="149" bgcolor="#fafafa"> 
  195.                       <div align="left"><b><font class="strong" >&nbsp;资产类别:</font></b></div>
  196.                     </td>
  197.                     <td width="443" bgcolor="#fafafa"> 
  198.                       <input type="hidden" name="categoryId" size="8" class="file" value="<%= equipmentASValue.getCategoryId()%>">
  199.                       <input type="text" name="categoryName" size="24" readonly class="file" value="<%= equipmentASValue.getCategoryName()%>">
  200.                       <input type="button" name="Submit3" value="选择" class="file"  onClick= toCategory()>
  201.                     </td>
  202.                   </tr>
  203.                   <tr> 
  204.                     <td width="149" bgcolor="#e0e0e0"> 
  205.                       <div align="left"><b><font class="strong" >&nbsp;名称:</font> </b></div>
  206.                     </td>
  207.                     <td  width="443" bgcolor="#e0e0e0"><font  class="strong"><font  class="strong"> 
  208.                       <input type="text" name="equipmentName" size="24" class="file" value="<%= equipmentASValue.getEquipmentName()%>">
  209.                       </font></font> </td>
  210.                   </tr>
  211.                   <tr> 
  212.                     <td width="149" bgcolor="#FaFaFa"> 
  213.                       <div align="left"><b><font  class="strong">&nbsp;用途: </font></b></div>
  214.                     </td>
  215.                     <td  width="443" bgcolor="#FaFaFa"><font  class="strong"> 
  216.                       <font  class="strong"> 
  217.                       <input type="text" name="purpose" size="24" class="file" value="<%= equipmentASValue.getPurpose()%>">
  218.                       </font></font></td>
  219.                   </tr>
  220.                   <tr> 
  221.                     <td width="149" bgcolor="#e0e0e0"> 
  222.                       <div align="left"><b><font  class="strong"><font  class="strong">&nbsp;型号:<font  class="strong"> 
  223.                         </font> </font></font></b></div>
  224.                     </td>
  225.                     <td  width="443" bgcolor="#e0e0e0"><font  class="strong"><font  class="strong"> 
  226.                       <input type="text" name="model" class="file" size="24" value="<%= equipmentASValue.getModel()%>">
  227.                       </font></font></td>
  228.                   </tr>
  229.                   <tr> 
  230.                     <td width="149" bgcolor="#fafafa"><b><font  class="strong"><font  class="strong">&nbsp;配置:</font></font></b></td>
  231.                     <td  width="443" bgcolor="#fafafa"><font  class="strong"><font  class="strong"> 
  232.                       <input type="text" name="configure" size="24" class="file" value="<%= equipmentASValue.getConfigure()%>">
  233.                       </font></font></td>
  234.                   </tr>
  235.                   <tr> 
  236.                     <td width="149" bgcolor="#e0e0e0"><b><font  class="strong"><font  class="strong">&nbsp;资产编号:</font></font></b></td>
  237.                     <td  width="443" bgcolor="#e0e0e0"><font  class="strong"><font  class="strong"> 
  238.                       <input type="text" name="equipmentCode" size="24" class="file" size="4" value="<%= equipmentASValue.getEquipmentCode()%>">
  239.                       </font></font></td>
  240.                   </tr>
  241.                   <tr> 
  242.                     <td width="149" bgcolor="#fafafa"> 
  243.                       <div align="left"><b><font  class="strong">&nbsp;购买价格:</font></b></div>
  244.                     </td>
  245.                     <td  width="443" bgcolor="#fafafa"> 
  246.                       <input type="text" name="minPrice" class="file" size="24" value="<%= equipmentASValue.getMinPrice()%>">
  247.                       元<font  class="strong"> - 
  248.                       <input type="text" name="maxPrice" class="file" size="24" value="<%= equipmentASValue.getMaxPrice()%>">
  249.                       </font>元</td>
  250.                   </tr>
  251.                   <tr> 
  252.                     <td width="149" bgcolor="#e0e0e0"> 
  253.                       <div align="left"><b><font  class="strong">&nbsp;使用者:</font></b></div>
  254.                     </td>
  255.                     <td  width="443" bgcolor="#e0e0e0"> 
  256.                       <select name="useDeptId" class=choice onChange=change(this)>
  257.                         <option value = -1>全部部门</option>
  258.                         <org:DivisionList> <vnex:items select='<%= equipmentASValue.getUseDeptId()+"" %>' > <option value= 
  259.                         <org:DivisionAttribute attribute="id"/> <org:DivisionAttribute attribute="isSelected"/> > 
  260.                         <org:DivisionAttribute attribute="levelStr"/>+<org:DivisionAttribute attribute="name"/> </option> 
  261.                         </vnex:items> </org:DivisionList> 
  262.                       </select>
  263.                       <select name="usePersonId">
  264.                         <option value=-1>-请选择-</option>
  265.                         <hr:EmployeeList divisionId='<%= equipmentASValue.getUseDeptId()%>'>
  266.                         <vnex:items  select ='<%= equipmentASValue.getUsePersonId()+""%>'> 
  267.                         <option value="<hr:EmployeeAttribute attribute="id" />" 
  268.                         <hr:EmployeeAttribute attribute="isSelected"/> > <hr:EmployeeAttribute attribute='<%= null %>' /> 
  269.                         </option>
  270.                         </vnex:items> </hr:EmployeeList> 
  271.                       </select>
  272.                     </td>
  273.                   </tr>
  274.                   <tr> 
  275.                     <td width="149" bgcolor="#fafafa"> 
  276.                       <div align="left"><b><font  class="strong">&nbsp;购买日期:</font></b></div>
  277.                     </td>
  278.                     <td  width="443" bgcolor="#fafafa"> 
  279.                       从: 
  280.                         <input type="text" name="beginDay" readonly size="18" class="text" value="<%= equipmentASValue.getBeginDay()%>" >
  281.                         <img src="/vnex/util/datetime.gif" style="cursor:hand;" align="absmiddle" alt="选择日期" onClick="fPopUpCalendarDlg(beginDay);return false"> 
  282.                        到: 
  283.                         <input type="text" name="endDay" readonly size="18" class="text" value="<%=equipmentASValue.getEndDay()%>" >
  284.                         <img src="/vnex/util/datetime.gif" style="cursor:hand;" align="absmiddle" alt="选择日期" onClick="fPopUpCalendarDlg(endDay);return false"> 
  285.                       
  286.                     </td>
  287.                   </tr>
  288.                   <tr> 
  289.                     <td width="149" bgcolor="#e0e0e0"><b><font  class="strong">&nbsp;购买者:</font></b></td>
  290.                     <td  width="443" bgcolor="#e0e0e0"> 
  291.                       <select name="buyDeptId" class=choice onChange=change(this)>
  292.                         <option value = -1>全部部门</option>
  293.                         <org:DivisionList> <vnex:items select='<%= equipmentASValue.getBuyDeptId()+"" %>' > <option value= 
  294.                         <org:DivisionAttribute attribute="id"/> <org:DivisionAttribute attribute="isSelected"/> > 
  295.                         <org:DivisionAttribute attribute="levelStr"/>+<org:DivisionAttribute attribute="name"/> </option> 
  296.                         </vnex:items> </org:DivisionList> 
  297.                       </select>
  298.                       <select name="buyPersonId">
  299.                         <option value=-1>-请选择-</option>
  300.                         <hr:EmployeeList divisionId='<%= equipmentASValue.getBuyDeptId()%>'>
  301.                         <vnex:items  select ='<%= equipmentASValue.getBuyPersonId()+""%>'> 
  302.                         <option value="<hr:EmployeeAttribute attribute="id" />" 
  303.                         <hr:EmployeeAttribute attribute="isSelected"/> > <hr:EmployeeAttribute attribute='<%= null %>' /> 
  304.                         </option>
  305.                         </vnex:items> </hr:EmployeeList> 
  306.                       </select>
  307.                     </td>
  308.                   </tr>
  309.                   <tr> 
  310.                     <td width="149" bgcolor="#fafafa"><b><font  class="strong">&nbsp;供应者:</font></b></td>
  311.                     <td  width="443" bgcolor="#fafafa"><font  class="strong"><font  class="strong"> 
  312.                       <input type="text" name="supplier" class="file" size="24" value="<%= equipmentASValue.getSupplier()%>">
  313.                       </font></font></td>
  314.                   </tr>
  315.                   <tr> 
  316.                     <td width="149" bgcolor="#e0e0e0"> 
  317.                       <div align="left"><b><font  class="strong">&nbsp;放置地点:</font></b></div>
  318.                     </td>
  319.                     <td  width="443" bgcolor="#e0e0e0"><font  class="strong"><font  class="strong"> 
  320.                       <input type="text" name="place" class="file" size="24" value="<%= equipmentASValue.getPlace()%>">
  321.                       </font></font> </td>
  322.                   </tr>
  323.                   <tr bgcolor="#fafafa"> 
  324.                     <td width="149"> 
  325.                       <div align="left"><b><font  class="strong">&nbsp;估计使用期限:</font></b></div>
  326.                     </td>
  327.                     <td  width="443"> 
  328.                       <input type="text" name="STerm" class="file" size="24" value="<%= equipmentASValue.getSTerm()%>">
  329.                       月</td>
  330.                   </tr>
  331.                   
  332.                   <tr bgcolor="#e0e0e0"> 
  333.                     <td width="149"> 
  334.                       <div align="left"><b><font  class="strong">&nbsp;有无维修记录:</font></b></div>
  335.                     </td>
  336.                     <td width="443"> 
  337.                       <div align="left"> 
  338.                         <input type="radio" name="repaired" value="1" <%=((equipmentASValue.getRepaired()==1)?("checked"):("unchecked"))%>>
  339.                         有&nbsp;&nbsp; 
  340.                         <input type="radio" name="repaired" value="0" <%=((equipmentASValue.getRepaired()==0)?("checked"):("unchecked"))%>>
  341.                         无&nbsp;&nbsp; 
  342.                         <input type="radio" name="repaired" value="-1" <%=((equipmentASValue.getRepaired()==-1)?("checked"):("unchecked"))%>>
  343.                         不指定 </div>
  344.                     </td>
  345.                   </tr>
  346.                   <tr> 
  347.                     <td colspan="2" bgcolor="#fafafa"> 
  348.                       <div align="center"><br>
  349.                         <input type="button" name="Submit" value="查询" class="file" onclick=toSuccess()>&nbsp;&nbsp;
  350.                         <input type="reset" name="Submit2" value="重置" class="file">&nbsp;&nbsp;
  351.                         <input type="button" name="Submit3" value="返回" class="file" onClick="location='/mainctrl/equipmentSearchResult'">                        
  352.                         
  353.                       </div>
  354.                     </td>
  355.                   </tr>
  356.                 </table>
  357.               </td>
  358.             </tr>
  359.           </table>
  360.           <jsp:include page="/vnex/page/TTOA_HELP.jsp" />
  361.        </TD>
  362.      </TR>
  363.      <jsp:include page="/vnex/page/TTOA_TABLE_BOTTOM.jsp" />
  364.     </TBODY> 
  365.   </TABLE>
  366.     <BR>
  367.   <jsp:include page="/vnex/page/TTOA_PRODUCER_LOGO.jsp" />
  368. </form>
  369. </DIV>
  370. </BODY>
  371. </HTML>