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

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