DocumentProcess.jsp
资源名称:OA.rar [点击查看]
上传用户:mingda
上传日期:2017-06-20
资源大小:27691k
文件大小:22k
源码类别:
OA系统
开发平台:
Java
- <%@ page contentType="text/html; charset=gb2312"%>
- <%@ page import="com.gforce.gfoa.*,com.gforce.currency.*,java.util.*" %>
- <jsp:include page="/CheckLogin.jsp" flush="true"/>
- <%
- Session m_session = new Session(session);
- int intUserID = m_session.GetInt("UserID");
- Request m_request = new Request(request);
- String strIp = request.getRemoteAddr();
- String strDocTempletTableName = "DocumentTemplet";
- int intDocumentID = m_request.GetInt("ID");
- int iSysDirID = m_request.GetInt("SysDirID");
- if(intDocumentID <1)
- {
- %>
- <script language="JavaScript" type="text/JavaScript">
- alert("请选择正确的公文,处理失败!");
- history.back();
- </script>
- <%
- }
- else
- {
- String strDocumentID = intDocumentID + "";
- //根据公文ID取公文信息
- Vector Document_vt = DocumentManagerPlus.getRecordByIDAll(strDocumentID);
- String strDTMFID = ((Vector)Document_vt.get(0)).get(2).toString();
- String strDocument_Name = ((Vector)Document_vt.get(0)).get(1).toString();
- String strCurrentTache = ((Vector)Document_vt.get(0)).get(7).toString();
- String strBuildUserID = ((Vector)Document_vt.get(0)).get(4).toString();
- //根据公文流转模板ID取公文流转模板信息
- Vector DTMF_vt = DocTempletMoveFlowManager.getRecordBySearch(strDTMFID,strDocTempletTableName);
- int intDocTempletID = Integer.parseInt(((Vector)DTMF_vt.get(0)).get(2).toString());
- String strMoveFlowID = ((Vector)DTMF_vt.get(0)).get(4).toString();
- String strIsAutoBuild = ((Vector)DTMF_vt.get(0)).get(21).toString();
- String strDocTempletID = intDocTempletID + "";
- //根据流转模板ID取流转环节信息
- Vector FTIC_vt = FlowTacheInfoManager.getRecordBySearch(strCurrentTache,"","","","","","","","","","","","","","","","","");
- Vector FTIN_vt = FlowTacheInfoManager.getRecordBySearch("","",strCurrentTache,"","","","","","","","","","","","","","","");
- //根据公文模板ID取公文模板信息
- Vector DocTemplet_vt = DocumentTempletManager.getRecordByID(intDocTempletID);
- String strDocTempletName = ((Vector)DocTemplet_vt.get(0)).get(1).toString();
- String strDocTempletEngName = ((Vector)DocTemplet_vt.get(0)).get(5).toString();
- //根据公文模板ID取公文模板字段信息
- Vector DTField_vt = DocTempletFieldsManager.getRecordBySearch("","","","","","","","","","","","True","","",strDocTempletID,"","","","OrderNumber","");
- if (DTField_vt.size()>0)
- {
- %>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=gb2312"><meta http-equiv="pragma" content="no-cache">
- <title>公文处理管理-- GForce OA 2.0</title>
- <link href="../css/txt.jsp" rel="stylesheet" type="text/css">
- <script language="JavaScript" src="/js/changestyle.js"></script>
- <script language="JavaScript" src="/Calendar/PopUpCalendarDlg.js"></script>
- <script language="JavaScript" type="text/javascript">
- function checkAddFields()
- {
- <%
- for (int i=0;i<DTField_vt.size();i++)
- {
- if (("," + ((Vector)DTField_vt.get(i)).get(9).toString() + ",").indexOf("," + intUserID + ",")>=0)
- {
- if (((Vector)DTField_vt.get(i)).get(8).toString().equalsIgnoreCase("True"))
- {
- out.println("if(document." + strDocTempletEngName + "." + ((Vector)DTField_vt.get(i)).get(3).toString() + ".value=="")");
- out.println("{");
- out.println("alert("请填写" + ((Vector)DTField_vt.get(i)).get(1).toString() + "内容!");");
- out.println("document." + strDocTempletEngName + "." + ((Vector)DTField_vt.get(i)).get(3).toString() + ".focus();");
- out.println("return false;");
- out.println("}");
- }
- }
- }
- %>
- }
- </script>
- </head>
- <body bgcolor="<%=m_session.GetString("BackColor")%>" leftmargin="0" topmargin="0">
- <table width="100%" height="100%" border="0" align="center" cellspacing="0">
- <tr>
- <td align="center" valign="top"><p> </p>
- <%
- out.println("<form name="" + strDocTempletEngName + "" action ="DocumentProcessAction.jsp?SysDirID=" + iSysDirID + "&ID=" + strDocumentID + "&DocTempletID=" + strDocTempletID + "" method="post" onSubmit="javascript:return checkAddFields();">");
- out.println("<table align="center" border="0" cellpadding="0" cellspacing="0" width="90%">");
- out.println("<tr>");
- out.println("<td align="center" valign="top"><font color="#0A0A0A"><b>" + strDocument_Name + "</b></font></td></tr>");
- out.println("<tr><td> </td></tr>");
- out.println("<tr><td> </td></tr></table>");
- out.println("<table align="center" border="1" cellspacing="2" width="90%" cellpadding="3" bordercolordark="#ffffff" bordercolorlight="#0a0a0a">");
- for (int i=0,j=0;i<DTField_vt.size();i++)
- {
- if ((("," + ((Vector)DTField_vt.get(i)).get(10).toString() + ",").indexOf("," + intUserID + ",")>=0)||(("," + ((Vector)DTField_vt.get(i)).get(9).toString() + ",").indexOf("," + intUserID + ",")>=0))
- {
- String strFormObject = "";
- String strFieldValue = "";
- boolean bReadOnly = true;
- Vector DocFieldsValue_vt = DocFieldsValueManager.getRecordBySearch("",strDocumentID,"",((Vector)DTField_vt.get(i)).get(0).toString(),"","","a.[ApproveFlowID]","True");
- if (DocFieldsValue_vt.size()>0)
- {
- strFieldValue = ((Vector)DocFieldsValue_vt.get(0)).get(3).toString();
- }
- else
- {
- strFieldValue = ((Vector)DTField_vt.get(i)).get(16).toString();
- }
- if ((("," + ((Vector)DTField_vt.get(i)).get(9).toString() + ",").indexOf("," + intUserID + ",")>=0))
- {
- bReadOnly=false;
- }
- if (((Vector)DTField_vt.get(i)).get(2).toString().equalsIgnoreCase("String"))
- {
- 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":"") + ">";
- }
- if (((Vector)DTField_vt.get(i)).get(2).toString().equalsIgnoreCase("Text"))
- {
- 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>";
- }
- if (bReadOnly==false)
- {
- if (((Vector)DTField_vt.get(i)).get(2).toString().equalsIgnoreCase("Name"))
- {
- 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'>";
- }
- if (((Vector)DTField_vt.get(i)).get(2).toString().equalsIgnoreCase("Optime"))
- {
- java.util.Date t_Date = new java.util.Date();
- 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'>";
- }
- }
- else
- {
- if (((Vector)DTField_vt.get(i)).get(2).toString().equalsIgnoreCase("Name"))
- {
- 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'>";
- }
- if (((Vector)DTField_vt.get(i)).get(2).toString().equalsIgnoreCase("Optime"))
- {
- java.util.Date t_Date = new java.util.Date();
- 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'>";
- }
- }
- if (((Vector)DTField_vt.get(i)).get(2).toString().equalsIgnoreCase("Read"))
- {
- 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'>";
- }
- if (((Vector)DTField_vt.get(i)).get(2).toString().equalsIgnoreCase("Numeric"))
- {
- 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'>";
- }
- if (((Vector)DTField_vt.get(i)).get(2).toString().equalsIgnoreCase("Date"))
- {
- 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":"") + ">";
- }
- if (((Vector)DTField_vt.get(i)).get(2).toString().equalsIgnoreCase("Radio"))
- {
- strFormObject = ((Vector)DTField_vt.get(i)).get(6).toString();
- String[] strOption = strFormObject.split("《,》");
- if(strOption.length>1)
- {
- strFormObject="";
- for(int k=0;k<strOption.length;k++)
- {
- String strOptionText="";
- String strOptionValue="";
- if(strOption[k].indexOf("《¥》")>0)
- {
- strOptionText=strOption[k].substring(0,strOption[k].indexOf("《¥》"));
- strOptionValue=strOption[k].substring(strOption[k].indexOf("《¥》")+3);
- }
- else
- {
- strOptionText=strOption[k];
- strOptionValue=strOption[k];
- }
- 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;
- if(k < strOption.length-1)
- {
- if(strOptionText.length()>20)
- strFormObject+="<br>";
- else
- strFormObject+=" ";
- }
- }
- }
- else
- {
- strFormObject="该单选按钮设置有问题,请与管理员联系!";
- }
- }
- if (((Vector)DTField_vt.get(i)).get(2).toString().equalsIgnoreCase("checkbox"))
- {
- strFormObject = ((Vector)DTField_vt.get(i)).get(6).toString();
- String[] strOption = strFormObject.split("《,》");
- if(strOption.length>1)
- {
- strFormObject="";
- for(int k=0;k<strOption.length;k++)
- {
- String strOptionText="";
- String strOptionValue="";
- if(strOption[k].indexOf("《¥》")>0)
- {
- strOptionText=strOption[k].substring(0,strOption[k].indexOf("《¥》"));
- strOptionValue=strOption[k].substring(strOption[k].indexOf("《¥》")+3);
- }
- else
- {
- strOptionText=strOption[k];
- strOptionValue=strOption[k];
- }
- 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;
- if(k < strOption.length-1)
- {
- if(strOptionText.length()>20)
- strFormObject+="<br>";
- else
- strFormObject+=" ";
- }
- }
- }
- else
- {
- strFormObject="该复选框设置有问题,请与管理员联系!";
- }
- }
- if (((Vector)DTField_vt.get(i)).get(2).toString().equalsIgnoreCase("Select"))
- {
- strFormObject = ((Vector)DTField_vt.get(i)).get(6).toString();
- String[] strOption = strFormObject.split("《,》");
- if(strOption.length>1)
- {
- strFormObject="<select name='" + ((Vector)DTField_vt.get(i)).get(3).toString() + "' " + ((Vector)DTField_vt.get(i)).get(5).toString() + " size='1' " + (bReadOnly?"disabled":"") + ">";
- for(int k=0;k<strOption.length;k++)
- {
- String strOptionText="";
- String strOptionValue="";
- if(strOption[k].indexOf("《¥》")>0)
- {
- strOptionText=strOption[k].substring(0,strOption[k].indexOf("《¥》"));
- strOptionValue=strOption[k].substring(strOption[k].indexOf("《¥》")+3);
- }
- else
- {
- strOptionText=strOption[k];
- strOptionValue=strOption[k];
- }
- strFormObject+="<option value='" + strOptionValue + "'" + (strOptionValue.equalsIgnoreCase(strFieldValue)?" selected":"") + ">" + strOptionText + "</option>";
- if(k < strOption.length-1)
- {
- if(strOptionText.length()>20)
- strFormObject+="<br>";
- else
- strFormObject+=" ";
- }
- }
- }
- else
- {
- strFormObject="该下拉列表设置有问题,请与管理员联系!";
- }
- }
- if (((Vector)DTField_vt.get(i)).get(2).toString().equalsIgnoreCase("List"))
- {
- strFormObject = ((Vector)DTField_vt.get(i)).get(6).toString();
- String[] strOption = strFormObject.split("《,》");
- if(strOption.length>1)
- {
- strFormObject="<select name='" + ((Vector)DTField_vt.get(i)).get(3).toString() + "' " + ((Vector)DTField_vt.get(i)).get(5).toString() + " size='3' multiple " + (bReadOnly?"disabled":"") + ">";
- for(int k=0;k<strOption.length;k++)
- {
- String strOptionText="";
- String strOptionValue="";
- if(strOption[k].indexOf("《¥》")>0)
- {
- strOptionText=strOption[k].substring(0,strOption[k].indexOf("《¥》"));
- strOptionValue=strOption[k].substring(strOption[k].indexOf("《¥》")+3);
- }
- else
- {
- strOptionText=strOption[k];
- strOptionValue=strOption[k];
- }
- strFormObject+="<option value='" + strOptionValue + "'" + (strOptionValue.equalsIgnoreCase(strFieldValue)?" selected":"") + ">" + strOptionText + "</option>";
- if(k < strOption.length-1)
- {
- if(strOptionText.length()>20)
- strFormObject+="<br>";
- else
- strFormObject+=" ";
- }
- }
- }
- else
- {
- strFormObject="该多选列表设置有问题,请与管理员联系!";
- }
- }
- if (((Vector)DTField_vt.get(i)).get(2).toString().equalsIgnoreCase("ACC"))
- {
- 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";
- if(bReadOnly)
- {
- strFormObject +=" disabled='true'";
- }
- else
- {
- strFormObject +=" onclick='return uploadacc(document.all." + ((Vector)DTField_vt.get(i)).get(3).toString() + ")'";
- }
- if(strFieldValue.trim().length()>0)
- {
- strFormObject +=" value='修改'><br><a href=""+ strFieldValue + "">下载附件</a>";
- }
- else
- {
- strFormObject +=" value='添加'>";
- }
- }
- if (strFormObject.trim().length()>0)
- {
- j=j+1;
- if(j % 2 == 0)
- {
- out.println("<tr id="Row"+ j + "" class="DataRowsSingle">");
- }
- else
- {
- out.println("<tr id="Row"+ j + "" class="DataRowsDouble">");
- }
- out.println("<td width="15%" align="right" valign="middle" nowrap><font color="#0A0A0A">"+((Vector)DTField_vt.get(i)).get(1).toString()+":</font> </td>");
- out.println("<td width="60%" align="left" valign="middle" nowrap>");
- out.println(strFormObject);
- out.println("</td>");
- out.println("</tr>");
- }
- }
- }
- out.println("<tr>");
- out.println("<td align="right" valign="middle" nowrap>流转环节选择: </td>");
- out.println("<td align="left" valign="middle">");
- out.println("<select name="FT_select">");
- if (((Vector)FTIC_vt.get(0)).get(3).toString().equalsIgnoreCase("S"))
- {
- out.println("<option value="" + strCurrentTache + "" selected>保存</option>");
- if(strIsAutoBuild.equalsIgnoreCase("true"))
- {
- out.println("<option value="-2">作废</option>");
- }
- else
- {
- }
- for (int i=0;i<FTIN_vt.size();i++)
- {
- out.println("<option value="" + ((Vector)FTIN_vt.get(i)).get(0).toString() + "">" + ((Vector)FTIN_vt.get(i)).get(1).toString() + "</option>");
- }
- }
- else if (((Vector)FTIC_vt.get(0)).get(3).toString().equalsIgnoreCase("E"))
- {
- out.println("<option value="" + ((Vector)FTIC_vt.get(0)).get(2).toString() + "">返回重填</option>");
- out.println("<option value="" + strCurrentTache + "" selected>保存公文内容</option>");
- out.println("<option value="-1">审批完毕</option>");
- }
- else
- {
- out.println("<option value="" + ((Vector)FTIC_vt.get(0)).get(2).toString() + "">返回重填</option>");
- out.println("<option value="" + strCurrentTache + "" selected>保存公文内容</option>");
- for (int i=0;i<FTIN_vt.size();i++)
- {
- out.println("<option value="" + ((Vector)FTIN_vt.get(i)).get(0).toString() + "">" + ((Vector)FTIN_vt.get(i)).get(1).toString() + "</option>");
- }
- }
- out.println("</select></td>");
- out.println("</tr>");
- out.println("<tr>");
- out.println("<td align="center" valign="middle" nowrap colspan="2">");
- out.println("<input type="hidden" name="CurrentTache" id="CurrentTache" value="" + strCurrentTache + "">");
- out.println("<input type="submit" value="确 定" style="background-color: #FFFFFF; border: 1 solid #000000"> ");
- out.println("<input type="reset" value="重 填" style="background-color: #FFFFFF; border: 1 solid #000000"> ");
- out.println("<input type="button" value="返 回" onclick="window.location='DocumentProcessManage.jsp?SysDirID=" + iSysDirID + "';" style="background-color: #FFFFFF; border: 1 solid #000000">");
- out.println("</td></tr>");
- out.println("</table>");
- out.println("</form>");
- %>
- </td>
- </tr>
- </table>
- </body>
- </html>
- <%
- }
- else
- {
- %>
- <script language="JavaScript" type="text/JavaScript">
- alert("该公文没有字段或所有字段已经被删除,处理失败!");
- history.back();
- </script>
- <%
- }
- }
- %>