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

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. String strDocTempletTableName = "DocumentTemplet";
  10. int intDocumentID = m_request.GetInt("ID");
  11. int iSysDirID = m_request.GetInt("SysDirID");
  12. if(intDocumentID <1)
  13. {
  14. %>
  15. <script language="JavaScript" type="text/JavaScript">
  16. alert("请选择正确的公文,处理失败!");
  17. history.back();
  18. </script>
  19. <%
  20. }
  21. else
  22. {
  23.   String strDocumentID = intDocumentID + "";
  24.   //根据公文ID取公文信息
  25.   Vector Document_vt = DocumentManagerPlus.getRecordByIDAll(strDocumentID);
  26.   String strDTMFID = ((Vector)Document_vt.get(0)).get(2).toString();
  27.   String strDocument_Name = ((Vector)Document_vt.get(0)).get(1).toString();
  28.   String strCurrentTache = ((Vector)Document_vt.get(0)).get(7).toString();
  29.   String strBuildUserID = ((Vector)Document_vt.get(0)).get(4).toString();
  30.   //根据公文流转模板ID取公文流转模板信息
  31.   Vector DTMF_vt = DocTempletMoveFlowManager.getRecordBySearch(strDTMFID,strDocTempletTableName);
  32.   int intDocTempletID = Integer.parseInt(((Vector)DTMF_vt.get(0)).get(2).toString());
  33.   String strMoveFlowID = ((Vector)DTMF_vt.get(0)).get(4).toString();
  34.   String strIsAutoBuild = ((Vector)DTMF_vt.get(0)).get(21).toString();
  35.   String strDocTempletID = intDocTempletID + "";
  36.   //根据流转模板ID取流转环节信息
  37.   Vector FTIC_vt = FlowTacheInfoManager.getRecordBySearch(strCurrentTache,"","","","","","","","","","","","","","","","","");
  38.   Vector FTIN_vt = FlowTacheInfoManager.getRecordBySearch("","",strCurrentTache,"","","","","","","","","","","","","","","");
  39.   //根据公文模板ID取公文模板信息
  40.   Vector DocTemplet_vt = DocumentTempletManager.getRecordByID(intDocTempletID);
  41.   String strDocTempletName = ((Vector)DocTemplet_vt.get(0)).get(1).toString();
  42.   String strDocTempletEngName = ((Vector)DocTemplet_vt.get(0)).get(5).toString();
  43.   //根据公文模板ID取公文模板字段信息
  44.   Vector DTField_vt = DocTempletFieldsManager.getRecordBySearch("","","","","","","","","","","","True","","",strDocTempletID,"","","","OrderNumber","");
  45.   if (DTField_vt.size()>0)
  46.   {
  47. %>
  48. <html>
  49. <head>
  50. <meta http-equiv="Content-Type" content="text/html; charset=gb2312"><meta http-equiv="pragma" content="no-cache">
  51. <title>公文处理管理-- GForce OA 2.0</title>
  52. <link href="../css/txt.jsp" rel="stylesheet" type="text/css">
  53. <script language="JavaScript" src="/js/changestyle.js"></script>
  54. <script language="JavaScript" src="/Calendar/PopUpCalendarDlg.js"></script>
  55. <script language="JavaScript" type="text/javascript">
  56. function checkAddFields()
  57. {
  58.   <%
  59.     for (int i=0;i<DTField_vt.size();i++)
  60.     {
  61.       if (("," + ((Vector)DTField_vt.get(i)).get(9).toString() + ",").indexOf("," + intUserID + ",")>=0)
  62.       {
  63.         if (((Vector)DTField_vt.get(i)).get(8).toString().equalsIgnoreCase("True"))
  64.         {
  65.           out.println("if(document." + strDocTempletEngName + "." + ((Vector)DTField_vt.get(i)).get(3).toString() + ".value=="")");
  66.           out.println("{");
  67.           out.println("alert("请填写" + ((Vector)DTField_vt.get(i)).get(1).toString() + "内容!");");
  68.           out.println("document." + strDocTempletEngName + "." + ((Vector)DTField_vt.get(i)).get(3).toString() + ".focus();");
  69.           out.println("return false;");
  70.           out.println("}");
  71.         }
  72.       }
  73.     }
  74.   %>
  75. }
  76. </script>
  77. </head>
  78. <body bgcolor="<%=m_session.GetString("BackColor")%>" leftmargin="0" topmargin="0">
  79. <table width="100%" height="100%" border="0" align="center" cellspacing="0">
  80.   <tr>
  81.      <td  align="center" valign="top"><p>&nbsp;</p>
  82.      <%
  83.         out.println("<form name="" + strDocTempletEngName + "" action ="DocumentProcessAction.jsp?SysDirID=" + iSysDirID + "&ID=" + strDocumentID + "&DocTempletID=" + strDocTempletID + "" method="post" onSubmit="javascript:return checkAddFields();">");
  84.           out.println("<table align="center" border="0" cellpadding="0" cellspacing="0" width="90%">");
  85.             out.println("<tr>");
  86.             out.println("<td align="center" valign="top"><font color="#0A0A0A"><b>" + strDocument_Name + "</b></font></td></tr>");
  87.             out.println("<tr><td>&nbsp</td></tr>");
  88.             out.println("<tr><td>&nbsp</td></tr></table>");
  89.             out.println("<table align="center" border="1" cellspacing="2" width="90%" cellpadding="3" bordercolordark="#ffffff" bordercolorlight="#0a0a0a">");
  90.             for (int i=0,j=0;i<DTField_vt.size();i++)
  91.             {
  92.               if ((("," + ((Vector)DTField_vt.get(i)).get(10).toString() + ",").indexOf("," + intUserID + ",")>=0)||(("," + ((Vector)DTField_vt.get(i)).get(9).toString() + ",").indexOf("," + intUserID + ",")>=0))
  93.               {
  94.                 String strFormObject = "";
  95.                 String strFieldValue = "";
  96.                 boolean bReadOnly = true;
  97.                 Vector DocFieldsValue_vt = DocFieldsValueManager.getRecordBySearch("",strDocumentID,"",((Vector)DTField_vt.get(i)).get(0).toString(),"","","a.[ApproveFlowID]","True");
  98.                 if (DocFieldsValue_vt.size()>0)
  99.                 {
  100.                   strFieldValue = ((Vector)DocFieldsValue_vt.get(0)).get(3).toString();
  101.                 }
  102.                 else
  103.                 {
  104.                   strFieldValue = ((Vector)DTField_vt.get(i)).get(16).toString();
  105.                 }
  106.                 if ((("," + ((Vector)DTField_vt.get(i)).get(9).toString() + ",").indexOf("," + intUserID + ",")>=0))
  107.                 {
  108.                   bReadOnly=false;
  109.                 }
  110.                 if (((Vector)DTField_vt.get(i)).get(2).toString().equalsIgnoreCase("String"))
  111.                 {
  112.                     strFormObject = "<input type='text' name='" + ((Vector)DTField_vt.get(i)).get(3).toString() + "' " + ((Vector)DTField_vt.get(i)).get(5).toString() + " value='" + strFieldValue + "' maxlength='" + ((Vector)DTField_vt.get(i)).get(15).toString() + "' " + (bReadOnly?"readonly":"") + ">";
  113.                 }
  114.                 if (((Vector)DTField_vt.get(i)).get(2).toString().equalsIgnoreCase("Text"))
  115.                 {
  116.                     strFormObject = "<textarea style='width:100%;' wrap='hard' cols='40' rows='6' name='" + ((Vector)DTField_vt.get(i)).get(3).toString() + "' " + ((Vector)DTField_vt.get(i)).get(5).toString() + " maxlength='" + ((Vector)DTField_vt.get(i)).get(15).toString() + "' " + (bReadOnly?"readonly":"") +">" + strFieldValue + "</textarea>";
  117.                 }
  118.                 if (bReadOnly==false)
  119.                 {
  120.                   if (((Vector)DTField_vt.get(i)).get(2).toString().equalsIgnoreCase("Name"))
  121.                   {
  122.                     strFormObject="<input type='text' readonly='true' name='" + ((Vector)DTField_vt.get(i)).get(3).toString() + "' " + ((Vector)DTField_vt.get(i)).get(5).toString() + " value='" + UserManager.getPersonnelNameByUserID(intUserID) + "' maxlength='" + ((Vector)DTField_vt.get(i)).get(15).toString() + "' size='10'>";
  123.                   }
  124.                   if (((Vector)DTField_vt.get(i)).get(2).toString().equalsIgnoreCase("Optime"))
  125.                   {
  126.                     java.util.Date t_Date = new java.util.Date();
  127.                     strFormObject="<input type='text' readonly='true' name='" + ((Vector)DTField_vt.get(i)).get(3).toString() + "' value='" + StringNew.GetDateString(t_Date,"yyyy-MM-dd HH:mm") + "' maxlength='12' size='16'>";
  128.                   }
  129.                 }
  130.                 else
  131.                 {
  132.                   if (((Vector)DTField_vt.get(i)).get(2).toString().equalsIgnoreCase("Name"))
  133.                   {
  134.                     strFormObject="<input type='text' readonly='true' name='" + ((Vector)DTField_vt.get(i)).get(3).toString() + "' " + ((Vector)DTField_vt.get(i)).get(5).toString() + " value='" + strFieldValue + "' maxlength='" + ((Vector)DTField_vt.get(i)).get(15).toString() + "' size='10'>";
  135.                   }
  136.                   if (((Vector)DTField_vt.get(i)).get(2).toString().equalsIgnoreCase("Optime"))
  137.                   {
  138.                     java.util.Date t_Date = new java.util.Date();
  139.                     strFormObject="<input type='text' readonly='true' name='" + ((Vector)DTField_vt.get(i)).get(3).toString() + "' value='" + StringNew.GetDateString(strFieldValue,"yyyy-MM-dd HH:mm") + "' maxlength='12' size='16'>";
  140.                   }
  141.                 }
  142.                 if (((Vector)DTField_vt.get(i)).get(2).toString().equalsIgnoreCase("Read"))
  143.                 {
  144.                    strFormObject="<input type='text' name='" + ((Vector)DTField_vt.get(i)).get(3).toString() + "' " + ((Vector)DTField_vt.get(i)).get(5).toString() + " value='" + strFieldValue + "' maxlength='" + ((Vector)DTField_vt.get(i)).get(15).toString() + "' readonly='true'>";
  145.                 }
  146.                 if (((Vector)DTField_vt.get(i)).get(2).toString().equalsIgnoreCase("Numeric"))
  147.                 {
  148.                     strFormObject="<input type='text' name='" + ((Vector)DTField_vt.get(i)).get(3).toString() + "' " + ((Vector)DTField_vt.get(i)).get(5).toString() + " value='" + strFieldValue + "' maxlength='" + ((Vector)DTField_vt.get(i)).get(15).toString() + "' " + (bReadOnly?"readonly":"") + " size='15'>";
  149.                 }
  150.                 if (((Vector)DTField_vt.get(i)).get(2).toString().equalsIgnoreCase("Date"))
  151.                 {
  152.                     strFormObject="<input type='text' name='" + ((Vector)DTField_vt.get(i)).get(3).toString() + "' " + ((Vector)DTField_vt.get(i)).get(5).toString() + " value='" + strFieldValue + "' maxlength='12' size='15' onFocus='JavaScript:this.value=fPopUpCalendarDlg(this.value);'  onDblClick='JavaScript:this.value=fPopUpCalendarDlg(this.value);' " + (bReadOnly?"readonly":"") + ">";
  153.                 }
  154.                 if (((Vector)DTField_vt.get(i)).get(2).toString().equalsIgnoreCase("Radio"))
  155.                 {
  156.                  strFormObject = ((Vector)DTField_vt.get(i)).get(6).toString();
  157.                  String[] strOption = strFormObject.split("《,》");
  158.                  if(strOption.length>1)
  159.                   {
  160.                     strFormObject="";
  161.                     for(int k=0;k<strOption.length;k++)
  162.                     {
  163.                       String strOptionText="";
  164.                       String strOptionValue="";
  165.                       if(strOption[k].indexOf("《¥》")>0)
  166.                        {
  167.                          strOptionText=strOption[k].substring(0,strOption[k].indexOf("《¥》"));
  168.                          strOptionValue=strOption[k].substring(strOption[k].indexOf("《¥》")+3);
  169.                        }
  170.                       else
  171.                        {
  172.                          strOptionText=strOption[k];
  173.                          strOptionValue=strOption[k];
  174.                        }
  175.                       strFormObject+="<input type='radio' name='" + ((Vector)DTField_vt.get(i)).get(3).toString() + "' " + ((Vector)DTField_vt.get(i)).get(5).toString() + " value='" + strOptionValue + "'" + (strOptionValue.equalsIgnoreCase(strFieldValue)?" checked":"") + " " + (bReadOnly?"disabled":"") + ">" + strOptionText;
  176.                       if(k < strOption.length-1)
  177.                        {
  178.                          if(strOptionText.length()>20)
  179.                           strFormObject+="<br>";
  180.                          else
  181.                           strFormObject+="&nbsp;&nbsp;&nbsp;";
  182.                        }
  183.                      }
  184.                    }
  185.                   else
  186.                    {
  187.                     strFormObject="该单选按钮设置有问题,请与管理员联系!";
  188.                    }
  189.                 }
  190.                 if (((Vector)DTField_vt.get(i)).get(2).toString().equalsIgnoreCase("checkbox"))
  191.                 {
  192.                   strFormObject = ((Vector)DTField_vt.get(i)).get(6).toString();
  193.                   String[] strOption = strFormObject.split("《,》");
  194.                   if(strOption.length>1)
  195.                    {
  196.                      strFormObject="";
  197.                      for(int k=0;k<strOption.length;k++)
  198.                       {
  199.                         String strOptionText="";
  200.                         String strOptionValue="";
  201.                         if(strOption[k].indexOf("《¥》")>0)
  202.                          {
  203.                            strOptionText=strOption[k].substring(0,strOption[k].indexOf("《¥》"));
  204.                            strOptionValue=strOption[k].substring(strOption[k].indexOf("《¥》")+3);
  205.                          }
  206.                         else
  207.                          {
  208.                            strOptionText=strOption[k];
  209.                            strOptionValue=strOption[k];
  210.                          }
  211.                         strFormObject+="<input type='checkbox' name='" + ((Vector)DTField_vt.get(i)).get(3).toString() + "' " + ((Vector)DTField_vt.get(i)).get(5).toString() + " value='" + strOptionValue + "'" + (strOptionValue.equalsIgnoreCase(strFieldValue)?" checked":"") + " " + (bReadOnly?"disabled":"") + ">" + strOptionText;
  212.                         if(k < strOption.length-1)
  213.                          {
  214.                            if(strOptionText.length()>20)
  215.                              strFormObject+="<br>";
  216.                            else
  217.                              strFormObject+="&nbsp;&nbsp;&nbsp;";
  218.                          }
  219.                        }
  220.                      }
  221.                   else
  222.                    {
  223.                      strFormObject="该复选框设置有问题,请与管理员联系!";
  224.                    }
  225.                   }
  226.                 if (((Vector)DTField_vt.get(i)).get(2).toString().equalsIgnoreCase("Select"))
  227.                 {
  228.                   strFormObject = ((Vector)DTField_vt.get(i)).get(6).toString();
  229.                   String[] strOption = strFormObject.split("《,》");
  230.                   if(strOption.length>1)
  231.                    {
  232.                      strFormObject="<select name='" + ((Vector)DTField_vt.get(i)).get(3).toString() + "' " + ((Vector)DTField_vt.get(i)).get(5).toString() + " size='1' " + (bReadOnly?"disabled":"") + ">";
  233.                      for(int k=0;k<strOption.length;k++)
  234.                       {
  235.                         String strOptionText="";
  236.                         String strOptionValue="";
  237.                         if(strOption[k].indexOf("《¥》")>0)
  238.                          {
  239.                            strOptionText=strOption[k].substring(0,strOption[k].indexOf("《¥》"));
  240.                            strOptionValue=strOption[k].substring(strOption[k].indexOf("《¥》")+3);
  241.                          }
  242.                         else
  243.                          {
  244.                            strOptionText=strOption[k];
  245.                            strOptionValue=strOption[k];
  246.                          }
  247.                         strFormObject+="<option value='" + strOptionValue + "'" + (strOptionValue.equalsIgnoreCase(strFieldValue)?" selected":"") + ">" + strOptionText + "</option>";
  248.                         if(k < strOption.length-1)
  249.                          {
  250.                            if(strOptionText.length()>20)
  251.                              strFormObject+="<br>";
  252.                            else
  253.                              strFormObject+="&nbsp;&nbsp;&nbsp;";
  254.                          }
  255.                        }
  256.                      }
  257.                   else
  258.                    {
  259.                      strFormObject="该下拉列表设置有问题,请与管理员联系!";
  260.                    }
  261.                   }
  262.                 if (((Vector)DTField_vt.get(i)).get(2).toString().equalsIgnoreCase("List"))
  263.                 {
  264.                   strFormObject = ((Vector)DTField_vt.get(i)).get(6).toString();
  265.                   String[] strOption = strFormObject.split("《,》");
  266.                   if(strOption.length>1)
  267.                    {
  268.                      strFormObject="<select name='" + ((Vector)DTField_vt.get(i)).get(3).toString() + "' " + ((Vector)DTField_vt.get(i)).get(5).toString() + " size='3' multiple " + (bReadOnly?"disabled":"") + ">";
  269.                      for(int k=0;k<strOption.length;k++)
  270.                       {
  271.                         String strOptionText="";
  272.                         String strOptionValue="";
  273.                         if(strOption[k].indexOf("《¥》")>0)
  274.                          {
  275.                            strOptionText=strOption[k].substring(0,strOption[k].indexOf("《¥》"));
  276.                            strOptionValue=strOption[k].substring(strOption[k].indexOf("《¥》")+3);
  277.                          }
  278.                         else
  279.                          {
  280.                            strOptionText=strOption[k];
  281.                            strOptionValue=strOption[k];
  282.                          }
  283.                         strFormObject+="<option value='" + strOptionValue + "'" + (strOptionValue.equalsIgnoreCase(strFieldValue)?" selected":"") + ">" + strOptionText + "</option>";
  284.                         if(k < strOption.length-1)
  285.                          {
  286.                           if(strOptionText.length()>20)
  287.                             strFormObject+="<br>";
  288.                           else
  289.                             strFormObject+="&nbsp;&nbsp;&nbsp;";
  290.                          }
  291.                        }
  292.                       }
  293.                   else
  294.                    {
  295.                      strFormObject="该多选列表设置有问题,请与管理员联系!";
  296.                    }
  297.                   }
  298.                 if (((Vector)DTField_vt.get(i)).get(2).toString().equalsIgnoreCase("ACC"))
  299.                 {
  300.                   strFormObject="<input type='text' id='" + ((Vector)DTField_vt.get(i)).get(3).toString() + "' name='" + ((Vector)DTField_vt.get(i)).get(3).toString() + "' " + ((Vector)DTField_vt.get(i)).get(5).toString() + " value='" + strFieldValue + "' maxlength='" + ((Vector)DTField_vt.get(i)).get(15).toString() + "' size='30'><input type=button";
  301.                   if(bReadOnly)
  302.                   {
  303.                     strFormObject +=" disabled='true'";
  304.                   }
  305.                   else
  306.                   {
  307.                     strFormObject +=" onclick='return uploadacc(document.all." + ((Vector)DTField_vt.get(i)).get(3).toString() + ")'";
  308.                   }
  309.                   if(strFieldValue.trim().length()>0)
  310.                   {
  311.                     strFormObject +=" value='修改'><br><a href=""+  strFieldValue + "">下载附件</a>";
  312.                   }
  313.                   else
  314.                   {
  315.                     strFormObject +=" value='添加'>";
  316.                   }
  317.                 }
  318.                 if (strFormObject.trim().length()>0)
  319.                 {
  320.                  j=j+1;
  321.                  if(j % 2 == 0)
  322.                   {
  323.                     out.println("<tr id="Row"+ j + "" class="DataRowsSingle">");
  324.                   }
  325.                  else
  326.                   {
  327.                     out.println("<tr id="Row"+ j + "" class="DataRowsDouble">");
  328.                   }
  329.                   out.println("<td width="15%" align="right" valign="middle" nowrap><font color="#0A0A0A">"+((Vector)DTField_vt.get(i)).get(1).toString()+":</font>&nbsp;</td>");
  330.                   out.println("<td width="60%" align="left" valign="middle" nowrap>");
  331.                   out.println(strFormObject);
  332.                   out.println("</td>");
  333.                   out.println("</tr>");
  334.                 }
  335.               }
  336.             }
  337.           out.println("<tr>");
  338.           out.println("<td align="right" valign="middle" nowrap>流转环节选择:&nbsp;</td>");
  339.           out.println("<td align="left" valign="middle">");
  340.           out.println("<select name="FT_select">");
  341.           if (((Vector)FTIC_vt.get(0)).get(3).toString().equalsIgnoreCase("S"))
  342.           {
  343.             out.println("<option value="" + strCurrentTache + "" selected>保存</option>");
  344.             if(strIsAutoBuild.equalsIgnoreCase("true"))
  345.             {
  346.                     out.println("<option value="-2">作废</option>");
  347.             }
  348.             else
  349.             {
  350.             }
  351.             for (int i=0;i<FTIN_vt.size();i++)
  352.             {
  353.              out.println("<option value="" + ((Vector)FTIN_vt.get(i)).get(0).toString() + "">" + ((Vector)FTIN_vt.get(i)).get(1).toString() + "</option>");
  354.             }
  355.           }
  356.           else if (((Vector)FTIC_vt.get(0)).get(3).toString().equalsIgnoreCase("E"))
  357.           {
  358.             out.println("<option value="" + ((Vector)FTIC_vt.get(0)).get(2).toString() + "">返回重填</option>");
  359.             out.println("<option value="" + strCurrentTache + "" selected>保存公文内容</option>");
  360.             out.println("<option value="-1">审批完毕</option>");
  361.           }
  362.           else
  363.           {
  364.             out.println("<option value="" + ((Vector)FTIC_vt.get(0)).get(2).toString() + "">返回重填</option>");
  365.             out.println("<option value="" + strCurrentTache + "" selected>保存公文内容</option>");
  366.             for (int i=0;i<FTIN_vt.size();i++)
  367.             {
  368.              out.println("<option value="" + ((Vector)FTIN_vt.get(i)).get(0).toString() + "">" + ((Vector)FTIN_vt.get(i)).get(1).toString() + "</option>");
  369.             }
  370.           }
  371.           out.println("</select></td>");
  372.           out.println("</tr>");
  373.           out.println("<tr>");
  374.           out.println("<td align="center" valign="middle" nowrap colspan="2">");
  375.           out.println("<input type="hidden" name="CurrentTache" id="CurrentTache" value="" + strCurrentTache + "">");
  376.           out.println("<input type="submit" value="确  定" style="background-color: #FFFFFF; border: 1 solid #000000">&nbsp;&nbsp;");
  377.           out.println("<input type="reset" value="重  填" style="background-color: #FFFFFF; border: 1 solid #000000">&nbsp;&nbsp;");
  378.           out.println("<input type="button" value="返  回" onclick="window.location='DocumentProcessManage.jsp?SysDirID=" + iSysDirID + "';" style="background-color: #FFFFFF; border: 1 solid #000000">");
  379.           out.println("</td></tr>");
  380.           out.println("</table>");
  381.         out.println("</form>");
  382.      %>
  383.      </td>
  384.   </tr>
  385. </table>
  386. </body>
  387. </html>
  388. <%
  389. }
  390. else
  391. {
  392. %>
  393. <script language="JavaScript" type="text/JavaScript">
  394. alert("该公文没有字段或所有字段已经被删除,处理失败!");
  395. history.back();
  396. </script>
  397. <%
  398. }
  399. }
  400. %>