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