EditDocument.jsp
资源名称:OA.rar [点击查看]
上传用户:mingda
上传日期:2017-06-20
资源大小:27691k
文件大小:13k
源码类别:
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); %>
- <%
- Request m_request = new Request(request);
- int iUserID = m_session.GetInt("UserID");
- int intDocumentID = m_request.GetInt("ID");
- int iTypesID = m_request.GetInt("TypesID");
- int iSysDirID = m_request.GetInt("SysDirID");
- if(intDocumentID<1)
- {
- %>
- <script language="JavaScript" type="text/JavaScript">
- alert("请选择正确的文档,修改失败!");
- history.back();
- </script>
- <%
- }
- else
- {
- Vector vt = DocumentManager.getByIDRecord(intDocumentID);
- if(vt.size() == 1)
- {
- %>
- <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="/Calendar/PopUpCalendarDlg.js"></SCRIPT>
- <script language="JavaScript" src="/js/changestyle.js"></script>
- <script language="JavaScript" type="text/javascript">
- function CheckEditDocument()
- {
- if(document.EditDocument.DocumentName.value=="")
- {
- alert("请输入名称!");
- document.EditDocument.DocumentName.focus();
- return false;
- }
- <%
- Vector vtFields = DocFieldsManager.getByDocTypeRecord(iTypesID);
- if(vtFields.size()>0)
- {
- for (int i=0; i<vtFields.size(); i++)
- {
- if (((Vector)vtFields.get(i)).get(3).toString().equalsIgnoreCase("STR"))
- {
- //字符串类型输入框,表单输入框名称为字段ID。
- if (((Vector)vtFields.get(i)).get(1).toString().indexOf("(必填)")>=0)
- {
- out.println("if(document.EditDocument.Name"+((Vector)vtFields.get(i)).get(0).toString()+".value=="")");
- out.println("{");
- out.println("alert("请输入"+((Vector)vtFields.get(i)).get(1).toString()+"!");");
- out.println("document.EditDocument.Name"+((Vector)vtFields.get(i)).get(0).toString()+".focus();");
- out.println("return false;");
- out.println("}");
- }
- }else
- if (((Vector)vtFields.get(i)).get(3).toString().equalsIgnoreCase("NUM"))
- {
- //数值类型输入框,表单输入框名称为字段ID。
- if (((Vector)vtFields.get(i)).get(1).toString().indexOf("(必填)")>=0)
- {
- out.println("if(isNaN(parseInt(document.EditDocument.Name"+((Vector)vtFields.get(i)).get(0).toString()+".value)))");
- out.println("{");
- out.println("alert("请输入正确的"+((Vector)vtFields.get(i)).get(1).toString()+"!");");
- out.println("document.EditDocument.Name"+((Vector)vtFields.get(i)).get(0).toString()+".select();");
- out.println("document.EditDocument.Name"+((Vector)vtFields.get(i)).get(0).toString()+".focus();");
- out.println("return false;");
- out.println("}");
- }
- else
- {
- out.println("if(document.EditDocument.Name"+((Vector)vtFields.get(i)).get(0).toString()+".value.length>0)");
- out.println("if(isNaN(parseInt(document.EditDocument.Name"+((Vector)vtFields.get(i)).get(0).toString()+".value)))");
- out.println("{");
- out.println("alert("请输入正确的"+((Vector)vtFields.get(i)).get(1).toString()+"!");");
- out.println("document.EditDocument.Name"+((Vector)vtFields.get(i)).get(0).toString()+".focus();");
- out.println("return false;");
- out.println("}");
- }
- }else
- if (((Vector)vtFields.get(i)).get(3).toString().equalsIgnoreCase("DATE"))
- {
- //日期类型输入框,表单输入框名称为字段ID。
- if (((Vector)vtFields.get(i)).get(1).toString().indexOf("(必填)")>=0)
- {
- out.println("if(!isDate(document.EditDocument.Name"+((Vector)vtFields.get(i)).get(0).toString()+".value))");
- out.println("{");
- out.println("alert("日期格式错误,请按照“2002-02-18”重新输入!");");
- out.println("document.EditDocument.Name"+((Vector)vtFields.get(i)).get(0).toString()+".focus();");
- out.println("return false;");
- out.println("}");
- }
- else
- {
- out.println("if(document.EditDocument.Name"+((Vector)vtFields.get(i)).get(0).toString()+".value.length>0)");
- out.println("if(!isDate(document.EditDocument.Name"+((Vector)vtFields.get(i)).get(0).toString()+".value))");
- out.println("{");
- out.println("alert("日期格式错误,请按照“2002-02-18”重新输入!");");
- out.println("document.EditDocument.Name"+((Vector)vtFields.get(i)).get(0).toString()+".focus();");
- out.println("return false;");
- out.println("}");
- }
- }else
- if (((Vector)vtFields.get(i)).get(3).toString().equalsIgnoreCase("TEXT"))
- {
- //备注类型输入框,表单输入框名称为字段ID。
- if (((Vector)vtFields.get(i)).get(1).toString().indexOf("(必填)")>=0)
- {
- out.println("if(document.EditDocument.Name"+((Vector)vtFields.get(i)).get(0).toString()+".value=="")");
- out.println("{");
- out.println("alert("请输入"+((Vector)vtFields.get(i)).get(1).toString()+"!");");
- out.println("document.EditDocument.Name"+((Vector)vtFields.get(i)).get(0).toString()+".focus();");
- out.println("return false;");
- out.println("}");
- }
- }else
- if (((Vector)vtFields.get(i)).get(3).toString().equalsIgnoreCase("ACC"))
- {
- //附件类型输入框,表单输入框名称为字段ID。
- if ((((Vector)vtFields.get(i)).get(1).toString()).indexOf("(必填)")>=0)
- {
- out.println("if(document.EditDocument.Name"+((Vector)vtFields.get(i)).get(0).toString()+".value=="")");
- out.println("{");
- out.println("alert("请输入"+((Vector)vtFields.get(i)).get(1).toString()+"!");");
- out.println("document.EditDocument.Name"+((Vector)vtFields.get(i)).get(0).toString()+".focus();");
- out.println("return false;");
- out.println("}");
- }
- }else
- {
- //未知类型。
- 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>
- <form name="EditDocument" action="/Operation/EditDocumentAction.jsp?SysDirID=<%=iSysDirID%>&TypesID=<%=iTypesID%>" method="post" onSubmit="javascript:return CheckEditDocument();">
- <table border="0" cellpadding="0" cellspacing="0" width="90%">
- <tr>
- <td align="right" valign="middle"><font color="#0A0A0A">名称:</font></td>
- <td align="left" valign="middle" nowrap>
- <input name="ID" type="hidden" value="<%=((Vector)vt.get(0)).get(0).toString()%>">
- <input name="PublishUserID" type="hidden" value="<%=((Vector)vt.get(0)).get(3).toString()%>">
- <input name="PublishTime" type="hidden" value="<%=StringNew.GetDateString(((Vector)vt.get(0)).get(4).toString(),"yyyy-MM-dd HH:mm:ss")%>">
- <input name="DocumentTypeID" type="hidden" value="<%=((Vector)vt.get(0)).get(5).toString()%>">
- <input name="DocumentName" type="text" maxlength="150" size="37" Title="名称" Value="<%=((Vector)vt.get(0)).get(1).toString()%>">
- </td>
- </tr>
- <tr>
- <td align="right" valign="middle"><font color="#0A0A0A">内容:</font></td>
- <td align="left" valign="middle" nowrap>
- <textarea name="Content" cols="30" rows="6" Title="内容"><%=((Vector)vt.get(0)).get(2).toString()%></textarea>
- </td>
- </tr>
- <%
- vtFields = DocFieldsManager.getByDocTypeRecord(iTypesID);
- if(vtFields.size() > 0)
- {
- for (int i=0; i<vtFields.size(); i++)
- {
- if (((Vector)vtFields.get(i)).get(3).toString().equalsIgnoreCase("STR"))
- {
- //字符串类型输入框,表单输入框名称为字段ID。
- out.println("<tr>");
- out.println("<td align="right" valign="middle"><font color="#0A0A0A">"+((Vector)vtFields.get(i)).get(1).toString()+":</font></td>");
- out.println("<td align="left" valign="middle" nowrap>");
- out.println("<input name="Name"+((Vector)vtFields.get(i)).get(0).toString()+"" type="text" maxlength="150" size="37" Title=""+((Vector)vtFields.get(i)).get(1).toString()+"" Value=""+FieldsValueManager.getFieldValueByID(intDocumentID,Integer.parseInt(((Vector)vtFields.get(i)).get(0).toString()))+"">");
- out.println("</td></tr>");
- out.println("</td></tr>");
- }else
- if (((Vector)vtFields.get(i)).get(3).toString().equalsIgnoreCase("NUM"))
- {
- //数值类型输入框,表单输入框名称为字段ID。
- out.println("<tr>");
- out.println("<td align="right" valign="middle"><font color="#0A0A0A">"+((Vector)vtFields.get(i)).get(1).toString()+":</font></td>");
- out.println("<td align="left" valign="middle" nowrap>");
- out.println("<input name="Name"+((Vector)vtFields.get(i)).get(0).toString()+"" type="text" maxlength="50" size="5" Title=""+((Vector)vtFields.get(i)).get(1).toString()+"" Value=""+FieldsValueManager.getFieldValueByID(intDocumentID,Integer.parseInt(((Vector)vtFields.get(i)).get(0).toString()))+"">");
- out.println("</td></tr>");
- out.println("</td></tr>");
- }else
- if (((Vector)vtFields.get(i)).get(3).toString().equalsIgnoreCase("DATE"))
- {
- //日期类型输入框,表单输入框名称为字段ID。
- out.println("<tr>");
- out.println("<td align="right" valign="middle"><font color="#0A0A0A">"+((Vector)vtFields.get(i)).get(1).toString()+":</font></td>");
- out.println("<td align="left" valign="middle" nowrap>");
- out.println("<input name="Name"+((Vector)vtFields.get(i)).get(0).toString()+"" type="text" maxlength="10" size="10" Title=""+((Vector)vtFields.get(i)).get(1).toString()+"" Value="" + FieldsValueManager.getFieldValueByID(intDocumentID,(Integer.parseInt(((Vector)vtFields.get(i)).get(0).toString()))) +"" onFocus="JavaScript:this.value=fPopUpCalendarDlg(this.value);" maxlength="12" size="12" onDblClick="JavaScript:this.value=fPopUpCalendarDlg(this.value);">");
- out.println("</td></tr>");
- out.println("</td></tr>");
- }else
- if (((Vector)vtFields.get(i)).get(3).toString().equalsIgnoreCase("TEXT"))
- {
- //备注类型输入框,表单输入框名称为字段ID。
- out.println("<tr>");
- out.println("<td align="right" valign="middle"><font color="#0A0A0A">"+((Vector)vtFields.get(i)).get(1).toString()+":</font></td>");
- out.println("<td align="left" valign="middle" nowrap>");
- out.println("<textarea name="Name"+((Vector)vtFields.get(i)).get(0).toString()+"" cols="30" rows="2" Title=""+((Vector)vtFields.get(i)).get(1).toString()+"">"+FieldsValueManager.getFieldValueByID(intDocumentID,Integer.parseInt(((Vector)vtFields.get(i)).get(0).toString()))+"</textarea>");
- out.println("</td></tr>");
- out.println("</td></tr>");
- }else
- if (((Vector)vtFields.get(i)).get(3).toString().equalsIgnoreCase("ACC"))
- {
- //附件类型输入框,表单输入框名称为字段ID。
- out.println("<tr>");
- out.println("<td align="right" valign="middle"><font color="#0A0A0A">"+((Vector)vtFields.get(i)).get(1).toString()+":</font></td>");
- out.println("<td align="left" valign="middle" nowrap>");
- out.println("<input name="Name"+((Vector)vtFields.get(i)).get(0).toString()+"" type="text" maxlength="150" size="37" Title=""+((Vector)vtFields.get(i)).get(1).toString()+"" Value=""+FieldsValueManager.getFieldValueByID(intDocumentID,Integer.parseInt(((Vector)vtFields.get(i)).get(0).toString()))+""><input type="button" value="添加" onclick="return uploadacc(document.EditDocument.Name"+((Vector)vtFields.get(i)).get(0).toString()+");"");
- out.println("</td></tr>");
- out.println("</td></tr>");
- }else
- {
- //未知类型。
- out.println("未知类型");
- }
- }
- }
- %>
- <tr>
- <td align="right" valign="middle"> </td>
- <td align="left" valign="middle" nowrap>
- </td>
- </tr>
- <tr>
- <td align="right" valign="middle"> </td>
- <td align="left" valign="middle" nowrap>
- <input type="submit" value="修改"> <input type="reset" value="重填"> <input type="button" value="返回" onclick="window.location='DocumentManage.jsp?SysDirID=<%=iSysDirID%>&TypesID=<%=iTypesID%>';">
- </td>
- </tr>
- </table>
- </form>
- </td>
- </tr>
- </table>
- </body>
- </html>
- <%
- }
- else
- {
- %>
- <script language="JavaScript" type="text/JavaScript">
- alert("该记录已经被删除或者您没有权限修改此记录,修改失败!");
- history.back();
- </script>
- <%
- }
- }
- %>