AddDocTempletMoveFlow.jsp
上传用户:mingda
上传日期:2017-06-20
资源大小:27691k
文件大小:19k
源码类别:

OA系统

开发平台:

Java

  1. <%@ page contentType="text/html; charset=gb2312"%>
  2. <%@ page import="com.gforce.gfoa.*,com.gforce.currency.*,java.util.*" %>
  3. <jsp:include page="/CheckLogin.jsp" flush="true"/>
  4. <%
  5. Session m_session = new Session(session);
  6. int intUserID = m_session.GetInt("UserID");
  7. Request m_request = new Request(request);
  8. String strIp = request.getRemoteAddr();
  9. int iSysDirID = m_request.GetInt("SysDirID");
  10. String strDocTempletTableName = m_request.GetString("DocTempletTableName");
  11. %>
  12. <html>
  13. <head>
  14. <meta http-equiv="Content-Type" content="text/html; charset=gb2312"><meta http-equiv="pragma" content="no-cache">
  15. <title>公文流转模板管理-- GForce OA 2.0</title>
  16. <link href="../css/txt.jsp" rel="stylesheet" type="text/css">
  17. <script language="JavaScript" src="/js/changestyle.js"></script>
  18. <script language="JavaScript" type="text/javascript">
  19. var MyArray = new Array();
  20. var MoveFlow = new Array();
  21. <%
  22. Vector MoveFlow_vt = MoveFlowTempletManager.getRecordBySearch("","","","","","","","a.FlowName",true,false);
  23. for (int i=0;i<MoveFlow_vt.size();i++)
  24. {
  25.    out.println("MoveFlow[" + i + "]=new Array('" + ((Vector)MoveFlow_vt.get(i)).get(0) + "','" + ((Vector)MoveFlow_vt.get(i)).get(1).toString() + "','" + ((Vector)MoveFlow_vt.get(i)).get(2).toString() + "','" + ((Vector)MoveFlow_vt.get(i)).get(3).toString() + "','" + UserManager.getPersonnelNamesByUserIDs(((Vector)MoveFlow_vt.get(i)).get(2).toString()) + "','" + DepartmentManager.getDepartNamesByIDs(((Vector)MoveFlow_vt.get(i)).get(3).toString()).replaceAll("n",",") + "');");
  26. }
  27. %>
  28. var DocTemp = new Array();
  29. <%
  30. Vector Doc_vt = DocumentTempletManager.getRecordBySearch("",iSysDirID,"","","","","","","","","","","","","","","a.TempletName",true,false);
  31. for (int i=0;i<Doc_vt.size();i++)
  32. {
  33.    out.println("DocTemp[" + i + "]=new Array('" + ((Vector)Doc_vt.get(i)).get(0) + "','" + ((Vector)Doc_vt.get(i)).get(3).toString() + "','" + ((Vector)Doc_vt.get(i)).get(6).toString() + "','" + ((Vector)Doc_vt.get(i)).get(7).toString() + "','" +  UserManager.getPersonnelNamesByUserIDs(((Vector)Doc_vt.get(i)).get(6).toString()) + "','" + DepartmentManager.getDepartNamesByIDs(((Vector)Doc_vt.get(i)).get(7).toString()).replaceAll("n",",") + "','" + ((Vector)Doc_vt.get(i)).get(8).toString() + "','" + ((Vector)Doc_vt.get(i)).get(9).toString()  + "','" +  UserManager.getPersonnelNamesByUserIDs(((Vector)Doc_vt.get(i)).get(8).toString()) + "','" + DepartmentManager.getDepartNamesByIDs(((Vector)Doc_vt.get(i)).get(9).toString()).replaceAll("n",",") + "');");
  34. }
  35. %>
  36. function checkAddFields()
  37. {
  38.     if(document.AddDocTempletMoveFlow.Name.value==0)
  39.     {
  40.         alert("请填写公文流转模板名称!");
  41.         document.AddDocTempletMoveFlow.Name.focus();
  42.         return false;
  43.     }
  44.     if(document.AddDocTempletMoveFlow.DocTempletID.value==0)
  45.     {
  46.         alert("请选择公文模板!");
  47.         document.AddDocTempletMoveFlow.DocTempletID.focus();
  48.         return false;
  49.     }
  50.   if(document.AddDocTempletMoveFlow.MoveFlowID.value==0)
  51.     {
  52.         alert("请选择流转模板!");
  53.         document.AddDocTempletMoveFlow.MoveFlowID.focus();
  54.         return false;
  55.     }
  56. }
  57. function EditFields()
  58. {
  59.         var StrMoveFlowWA_UIDs="";
  60.         var StrMoveFlowWA_UNames="";
  61.         var StrDocTempWA_UIDs="";
  62.         var StrDocTempWA_UNames="";
  63.         var StrDocTempWA_DIDs="";
  64.         var StrDocTempWA_DNames="";
  65.         var StrMoveFlowWA_DIDs="";
  66.         var StrMoveFlowWA_DNames="";
  67.         var WUName="";
  68.         var WDName="";
  69.         var StrDocTempOR_UIDs="";
  70.         var StrDocTempOR_UNames="";
  71.         var StrDocTempOR_DIDs="";
  72.         var StrDocTempOR_DNames ="";
  73.         var RUName="";
  74.         var RDName="";
  75.   iDocIndex=document.AddDocTempletMoveFlow.DocTempletID.selectedIndex-1;
  76.   iMoveIndex=document.AddDocTempletMoveFlow.MoveFlowID.selectedIndex-1;
  77.   if (iDocIndex<0)
  78.   {
  79.     StrDocTempWA_UIDs="";
  80.         StrDocTempWA_DIDs="";
  81.         StrDocTempWA_UNames = "";
  82.         StrDocTempWA_DNames = "";
  83.         StrDocTempOR_UIDs = "";
  84.         StrDocTempOR_UNames = "";
  85.         StrDocTempOR_DIDs = "";
  86.         StrDocTempOR_DNames = "";
  87.   }
  88.   else
  89.   {
  90.           StrDocTempWA_UIDs = DocTemp[iDocIndex][2];
  91.           StrDocTempWA_DIDs = DocTemp[iDocIndex][3];
  92.           StrDocTempWA_UNames = DocTemp[iDocIndex][4];
  93.           StrDocTempWA_DNames = DocTemp[iDocIndex][5];
  94.           StrDocTempOR_UIDs = DocTemp[iDocIndex][6];
  95.           StrDocTempOR_DIDs = DocTemp[iDocIndex][7];
  96.           StrDocTempOR_UNames = DocTemp[iDocIndex][8];
  97.           StrDocTempOR_DNames = DocTemp[iDocIndex][9];
  98.   }
  99.   if (iMoveIndex<0)
  100.   {
  101.     StrMoveFlowWA_UIDs="";
  102.         StrMoveFlowWA_DIDs="";
  103.           StrMoveFlowWA_UNames = "";
  104.           StrMoveFlowWA_DNames = "";
  105.   }
  106.   else
  107.   {
  108.           StrMoveFlowWA_UIDs = MoveFlow[iMoveIndex][2];
  109.           StrMoveFlowWA_DIDs = MoveFlow[iMoveIndex][3];
  110.           StrMoveFlowWA_UNames = MoveFlow[iMoveIndex][4];
  111.           StrMoveFlowWA_DNames = MoveFlow[iMoveIndex][5];
  112.   }
  113.   if (StrDocTempWA_UIDs.length<=StrMoveFlowWA_UIDs.length)
  114.   {
  115.       WUstring="";
  116.           WUName = "";
  117.           if (StrDocTempWA_UIDs.length>0)
  118.           {
  119.                   if(StrDocTempWA_UIDs.indexOf(",")>0)
  120.                 {
  121.                   MyArray = StrDocTempWA_UIDs.split(",");
  122.                   MyArray1 = StrDocTempWA_UNames.split(",");
  123.                   StrMoveFlowWA_UIDs=","+StrMoveFlowWA_UIDs+",";
  124.                   for (var i=0;i<MyArray.length;i++)
  125.                   {
  126.                         if (StrMoveFlowWA_UIDs.indexOf(","+ MyArray[i] +",")>=0)
  127.                         {
  128.                                 if(WUstring=="")
  129.                                 {
  130.                                         WUstring += MyArray[i];
  131.                                         WUName += MyArray1[i];
  132.                                 }
  133.                                 else
  134.                                 {
  135.                                         WUstring += (","+MyArray[i]);
  136.                                         WUName += (","+MyArray1[i]);
  137.                                 }
  138.                         }
  139.                   }
  140.                 }
  141.                 else
  142.                 {
  143.                         WUstring=StrDocTempWA_UIDs;
  144.                         WUName = StrDocTempWA_UNames;
  145.                 }
  146.           }
  147.   }
  148.   else
  149.   {
  150.       WUstring="";
  151.           if (StrMoveFlowWA_UIDs.length>0)
  152.           {
  153.                   if(StrMoveFlowWA_UIDs.indexOf(",")>0)
  154.                 {
  155.                   MyArray = StrMoveFlowWA_UIDs.split(",");
  156.                   MyArray1 = StrMoveFlowWA_UNames.split(",");
  157.                   StrDocTempWA_UIDs=","+StrDocTempWA_UIDs+",";
  158.                   for (var i=0;i<MyArray.length;i++)
  159.                   {
  160.                         if (StrDocTempWA_UIDs.indexOf(","+ MyArray[i] +",")>=0)
  161.                         {
  162.                                 if(WUstring=="")
  163.                                 {
  164.                                         WUstring += MyArray[i];
  165.                                         WUName += MyArray1[i];
  166.                                 }
  167.                                 else
  168.                                 {
  169.                                         WUstring += (","+MyArray[i]);
  170.                                         WUName += (","+MyArray1[i]);
  171.                                 }
  172.                         }
  173.                   }
  174.                 }
  175.                 else
  176.                 {
  177.                         WUstring=StrMoveFlowWA_UIDs;
  178.                         WUName=StrMoveFlowWA_UNames;
  179.                 }
  180.           }
  181.   }
  182.   if (StrDocTempWA_DIDs.length<=StrMoveFlowWA_DIDs.length)
  183.   {
  184.       WDstring="";
  185.           WDName="";
  186.           if (StrDocTempWA_DIDs.length>0)
  187.           {
  188.                   if(StrDocTempWA_DIDs.indexOf(",")>0)
  189.                 {
  190.                   MyArray = StrDocTempWA_DIDs.split(",");
  191.                   MyArray1 = StrDocTempWA_Dnames.split(",");
  192.                   StrMoveFlowWA_DIDs=","+StrMoveFlowWA_DIDs+",";
  193.                   for (var i=0;i<MyArray.length;i++)
  194.                   {
  195.                         if (StrMoveFlowWA_DIDs.indexOf(","+ MyArray[i] +",")>=0)
  196.                         {
  197.                                 if(WDstring=="")
  198.                                 {
  199.                                 WDstring += MyArray[i];
  200.                                 WDName += MyArray1[i];
  201.                                 }
  202.                                 else
  203.                                 {
  204.                                 WDstring += (","+MyArray[i]);
  205.                                 WDName += ("n"+MyArray1[i]);
  206.                                 }
  207.                         }
  208.                   }
  209.                 }
  210.                 else
  211.                 {
  212.                         WDstring=StrDocTempWA_DIDs;
  213.                         WDName=StrDocTempWA_DNames;
  214.                 }
  215.           }
  216.   }
  217.   else
  218.   {
  219.       WDstring="";
  220.           WDName = "";
  221.           if (StrMoveFlowWA_DIDs.length>0)
  222.           {
  223.                   if(StrMoveFlowWA_DIDs.indexOf(",")>0)
  224.                 {
  225.                   MyArray = StrMoveFlowWA_DIDs.split(",");
  226.                   MyArray1 = StrMoveFlowWA_DNames.split(",");
  227.                   StrDocTempWA_DIDs=","+StrDocTempWA_DIDs+",";
  228.                   for (var i=0;i<MyArray.length;i++)
  229.                   {
  230.                         if (StrDocTempWA_DIDs.indexOf(","+ MyArray[i] +",")>=0)
  231.                         {
  232.                                 if (WDstring=="")
  233.                                 {
  234.                                 WDstring += MyArray[i];
  235.                                 WDName += MyArray1[i];
  236.                                 }
  237.                                 else
  238.                                 {
  239.                                 WDstring += (","+MyArray[i]);
  240.                                 WDName += ("n"+MyArray1[i]);
  241.                                 }
  242.                         }
  243.                   }
  244.                 }
  245.                 else
  246.                 {
  247.                         WDstring=StrMoveFlowWA_DIDs;
  248.                         WDName=StrMoveFlowWA_DNames;
  249.                 }
  250.           }
  251.   }
  252.   if (StrDocTempOR_UNames.length>0)
  253.   {
  254.                 RUName = StrDocTempOR_UNames;
  255.   }
  256.   if (StrDocTempOR_DNames.length>0)
  257.   {
  258.     for(;;)
  259.         {
  260.                 if (StrDocTempOR_DNames.indexOf(",")>0)
  261.                 {
  262.                         StrDocTempOR_DNames = StrDocTempOR_DNames.replace(",","n");
  263.                 }
  264.                 else
  265.                 {
  266.                         break;
  267.                 }
  268.         }
  269.         RDName = StrDocTempOR_DNames;
  270.   }
  271.   document.AddDocTempletMoveFlow.WritableUserIDs.value=WUstring;
  272.   document.AddDocTempletMoveFlow.WritableUserNames.value=WUName;
  273.   document.AddDocTempletMoveFlow.WritableDepartIDs.value=WDstring;
  274.   document.AddDocTempletMoveFlow.WritableDepartNames.value=WDName;
  275.   document.AddDocTempletMoveFlow.ReadOnlyUserIDs.value=StrDocTempOR_UIDs;
  276.   document.AddDocTempletMoveFlow.ReadOnlyUserNames.value=RUName;
  277.   document.AddDocTempletMoveFlow.ReadOnlyDepartIDs.value=StrDocTempOR_DIDs;
  278.   document.AddDocTempletMoveFlow.ReadOnlyDepartNames.value=RDName;
  279. }
  280. function AddMoveFlow()
  281. {
  282.   for(var i=0;i<MoveFlow.length;i++)
  283.   {
  284.     document.AddDocTempletMoveFlow.MoveFlowID.length++;
  285.     document.AddDocTempletMoveFlow.MoveFlowID.options[document.AddDocTempletMoveFlow.MoveFlowID.length-1].text=MoveFlow[i][1];
  286.     document.AddDocTempletMoveFlow.MoveFlowID.options[document.AddDocTempletMoveFlow.MoveFlowID.length-1].value=MoveFlow[i][0];
  287.   }
  288.   for(var i=0;i<DocTemp.length;i++)
  289.   {
  290.     document.AddDocTempletMoveFlow.DocTempletID.length++;
  291.     document.AddDocTempletMoveFlow.DocTempletID.options[document.AddDocTempletMoveFlow.DocTempletID.length-1].text=DocTemp[i][1];
  292.     document.AddDocTempletMoveFlow.DocTempletID.options[document.AddDocTempletMoveFlow.DocTempletID.length-1].value=DocTemp[i][0];
  293.   }
  294. }
  295. </script>
  296. </head>
  297. <body bgcolor="<%=m_session.GetString("BackColor")%>" leftmargin="0" topmargin="0" onLoad="AddMoveFlow();document.AddDocTempletMoveFlow.Name.focus();">
  298.  <table width="100%" border="0" cellpadding="0" cellspacing="0">
  299.         <tr>
  300.           <td height="50" valign="top" background="../images/dy-back.gif">
  301.             <table width="100%" border="0" cellpadding="0" cellspacing="0">
  302.               <tr valign="middle">
  303.                 <td width="61" align="center" height="20"><img src="../images/dy-01.gif" width="38" height="36"></td>
  304.                 <td width="118" nowrap="nowrap" valign="middle"><strong><font color="#000000">新增流转模板</font></strong></td>
  305.                 <td align="right" nowrap="nowrap" valign="bottom">&nbsp;
  306.                    <!-- 群增<img src="../images/MulAdd.gif" onMouseOver="this.src='../images/MulAdd_a.gif';" onMouseOut="this.src='../images/MulAdd.gif';" border="0" height="22" width="59">&nbsp;-->
  307.                  <!--<img src="../images/Single.gif" onMouseOver="this.src='../images/Single_a.gif';" onMouseOut="this.src='../images/Single.gif';" border="0" height="22" width="59">&nbsp;-->
  308.                   <!-- 修改<img src="../images/Update.gif" onMouseOver="this.src='../images/Update_a.gif';" onMouseOut="this.src='../images/Update.gif';" border="0" height="22" width="59">&nbsp;-->
  309.                   <!-- 删除<img src="../images/Del.gif" onMouseOver="this.src='../images/Del_a.gif';" onMouseOut="this.src='../images/Del.gif';" border="0" height="22" width="59">&nbsp;-->
  310.                   <!-- 查看<img src="../images/Query.gif" onMouseOver="this.src='../images/Query_a.gif';" onMouseOut="this.src='../images/Query.gif';" border="0" height="22" width="59">&nbsp;-->
  311.                   <!-- 组合查询<img src="../images/GroupQuery.gif" onMouseOver="this.src='../images/GroupQuery_a.gif';" onMouseOut="this.src='../images/GroupQuery.gif';" border="0" height="22" width="79">&nbsp;-->
  312.                 </td>
  313.               </tr>
  314.             </table>
  315.           </td>
  316.         </tr>
  317.       </table>
  318. <table width="100%" height="100%" border="0" align="center" cellspacing="0">
  319.   <tr>
  320.      <td  align="center" valign="top"><p>&nbsp;</p>
  321.      <form name="AddDocTempletMoveFlow" action="AddDocTempletMoveFlowAction.jsp?SysDirID=<%=iSysDirID%>" method="post" onSubmit="javascript:return checkAddFields();">
  322.         <table  border="1" cellpadding="1" cellspacing="1" width="90%">
  323.          <tr>
  324.                <td width="14%" align="center" valign="middle" nowrap><font color="#0A0A0A">公文流转模板名称:&nbsp;</font></td>
  325.                <td colspan="3" align="left" valign="middle" nowrap>&nbsp;<input name="Name" type="text" maxlength="300" size="60"></td>
  326.          </tr>
  327.                <tr><td colspan="4"><p>&nbsp;</p></td></tr>
  328.          <tr>
  329.                <td width="14%" align="center" valign="middle" nowrap><font color="#0A0A0A">公文模板名称:</font></td>
  330.                <td colspan="1" align="left" valign="middle" nowrap>&nbsp;
  331.                <select name='DocTempletID' onChange="EditFields()"><option value=0 selected>无</option></select>
  332.                </td>
  333.                <td width="14%" align="left" valign="middle" nowrap><font color="#0A0A0A">&nbsp;流转模版名称:</font></td>
  334.                <td colspan="1" align="left" valign="middle" nowrap>
  335.                &nbsp;<select name='MoveFlowID' onChange="EditFields()"><option value=0 selected>无</option></select>
  336.                <input name="DocTempletTableName" type="hidden" value="<%=strDocTempletTableName%>">
  337.                <input name="UpdateUserID" type="hidden" value="<%=intUserID%>">
  338.                <%java.util.Date t_Date = new java.util.Date();%>
  339.                <input name="UpdateTime" type="hidden" value="<%=StringNew.GetDateString(t_Date,"yyyy-MM-dd HH:mm:ss")%>">
  340.                <input name="UpdateFromIP" type="hidden" value="<%=strIp%>"></td>
  341.          </tr>
  342.                <tr><td colspan="4"><p>&nbsp;</p></td></tr>
  343.          <tr>
  344.                <td width="14%" align="center" valign="middle" nowrap><font color="#0A0A0A">可写用户姓名:</font></td>
  345.                <td colspan="3" align="left" valign="middle" nowrap>
  346.                &nbsp;<textarea name="WritableUserNames" cols="70" rows="3" readonly="true" onDblClick="GetUserIDAndNames(document.AddDocTempletMoveFlow.WritableUserIDs,this);"></textarea>
  347.                <input name="WritableUserIDs" type="hidden">
  348.                <a href="" onclick="GetUserIDAndNames(document.AddDocTempletMoveFlow.WritableUserIDs,document.AddDocTempletMoveFlow.WritableUserNames);return false;" title="选择用户"><img src="/images/couple.gif" border="0"></a>
  349.                </td>
  350.          </tr>
  351.                <tr><td colspan="4"><p>&nbsp;</p></td></tr>
  352.          <tr>
  353.                <td width="14%" align="center" valign="middle" nowrap><font color="#0A0A0A">可写部门名称:</font></td>
  354.                <td colspan="3" align="left" valign="middle" nowrap>
  355.                &nbsp;<textarea name="WritableDepartNames" cols="70" rows="3" readonly="true" ondblclick="GetDepartIDAndNames(document.AddDocTempletMoveFlow.WritableDepartIDs, this);"></textarea>
  356.                <input name="WritableDepartIDs" type="hidden">
  357.                <a href="" onclick="GetDepartIDAndNames(document.AddDocTempletMoveFlow.WritableDepartIDs, document.AddDocTempletMoveFlow.WritableDepartNames);return false;" title="选择部门"><img src="/images/couple.gif" border="0"></a>
  358.                </td>
  359.          </tr>
  360.                <tr><td colspan="4"><p>&nbsp;</p></td></tr>
  361.          <tr>
  362.                <td width="14%" align="center" valign="middle" nowrap><font color="#0A0A0A">只读用户姓名:</font></td>
  363.                <td colspan="3" align="left" valign="middle" nowrap>
  364.                &nbsp;<textarea name="ReadOnlyUserNames" cols="70" rows="3" readonly="true" onDblClick="GetUserIDAndNames(document.AddDocTempletMoveFlow.ReadOnlyUserIDs,this);"></textarea>
  365.                <input name="ReadOnlyUserIDs" type="hidden">
  366.                <a href="" onclick="GetUserIDAndNames(document.AddDocTempletMoveFlow.ReadOnlyUserIDs,document.AddDocTempletMoveFlow.ReadOnlyUserNames);return false;" title="选择用户"><img src="/images/couple.gif" border="0"></a>
  367.                </td>
  368.          </tr>
  369.                <tr><td colspan="4"><p>&nbsp;</p></td></tr>
  370.          <tr>
  371.                <td width="14%" align="center" valign="middle" nowrap><font color="#0A0A0A">只读部门名称:</font></td>
  372.                <td colspan="3" align="left" valign="middle" nowrap>
  373.                &nbsp;<textarea name="ReadOnlyDepartNames" cols="70" rows="3" readonly="true" onDblClick="GetDepartIDAndNames(document.AddDocTempletMoveFlow.ReadOnlyDepartIDs,this);"></textarea>
  374.                <input name="ReadOnlyDepartIDs" type="hidden">
  375.                <a href="" onclick="GetDepartIDAndNames(document.AddDocTempletMoveFlow.ReadOnlyDepartIDs,document.AddDocTempletMoveFlow.ReadOnlyDepartNames);return false;" title="选择部门"><img src="/images/couple.gif" border="0"></a>
  376.                </td>
  377.          </tr>
  378.          <table width="90%" border="0">
  379.            <tr>
  380.              <td width="30%">&nbsp;</td><td width="70%">&nbsp;</td>
  381.            </tr>
  382.            <tr>
  383.              <td width="30%">&nbsp;</td>
  384.              <td align="left" valign="middle" nowrap><input type="submit" value="确定">
  385.               &nbsp;&nbsp;&nbsp; <input type="reset" value="重填"> &nbsp;&nbsp;&nbsp;
  386.               <input type="button" value="返回" onclick="window.location='DocTempletMoveFlowManage.jsp?SysDirID=<%=iSysDirID%>';">
  387.              </td>
  388.           </tr>
  389.          </table>
  390.         </table>
  391.      </form>
  392.    </td>
  393.   </tr>
  394. </table>
  395. </body>
  396. </html>