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

电子政务应用

开发平台:

Java

  1. <%@ taglib uri="/vnex.tld" prefix="vnex" %>
  2. <%@ taglib uri="/vnex_workflow.tld" prefix="vnex_workflow" %>
  3. <%@ page errorPage="/vnex/ErrorPage.jsp" %>
  4. <%@ page import="java.util.Iterator" %>
  5. <%@ page import="com.vnex.intranet.util.TimeStamp" %>
  6. <%@ page import="com.vnex.intranet.workflow.document.value.*" %>
  7. <%@ page import="com.vnex.intranet.workflow.pub.value.WorkflowFileValueBean" %>
  8. <%@ page import="com.vnex.intranet.util.SubPathGenerater" %>
  9. <%@ page import="com.vnex.intranet.system.loader.ConfigParaLoader"%>
  10. <%@ page import="com.vnex.intranet.upload.*"%>
  11. <%@ page import="com.vnex.intranet.util.FieldUtil" %> 
  12. <jsp:useBean id="mySmartUpload" scope="page" class="com.vnex.intranet.upload.SmartUpload" />
  13. <jsp:useBean id="BusinessName" scope="session" class="com.vnex.intranet.pub.BusinessSession" />
  14. <jsp:useBean id="drvb" scope="session" class="com.vnex.intranet.workflow.document.value.DocumentReceivedValueBean"/>
  15. <jsp:include page="/vnex/head.jsp"/>
  16. <% 
  17.     // this attribute used by FileAttributeTag to change encode of chinese file name to view.
  18.     pageContext.setAttribute("encodeFlag" , "false");
  19.     String current = new java.sql.Date(System.currentTimeMillis()).toString();  
  20.     
  21.     if( request.getParameter("type") == null )
  22.     {
  23.         drvb = new DocumentReceivedValueBean();
  24.         session.setAttribute( "recieveddocument", drvb );
  25.     }          
  26. %>
  27. <%@ include file= "/vnex/intranet/office/document/receivedDocUpload.jsp" %>
  28. <script Language="JavaScript" src="/vnex/intranet/calendar/Popup.js"></script>
  29. <script language="JavaScript" src="/vnex/util/validate.js"></script>
  30. <script language=JavaScript>
  31. function createDoc(form)
  32. {
  33.    if(checkIt(form))
  34.    {
  35.       checkAll(document.forms[0].attachments);
  36.       form.action="/mainctrl/office/document/receivedcreateok";
  37.       form.submit();
  38.    }   
  39. }
  40. function uploadDoc(form)
  41. {      
  42.    if(checkIt(form))
  43.    {
  44.        form.action="/mainctrl/office/document/receivedcreate?type=1";
  45.        form.encoding="multipart/form-data";
  46.        form.submit(); 
  47.    }    
  48. }
  49. function deleteDoc(form)
  50. {   
  51.    if(checkIt(form))
  52.    {   
  53.        form.action="/mainctrl/office/document/receivedcreate?type=2";    
  54.        form.submit(); 
  55.    }    
  56. }
  57. function checkIt(form)
  58. {
  59.    if(isEmpty(stripWhitespace(form.title.value)))
  60.    {
  61.       alert("请输入收文标题");
  62.       form.title.focus();
  63.       return false;
  64.    }
  65.    if( form.title.value.length >64 )
  66.    {
  67.       alert("收文标题长度不能超过64位.");
  68.       form.title.focus();
  69.       return false;
  70.    }  
  71.    if(isEmpty(form.NO.value))
  72.    {
  73.       alert("请输入收文文号");
  74.       form.NO.focus();
  75.       return false;
  76.    }
  77.    if( form.NO.value.length >32 )
  78.    {
  79.       alert("收文文号长度不能超过32位.");
  80.       form.NO.focus();
  81.       return false;
  82.    } 
  83.      
  84.    if(!isInteger( form.fileNumber.value ))
  85.    {
  86.       alert("文件数非法,请输入数字.");
  87.       form.fileNumber.focus();
  88.       return false;
  89.    }
  90.    if( form.fileNumber.value.length >5 )
  91.    {
  92.       alert("文件数的数字长度不能超过5位.");
  93.       form.fileNumber.focus();
  94.       return false;
  95.    }  
  96.    if(!isInteger( form.pages.value ))
  97.    {
  98.       alert("文件页数非法,请输入数字.");
  99.       form.pages.focus();
  100.       return false;
  101.    }     
  102.    if( form.pages.value.length >5 )
  103.    {
  104.       alert("文件页数的数字长度不能超过5位.");
  105.       form.pages.focus();
  106.       return false;
  107.    } 
  108.    if( form.content.value.length >250 )
  109.    {
  110.       alert("文件内容的长度不能超过250位.");
  111.       form.content.focus();
  112.       return false;
  113.    } 
  114.    if( form.remark.value.length >200 )
  115.    {
  116.       alert("文件备注的长度不能超过200位.");
  117.       form.remark.focus();
  118.       return false;
  119.    } 
  120.    if( !isEmpty(form.receivedDateS.value) )
  121.    {            
  122.       if(!isVNEXDate(form.receivedDateS.value))
  123.       {
  124.         alert("收文接收日期非法");
  125.         form.receivedDateS.focus();
  126.         return false;
  127.       }  
  128.       if( "<%=current%>" < form.receivedDateS.value)
  129.       {
  130.         alert("收文接收日期必须在本日之前!");
  131.         form.receivedDateS.focus();
  132.         return false;
  133.       }
  134.    }     
  135.    return true;
  136. }
  137. function checkAll( selObj )
  138. {
  139.     for ( var i = 0; i < selObj.options.length; i++ )
  140.        selObj.options[i].selected = true;
  141. }
  142. </script>
  143. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  144. <HTML>
  145. <jsp:include page="/vnex/page/FORM_HEAD.jsp" />
  146. <BODY text=#000000 vLink=#000000 aLink=#000000 link=#000000 bgColor=#ffffff topMargin=20 leftmargin="0" marginwidth="0" marginheight="0">
  147. <script language="JavaScript1.2" src="/vnex/menu/dockmenu_office.js"></script>
  148. <script language="JavaScript1.2" src="/vnex/menu/dockmenu.js"></script>
  149. <script language="JavaScript">
  150. window.onload=init
  151. </script>
  152. <DIV align=center>
  153.   <form name="docReceived" method="post" >
  154.     <TABLE class=outter cellSpacing=0 cellPadding=0 width=600 border=0>
  155.     <TBODY> 
  156.     <jsp:include page="/vnex/page/TTOA_TABLE_TOP.jsp" />
  157.       <TR> 
  158.         <TD colSpan=3 align="center"><br>
  159.           <table width="600" border="1" cellspacing="1" bordercolor="#666666">
  160.             <tr> 
  161.               <td align="center" colspan="2" bgcolor="#FFFFFF"> 
  162.                 <table width="600" border="0" cellspacing="0" cellpadding="0">
  163.                    <tr bgcolor="#666666"> 
  164.                     <td colspan="2" height="15"><font class="strongw">&nbsp;<a href="/mainctrl/system/main"><font color="#FFFFFF">首页</font></a>&gt;&gt;<a href="/mainctrl/office/main"><font color="#FFFFFF">办公室管理</font></a>
  165.                     &gt;&gt;<a href="/mainctrl/office/document/receivedlist"><font color="#FFFFFF">收文管理</font></a>&gt;&gt;创建收文
  166.                       </font></td>
  167.                   </tr>
  168.                 </table>
  169.                 <table class=title border="0" cellpadding="2" cellspacing="1" width="600">
  170.                   <tr bgcolor="#e0e0e0"> 
  171.                     <td width="15%"> 
  172.                       <div align="left"><font class="strong" >&nbsp;文号:</font></div>
  173.                     </td>
  174.                     <td > 
  175.                       <input type="text" name="NO" size="24" class="file" value= "<%= FieldUtil.filterQuotTag( drvb.getNO() ) %>">
  176.                       * (注:带*为必填内容)</td>
  177.                   </tr>
  178.                   <tr bgcolor="#fafafa"> 
  179.                     <td width="15%"> 
  180.                       <div align="left"><font class="strong" >&nbsp;标题:</font> </div>
  181.                     </td>
  182.                     <td > 
  183.                       <input type="text" name="title" size="24" class="file" value= "<%= FieldUtil.filterQuotTag( drvb.getTitle() ) %>">
  184.                       * </td>
  185.                   </tr>
  186.                   <tr bgcolor="#e0e0e0"> 
  187.                     <td width="15%"> 
  188.                       <div align="left"><font  class="strong">&nbsp;来文机关: </font></div>
  189.                     </td>
  190.                     <td > 
  191.                       <input type="text" name="comeFrom" size="24" class="file" value= "<%= FieldUtil.filterQuotTag( drvb.getComeFrom() ) %>">
  192.                       </td>
  193.                   </tr>
  194.                   <tr bgcolor="#fafafa"> 
  195.                     <td width="15%"> 
  196.                       <div align="left"><font  class="strong">&nbsp;文件分类: </font></div>
  197.                     </td>
  198.                     <td > 
  199.                       <select name="type">
  200.                           <%
  201.                               Iterator dtypes = DocumentReceivedType.getAvailableDocumentReceivedTypes().iterator();
  202.                               while ( dtypes.hasNext() )
  203.                               {
  204.                                   DocumentReceivedType dtype = ( DocumentReceivedType )dtypes.next();
  205.                          %>
  206.                          <option value="<%= dtype.getId() %>" <% if ( drvb.getType()!= null && dtype.getId()==drvb.getType().getId() ) out.print("selected"); %>>
  207.                          <%= dtype.getName() %></option>
  208.                          <%
  209.                               }                              
  210.                          %>
  211.                       </select>
  212.                     </td>
  213.                   </tr>
  214.                   <tr bgcolor="#e0e0e0"> 
  215.                     <td width="15%"> 
  216.                       <div align="left"><font class="strong">&nbsp;接受日期:</font></div>
  217.                     </td>
  218.                     <td > 
  219.                     <%  if( request.getParameter("type") == null ){ %>
  220.                     <input type="text" name="receivedDateS" class=text size="20" value="<%= current %>">&nbsp;
  221.                     <% }else{ %>
  222.                     <input type="text" name="receivedDateS" class=text size="20" value="<%= drvb.getReceivedDateS() %>" >&nbsp;
  223.                     <%}%>
  224.                     <img src="/vnex/intranet/calendar/datetime.gif" style="cursor:hand;" align="absmiddle" alt="弹出日历下拉菜单" onClick="fPopUpCalendarDlg(receivedDateS);return false">
  225.                     </td>  
  226.                   </tr>
  227.                   <tr bgcolor="#fafafa"> 
  228.                     <td width="15%"><font  class="strong"><font  class="strong">&nbsp;密级:</font></font></td>
  229.                     <td ><font  class="strong"> 
  230.                      <select name="securityType">
  231.                         <%
  232.                               Iterator types = SecurityType.getAvailableSecurityTypes().iterator();
  233.                               while ( types.hasNext() )
  234.                               {
  235.                                   SecurityType rtype = ( SecurityType )types.next();
  236.                          %>
  237.                          <option value="<%= rtype.getId() %>" <% if ( drvb.getSecurityType()!= null && rtype.getId()==drvb.getSecurityType().getId() ) out.print("selected"); %>>
  238.                          <%= rtype.getName() %></option>
  239.                          <%
  240.                               }                             
  241.                          %>
  242.                       </select>
  243.                       </select>
  244.                       </font></td>
  245.                   </tr>
  246.                   <tr bgcolor="#e0e0e0"> 
  247.                     <td width="15%"> 
  248.                       <div align="left"><font  class="strong">&nbsp;文件数:</font></div>
  249.                     </td>
  250.                     <td ><font  class="strong"><font  class="strong"> 
  251.                     <% if ( drvb.getFileNumber() == -1 ) 
  252.                        { %>
  253.                       <input type="text" name="fileNumber" size="24" class="file" >
  254.                     <% }else   
  255.                        { %>
  256.                       <input type="text" name="fileNumber" size="24" class="file" value= "<%= drvb.getFileNumber() %>">
  257.                     <% } 
  258.                     %>  
  259.                       </font></font></td>
  260.                   </tr>
  261.                   <tr bgcolor="#fafafa"> 
  262.                     <td width="15%"> 
  263.                       <div align="left"><font  class="strong">&nbsp;文件页数 :</font></div>
  264.                     </td>
  265.                     <td >
  266.                     <% if ( drvb.getPages() == -1 ) 
  267.                        { 
  268.                      %> 
  269.                       <input type="text" name="pages" size="24"" class="file" >
  270.                     <% }
  271.                        else
  272.                        { 
  273.                     %>
  274.                       <input type="text" name="pages" size="24" class="file" value= "<%= drvb.getPages() %>">
  275.                     <% } %>    
  276.                     </td>
  277.                   </tr>
  278.                   <tr bgcolor="#e0e0e0"> 
  279.                     <td width="15%" valign="top"> 
  280.                       <font  class="strong">&nbsp;文件内容:</font>
  281.                     </td>
  282.                     <td><textarea name="content" cols="59" rows="5"><%= FieldUtil.filterQuotTag( drvb.getContent() ) %></textarea>
  283.                     </td>
  284.                   </tr>
  285.                   <tr bgcolor="#fafafa"> 
  286.                     <td width="15%" valign="top"> 
  287.                       <font  class="strong">&nbsp;备注:</font> 
  288.                     </td>
  289.                     <td>  
  290.                         <textarea name="remark" cols="59" rows="5"><%= FieldUtil.filterQuotTag( drvb.getRemark() ) %></textarea>
  291.                     </td>
  292.                   </tr>
  293.                   <tr bgcolor="#e0e0e0">                     
  294.                     <td width="15%" valign="top"> 
  295.                       <font  class="strong">&nbsp;文  档:</font>
  296.                     </td>
  297.                     <td>  
  298.                         <select name="attachments" size="6" multiple style="width:300">
  299.                          <vnex_workflow:fileList collection="<%=drvb.getFiles()%>">          
  300.                           <vnex_workflow:items>                             
  301.                             <option value = "<vnex_workflow:fileAttribute attribute="workflowfile_title"/>">
  302.                             <vnex_workflow:fileAttribute attribute="workflowfile_name"/></option>                                         
  303.                           </vnex_workflow:items> 
  304.                           </vnex_workflow:fileList>  
  305.                         </select>
  306.                         <input type="button" name="Button22" value="删除" onClick="deleteDoc( this.form )" class="text">
  307.                         <br>
  308.                         <input type="file" name="file" class="text">&nbsp;
  309.                         <input type="button" name="Button2" value="上传" class="text" onClick="uploadDoc( this.form )">                      
  310.                     </td>
  311.                   </tr>
  312.                   <tr bgcolor="#fafafa"> 
  313.                     <td colspan="2" align="center"> 
  314.                         <input type="button" name="Submit" value="保存" class="text" onClick="createDoc(this.form)" >&nbsp;&nbsp;
  315.                         <input type="reset" name="Submit11" value="重置" class="file">&nbsp;&nbsp;
  316.                         <input type="reset" name="Submit2" value="放弃" class="text" onclick="location='/mainctrl/office/document/receivedlist?type=2'">
  317.                     </td>
  318.                   </tr>
  319.                 </table>
  320.               </td>
  321.             </tr>
  322.           </table>        
  323.         <jsp:include page="/vnex/page/TTOA_HELP.jsp" />
  324. </TD>
  325.     </TR>
  326.     <jsp:include page="/vnex/page/TTOA_TABLE_BOTTOM.jsp" />
  327.     </TBODY> 
  328.   </TABLE>
  329.   <BR>
  330.  <jsp:include page="/vnex/page/TTOA_PRODUCER_LOGO.jsp" />
  331. </form></DIV>