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

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. <html>
  5. <head>
  6. <meta http-equiv="Content-Type" content="text/html; charset=gb2312"><meta http-equiv="pragma" content="no-cache">
  7. <title>基本工资管理-- GForce OA 2.0</title>
  8. <link href="../css/txt.jsp" rel="stylesheet" type="text/css">
  9. <script language="JavaScript" src="/js/changestyle.js"></script>
  10. <script language="JavaScript">
  11. function checkpayconfirm(formname)
  12. {
  13.   if(formname.IsConfirmed.options[formname.IsConfirmed.selectedIndex].value=="0")
  14.   {
  15.     if(formname.ConfirmInfo.value=="")
  16.     {
  17.       alert("请输入工资确认信息!");
  18.       formname.ConfirmInfo.focus();
  19.       return false;
  20.     }
  21.     else
  22.     {
  23.       return true;
  24.     }
  25.   }
  26.   else
  27.   {
  28.     if(confirm("您确定要确认这次的工资吗?"))
  29.     {
  30.       formname.ConfirmInfo.value="我确认我的工资准确无误!";
  31.       return true;
  32.     }
  33.     else
  34.     {
  35.       formname.IsConfirmed.focus();
  36.       return false;
  37.     }
  38.   }
  39. }
  40. </script>
  41. </head>
  42. <body bgcolor="<%=m_session.GetString("BackColor")%>" leftmargin="0" topmargin="0">
  43.    <table width="100%" height="100%" border="0" align="center" cellspacing="0">
  44.     <tr>
  45.     <td align="center" valign="top">
  46.       <table width="100%" border="0" cellpadding="0" cellspacing="0">
  47.         <tr>
  48.           <td height="50" valign="top" background="../images/dy-back.gif">
  49.             <table width="100%" border="0" cellpadding="0" cellspacing="0">
  50.               <tr valign="middle">
  51.                 <td width="61" align="center" height="20"><img src="../images/dy-01.gif" width="38" height="36"></td>
  52.                 <td width="118" nowrap="nowrap" valign="middle"><strong><font color="#000000">工资确认</font></strong></td>
  53.                 <td align="right" nowrap="nowrap" valign="bottom">&nbsp;
  54.                    <!-- 群增<img src="../images/MulAdd.gif" onMouseOver="this.src='../images/MulAdd_a.gif';" onMouseOut="this.src='../images/MulAdd.gif';" border="0" height="22" width="59">&nbsp;-->
  55.                  <!--单增<img src="../images/Single.gif" onMouseOver="this.src='../images/Single_a.gif';" onMouseOut="this.src='../images/Single.gif';" border="0" height="22" width="59">&nbsp;-->
  56.                   <!-- 修改<img src="../images/Update.gif" onMouseOver="this.src='../images/Update_a.gif';" onMouseOut="this.src='../images/Update.gif';" border="0" height="22" width="59">&nbsp;-->
  57.                   <!-- 删除<img src="../images/Del.gif" onMouseOver="this.src='../images/Del_a.gif';" onMouseOut="this.src='../images/Del.gif';" border="0" height="22" width="59">&nbsp;-->
  58.                   <!-- 查看<img src="../images/Query.gif" onMouseOver="this.src='../images/Query_a.gif';" onMouseOut="this.src='../images/Query.gif';" border="0" height="22" width="59">&nbsp;-->
  59.                   <!-- 组合查询<img src="../images/GroupQuery.gif" onMouseOver="this.src='../images/GroupQuery_a.gif';" onMouseOut="this.src='../images/GroupQuery.gif';" border="0" height="22" width="79">&nbsp;-->
  60.                 </td>
  61.               </tr>
  62.             </table>
  63.           </td>
  64.         </tr>
  65.       </table><br>
  66. <%
  67. Request m_request = new Request(request);
  68. int iUserID = m_session.GetInt("UserID");
  69. int iPayYear = m_request.GetInt("PayYear");
  70. int iPayMonth = m_request.GetInt("PayMonth");
  71. int iIsConfirmed = m_request.GetInt("IsConfirmed");
  72. String strConfirmInfo = m_request.GetString("ConfirmInfo");
  73. int iPage = m_request.GetInt("Page");
  74. if(iPayYear>0 && iPayMonth >0 && strConfirmInfo.length()>0)
  75. {
  76.   int iPersonnelID = Integer.parseInt(((Vector)UserManager.getUserInfoByID(iUserID).get(0)).get(3).toString());
  77.   int iPayConfirm = PayManager.confirmPay(iPersonnelID,iPayYear,iPayMonth,iIsConfirmed,strConfirmInfo);
  78.   if(iPayConfirm>0)
  79.   {
  80.     out.println("<script language="javascript">alert("工资确认成功!");self.location='PersonnelPayList.jsp?Page=" + iPage + "';</script>");
  81.   }
  82.   else if(iPayConfirm==-3)
  83.   {
  84.     out.println("<script language="javascript">alert("您确认的工资信息不存在,工资确认失败!");history.back();</script>");
  85.   }
  86.   else if(iPayConfirm==-7)
  87.   {
  88.     out.println("<script language="javascript">alert("该工资信息您已经确认过,不能再次确认,工资确认失败!");self.location='PersonnelPayList.jsp?Page=" + iPage + "';</script>");
  89.   }
  90.   else
  91.   {
  92.     out.println("<script language="javascript">self.location='PersonnelPayList.jsp?Page=" + iPage + "';</script>");
  93.   }
  94. }
  95. else
  96. {
  97. %>
  98. <table width="100%" height="100%" border="0" align="center" cellspacing="0">
  99.     <tr>
  100.         <td align="center" valign="top">
  101.           <p><br>
  102.           “<%=UserManager.getPersonnelNameByUserID(iUserID)%>”的工资详细列表
  103.             <table width="90%" border="1" cellpadding="3" cellspacing="0" bordercolordark="#ffffff" bordercolorlight="#0a0a0a" style="">
  104.                 <tr align="center" valign="middle" bgcolor="<%=m_session.GetString("TitleColor")%>">
  105.                     <th width="4%" height="24" nowrap><img src="/images/white.gif" width="12"></th>
  106.                     <th width="4%" nowrap><font color="#000000">序号</font></th>
  107.                     <th width="10%" nowrap><font color="#000000">工资年月</font></th>
  108. <%
  109. int iPageSize = 15;
  110. String strPayTypeID = ",";
  111. Vector vt = PayTypeManager.getAllRecord();
  112. int iPayTypeCount = vt.size();
  113. for (int i=0;i<vt.size();i++)
  114. {
  115.   out.println("<th nowrap><font color="#000000">" + ((Vector)vt.get(i)).get(1).toString() + "</font></th>");
  116.   if (((Vector)vt.get(i)).get(1).toString().indexOf("*") >= 0)
  117.   {
  118.     strPayTypeID += ((Vector)vt.get(i)).get(0).toString() + ",";
  119.   }
  120. }
  121. %>
  122.                     <th width="8%" nowrap><font color="#000000">合计</font></th>
  123.                     <th width="8%" nowrap><font color="#000000">确认状态</font></th>
  124.                     <th width="8%" nowrap><font color="#000000">确认信息</font></th>
  125.                     <th width="8%" nowrap><font color="#000000">工资确认</font></th>
  126.                 </tr>
  127. <%
  128. vt = PayManager.getUserPay(iUserID);
  129. iPageSize = iPageSize * iPayTypeCount;
  130. if(iPage<1)iPage=1;
  131. int iPageCount = StringNew.getPageCount(vt.size(),iPageSize);
  132. if(iPage>iPageCount) iPage=1;
  133. for(int i=(iPage-1)*iPageSize;i<vt.size()&&i<iPage*iPageSize;)
  134. {
  135.     String strID = ((Vector)vt.get(i)).get(0).toString();
  136.     if( (i/iPayTypeCount) % 2 == 0)
  137.     out.println("<tr id="Row"+ i + "" class="DataRowsSingle" onmouseover="mouseon(this,'image" + i + "');" onmouseout="mouseout(this,'image" + i + "','DataRowsSingle');">");
  138.     else
  139.     out.println("<tr id="Row"+ i + "" class="DataRowsDouble" onmouseover="mouseon(this,'image" + i + "');" onmouseout="mouseout(this,'image" + i + "','DataRowsDouble');">");
  140.     out.println("<td align="right" valign="middle"><img id="image" + i + "" src="../images/lastpost1.gif" style="display:none;"> </td>");
  141.     out.println("<td align="center" valign="middle">" + (((int)i/iPayTypeCount) + 1) + "</td>");
  142.     out.println("<td align="center" valign="middle" nowrap>" + ((Vector)vt.get(i)).get(4).toString() + "年" + ((Vector)vt.get(i)).get(5).toString() + "月</td>");
  143.     long SumPay = 0;
  144.     for(int j=0;j<iPayTypeCount;j++,i++)
  145.     {
  146.       String strPay = ((Vector)vt.get(i)).get(3).toString();
  147. if(strPay.length()>1)
  148.        out.println("<td align="right" valign="middle" nowrap>" + strPay.substring(0,strPay.length()-2) + "</td>");
  149. else
  150. out.println("<td align="right" valign="middle" nowrap>" + strPay + "&nbsp;</td>");
  151.       try
  152.       {
  153.         if(strPayTypeID.indexOf(","+((Vector)vt.get(i)).get(2).toString()+",") < 0)
  154.         {
  155.            SumPay += (int)(Float.parseFloat(strPay) * 100);
  156.         }
  157.       }
  158.       catch(Exception err)
  159.       {
  160.       }
  161.     }
  162.     out.println("<td align="right" valign="middle" nowrap>" +(float)((float)SumPay/100)+ "</td>");
  163.     if(((Vector)vt.get(i-1)).get(6).toString().equalsIgnoreCase("true"))
  164.     {
  165.       out.println("<td align="center" valign="middle" nowrap>已确认</td>");
  166.       out.println("<td align="left" valign="middle" nowrap colspan="2">" + ((Vector)vt.get(i-1)).get(7).toString()+ "</td>");
  167.     }
  168.     else
  169.     {
  170.       out.println("<form name="PayConfirm" + i+1 + "" onsubmit="return checkpayconfirm(this);" method="post"><td align="left" valign="middle" nowrap><select name="IsConfirmed"><option value="0" selected>有问题不确认</option><option value="1">没问题我确认</option></select></td>");
  171.       out.println("<td align="left" valign="middle" nowrap><input name="ConfirmInfo" value="" + ((Vector)vt.get(i-1)).get(7).toString()+ "" type="text" size="16" maxlength="50"></td>");
  172.       out.println("<td align="left" valign="middle" nowrap><input name="submit1" type="submit" value="确定"><input name="PayYear" value="" + ((Vector)vt.get(i-1)).get(4).toString()+ "" type="hidden"><input name="PayMonth" value="" + ((Vector)vt.get(i-1)).get(5).toString()+ "" type="hidden"></td>");
  173.     }
  174.     out.println("</form></tr>");
  175. }
  176. out.println("<tr><th align="center" valign="top" colspan=""+(iPayTypeCount+7)+"">");
  177. String strCurrentPageURL = request.getRequestURI();
  178. if(iPage<2)
  179. out.print("首页&nbsp;&nbsp;上页");
  180. else
  181. out.print("<a href=""+ strCurrentPageURL+"?Page=" + 1 + "">首页</a>&nbsp;&nbsp;<a href=""+ strCurrentPageURL+"?Page=" + (iPage-1) + "">上页</a>");
  182. out.print("&nbsp;&nbsp;当前是第" + iPage + "页,共" + vt.size() + "条记录" + iPageCount + "页&nbsp;&nbsp;");
  183. if(iPage>=iPageCount)
  184. out.print("下页&nbsp;&nbsp;末页");
  185. else
  186. out.print("<a href=""+ strCurrentPageURL+"?Page=" + (iPage+1) + "">下页</a>&nbsp;&nbsp;<a href=""+ strCurrentPageURL+"?Page=" + iPageCount + "">末页</a>");
  187. out.println("</th>");
  188. %>
  189.         </table></p>
  190.         </td>
  191.     </tr>
  192. </table>
  193. <%
  194. }
  195. %>
  196. </body>
  197. </html>