employee_salary_count_manage.jsp
资源名称:NetOffice.rar [点击查看]
上传用户:guhaomin
上传日期:2007-06-10
资源大小:23203k
文件大小:10k
源码类别:
电子政务应用
开发平台:
Java
- <%
- /**
- * $RCSfile: employee_salary_count_manage.jsp,v $
- * $Revision: 1.0 $
- * $Date: 2001/05/17 20:57:46 $
- * /mainctrl/intranet/hr/employee_salary_count_manage
- */
- %>
- <%@ page errorPage="/vnex/ErrorPage.jsp" %>
- <%@ page import="com.vnex.intranet.hr.employer_info.value.*" %>
- <%@ page import="com.vnex.intranet.hr.employer_info.process.*" %>
- <%@ page import="com.vnex.intranet.hr.util.*" %>
- <%@ page import="java.util.*" %>
- <%@ page import="java.text.DecimalFormat" %>
- <jsp:useBean id="salaryProxyBean" class="com.vnex.intranet.hr.employer_info.proxy.SalaryProxyBean" scope="application" />
- <%
- int emp_id = -1;
- emp_id = Integer.parseInt( request.getParameter("emp_id") );
- DecimalFormat dFormat = new DecimalFormat("##.##");
- String emp_name = request.getParameter("emp_name");
- String start = request.getParameter("start");
- Collection pageColl = new ArrayList();
- if ( request.getParameter("doSave") != null && request.getParameterValues("emp_id") != null)
- {
- String[] comId = request.getParameterValues("component_id");
- String[] comCount = request.getParameterValues("component_count");
- if ( comId.length == comCount.length )
- {
- for ( int i=0; i<comId.length; i++ )
- {
- SalaryCountBean scb = new SalaryCountBean();
- scb.setComId( Integer.parseInt( comId[i] ) );
- scb.setEmpId( emp_id );
- scb.setCount( Double.parseDouble( comCount[i] ) );
- scb.setComType( MemberDbTable.SALARY_TYPE );
- salaryProxyBean.salaryStore( scb );
- }
- }
- response.sendRedirect("/mainctrl/intranet/hr/search_result");
- }
- if ( request.getParameter("doCreate") != null && request.getParameterValues("emp_id") != null)
- {
- String[] comId = request.getParameterValues("component_id");
- String[] comCount = request.getParameterValues("component_count");
- String[] comName = request.getParameterValues("component_name");
- String[] countType = request.getParameterValues("count_type");
- MemberDateSalary mds = new MemberDateSalary();
- mds.setEmpId( emp_id );
- if ( comId.length == comCount.length && comCount.length == comName.length )
- {
- for ( int i=0; i<comId.length; i++ )
- {
- DateComponentBean dcb = new DateComponentBean();
- dcb.setId( Integer.parseInt(comId[i]) );
- dcb.setName( comName[i] );
- double tcount = Double.parseDouble(comCount[i])*Integer.parseInt(countType[i]);
- dcb.setCount( tcount );
- mds.getComponent().add(dcb);
- }
- }
- salaryProxyBean.dateCreate(mds);
- response.sendRedirect("/mainctrl/intranet/hr/search_result");
- }
- if ( request.getParameter("doEmpSalary") != null && emp_id > 0 )
- {
- salaryProxyBean.salaryCreateEmpSalary( emp_id );
- }
- pageColl = salaryProxyBean.salaryFindAll( emp_id, MemberDbTable.SALARY_TYPE );
- int salaryCollCount = pageColl.size();
- %>
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
- <HTML>
- <jsp:include page="/vnex/page/FORM_HEAD.jsp" />
- <script language="JavaScript1.2" src="/vnex/menu/dockmenu_hr.js"></script>
- <script language="JavaScript" src="/vnex/menu/dockmenu.js"></script>
- <script language="JavaScript" src="/vnex/validate.js"></script>
- <script language=JavaScript>
- function submitSave()
- {
- for (var i = 0; i < form1.component_count.length; i++)
- {
- if ( !checkSalaryNum( form1.component_count[i] ) )
- {
- form1.component_count[i].focus();
- return false;
- }
- }
- form1.action= "/mainctrl/intranet/hr/employee_salary_count_manage?emp_id=<%= emp_id %>&emp_name=<%= emp_name %>&doSave=1";
- form1.submit();
- }
- function submitCreate()
- {
- if ( confirm("你确认要生成此职员的本月工资单吗?") )
- {
- form1.action= "/mainctrl/intranet/hr/employee_salary_count_manage?emp_id=<%= emp_id %>&emp_name=<%= emp_name %>&doCreate=1";
- form1.submit();
- }
- else return false;
- }
- function checkSalaryNum( thefield )
- {
- if ( !isSignedFloat(thefield.value, false) )
- {
- alert("请输入正确的数字类型!");
- thefield.focus();
- thefield.select();
- return false;
- }
- if ( thefield.value <0 )
- {
- alert("你输入的金额必须>0!");
- thefield.focus();
- thefield.select();
- return false;
- }
- if ( thefield.value >999999 )
- {
- alert("你输入的金额不能大于999999.00!");
- thefield.focus();
- thefield.select();
- return false;
- }
- return true;
- }
- function submitCreateEmpSalary()
- {
- if ( confirm("你确认要生成此职员的工资组成项目吗?") )
- {
- form1.action= "/mainctrl/intranet/hr/employee_salary_count_manage?emp_id=<%= emp_id %>&emp_name=<%= emp_name %>&doEmpSalary=1";
- form1.submit();
- }
- else return false;
- }
- </script>
- <BODY text=#000000 vLink=#000000 aLink=#000000 link=#000000 bgColor=#ffffff topMargin=20 leftmargin="0" marginwidth="0" marginheight="0">
- <DIV align=center>
- <form name="form1" method="post" action="/mainctrl/intranet/hr/employee_salary_count_manage?emp_id=<%= emp_id %>&emp_name=<%= emp_name %>">
- <TABLE class=outter cellSpacing=0 cellPadding=0 width=600 border=0>
- <TBODY>
- <jsp:include page="/vnex/page/TTOA_TABLE_TOP.jsp" />
- <TR>
- <TD colSpan=3 align="center">
- <br>
- <table width="600" border="1" cellspacing="1" bordercolor="#666666">
- <tr>
- <td bgcolor="#fafafa">
- <table width="600" border="0" cellspacing="0" >
- <tr>
- <td bgcolor="#666666"><font class="strongw"><a href="/mainctrl/home/index"><font color="#FFFFFF">首页</font></a>>><a href="/mainctrl/hr/main"><font color="#FFFFFF">人力资源</font></a>>><a href="/mainctrl/intranet/hr/search_result"><font color="#FFFFFF">员工信息</font></a>>><font color="#FFFFFF">薪酬设置</font></font></td>
- </tr>
- </table>
- <table class=title cellspacing=1 cellpadding=2 width="600" border=0>
- <tr>
- <td width="153" align="center"><font class=strong>名称</font></td>
- <td width="76" align="center"><font class=strong>方式</font></td>
- <td width="105" align="center"><font class=strong>类型</font></td>
- <td width="193" align="center"><font class=strong>金额</font></td>
- </tr>
- <%
- String bgcolor = null;
- int color_i = 0;
- Iterator iter = pageColl.iterator();
- double sum=0;
- while ( iter.hasNext() )
- {
- MemberSalary sc = (MemberSalary)iter.next();
- sum += sc.getCount()*sc.getComponent().getCalcType()*sc.getComponent().getState();
- color_i++;
- if( color_i%2==0 )
- {
- bgcolor = "#e0e0e0";
- }
- else
- {
- bgcolor = "#fafafa";
- }
- %>
- <tr bgcolor="<%= bgcolor %>">
- <td width="153" align="center"><%= sc.getComponent().getName() %></td>
- <td width="76" align="center"><% if ( sc.getComponent().getCalcType() == MemberDbTable.DECREASE_TYPE ) out.print("减项"); else out.print("增项"); %></td>
- <td width="105" align="center"><% if ( sc.getComponent().getType() == MemberDbTable.SALARY_TYPE ) out.print("工资"); else if ( sc.getComponent().getType() == MemberDbTable.INSURANCE_TYPE ) out.print("保险"); else out.print("福利"); %></td>
- <td width="193" align="center">
- <input type="text" name="component_count" class=text onChange="checkSalaryNum(this)" size="24" value="<%= sc.getCount() %>"> 元
- <input type="hidden" name="component_id" class=text size="20" value=<%= sc.getComponent().getId() %>>
- <input type="hidden" name="component_name" class=text size="20" value=<%= sc.getComponent().getName() %>>
- <input type="hidden" name="count_type" class=text size="20" value=<%= sc.getComponent().getCalcType() %>>
- </td>
- </tr>
- <%
- }
- %>
- <tr>
- <td width="153" bgcolor="#e0e0e0" align="center">实发金额</td>
- <td width="76" bgcolor="#e0e0e0" align="center"> </td>
- <td width="105" bgcolor="#e0e0e0" align="center"> </td>
- <td width="193" bgcolor="#e0e0e0" align="center"><%= dFormat.format(sum) %> (元)</td>
- </tr>
- <tr bgcolor="#fafafa">
- <td colspan="5" height="30" align="center">
- <%
- if ( salaryCollCount >0 )
- {
- %>
- <input type="button" value="保存" name="B3" class=text onclick="return submitSave()">
- <%
- }
- %>
- <%
- if ( !salaryProxyBean.dateCheckList(emp_id) && salaryCollCount >0 )
- {
- %>
- <input type="button" style="width:95px" value="生成本月工资单" name="B32" class=text onclick="return submitCreate()">
- <%
- }
- %>
- <%
- if ( salaryCollCount <1 )
- {
- %>
- <input type="button" style="width:80px" value="生成工资选项" name="B33" class=text onclick="return submitCreateEmpSalary()">
- <%
- }
- %>
- <input type="reset" value="放弃" onClick="location='/mainctrl/intranet/hr/search_result?start=<%= start %>'" name="B2" class=text>
- </td>
- </tr>
- </table>
- </td>
- </tr></table>
- <br>
- <br>
- <jsp:include page="/vnex/page/TTOA_HELP.jsp" />
- </TD>
- </TR>
- <jsp:include page="/vnex/page/TTOA_TABLE_BOTTOM.jsp" />
- </TBODY>
- </TABLE>
- <BR>
- <jsp:include page="/vnex/page/TTOA_PRODUCER_LOGO.jsp" />
- <input type=hidden name=start value=<%= start %> >
- </form></DIV>
- </BODY></HTML>