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

电子政务应用

开发平台:

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="drvb" scope="request" class="com.vnex.intranet.workflow.document.value.DocumentReceivedValueBean"/>
  14. <jsp:useBean id="documentProxy" scope="application" class="com.vnex.intranet.workflow.document.proxy.DocumentProxyBean" />
  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.     if( request.getParameter("type") == null )
  21.     { 
  22.         String sId = request.getParameter("id");         
  23.         drvb = documentProxy.getReceivedDocDetail( Integer.parseInt( sId ) );  
  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/receivedupdateok";
  37.       form.submit();
  38.    }   
  39. }
  40. function uploadDoc(form)
  41. {      
  42.    if(checkIt(form))
  43.    {
  44.        form.action="/mainctrl/office/document/receivedupdate?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/receivedupdate?type=2";    
  54.        form.submit();     
  55.    }
  56. }
  57. function checkIt(form)
  58. {
  59.    if(isEmpty(stripWhitespace(form.title.value)))
  60.    {
  61.       alert("请输入收文标题");
  62.       return false;
  63.    }
  64.    if( form.title.value.length >64 )
  65.    {
  66.       alert("收文标题长度不能超过64位.");
  67.       return false;
  68.    }  
  69.    if(isEmpty(form.NO.value))
  70.    {
  71.       alert("请输入收文文号");
  72.       return false;
  73.    }
  74.    if( form.NO.value.length >32 )
  75.    {
  76.       alert("收文文号长度不能超过32位.");
  77.       return false;
  78.    } 
  79.      
  80.    if(!isInteger( form.fileNumber.value ))
  81.    {
  82.       alert("文件数非法,请输入数字.");
  83.       return false;
  84.    }
  85.    if( form.fileNumber.value.length >5 )
  86.    {
  87.       alert("文件数的数字长度不能超过5位.");
  88.       return false;
  89.    }  
  90.    if(!isInteger( form.pages.value ))
  91.    {
  92.       alert("文件页数非法,请输入数字.");
  93.       return false;
  94.    }     
  95.    if( form.pages.value.length >5 )
  96.    {
  97.       alert("文件页数的数字长度不能超过5位.");
  98.       return false;
  99.    } 
  100.    if( form.content.value.length >250 )
  101.    {
  102.       alert("文件内容的长度不能超过250位.");
  103.       return false;
  104.    } 
  105.    if( form.remark.value.length >200 )
  106.    {
  107.       alert("文件备注的长度不能超过200位.");
  108.       return false;
  109.    } 
  110.    if( !isEmpty(form.receivedDateS.value) )
  111.    {            
  112.       if(!isVNEXDate(form.receivedDateS.value))
  113.       {
  114.         alert("收文接收日期非法");
  115.         return false;
  116.       }  
  117.       if( "<%=current%>" < form.receivedDateS.value)
  118.       {
  119.         alert("收文接收日期必须在本日之前!");
  120.         return false;
  121.       }
  122.    } 
  123.     
  124.    return true;
  125. }
  126. function openAttach( mSelObj )
  127. {    
  128.     for( var i = 0; i < mSelObj.options.length; i++ )
  129.     {
  130.        var oriLen = mSelObj.options.length;
  131.        if ( mSelObj.options[i].selected )
  132.        {
  133.            var eid = mSelObj.options[i].value;
  134.            window.open( "/" + eid );
  135.        }
  136.     }
  137. }
  138. function addKey()
  139. {
  140.     var opt = new Option();
  141.     var opt2 = new Option();
  142.     
  143.     if(!document.forms[0].file.value=="")
  144.     {
  145.       opt.value = document.forms[0].file.value;
  146.       opt.text = document.forms[0].file.value;
  147.       var flag1 = 1;
  148.       for(var i=0;i<document.forms[0].attachments.length;i++)
  149.       {
  150.         if(document.forms[0].attachments.options[i].text==opt.text)
  151.         {
  152.           flag1 = 0;
  153.           break;
  154.         }
  155.       }
  156.       if(flag1==1)
  157.       {
  158.         document.forms[0].attachments.options[document.forms[0].attachments.length] = opt;
  159.       }
  160.     }
  161. }
  162. function checkAll( selObj )
  163. {
  164.     for ( var i = 0; i < selObj.options.length; i++ )
  165.        selObj.options[i].selected = true;
  166. }
  167. </script>
  168. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  169. <HTML>
  170. <jsp:include page="/vnex/page/FORM_HEAD.jsp" />
  171. <BODY text=#000000 vLink=#000000 aLink=#000000 link=#000000 bgColor=#ffffff topMargin=20 leftmargin="0" marginwidth="0" marginheight="0">
  172. <script language="JavaScript1.2" src="/vnex/menu/dockmenu_office.js"></script>
  173. <script language="JavaScript1.2" src="/vnex/menu/dockmenu.js"></script>
  174. <script language="JavaScript">
  175. window.onload=init
  176. </script>
  177. <DIV align=center>
  178.   <form name="form1" method="post" action="">
  179.     <TABLE class=outter cellSpacing=0 cellPadding=0 width=600 border=0>
  180.     <TBODY> 
  181.         <jsp:include page="/vnex/page/TTOA_TABLE_TOP.jsp" />
  182.       <TR> 
  183.         <TD colSpan=3 align="center"><br>
  184.           <table width="600" border="1" cellspacing="1" bordercolor="#666666">
  185.             <tr> 
  186.               <td align="center" colspan="2" bgcolor="#FFFFFF"> 
  187.                 <table width="600" border="0" cellspacing="0" cellpadding="0">
  188.                   <tr bgcolor="#666666"> 
  189.                     <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>
  190.                     &gt;&gt;<a href="/mainctrl/office/document/receivedlist"><font color="#FFFFFF">收文管理</font></a>&gt;&gt;修改收文
  191.                       </font></td>
  192.                   </tr>
  193.                 </table>
  194.                 <table class=title border="0" cellpadding="2" cellspacing="1" width="600">
  195.                   <tr bgcolor="#e0e0e0"> 
  196.                     <td width="15%"> 
  197.                       <font class="strong" >&nbsp;文号:</font>
  198.                     </td>
  199.                     <td> 
  200.                       <input type="hidden" name="id" value= "<%= drvb.getId() %>">
  201.                       <input type="text" name="NO" size="24" class="file" value= "<%= FieldUtil.filterQuotTag( drvb.getNO() ) %>">
  202.                       * (注:带*为必填内容)</td>
  203.                     </tr>
  204.                    <tr bgcolor="#fafafa"> 
  205.                     <td width="15%"> 
  206.                       <font class="strong" >&nbsp;标题:</font>
  207.                     </td>
  208.                     <td> 
  209.                       <input type="text" name="title" size="24" class="file" value= "<%= FieldUtil.filterQuotTag( drvb.getTitle() ) %>">
  210.                       * </td>
  211.                   </tr>
  212.                   <tr bgcolor="#e0e0e0"> 
  213.                     <td width="15%"> 
  214.                       <font  class="strong">&nbsp;来文机关: </font>
  215.                     </td>
  216.                     <td > 
  217.                       <input type="text" name="comeFrom" size="24" class="file" value= "<%= FieldUtil.filterQuotTag( drvb.getComeFrom() ) %>">
  218.                       </td>
  219.                   </tr>
  220.                   <tr bgcolor="#fafafa"> 
  221.                     <td width="15%"> 
  222.                       <font  class="strong">&nbsp;文件分类: </font>
  223.                     </td>
  224.                     <td > 
  225.                       <select name="type">
  226.                         <%
  227.                               Iterator dtypes = DocumentReceivedType.getAvailableDocumentReceivedTypes().iterator();
  228.                               while ( dtypes.hasNext() )
  229.                               {
  230.                                   DocumentReceivedType dtype = ( DocumentReceivedType )dtypes.next();
  231.                          %>
  232.                          <option value="<%= dtype.getId() %>" <% if ( drvb.getType()!= null && dtype.getId()==drvb.getType().getId() ) out.print("selected"); %>>
  233.                          <%= dtype.getName() %></option>
  234.                          <%
  235.                               }                              
  236.                          %>
  237.                       </select>
  238.                     </td>
  239.                   </tr>
  240.                   <tr bgcolor="#e0e0e0"> 
  241.                     <td width="15%"> 
  242.                       <font  class="strong">&nbsp;接受日期:</font>
  243.                     </td>
  244.                     <td >          
  245.                       <input type="text" name="receivedDateS" class=text size="20" value="<%= drvb.getReceivedDateS() %>" ><img src="/vnex/intranet/calendar/datetime.gif" style="cursor:hand;" align="absmiddle" alt="弹出日历下拉菜单" onClick="fPopUpCalendarDlg(receivedDateS);return false">
  246.                     </td>
  247.                   </tr>
  248.                   <tr bgcolor="#fafafa"> 
  249.                     <td width="15%"><font  class="strong">&nbsp;密级:</font></td>
  250.                     <td >
  251.                       <select name="securityType">
  252.                         <%
  253.                               Iterator types = SecurityType.getAvailableSecurityTypes().iterator();
  254.                               while ( types.hasNext() )
  255.                               {
  256.                                   SecurityType rtype = ( SecurityType )types.next();
  257.                          %>
  258.                          <option value="<%= rtype.getId() %>" <% if ( drvb.getSecurityType()!= null && rtype.getId()==drvb.getSecurityType().getId() ) out.print("selected"); %>>
  259.                          <%= rtype.getName() %></option>
  260.                          <%
  261.                               }
  262.                               
  263.                          %>
  264.                       </select>
  265.                       </td>
  266.                   </tr>
  267.                   <tr bgcolor="#e0e0e0"> 
  268.                     <td width="15%"> 
  269.                       <div align="left"><font  class="strong">&nbsp;文件数:</font></div>
  270.                     </td>
  271.                     <td >
  272.                     <% if ( drvb.getFileNumber() != -1 ) 
  273.                        { %>
  274.                       <input type="text" name="fileNumber" size="24" class="file" value= "<%= drvb.getFileNumber() %>">
  275.                     <% }else   
  276.                        { %>
  277.                       <input type="text" name="fileNumber" size="24" class="file">
  278.                     <% } %>  
  279.                       </td>
  280.                   </tr>
  281.                   <tr bgcolor="#fafafa"> 
  282.                     <td width="15%"> 
  283.                       <div align="left"><font  class="strong">&nbsp;文件页数 :</font></div>
  284.                     </td>
  285.                     <td >
  286.                     <% if ( drvb.getPages() != -1 ) 
  287.                        { %> 
  288.                       <input type="text" name="pages" size="24" class="file" value= "<%= drvb.getPages() %>">
  289.                     <% }else   
  290.                        { %>
  291.                       <input type="text" name="pages" size="24" class="file">
  292.                     <% } %>    
  293.                     </td>
  294.                   </tr>
  295.                   <tr bgcolor="#e0e0e0"> 
  296.                     <td width="15%" valign="top"> 
  297.                       <font  class="strong">&nbsp;文件内容:</font>
  298.                     </td>
  299.                     <td><textarea name="content" cols="59" rows="5"><%= FieldUtil.filterQuotTag( drvb.getContent() ) %></textarea>
  300.                     </td>
  301.                   </tr>
  302.                   <tr bgcolor="#fafafa"> 
  303.                     <td width="15%" valign="top"> 
  304.                       <font  class="strong">&nbsp;备注:</font> 
  305.                     </td>
  306.                     <td>  
  307.                         <textarea name="remark" cols="59" rows="5"><%= FieldUtil.filterQuotTag( drvb.getRemark() ) %></textarea>
  308.                     </td>
  309.                   </tr>
  310.                   <tr bgcolor="#e0e0e0">                     
  311.                     <td width="15%" valign="top"> 
  312.                       <font  class="strong">&nbsp;上传附件:<br>&nbsp;(注:点击附件名称就可以查看附件. ) </font>
  313.                     </td>
  314.                     <td>  
  315.                         <!--select name="attachments" size="6" multiple style="width:300" onChange="openAttach( document.forms[0].attachments )"-->
  316.                         <select name="attachments" size="6" multiple style="width:300" >
  317.                          <vnex_workflow:fileList collection="<%=drvb.getFiles()%>">          
  318.                           <vnex_workflow:items>                                        
  319.                             <option value = "<vnex_workflow:fileAttribute attribute="workflowfile_title"/>">                                                           
  320.                                 <vnex_workflow:fileAttribute attribute="workflowfile_name"/></option>                                         
  321.                           </vnex_workflow:items> 
  322.                          </vnex_workflow:fileList>  
  323.                         </select>&nbsp;
  324.                         <input type="button" name="Button22" value="删除" onClick="deleteDoc(this.form)" class="text">
  325.                         <br>                        
  326.                         <input type="file" name="file" class="text">&nbsp;&nbsp;
  327.                         <input type="button" name="Button2" value="上传" class="text" onClick="uploadDoc(this.form)">                     
  328.                       </td>
  329.                   </tr>                    
  330.                   <tr bgcolor="#fafafa"> 
  331.                     <td colspan="2" align="center" height="30"> 
  332.                         <input type="button" name="Submit" value="保存" class="file" onClick="createDoc(this.form)" >&nbsp;&nbsp;
  333.                         <input type="reset" name="Submit2" value="重置" class="file">
  334.                         <input type="reset" name="Submit2" value="放弃" class="file" onclick="location='/mainctrl/office/document/receivedlist?type=2'">
  335.                     </td>
  336.                   </tr>
  337.                 </table>
  338.               </td>
  339.             </tr>
  340.           </table>         
  341. <jsp:include page="/vnex/page/TTOA_HELP.jsp" />
  342. </TD>
  343.     </TR>
  344.     <jsp:include page="/vnex/page/TTOA_TABLE_BOTTOM.jsp" />
  345.     </TBODY> 
  346.   </TABLE>
  347.   <BR>
  348.  <jsp:include page="/vnex/page/TTOA_PRODUCER_LOGO.jsp" />
  349. </form></DIV>