AddAsset.jsp
资源名称:OA.rar [点击查看]
上传用户:mingda
上传日期:2017-06-20
资源大小:27691k
文件大小:14k
源码类别:
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); %>
- <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 CheckAddAsset()
- {
- if(document.AddAsset.AssetName.value=="")
- {
- alert("请输入名称!");
- document.AddAsset.AssetName.focus();
- return false;
- }
- <%
- Request t_request = new Request(request);
- int iUserID = m_session.GetInt("UserID");
- int iTypesID = t_request.GetInt("TypesID");
- int iSysDirID = t_request.GetInt("SysDirID");
- Vector vtFields = AssetFieldsManager.getByAssetTypeRecord(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.AddAsset.Name"+((Vector)vtFields.get(i)).get(0).toString()+".value=="")");
- out.println("{");
- out.println("alert("请输入"+((Vector)vtFields.get(i)).get(1).toString()+"!");");
- out.println("document.AddAsset.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.AddAsset.Name"+((Vector)vtFields.get(i)).get(0).toString()+".value,10)))");
- out.println("{");
- out.println("alert("请输入正确的"+((Vector)vtFields.get(i)).get(1).toString()+"!");");
- out.println("document.AddAsset.Name"+((Vector)vtFields.get(i)).get(0).toString()+".select();");
- out.println("document.AddAsset.Name"+((Vector)vtFields.get(i)).get(0).toString()+".focus();");
- out.println("return false;");
- out.println("}");
- }
- else
- {
- out.println("if(document.AddAsset.Name"+((Vector)vtFields.get(i)).get(0).toString()+".value.length>0)");
- out.println("if(isNaN(parseInt(document.AddAsset.Name"+((Vector)vtFields.get(i)).get(0).toString()+".value,10)))");
- out.println("{");
- out.println("alert("请输入正确的"+((Vector)vtFields.get(i)).get(1).toString()+"!");");
- out.println("document.AddAsset.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.AddAsset.Name"+((Vector)vtFields.get(i)).get(0).toString()+".value))");
- out.println("{");
- out.println("alert("日期格式错误,请按照“2002-02-18”重新输入!");");
- out.println("document.AddAsset.Name"+((Vector)vtFields.get(i)).get(0).toString()+".focus();");
- out.println("return false;");
- out.println("}");
- }
- else
- {
- out.println("if(document.AddAsset.Name"+((Vector)vtFields.get(i)).get(0).toString()+".value.length>0)");
- out.println("if(!isDate(document.AddAsset.Name"+((Vector)vtFields.get(i)).get(0).toString()+".value))");
- out.println("{");
- out.println("alert("日期格式错误,请按照“2002-02-18”重新输入!");");
- out.println("document.AddAsset.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.AddAsset.Name"+((Vector)vtFields.get(i)).get(0).toString()+".value=="")");
- out.println("{");
- out.println("alert("请输入"+((Vector)vtFields.get(i)).get(1).toString()+"!");");
- out.println("document.AddAsset.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.AddAsset.Name"+((Vector)vtFields.get(i)).get(0).toString()+".value=="")");
- out.println("{");
- out.println("alert("请输入"+((Vector)vtFields.get(i)).get(1).toString()+"!");");
- out.println("document.AddAsset.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">
- <table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td height="50" valign="top" background="../images/dy-back.gif">
- <table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr valign="middle">
- <td width="61" align="center" height="20"><img src="../images/dy-01.gif" width="38" height="36"></td>
- <td width="118" nowrap="nowrap" valign="middle"><strong><font color="#000000">会议新增</font></strong></td>
- <td align="right" nowrap="nowrap" valign="bottom">
- <!-- 群增<img src="../images/MulAdd.gif" onMouseOver="this.src='../images/MulAdd_a.gif';" onMouseOut="this.src='../images/MulAdd.gif';" border="0" height="22" width="59"> -->
- <!--<img src="../images/Single.gif" onMouseOver="this.src='../images/Single_a.gif';" onMouseOut="this.src='../images/Single.gif';" border="0" height="22" width="59"> -->
- <!-- 修改<img src="../images/Update.gif" onMouseOver="this.src='../images/Update_a.gif';" onMouseOut="this.src='../images/Update.gif';" border="0" height="22" width="59"> -->
- <!-- 删除<img src="../images/Del.gif" onMouseOver="this.src='../images/Del_a.gif';" onMouseOut="this.src='../images/Del.gif';" border="0" height="22" width="59"> -->
- <!-- 查看<img src="../images/Query.gif" onMouseOver="this.src='../images/Query_a.gif';" onMouseOut="this.src='../images/Query.gif';" border="0" height="22" width="59"> -->
- <!-- 组合查询<img src="../images/GroupQuery.gif" onMouseOver="this.src='../images/GroupQuery_a.gif';" onMouseOut="this.src='../images/GroupQuery.gif';" border="0" height="22" width="79"> -->
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- <table width="100%" height="100%" border="0" align="center" cellspacing="0">
- <tr>
- <td align="center" valign="top"><p> </p>
- <form name="AddAsset" action="/Asset/AddAssetAction.jsp?SysDirID=<%=iSysDirID%>&TypesID=<%=iTypesID%>" method="post" onSubmit="javascript:return CheckAddAsset();">
- <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="AddUserID" type="hidden" value="<%=iUserID%>">
- <%java.util.Date t_Date = new java.util.Date();%>
- <input name="AddTime" type="hidden" value="<%=StringNew.GetDateString(t_Date,"yyyy-MM-dd HH:mm:ss")%>">
- <input name="AssetTypeID" type="hidden" value="<%=iTypesID%>">
- <input name="AssetName" type="text" maxlength="150" size="37">
- </td>
- </tr>
- <tr>
- <td align="right" valign="middle"><font color="#0A0A0A">编号:</font></td>
- <td align="left" valign="middle" nowrap>
- <input name="AssetNumber" type="text" maxlength="50" size="37">
- </td>
- </tr>
- <%
- vtFields = AssetFieldsManager.getByAssetTypeRecord(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()+"">");
- 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()+"">");
- 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()+"" onFocus="JavaScript:this.value=fPopUpCalendarDlg(this.value,-10,+10);" maxlength="12" size="12" onDblClick="JavaScript:this.value=fPopUpCalendarDlg(this.value,-10,+10);">");
- 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()+""></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()+""><input type="button" value="添加" onclick="return uploadacc(document.AddAsset.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='AssetManage.jsp?SysDirID=<%=iSysDirID%>&TypesID=<%=iTypesID%>';">
- </td>
- </tr>
- </table>
- </form>
- </td>
- </tr>
- </table>
- </body>
- </html>