equipment_advancedsearchresult.jsp
资源名称:NetOffice.rar [点击查看]
上传用户:guhaomin
上传日期:2007-06-10
资源大小:23203k
文件大小:13k
源码类别:
电子政务应用
开发平台:
Java
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
- <HTML><jsp:include page="/vnex/page/FORM_HEAD.jsp" />
- <%@ page import="java.util.*"%>
- <%@ page import="java.sql.*"%>
- <%@ page import="com.vnex.intranet.util.*"%>
- <%@ page import="com.vnex.intranet.equipment.value.*"%>
- <%@ page import="com.vnex.intranet.equipment.process.*"%>
- <jsp:useBean id="SearchCondition" class="com.vnex.intranet.equipment.value.EquipmentConditionBean" scope="Session" />
- <jsp:useBean id="AdvancedSearchProxy" class="com.vnex.intranet.equipment.proxy.EquipmentProxyBean" scope="Application" />
- <jsp:useBean id="equipmentValueView" class="com.vnex.intranet.equipment.value.EquipmentValueBean" scope="session" />
- <jsp:setProperty name="equipmentValueView" property="*" />
- <%
- HttpSession sess;
- String navBar;
- int start = 1;
- int rows = 10;
- EquipmentListValueBean equipmentlist;
- Collection eList;
- String action;
- int categoryId=-1;
- String categoryName="";
- String keyword = "";
- if (request.getParameter("categoryId") != null )
- {
- categoryId = (new Integer(request.getParameter("categoryId")).intValue());
- keyword = request.getParameter("categoryId");
- }
- if (request.getParameter("categoryName") != null)
- categoryName = (request.getParameter("categoryName"));
- sess = request.getSession( false );
- if ("true".equals(request.getParameter("cache")))
- {
- equipmentlist = (EquipmentListValueBean)sess.getAttribute("equipmentlist");
- start = Integer.parseInt(request.getParameter("start"));
- }
- else
- {
- if (request.getParameter("start") != null)
- {
- start = Integer.parseInt(request.getParameter("start"));
- }
- int categoryid;
- String name;
- String purpose;
- String model;
- String configure;
- String equipmentcode;
- double minprice;
- double maxprice;
- int usedeptid;
- int usepersonid;
- Timestamp begindate = null;
- Timestamp enddate = null;
- int buydeptid;
- int buypersonid;
- String supplier;
- String place;
- int term;
- int quantity;
- int repaired;
- try
- {
- categoryid = Integer.parseInt(request.getParameter("categoryId"));
- }
- catch (Exception e)
- {
- categoryid = -1;
- }
- name = request.getParameter("equipmentName");
- if (name == null)
- name = "";
- purpose = request.getParameter("purpose");
- if (purpose == null)
- purpose = "";
- model = request.getParameter("model");
- if (model == null)
- model = "";
- configure = request.getParameter("configure");
- if (configure == null)
- configure = "";
- equipmentcode = request.getParameter("equipmentCode");
- if (equipmentcode == null)
- equipmentcode = "";
- try
- {
- minprice = Double.parseDouble(request.getParameter("minPrice"));
- }
- catch (Exception e)
- {
- minprice = -1;
- }
- try
- {
- maxprice = Double.parseDouble(request.getParameter("maxPrice"));
- }
- catch (Exception e)
- {
- maxprice = -1;
- }
- try
- {
- usedeptid = Integer.parseInt(request.getParameter("useDeptId"));
- }
- catch (Exception e)
- {
- usedeptid = -1;
- }
- try
- {
- usepersonid = Integer.parseInt(request.getParameter("usePersonId"));
- }
- catch (Exception e)
- {
- usepersonid = -1;
- }
- try
- {
- if (request.getParameter("beginDay").length() > 0 )
- begindate = TimeStamp.toTimestamp(request.getParameter("beginDay")+" 00:00:00.0");
- }
- catch (Exception e)
- {
- begindate = null;
- }
- try
- {
- if (request.getParameter("endDay").length() > 0 )
- enddate = TimeStamp.toTimestamp(request.getParameter("endDay")+" 00:00:00.0");
- }
- catch (Exception e)
- {
- enddate = null;
- }
- try
- {
- buydeptid = Integer.parseInt(request.getParameter("buyDeptId"));
- //out.println("buydeptid="+buydeptid);
- }
- catch (Exception e)
- {
- buydeptid = -1;
- }
- try
- {
- buypersonid = Integer.parseInt(request.getParameter("buyPersonId"));
- //out.println("buypersonid="+buypersonid);
- }
- catch (Exception e)
- {
- buypersonid = -1;
- }
- supplier = request.getParameter("supplier");
- if (supplier == null)
- supplier = "";
- place = request.getParameter("place");
- if (place == null)
- place = "";
- try
- {
- term = Integer.parseInt(request.getParameter("STerm"));
- }
- catch (Exception e)
- {
- term = -1;
- }
- try
- {
- quantity = Integer.parseInt(request.getParameter("SQuantity"));
- }
- catch (Exception e)
- {
- quantity = -1;
- }
- if ("1".equals(request.getParameter("repaired")))
- repaired = 1;
- else if ("0".equals(request.getParameter("repaired")))
- repaired = 0;
- else
- repaired = -1;
- if (request.getParameter("set") != null && request.getParameter("set").equals("1"))
- {//set conditionbean
- SearchCondition.setCategoryId(categoryid);
- SearchCondition.setEquipmentName(name);
- SearchCondition.setPurpose(purpose);
- SearchCondition.setModel(model);
- SearchCondition.setConfigure(configure);
- SearchCondition.setEquipmentCode(equipmentcode);
- SearchCondition.setMinPrice(minprice);
- SearchCondition.setMaxPrice(maxprice);
- SearchCondition.setBuyDeptId(buydeptid);
- SearchCondition.setBuyPersonId(buypersonid);
- SearchCondition.setUseDeptId(usedeptid);
- SearchCondition.setUsePersonId(usepersonid);
- SearchCondition.setBeginBuyDate(begindate);
- SearchCondition.setEndBuyDate(enddate);
- SearchCondition.setSupplier(supplier);
- SearchCondition.setPlace(place);
- SearchCondition.setTerm(term);
- SearchCondition.setQuantity(quantity);
- SearchCondition.setRepaired(repaired);
- }
- equipmentlist = AdvancedSearchProxy.equipmentAdvancedSearch(SearchCondition);
- sess.setAttribute("equipmentlist",equipmentlist);
- }
- eList = equipmentlist.getEquipmentList();
- if (eList.size() < start && start > 10)
- start = start - 10;
- categoryName="";
- %>
- <script language= JavaScript>
- function toDelete()
- {
- if (<%=eList.size()%> == 0)
- {
- alert ("没有要删除的项!");
- return false;
- }
- var items=searchForm.check1.length;
- var j = -1;
- var sign = 1;
- if (items>1)
- {
- for (i=0;i < items;i++)
- {
- if (searchForm.check1[i].checked)
- j = i;
- }
- if (j == -1)
- {
- alert ("没有可供删除的选项!" );
- sign = 0;
- }
- }
- else
- {
- if (searchForm.check1.checked)
- sign = 1;
- else
- {
- alert ("没有可供删除的选项!" );
- sign = 0
- }
- }
- if (sign == 1)
- {
- if (!confirm("真的删除这些记录吗?"))
- return false;
- searchForm.action="/mainctrl/equipmentsAdvancedDeleteSuccess"
- searchForm.submit();
- }
- }
- function checkAll(checkbox_select,checkbox_names)
- {
- var items=checkbox_names.length;
- if(items>1)
- {
- for(i=0;i<items;i++) checkbox_names[i].checked=checkbox_select.checked;
- }
- else
- {
- checkbox_names.checked=checkbox_select.checked;
- }
- }
- function toCategory(form)
- {
- form.action="/mainctrl/categoryList?pageName=equipmentSearchResult";
- form.submit();
- }
- </script>
- <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>
- <form name="searchForm" method="post" action="/mainctrl/equipmentSearchResult">
- <DIV align=center>
- <TABLE class=outter cellSpacing=0 cellPadding=0 width=600 border=0>
- <TBODY>
- <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 bgcolor="#666666">
- <td colspan="2" height="15"><font class="strongw"><a href="/mainctrl/home/index"><font color="#FFFFFF">首页</font></a>>><a href="/mainctrl/office/main"><font color="#FFFFFF">办公室管理</font></a>>>固定资产管理</font></td>
- </tr>
- <tr>
- <td colspan="2" height="30"><font class="strong" > 类别:</font>
- <input type="hidden" name="keyword" class="file" value="<%=categoryId%>">
- <input type="test" name="categoryName" class="file" readonly value="<%=categoryName%>">
- <input type="button" name="Submit2" value="选择" class="file" onClick="toCategory(searchForm)")>
- <input type="button" name="SubmitA" value="高级查询" class="file" style="width:60px" onClick="location='/mainctrl/equipmentAdvancedSearch'">
- <input type="button" name="SubmitS" value="统计汇总" class="file" style="width:60px" onClick="location='/mainctrl/equipmentStat'">
- </td>
- </tr>
- </table>
- <table class=title cellspacing=1 cellpadding=2 width="600" border=0>
- <tr bgcolor="#FFFFFF">
- <td colspan="7" height="30">
- <input type="button" name="bAdd" value="新建" class="file" onClick="location='/mainctrl/equipmentAdd'">
- <input type="button" name="bDelete" value="删除" class="file" onClick=toDelete()>
- <input type="button" name="bBatch" value="批量增加" class="file" style="width:60" onClick="location='/mainctrl/equipmentBatchAdd'">
- <input type="button" name="bBatchUse" value="批量增加使用者" class="file" style="width: 95" onClick="location='/mainctrl/equipmentBatchSearchResult'">
- </td>
- </tr>
- <tr align=middle >
- <td width="7%"><font class="strong">选择</font></td>
- <td width="10%"><font class="strong"> 编号 </font></td>
- <td width="19%"><font class="strong">名称</font></td>
- <td width="23%"><font class="strong">资产编号 </font></td>
- <td width="18%"><font class="strong">类别 </font></td>
- <td width="23%"><font class="strong">购入时间 </font></td>
- </tr>
- <%
- int i = 0;
- int r;
- if (start > eList.size() - (eList.size() % rows))
- r = eList.size() % rows;
- else
- r = 10;
- Iterator it = eList.iterator();
- while(i < start - 1)
- {
- it.next();
- i ++;
- }
- i = 0;
- while(i < r)
- {
- EquipmentValueBean eInfo= (EquipmentValueBean)it.next();
- if (i % 2 == 0)
- {
- %>
- <tr align=middle bgColor="#fafafa" colspan="7">
- <%
- }
- else
- {
- %>
- <tr align=middle bgColor="#e0e0e0" colspan="7">
- <%
- }
- %>
- <td width="7%">
- <input type="checkbox" name="check1" value=<%=eInfo.getId()%>>
- <br>
- </td>
- <td width="10%"><a href="equipmentDetail?equipmentId=<%=eInfo.getId()%>&simple=false&start=<%=start%>"><%=eInfo.getId()%></a></td>
- <td width="19%"><%=FieldUtil.shortenString(FieldUtil.filterScriptTag(eInfo.getEquipmentName()),15)%><br>
- </td>
- <td width="23%"><%=FieldUtil.shortenString(FieldUtil.filterScriptTag(eInfo.getEquipmentCode()),15)%></td>
- <td width="18%"><%=FieldUtil.filterScriptTag(eInfo.getCategoryName())%></td>
- <td width="23%"><%
- if (eInfo.getBuyDate() != null) out.print(eInfo.getBuyDate().toString().substring(0,10));
- %>
- </td>
- </tr>
- <%
- i ++;
- }
- %>
- <%
- if (eList.size() > 0)
- {
- %>
- <tr align=middle>
- <td colspan="6" bgcolor="#e0e0e0">
- <div align="left">
- <input type="checkbox" name="check2" value="checkbox" onClick = checkAll(check2,check1)>
- 全选</div>
- </td>
- </tr>
- <%}%>
- <%
- action = "/mainctrl/equipmentAdvancedSearchResult?cache=true";
- navBar = NavBar.makeNavbar(start,eList.size(),rows,action);
- %>
- <tr align=middle>
- <td colspan="6" bgcolor="#fafafa">
- <div align="left"> <%=navBar%>
- </div>
- </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>