DocumentLink.jsp
资源名称:OA.rar [点击查看]
上传用户:mingda
上传日期:2017-06-20
资源大小:27691k
文件大小:10k
源码类别:
OA系统
开发平台:
Java
- <%@ page contentType="text/html; charset=gb2312"%>
- <%@ page import="com.gforce.gfoa.*,com.gforce.currency.*,java.util.*,java.net.*" %>
- <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="2" width="90%">
- <tr>
- <td width="30%" align="right" valign="middle"><font color="#0A0A0A">名称:</font></td>
- <td align="left" valign="middle">
- <%=((Vector)vt.get(0)).get(1).toString()%>
- </td>
- </tr>
- <tr>
- <td width="30%" align="right" valign="middle"><font color="#0A0A0A">内容:</font></td>
- <td align="left" valign="middle"> <%=((Vector)vt.get(0)).get(2).toString()%>
- </td>
- </tr>
- <%
- vtFields = DocFieldsManager.getByDocTypeRecord(iTypesID);
- if(vtFields.size() > 0)
- {
- for (int i=0; i<vtFields.size(); i++)
- {
- String strFieldValue = FieldsValueManager.getFieldValueByID(intDocumentID,Integer.parseInt(((Vector)vtFields.get(i)).get(0).toString()));
- String strFieldType = ((Vector)vtFields.get(i)).get(3).toString();
- 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>");
- if(strFieldValue.length()>0)
- {
- if (strFieldType.equalsIgnoreCase("STR"))
- {
- //字符串类型输入框,表单输入框名称为字段ID。
- out.println(strFieldValue);
- }
- else if(strFieldType.equalsIgnoreCase("NUM"))
- {
- //数值类型输入框,表单输入框名称为字段ID。
- out.println(strFieldValue);
- }
- else if (strFieldType.equalsIgnoreCase("DATE"))
- {
- //日期类型输入框,表单输入框名称为字段ID。
- out.println(StringNew.GetDateString(strFieldValue,"yyyy年MM月dd日"));
- }
- else if (((Vector)vtFields.get(i)).get(3).toString().equalsIgnoreCase("TEXT"))
- {
- //备注类型输入框,表单输入框名称为字段ID。
- out.println(strFieldValue);
- }
- else if (((Vector)vtFields.get(i)).get(3).toString().equalsIgnoreCase("ACC"))
- {
- //附件类型输入框,表单输入框名称为字段ID。
- out.println("<a href="" + strFieldValue.substring(0,strFieldValue.lastIndexOf("/")+1) + URLEncoder.encode(strFieldValue.substring(strFieldValue.lastIndexOf("/")+1),"UTF8") + "" target="_blank">");
- out.println(strFieldValue.substring(strFieldValue.lastIndexOf("/")+1));
- out.println("</a>(点击附件名称下载附件)");
- }
- }
- else
- {
- out.println(" ");
- }
- out.println("</td></tr>");
- }
- }
- %>
- <tr>
- <td width="30%" align="right" valign="middle"> </td>
- <td align="left" valign="middle"> <br>
- <br>
- </td>
- </tr>
- <tr>
- <td width="30%" align="right" valign="middle"> </td>
- <td align="right" valign="middle">
- <input type="button" value="关闭" onclick="window.close();">
- </td>
- </tr>
- </table>
- </form>
- </td>
- <!--
- -->
- </tr>
- </table>
- </body>
- </html>
- <%
- }
- else
- {
- %>
- <script language="JavaScript" type="text/JavaScript">
- alert("该记录已经被删除或者您没有权限修改此记录,修改失败!");
- history.back();
- </script>
- <%
- }
- }
- %>