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