asset_add.jsp
上传用户:jhtang88
上传日期:2014-01-27
资源大小:28528k
文件大小:8k
源码类别:

Jsp/Servlet

开发平台:

Java

  1. <%@ page contentType="text/html; charset=utf-8"%>
  2. <%@ page import = "java.net.URLEncoder"%>
  3. <%@ page import = "java.util.*"%>
  4. <%@ page import = "cn.js.fan.util.*"%>
  5. <%@ page import = "com.redmoon.oa.asset.*"%>
  6. <%@ page import = "cn.js.fan.web.*"%>
  7. <%@ page import = "com.redmoon.oa.dept.*"%>
  8. <%@ page import = "com.redmoon.oa.BasicDataMgr"%>
  9. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  10. <html>
  11. <head>
  12. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  13. <title>添加资产</title>
  14. <link href="../common.css" rel="stylesheet" type="text/css">
  15. <%@ include file="../inc/nocache.jsp"%>
  16. <script language="JavaScript" type="text/JavaScript">
  17. <!--
  18. function findObj(theObj, theDoc)
  19. {
  20.   var p, i, foundObj;
  21.   
  22.   if(!theDoc) theDoc = document;
  23.   if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)
  24.   {
  25.     theDoc = parent.frames[theObj.substring(p+1)].document;
  26.     theObj = theObj.substring(0,p);
  27.   }
  28.   if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
  29.   for (i=0; !foundObj && i < theDoc.forms.length; i++) 
  30.     foundObj = theDoc.forms[i][theObj];
  31.   for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++) 
  32.     foundObj = findObj(theObj,theDoc.layers[i].document);
  33.   if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);
  34.   
  35.   return foundObj;
  36. }
  37. var GetDate=""; 
  38. function SelectDate(ObjName,FormatDate){
  39. var PostAtt = new Array;
  40. PostAtt[0]= FormatDate;
  41. PostAtt[1]= findObj(ObjName);
  42. GetDate = showModalDialog("../util/calendar/calendar.htm", PostAtt ,"dialogWidth:286px;dialogHeight:221px;status:no;help:no;");
  43. }
  44. function SetDate()
  45. findObj(ObjName).value = GetDate; 
  46. }
  47. function setPerson(deptCode, deptName, user, userRealName)
  48. {
  49. form1.keeper.value = user;
  50. form1.keeperRealName.value = userRealName;
  51. }
  52. //-->
  53. </script>
  54. <jsp:useBean id="privilege" scope="page" class="com.redmoon.oa.pvg.Privilege"/>
  55. <%
  56. String priv="oa.asset";
  57. if (!privilege.isUserPrivValid(request, priv)) {
  58. out.println(SkinUtil.makeErrMsg(request, SkinUtil.LoadString(request, "pvg_invalid")));
  59. return;
  60. }
  61. String op = ParamUtil.get(request, "op");
  62. if (op.equals("add")) {
  63. AssetMgr am = new AssetMgr();
  64. boolean re = false;
  65. try {
  66.   re = am.create(request);
  67. }
  68. catch (ErrMsgException e) {
  69. out.print(StrUtil.Alert(e.getMessage()));
  70. }
  71. if (re)
  72. out.print(StrUtil.Alert_Redirect("操作成功!", "asset_add.jsp"));
  73. }%>
  74. <style type="text/css">
  75. <!--
  76. .style2 {font-size: 14px}
  77. .STYLE5 {color: #FF0000}
  78. .STYLE7 {color: #FFFFFF}
  79. -->
  80. </style>
  81. </head>
  82. <body background="" leftmargin="0" topmargin="5" marginwidth="0" marginheight="0">
  83. <jsp:useBean id="fchar" scope="page" class="cn.js.fan.util.StrUtil"/>
  84. <%@ include file="asset_inc_menu_top.jsp"%>
  85. <br>
  86.   <table width="580" height="89" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" class="tableframe">
  87.   <tr> 
  88.     <td width="580" height="23" valign="bottom" class="right-title" >&nbsp;<span class="STYLE7">&nbsp;添加资产</span></td>
  89.   </tr>
  90.   <tr> 
  91.     <td valign="top"><TABLE cellSpacing="0" cellPadding="0" width="100%" border="0">
  92.       <TBODY>
  93.         <TR>
  94.           <TD vAlign="top"><TABLE width="100%" border="0" bordercolor="#CCCCCC">
  95.             <FORM name="form1" action="?op=add" method="post">
  96.               <TBODY>
  97.                 <TR>
  98.                   <TD align="right" width="15%">资产名称:</TD>
  99.                   <TD width="37%"><INPUT name="name" id="name" maxLength="255">
  100.                       <span class="STYLE5"> *</span> </TD>
  101.                   <TD align="right" width="12%">型 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;号:</TD>
  102.                   <TD width="36%"><INPUT name="type" id="type" maxLength="255">                  </TD>
  103.                 </TR>
  104.                 <TR>
  105.                   <TD align="right">资产编号:</TD>
  106.                   <TD><INPUT name="number" id="number" maxLength="25">
  107.                       <span class="STYLE5"> *</span></TD>
  108.                   <TD align="right">资产价值:</TD>
  109.                   <TD><INPUT name="price" id="price" value="0" maxLength="10">
  110.                     (元)</TD>
  111.                 </TR>
  112.                 <TR>
  113.                   <TD align="right">资产类别:</TD>
  114.                   <TD><%
  115.   AssetTypeDb atd = new AssetTypeDb();
  116.   String opts = "";
  117.   Iterator ir = atd.list().iterator();
  118.   while (ir.hasNext()) {
  119.  atd = (AssetTypeDb)ir.next();
  120.  opts += "<option value='" + atd.getId() + "'>" + atd.getName() + "</option>";
  121.   }
  122.   %>
  123.                       <select name="typeId" id="typeId" >
  124.                         <option value=0 selected>---请选择---</option>
  125.                         <%=opts%>
  126.                       </select>
  127.                       <span class="STYLE5"> *</span> </TD>
  128.                   <TD align="right">资产归属:</TD>
  129.                   <TD><select name="department">
  130.                       <%
  131. DeptMgr dm = new DeptMgr();
  132. DeptDb lf = dm.getDeptDb(DeptDb.ROOTCODE);
  133. DeptView dv = new DeptView(lf);
  134. dv.ShowDeptAsOptions(out, lf, lf.getLayer()); 
  135.  %>
  136.                     </select>
  137.                       <span class="STYLE5">*
  138.                         <%
  139.    Date d = new Date();
  140.    String dt = DateUtil.format(d, "yyyy-MM-dd");
  141.  %>
  142.                     </span></TD>
  143.                 </TR>
  144.                 <TR>
  145.                   <TD align="right">购&nbsp;&nbsp;置&nbsp;&nbsp;人:</TD>
  146.                   <TD><INPUT name="buyMan" id="buyMan" maxLength="25">                  </TD>
  147.                   <TD align="right">购置时间:</TD>
  148.                   <TD><INPUT name="buyDate" id="buyDate" maxLength="10" value="<%=dt%>">
  149.                       <img style="CURSOR: hand" onClick="SelectDate('buyDate', 'yyyy-MM-dd')" src="../images/form/calendar.gif" align="absMiddle" border="0" width="26" height="26"> </TD>
  150.                 </TR>
  151.                 <TR>
  152.                   <TD align="right">领用时间:</TD>
  153.                   <TD id="td_com"><input name="startDate" id="startDate" maxlength="10">
  154.                       <img style="CURSOR: hand" onClick="SelectDate('startDate', 'yyyy-MM-dd')" src="../images/form/calendar.gif" align="absMiddle" border="0" width="26" height="26"></TD>
  155.                   <TD align="right">保&nbsp;&nbsp;管&nbsp;&nbsp;人:</TD>
  156.                   <TD id="user">
  157.   <INPUT name="keeperRealName" id="keeperRealName" maxLength="10" width="80">
  158.   <INPUT name="keeper" id="keeper" maxLength="10" width="80" type="hidden">
  159.                     <a href="#" onClick="javascript:showModalDialog('../user_sel.jsp',window.self,'dialogWidth:480px;dialogHeight:320px;status:no;help:no;')"> 选择用户</a> </TD>
  160.                 </TR>
  161.                 <TR>
  162.                   <TD align="right">备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 注:</TD>
  163.                   <TD><TEXTAREA name="abstracts" id="abstracts"></TEXTAREA>                  </TD>
  164.                   <TD align="right">增加方式:</TD>
  165.                   <TD>
  166.   <%
  167.   BasicDataMgr bdm = new BasicDataMgr("asset");
  168.   String options = bdm.getOptionsStr("增加方式");
  169.   %>
  170.                     <select name="addId" id="addId">
  171. <%=options%>
  172. </select></TD>
  173.                 </TR>
  174.                 <TR>
  175.                   <TD align="right">登&nbsp;&nbsp;记&nbsp;&nbsp;人: </TD>
  176.                   <TD><INPUT name="InputMan" ></TD>
  177.                   <TD align="right">登记时间:</TD>
  178.                   <TD><INPUT id="regDate"  name="regDate" value="<%=dt%>"></TD>
  179.                 </TR>
  180.                 <TR>
  181.                   <TD colspan="4" align="right"><input name="button" type="submit" class="button1"  value="  确定  ">
  182.   
  183.   <input name="button" type="button" class="button1" onClick="window.close()" value="  取消  ">
  184.   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
  185.                   </TR>
  186.               </TBODY>
  187.             </FORM>
  188.           </TABLE></TD>
  189.         </TR>
  190.       </TBODY>
  191.     </TABLE>    </td>
  192.   </tr>
  193. </table>
  194. <br>
  195. <br>
  196. </body>
  197. </html>