EditErrandApply.jsp
上传用户:mingda
上传日期:2017-06-20
资源大小:27691k
文件大小:21k
源码类别:

OA系统

开发平台:

Java

  1. <%@ page contentType="text/html; charset=gb2312"%>
  2. <%@ page import="com.gforce.gfoa.*,com.gforce.currency.*,java.util.*" %>
  3. <jsp:include page="/CheckLogin.jsp" flush="true"/> <% Session m_session = new Session(session); %>
  4. <%
  5. Request m_request = new Request(request);
  6. int intErrandApplyID = m_request.GetInt("ID");
  7. int iSysDirID = m_request.GetInt("SysDirID");
  8. if(intErrandApplyID<1)
  9. {
  10. %>
  11. <script language="JavaScript" type="text/JavaScript">
  12. alert("请选择正确的出差申请,修改失败!");
  13. history.back();
  14. </script>
  15. <%
  16. }
  17. else
  18. {
  19. Vector vt = ErrandApplyManager.getRecordByID(intErrandApplyID);
  20. if(vt.size()==1)
  21. {
  22. %>
  23. <html>
  24. <head>
  25. <meta http-equiv="Content-Type" content="text/html; charset=gb2312"><meta http-equiv="pragma" content="no-cache">
  26. <title>出差申请管理-- GForce OA 2.0</title>
  27. <link href="/css/txt.jsp" rel="stylesheet" type="text/css">
  28. <SCRIPT language="JavaScript" src="/Calendar/PopUpCalendarDlg.js"></SCRIPT>
  29. <script language="JavaScript" type="text/javascript">
  30. function checkEditErrandApply()
  31. {
  32.        if(document.EditErrandApply.CompanyTo.value=="")
  33.     {
  34.         alert("请输入出差目的单位名称!");
  35.         document.EditErrandApply.CompanyTo.focus();
  36.         return false;
  37.     }
  38.     if(!isDate(document.EditErrandApply.PlanStartDateD.value))
  39.     {
  40.        alert("日期格式错误,请按照“2002-02-18”重新输入!");
  41.        document.EditErrandApply.PlanStartDateD.focus();
  42.        return false;
  43.     }
  44.     if(!isDate(document.EditErrandApply.PlanEndDateD.value))
  45.     {
  46.       alert("日期格式错误,请按照“2002-02-18”重新输入!");
  47.       document.EditErrandApply.PlanEndDateD.focus();
  48.       return false;
  49.     }
  50.     for(var i=0;i<parseInt(document.EditErrandApply.ApproveLevel.selectedIndex)+1;i++)
  51.     {
  52.        eval('document.all.ApproveList' + (i+1)).style.display='';
  53.        if(parseInt(eval("document.EditErrandApply.ApproveUserID" + (i+1)).value)<1)
  54.        {
  55.          alert("请选择第" + (i+1) + "级审批用户!");
  56.          eval("document.EditErrandApply.PersonnelName" + (i+1)).focus();
  57.          return false;
  58.        }
  59.     }
  60. //计划开始时间,结束时间合成
  61.    document.EditErrandApply.PlanStartTime.value = document.EditErrandApply.PlanStartDateD.value + " "+
  62.                                                  document.EditErrandApply.PlanStartDateT.value + ":00:00";
  63.    document.EditErrandApply.PlanEndTime.value = document.EditErrandApply.PlanEndDateD.value + " "+
  64.                                                  document.EditErrandApply.PlanEndDateT.value + ":00:00";
  65. }
  66. function PopUpSelectUser(UserName,Number,UserID)
  67. {
  68.   showx = event.screenX - event.offsetX;    // + deltaX;
  69.   showy = event.screenY - event.offsetY+18; // + deltaY;
  70.   var retval = window.showModalDialog("/SelectUser1.jsp", "","dialogWidth:480px; dialogHeight:408px; dialogLeft:"+showx+"px; dialogTop:"+showy+"px; help:no; status:no; directories:yes;scrollbars:yes;Resizable=yes; ");
  71.   if(retval!=null)
  72.   {
  73.     if(retval.indexOf("|!|")>0)
  74.     {
  75.       var strtemp = retval.split("|!|");
  76.       UserName.value=strtemp[1];
  77.       Number.value=strtemp[2];
  78.       UserID.value=strtemp[0];
  79.     }
  80.   }
  81. }
  82. </script>
  83. </head>
  84. <body bgcolor="<%=m_session.GetString("BackColor")%>" leftmargin="0" topmargin="0">
  85. <table width="100%" height="100%" border="0" align="center" cellspacing="0">
  86.     <tr>
  87.         <td align="center" valign="top"><p>&nbsp;</p>
  88.             <form name="EditErrandApply" action="/Operation/EditErrandApplyAction.jsp?SysDirID=<%=iSysDirID%>" method="post" onSubmit="javascript:return checkEditErrandApply();">
  89.             <table  border="0" cellpadding="0" cellspacing="0" width="90%">
  90.                 <tr>
  91.                     <td align="right" valign="middle"><font color="#0A0A0A">目的单位名称:</font></td>
  92.                     <td align="left" valign="middle" nowrap>
  93.                         <input name="ID" type="Hidden" value="<%=((Vector)vt.get(0)).get(0).toString()%>" >
  94.                         <input name="SysDirID" type="Hidden" value="<%=((Vector)vt.get(0)).get(14).toString()%>" >
  95.                         <input name="ApplyUserID" type="hidden" value="<%=((Vector)vt.get(0)).get(11).toString()%>">
  96.                         <input name="ConfirmUserID" type="hidden" value="<%=((Vector)vt.get(0)).get(13).toString()%>">
  97.                         <input name="ApplyTime" type="hidden" value="<%=StringNew.GetDateString(((Vector)vt.get(0)).get(12).toString(),"yyyy-MM-dd HH:mm:ss")%>">
  98.                         <input name="CompanyTo" type="text" maxlength="150" size="37" value="<%=((Vector)vt.get(0)).get(5).toString()%>">
  99.                     </td>
  100.                 </tr>
  101.                 <tr>
  102.                     <td align="right" valign="middle"><font color="#0A0A0A">目的城市:</font></td>
  103.                     <td align="left" valign="middle" nowrap>
  104.                         <input name="CityTo" type="text" maxlength="60" size="37" value="<%=((Vector)vt.get(0)).get(6).toString()%>">
  105.                     </td>
  106.                 </tr>
  107.                 <tr>
  108.                     <td align="right" valign="middle"><font color="#0A0A0A">出差事由:</font></td>
  109.                     <td align="left" valign="middle" nowrap>
  110.                         <input name="ErrandTitle" type="text" maxlength="150" size="37" value="<%=((Vector)vt.get(0)).get(7).toString()%>">
  111.                     </td>
  112.                 </tr>
  113.                 <tr>
  114.                     <td align="right" valign="middle"><font color="#0A0A0A">出差事由描述:</font></td>
  115.                     <td align="left" valign="middle" nowrap>
  116.                       <textarea name="ErrandContent" cols="30" rows="2"><%=((Vector)vt.get(0)).get(8).toString()%></textarea>
  117.                     </td>
  118.                 </tr>
  119.                 <tr>
  120.                     <td align="right" valign="middle"><font color="#0A0A0A">出差人员:</font></td>
  121.                     <td align="left" valign="middle" nowrap>
  122.                         <input name="Personnels" type="text" maxlength="200" size="37" value="<%=((Vector)vt.get(0)).get(9).toString()%>">
  123.                     </td>
  124.                 </tr>
  125.                 <tr>
  126.                     <td align="right" valign="middle"><font color="#0A0A0A">计划开始时间:</font></td>
  127.                     <td align="left" valign="middle" nowrap>
  128.                     <input name="PlanStartTime" type="hidden">
  129.                     <input name="PlanStartDateD" type="text" value="<%=StringNew.GetDateString(((Vector)vt.get(0)).get(1).toString(),"yyyy-MM-dd")%>" onFocus="JavaScript:this.value=fPopUpCalendarDlg(this.value);" maxlength="12" size="12" onDblClick="JavaScript:this.value=fPopUpCalendarDlg(this.value);">
  130.               <select name="PlanStartDateT">
  131.                 <option value="<%=StringNew.GetDateString(((Vector)vt.get(0)).get(1).toString(),"H")%>" selected><%=StringNew.GetDateString(((Vector)vt.get(0)).get(1).toString(),"H")%></option>
  132.                 <option value="6">6</option>
  133.                 <option value="7">7</option>
  134.                 <option value="8">8</option>
  135.                 <option value="9">9</option>
  136.                 <option value="10">10</option>
  137.                 <option value="11">11</option>
  138.                 <option value="12">12</option>
  139.                 <option value="13">13</option>
  140.                 <option value="14">14</option>
  141.                 <option value="15">15</option>
  142.                 <option value="16">16</option>
  143.                 <option value="17">17</option>
  144.                 <option value="18">18</option>
  145.                 <option value="19">19</option>
  146.                 <option value="20">20</option>
  147.               </select>
  148.               <font color="#0A0A0A">时</font></td>
  149.                 </tr>
  150.                 <tr>
  151.                     <td align="right" valign="middle"><font color="#0A0A0A">计划结束时间:</font></td>
  152.                     <td align="left" valign="middle" nowrap>
  153.                     <input name="PlanEndTime" type="hidden">
  154.                     <input name="PlanEndDateD" type="text" value="<%=StringNew.GetDateString(((Vector)vt.get(0)).get(2).toString(),"yyyy-MM-dd")%>" onFocus="JavaScript:this.value=fPopUpCalendarDlg(this.value);" maxlength="12" size="12" onDblClick="JavaScript:this.value=fPopUpCalendarDlg(this.value);">
  155.               <select name="PlanEndDateT">
  156.                 <option value="<%=StringNew.GetDateString(((Vector)vt.get(0)).get(2).toString(),"H")%>" selected><%=StringNew.GetDateString(((Vector)vt.get(0)).get(2).toString(),"H")%></option>
  157.                 <option value="6">6</option>
  158.                 <option value="7">7</option>
  159.                 <option value="8">8</option>
  160.                 <option value="9">9</option>
  161.                 <option value="10">10</option>
  162.                 <option value="11">11</option>
  163.                 <option value="12">12</option>
  164.                 <option value="13">13</option>
  165.                 <option value="14">14</option>
  166.                 <option value="15">15</option>
  167.                 <option value="16">16</option>
  168.                 <option value="17">17</option>
  169.                 <option value="18">18</option>
  170.                 <option value="19">19</option>
  171.                 <option value="20">20</option>
  172.               </select>
  173.               <font color="#0A0A0A">时</font></td>
  174.                 </tr>
  175.                 <tr>
  176.                     <td align="right" valign="middle"><font color="#0A0A0A">备注:</font></td>
  177.                     <td align="left" valign="middle" nowrap>
  178.                       <textarea name="Remark" cols="30" rows="2"><%=((Vector)vt.get(0)).get(10).toString()%></textarea>
  179.                     </td>
  180.                 </tr>
  181. <%
  182.   vt = ApproveRecordManager.getRecordByRecordID(intErrandApplyID,"出差申请");
  183. %>
  184.   <tr>
  185.     <td align="right" valign="middle">审批级别:</td>
  186.     <td align="left" valign="middle" nowrap>
  187.       <select name="ApproveLevel" onchange="for(var i=0;i<7;i++){if(i>this.selectedIndex){eval('document.all.ApproveList' + (i+1)).style.display='none';}else{eval('document.all.ApproveList' + (i+1)).style.display='';}}">
  188.       <%
  189.       for(int i=0;i<7;i++)
  190.       {
  191.         if((i+1)==vt.size())
  192.         {
  193.           out.println("<option value="" + (i+1) + "" selected>" + (i+1) + "级</option>");
  194.         }
  195.         else
  196.         {
  197.           out.println("<option value="" + (i+1) + "">" + (i+1) + "级</option>");
  198.         }
  199.       }
  200.       %>
  201.       </select>
  202.     </td>
  203.   </tr>
  204.   <tr>
  205.     <td align="right" valign="middle">&nbsp;</td>
  206.     <td align="center" valign="middle" nowrap>
  207.       <table border="1" cellpadding="0" cellspacing="0" width="95%">
  208.         <tr bgcolor="<%=m_session.GetString("TitleColor")%>">
  209.           <th align="center" valign="middle" nowrap>级别</th>
  210.           <th align="center" valign="middle" nowrap>员工姓名</th>
  211.           <th align="center" valign="middle" nowrap>员工编号</th>
  212.         </tr>
  213.         <tr ID="ApproveList1" <%=(1>vt.size())?"style="display:none"":""%>>
  214.           <td align="center" valign="middle" nowrap>一级</td>
  215.           <td align="center" valign="middle" nowrap><input name="PersonnelName1" type="text" readonly size="20" onFocus="PopUpSelectUser(document.EditErrandApply.PersonnelName1,document.EditErrandApply.PersonnelNumber1,document.EditErrandApply.ApproveUserID1);" onDblClick="PopUpSelectUser(document.EditErrandApply.PersonnelName1,document.EditErrandApply.PersonnelNumber1,document.EditErrandApply.ApproveUserID1);" value="<%=(1<=vt.size())?UserManager.getPersonnelNameByUserID(Integer.parseInt(((Vector)vt.get(0)).get(3).toString())):""%>"><input name="ApproveUserID1" type="Hidden" value="<%=(1<=vt.size())?((Vector)vt.get(0)).get(3).toString():"0"%>"></td>
  216.           <td align="center" valign="middle" nowrap><input name="PersonnelNumber1" type="text" readonly size="20" onFocus="PopUpSelectUser(document.EditErrandApply.PersonnelName1,document.EditErrandApply.PersonnelNumber1,document.EditErrandApply.ApproveUserID1);" onDblClick="PopUpSelectUser(document.EditErrandApply.PersonnelName1,document.EditErrandApply.PersonnelNumber1,document.EditErrandApply.ApproveUserID1);" value="<%=(1<=vt.size())?UserManager.getPersonnelNumberByUserID(Integer.parseInt(((Vector)vt.get(0)).get(3).toString())):""%>"></td>
  217.         </tr>
  218.         <tr ID="ApproveList2" <%=(2>vt.size())?"style="display:none"":""%>>
  219.           <td align="center" valign="middle" nowrap>二级</td>
  220.           <td align="center" valign="middle" nowrap><input name="PersonnelName2" type="text" readonly size="20" onFocus="PopUpSelectUser(document.EditErrandApply.PersonnelName2,document.EditErrandApply.PersonnelNumber2,document.EditErrandApply.ApproveUserID2);" onDblClick="PopUpSelectUser(document.EditErrandApply.PersonnelName2,document.EditErrandApply.PersonnelNumber2,document.EditErrandApply.ApproveUserID2);" value="<%=(2<=vt.size())?UserManager.getPersonnelNameByUserID(Integer.parseInt(((Vector)vt.get(1)).get(3).toString())):""%>"><input name="ApproveUserID2" type="Hidden" value="<%=(2<=vt.size())?((Vector)vt.get(1)).get(3).toString():"0"%>"></td>
  221.           <td align="center" valign="middle" nowrap><input name="PersonnelNumber2" type="text" readonly size="20" onFocus="PopUpSelectUser(document.EditErrandApply.PersonnelName1,document.EditErrandApply.PersonnelNumber1,document.EditErrandApply.ApproveUserID1);" onDblClick="PopUpSelectUser(document.EditErrandApply.PersonnelName2,document.EditErrandApply.PersonnelNumber2,document.EditErrandApply.ApproveUserID2);" value="<%=(2<=vt.size())?UserManager.getPersonnelNumberByUserID(Integer.parseInt(((Vector)vt.get(1)).get(3).toString())):""%>"></td>
  222.         </tr>
  223.         <tr ID="ApproveList3" <%=(3>vt.size())?"style="display:none"":""%>>
  224.           <td align="center" valign="middle" nowrap>三级</td>
  225.           <td align="center" valign="middle" nowrap><input name="PersonnelName3" type="text" readonly size="20" onFocus="PopUpSelectUser(document.EditErrandApply.PersonnelName3,document.EditErrandApply.PersonnelNumber3,document.EditErrandApply.ApproveUserID3);" onDblClick="PopUpSelectUser(document.EditErrandApply.PersonnelName3,document.EditErrandApply.PersonnelNumber3,document.EditErrandApply.ApproveUserID3);" value="<%=(3<=vt.size())?UserManager.getPersonnelNameByUserID(Integer.parseInt(((Vector)vt.get(2)).get(3).toString())):""%>"><input name="ApproveUserID3" type="Hidden" value="<%=(3<=vt.size())?((Vector)vt.get(2)).get(3).toString():"0"%>"></td>
  226.           <td align="center" valign="middle" nowrap><input name="PersonnelNumber3" type="text" readonly size="20" onFocus="PopUpSelectUser(document.EditErrandApply.PersonnelName3,document.EditErrandApply.PersonnelNumber3,document.EditErrandApply.ApproveUserID3);" onDblClick="PopUpSelectUser(document.EditErrandApply.PersonnelName3,document.EditErrandApply.PersonnelNumber3,document.EditErrandApply.ApproveUserID3);" value="<%=(3<=vt.size())?UserManager.getPersonnelNumberByUserID(Integer.parseInt(((Vector)vt.get(2)).get(3).toString())):""%>"></td>
  227.         </tr>
  228.         <tr ID="ApproveList4" <%=(4>vt.size())?"style="display:none"":""%>>
  229.           <td align="center" valign="middle" nowrap>四级</td>
  230.           <td align="center" valign="middle" nowrap><input name="PersonnelName4" type="text" readonly size="20" onFocus="PopUpSelectUser(document.EditErrandApply.PersonnelName4,document.EditErrandApply.PersonnelNumber4,document.EditErrandApply.ApproveUserID4);" onDblClick="PopUpSelectUser(document.EditErrandApply.PersonnelName4,document.EditErrandApply.PersonnelNumber4,document.EditErrandApply.ApproveUserID4);" value="<%=(4<=vt.size())?UserManager.getPersonnelNameByUserID(Integer.parseInt(((Vector)vt.get(3)).get(3).toString())):""%>"><input name="ApproveUserID4" type="Hidden" value="<%=(4<=vt.size())?((Vector)vt.get(3)).get(3).toString():"0"%>"></td>
  231.           <td align="center" valign="middle" nowrap><input name="PersonnelNumber4" type="text" readonly size="20" onFocus="PopUpSelectUser(document.EditErrandApply.PersonnelName4,document.EditErrandApply.PersonnelNumber4,document.EditErrandApply.ApproveUserID4);" onDblClick="PopUpSelectUser(document.EditErrandApply.PersonnelName4,document.EditErrandApply.PersonnelNumber4,document.EditErrandApply.ApproveUserID4);" value="<%=(4<=vt.size())?UserManager.getPersonnelNumberByUserID(Integer.parseInt(((Vector)vt.get(3)).get(3).toString())):""%>"></td>
  232.         </tr>
  233.         <tr ID="ApproveList5" <%=(5>vt.size())?"style="display:none"":""%>>
  234.           <td align="center" valign="middle" nowrap>五级</td>
  235.           <td align="center" valign="middle" nowrap><input name="PersonnelName5" type="text" readonly size="20" onFocus="PopUpSelectUser(document.EditErrandApply.PersonnelName5,document.EditErrandApply.PersonnelNumber5,document.EditErrandApply.ApproveUserID5);" onDblClick="PopUpSelectUser(document.EditErrandApply.PersonnelName5,document.EditErrandApply.PersonnelNumber5,document.EditErrandApply.ApproveUserID5);" value="<%=(5<=vt.size())?UserManager.getPersonnelNameByUserID(Integer.parseInt(((Vector)vt.get(4)).get(3).toString())):""%>"><input name="ApproveUserID5" type="Hidden" value="<%=(5<=vt.size())?((Vector)vt.get(4)).get(3).toString():"0"%>"></td>
  236.           <td align="center" valign="middle" nowrap><input name="PersonnelNumber5" type="text" readonly size="20" onFocus="PopUpSelectUser(document.EditErrandApply.PersonnelName5,document.EditErrandApply.PersonnelNumber5,document.EditErrandApply.ApproveUserID5);" onDblClick="PopUpSelectUser(document.EditErrandApply.PersonnelName5,document.EditErrandApply.PersonnelNumber5,document.EditErrandApply.ApproveUserID5);" value="<%=(5<=vt.size())?UserManager.getPersonnelNumberByUserID(Integer.parseInt(((Vector)vt.get(4)).get(3).toString())):""%>"></td>
  237.         </tr>
  238.         <tr ID="ApproveList6" <%=(6>vt.size())?"style="display:none"":""%>>
  239.           <td align="center" valign="middle" nowrap>六级</td>
  240.           <td align="center" valign="middle" nowrap><input name="PersonnelName6" type="text" readonly size="20" onFocus="PopUpSelectUser(document.EditErrandApply.PersonnelName6,document.EditErrandApply.PersonnelNumber6,document.EditErrandApply.ApproveUserID6);" onDblClick="PopUpSelectUser(document.EditErrandApply.PersonnelName6,document.EditErrandApply.PersonnelNumber6,document.EditErrandApply.ApproveUserID6);" value="<%=(6<=vt.size())?UserManager.getPersonnelNameByUserID(Integer.parseInt(((Vector)vt.get(5)).get(3).toString())):""%>"><input name="ApproveUserID6" type="Hidden" value="<%=(6<=vt.size())?((Vector)vt.get(5)).get(3).toString():"0"%>"></td>
  241.           <td align="center" valign="middle" nowrap><input name="PersonnelNumber6" type="text" readonly size="20" onFocus="PopUpSelectUser(document.EditErrandApply.PersonnelName6,document.EditErrandApply.PersonnelNumber6,document.EditErrandApply.ApproveUserID6);" onDblClick="PopUpSelectUser(document.EditErrandApply.PersonnelName6,document.EditErrandApply.PersonnelNumber6,document.EditErrandApply.ApproveUserID6);" value="<%=(6<=vt.size())?UserManager.getPersonnelNumberByUserID(Integer.parseInt(((Vector)vt.get(5)).get(3).toString())):""%>"></td>
  242.         </tr>
  243.         <tr ID="ApproveList7" <%=(7>vt.size())?"style="display:none"":""%>>
  244.           <td align="center" valign="middle" nowrap>七级</td>
  245.           <td align="center" valign="middle" nowrap><input name="PersonnelName7" type="text" readonly size="20" onFocus="PopUpSelectUser(document.EditErrandApply.PersonnelName7,document.EditErrandApply.PersonnelNumber7,document.EditErrandApply.ApproveUserID7);" onDblClick="PopUpSelectUser(document.EditErrandApply.PersonnelName7,document.EditErrandApply.PersonnelNumber7,document.EditErrandApply.ApproveUserID7);" value="<%=(7<=vt.size())?UserManager.getPersonnelNameByUserID(Integer.parseInt(((Vector)vt.get(6)).get(3).toString())):""%>"><input name="ApproveUserID7" type="Hidden" value="<%=(7<=vt.size())?((Vector)vt.get(6)).get(3).toString():"0"%>"></td>
  246.           <td align="center" valign="middle" nowrap><input name="PersonnelNumber7" type="text" readonly size="20" onFocus="PopUpSelectUser(document.EditErrandApply.PersonnelName7,document.EditErrandApply.PersonnelNumber7,document.EditErrandApply.ApproveUserID7);" onDblClick="PopUpSelectUser(document.EditErrandApply.PersonnelName7,document.EditErrandApply.PersonnelNumber7,document.EditErrandApply.ApproveUserID7);" value="<%=(7<=vt.size())?UserManager.getPersonnelNumberByUserID(Integer.parseInt(((Vector)vt.get(6)).get(3).toString())):""%>"></td>
  247.         </tr>
  248.       </table>
  249.     </td>
  250.   </tr>
  251.                 <tr>
  252.                     <td align="right" valign="middle">&nbsp;</td>
  253.                     <td align="left" valign="middle" nowrap>
  254.                         <input type="submit" value="修改">&nbsp;&nbsp; <input type="reset" value="重填">&nbsp;&nbsp; <input type="button" value="返回" onclick="window.location='ErrandApplyManage.jsp?SysDirID=<%=iSysDirID%>';">
  255.                    </td>
  256.                 </tr>
  257.             </table>
  258.             </form>
  259.         </td>
  260.     </tr>
  261. </table>
  262. </body>
  263. </html>
  264. <%
  265. }
  266. else
  267. {
  268. %>
  269. <script language="JavaScript" type="text/JavaScript">
  270. alert("该记录已经被删除或者您没有权限修改此记录,修改失败!");
  271. history.back();
  272. </script>
  273. <%
  274. }
  275. }
  276. %>