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

电子政务应用

开发平台:

Java

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  2. <%@ page language="java" %>
  3. <%@ page import="java.util.*" %>
  4. <%@ page import="java.lang.*" %>
  5. <%@ page import="com.vnex.intranet.budget.value.*" %>
  6. <%@ page import="com.vnex.intranet.util.FieldUtil" %> 
  7. <jsp:useBean id="BudgetProxy" scope="application" class="com.vnex.intranet.budget.proxy.BudgetProxyBean" />
  8. <%
  9. if((session.getAttribute("budgetCreateAll") != null)&&(session.getAttribute("month") != null))
  10. {
  11.     session.removeAttribute("budgetCreateAll");
  12. session.removeAttribute("month");
  13. }
  14. %>
  15. <HTML><jsp:include page="/vnex/page/FORM_HEAD.jsp" />
  16. <script language="JavaScript1.2" src="/vnex/menu/dockmenu_finance.js"></script><script language="JavaScript1.2" src="/vnex/menu/dockmenu.js"></script>
  17. <%
  18.     Calendar nowTime = Calendar.getInstance();
  19.     int nowYear = nowTime.get( Calendar.YEAR);
  20.     int nowMonth = nowTime.get(Calendar.MONTH)+1;
  21. %>
  22. <script language=javaScript>
  23. function check()
  24. {
  25.     var sign = 0;
  26.       for (var i=0;i<document.modify.elements.length;i++)
  27.     {
  28.     var e = document.modify.elements[i];
  29.     if ((e.name!="chkall")&&(e.checked==true)&&((e.name).substring(0,6)=="status"))
  30.        sign++;
  31.     }
  32. if(sign == 0)
  33. {
  34.  alert("请选择一个以上的项目!");
  35.  return false;
  36. }
  37.     if(modify.year.value><%=nowYear%>||(modify.year.value==<%=nowYear%>&&modify.month.value><%=nowMonth%>))
  38. {
  39.     return true;
  40. }
  41. else
  42. {
  43.     alert("请选择比当前日期大的月份!");
  44.     return false;
  45. }
  46. }
  47. function createAllDivision()
  48. {
  49.     if (check())
  50. {
  51.         modify.action="itemManagementJudge";
  52.         modify.submit();
  53.    }
  54. }
  55. function CheckAll(form)
  56. {
  57.   for (var i=0;i<form.elements.length;i++)
  58.   {
  59.     var e = form.elements[i];
  60.     if (e.name != 'chkall')
  61.        e.checked = form.chkall.checked;
  62.   }
  63. }
  64. </script>
  65. <BODY text=#000000 vLink=#000000 aLink=#000000 link=#000000 bgColor=#ffffff topMargin=20 leftmargin="0" marginwidth="0" marginheight="0">
  66. <DIV align=center>
  67.  <form name="modify" method="post" >
  68.   <TABLE class=outter cellSpacing=0 cellPadding=0 width=600 border=0>
  69.    
  70.     <jsp:include page="/vnex/page/TTOA_TABLE_TOP.jsp" />
  71.     <TR> 
  72.         <TD colSpan=3 align="center" class="iframestyle" valign="top"><br>
  73.           <table width="600" border="1" cellspacing="1" bordercolor="#666666">
  74.             <tr valign="top"> 
  75.               <td > 
  76.                 
  77.                 <table width="600" border="0" cellspacing="0" cellpadding="2">
  78.                   <tr> 
  79.                     <td bgcolor="#666666"><font class="strongw"><a href="/mainctrl/home/index"><font color="#FFFFFF">首页</font></a>&gt;&gt;<a href="/mainctrl/finance/main"><font color="#FFFFFF">财务</font></a>&gt;&gt;项目维护</font></td>
  80.                   </tr>
  81.                   <tr bgcolor="#fafafa"> 
  82.                     <td height="30">
  83. <%
  84. if((BudgetProxy.getMaxMonth()).equals("NoRecord"))
  85. {
  86. }
  87. else
  88. {
  89. %>&nbsp;&nbsp; 已经生成预算项目的最大月是<%=BudgetProxy.getMaxMonth()%> 
  90.                       ,<br>
  91. <%
  92. }
  93. %>
  94. &nbsp;&nbsp; 为全部部门生成 
  95.                     <%
  96. String yearOfNow = "";
  97. String dayOfNow = "";
  98. yearOfNow = BudgetProxy.getCompareNextMonth().substring(0,4);
  99. dayOfNow = BudgetProxy.getCompareNextMonth().substring(5,7);
  100. out.println("<select style="WIDTH: 65px" name="year" class="button">");
  101. for(int i=2000;i<2050;i++)
  102. {
  103.     if (String.valueOf(i).equals(yearOfNow))
  104. {
  105.     out.println("<option value=""+i+"" selected><b>"+i+"</b></option>");
  106. }
  107. else
  108. {
  109.     out.println("<option value=""+i+""><b>"+i+"</b></option>");
  110. }
  111. }
  112. out.println("</select>年");
  113. out.println("<select style="WIDTH: 50px" name="month">");
  114. for(int i=1;i<=12;i++)
  115. {
  116.     if (Integer.parseInt(dayOfNow) == i)
  117. {
  118.     if(i<10)
  119.     out.println("<option value="0"+i+"" selected><b>"+i+"</b></option>");
  120.     else
  121.     out.println("<option value=""+i+"" selected><b>"+i+"</b></option>");
  122. }
  123. else
  124. {
  125.     if(i<10) 
  126.         out.println("<option value="0"+i+""><b>"+i+"</b></option>");
  127.     else
  128.     out.println("<option value=""+i+""><b>"+i+"</b></option>");
  129. }
  130. }
  131. out.println("</select>月 预算项目列表。");
  132. %> 
  133.                       <input type="button" name="Button" value="生成" class="text" onClick="createAllDivision()">
  134.                     </td>
  135.                   </tr>
  136.                 </table>
  137.                 <table width="600" border="0" cellspacing="1" cellpadding="2" class=title>
  138.                   <tr> 
  139.                     <td colspan="3" height="30" bgcolor="#fafafa">&nbsp; 
  140.                       <input type="button" name="Button33" onClick="location='itemManagementCreate'" value="新增" class="text">
  141.                       &nbsp;&nbsp; </td>
  142.                   </tr>
  143.                   <tr align="center"> 
  144.                     <td width="7%"><font class="strong">选择</font></td>
  145.                     <td width="123"><font class="strong">项目</font></td>
  146.                     <td width="381"><font class="strong">备注</font></td>
  147.                   </tr>
  148.                   <%
  149. int color = 1;
  150. String col = "";
  151. int total=0;
  152. Collection coll = BudgetProxy.showAllItem();
  153. Iterator iter = coll.iterator();
  154. while(iter.hasNext())
  155. {
  156.     BudgetValueBean valueBean = (BudgetValueBean)iter.next();
  157. col = ((color%2)==1)?"#e0e0e0":"#fafafa";
  158. total++;
  159. color++;
  160. %>
  161.                   <tr align="center" bgcolor=<%=col%>> 
  162.                     <td width="123"> 
  163.                       <input type="checkbox" name="status<%=total%>" value="checkbox" >
  164.                       <input type="hidden" name="id<%=total%>" value="<%=valueBean.getId()%>">
  165.                     </td>
  166.                     <td width="123"><a href="itemModify?id=<%=valueBean.getId()%>"><%=FieldUtil.filterScriptTag(FieldUtil.filterQuotTag(valueBean.getName()))%></a></td>
  167.                     <td width="381"><%=FieldUtil.shortenString(FieldUtil.filterScriptTag(FieldUtil.filterQuotTag(valueBean.getDescription())))%></td>
  168.                   </tr>
  169.                   <%
  170. }
  171.     %>
  172.                   <tr align="center" bgcolor=#fafafa> 
  173.                     <td width="123"> 
  174.                       <INPUT onclick=CheckAll(this.form) type=checkbox value=on name="chkall">
  175.                     </td>
  176.                     <td colspan="2">
  177.                       <div align="left">&nbsp;&nbsp;全选
  178.                       </div>
  179.                     </td>
  180.                   </tr>
  181.                 </table>
  182.                 <input type="hidden" name="total" value="<%=total%>">
  183.               </td>
  184.             </tr>
  185.           </table>
  186.                     <jsp:include page="/vnex/page/TTOA_HELP.jsp" />
  187.        </TD>
  188.     </TR>
  189.      <jsp:include page="/vnex/page/TTOA_TABLE_BOTTOM.jsp" />
  190.     </TABLE>
  191.     <BR>
  192.     <jsp:include page="/vnex/page/TTOA_PRODUCER_LOGO.jsp" />
  193. </form>
  194.   </DIV>
  195.  </BODY>
  196. </HTML>