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

OA系统

开发平台:

Java

  1. <%@ page contentType="text/html; charset=gb2312"%>
  2. <%@ page import="com.gforce.gfoa.*,com.gforce.currency.*,java.util.*" %>
  3. <jsp:include page="/CheckLogin1.jsp" flush="true"/> <% Session m_session = new Session(session); %>
  4. <%
  5. Request m_request = new Request(request);
  6. int intPersonnelID = m_request.GetInt("ID");
  7. if(intPersonnelID<1)
  8. {
  9.   %>
  10.   <script language="JavaScript" type="text/JavaScript">
  11.   alert("请选择正确的记录,修改失败!");
  12.   //history.back();
  13.   window.close();
  14.   </script>
  15.   <%
  16. }
  17. else
  18. {
  19.   Vector vt = BasePayManager.getRecordByPersonnelID(intPersonnelID);
  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 checkEditBasePay()
  31.     {
  32.       var sum1=0,sum2=0;
  33.       <%
  34.       for (int i=0;i<vt.size();i++)
  35.       {
  36.         String strPayTypeName=PayTypeManager.getPayTypeNameByID(Integer.parseInt(((Vector)vt.get(i)).get(2).toString(),10));
  37.         out.println("if(isNaN(parseInt(document.EditBasePay.Name"+((Vector)vt.get(i)).get(2).toString()+".value))){");
  38.         out.println("alert("请输入正确的数量!");");
  39.         out.println("document.EditBasePay.Name"+ ((Vector)vt.get(i)).get(2).toString() +".select();");
  40.         out.println("document.EditBasePay.Name"+ ((Vector)vt.get(i)).get(2).toString() +".focus();");
  41.         out.println("return false;}");
  42.         if(strPayTypeName.indexOf("*")>=0)
  43.         {
  44.           out.println("sum1+=parseFloat(document.EditBasePay.Name"+((Vector)vt.get(i)).get(2).toString()+".value);");
  45.         }
  46.         else
  47.         {
  48.           out.println("sum2+=parseFloat(document.EditBasePay.Name"+((Vector)vt.get(i)).get(2).toString()+".value);");
  49.         }
  50.       }
  51.       %>
  52.       if(sum1>0&&Math.round(sum1 * 100) !=Math.round(sum2 * 100))
  53.       {
  54.         alert("带“*”的工资条目总和(" + (Math.round(sum1 * 100)/100.0) + "元)应该等于不带“*”的工资条目总和(" + (Math.round(sum2 * 100)/100.0) + "元)!");
  55.         return false;
  56.       }
  57.     }
  58.     </script>
  59.     </head>
  60.     <body bgcolor="<%=m_session.GetString("BackColor")%>" leftmargin="0" topmargin="0">
  61.       <table width="100%" height="100%" border="0" align="center" cellspacing="0">
  62.         <tr>
  63.           <td align="center" valign="top"><p>&nbsp;</p>
  64.             <form name="EditBasePay" action="/Pay/EditBasePayAction.jsp?PersonnelID=<%=intPersonnelID%>" method="post" onSubmit="javascript:return checkEditBasePay();">
  65.               <table  border="0" cellpadding="0" cellspacing="0" width="90%">
  66.               <%
  67.               Vector vt1=PersonnelManager.getRecordByID(intPersonnelID);
  68.              if(vt1.size()==1)
  69.              {
  70. out.println("<tr>");
  71. out.println("<td align="right" valign="middle">员工姓名:</td>");
  72. out.println("<td align="left" valign="middle" nowrap>");
  73. out.println(((Vector)vt1.get(0)).get(1).toString());
  74. out.println("</td>");
  75. out.println("</tr>");
  76. out.println("<tr>");
  77. out.println("<td align="right" valign="middle">员工编号:</td>");
  78. out.println("<td align="left" valign="middle" nowrap>");
  79. out.println(((Vector)vt1.get(0)).get(4).toString());
  80. out.println("</td>");
  81. out.println("</tr>");
  82. }
  83. for (int i=0;i<vt.size();i++)
  84. {
  85.     out.println("<tr>");
  86.     out.println("<td align="right" valign="middle">"+PayTypeManager.getPayTypeNameByID(Integer.parseInt(((Vector)vt.get(i)).get(2).toString()))+":</td>");
  87.     out.println("<td align="left" valign="middle" nowrap>");
  88.     out.println("<input name="Name"+((Vector)vt.get(i)).get(2).toString()+"" type="text" maxlength="15" size="20" Value=""+ ((Vector)vt.get(i)).get(3).toString() +"">");
  89.     out.println("</td>");
  90.     out.println("</tr>");
  91. }
  92. %>
  93.                 <tr>
  94.                   <td align="right" valign="middle">&nbsp;</td>
  95.                   <td align="left" valign="middle" nowrap></td>
  96.                 </tr>
  97.                 <tr>
  98.                   <td align="right" valign="middle">&nbsp;</td>
  99.                   <td align="left" valign="middle" nowrap>
  100.                     <input type="submit" value="修改">&nbsp;&nbsp; <input type="reset" value="重填">&nbsp;&nbsp; <input type="button" value="返回" onclick="window.close();">
  101.                   </td>
  102.                 </tr>
  103.              </table>
  104.             </form>
  105.          </td>
  106.      </tr>
  107. </table>
  108. </body>
  109. </html>
  110. <%
  111. }
  112. else
  113. {
  114. %>
  115. <script language="JavaScript" type="text/JavaScript">
  116. alert("该记录已经被删除或者您没有权限修改此记录,修改失败!");
  117. window.close();
  118. </script>
  119. <%
  120. }
  121. }
  122. %>