employee_role_setting.jsp
资源名称:NetOffice.rar [点击查看]
上传用户:guhaomin
上传日期:2007-06-10
资源大小:23203k
文件大小:13k
源码类别:
电子政务应用
开发平台:
Java
- <%
- /**
- * $RCSfile: employee_role_setting.jsp,v $
- * $Revision: 1.0 $
- * $Date: 2001/05/17 20:57:46 $
- * /mainctrl/intranet/hr/role_set
- */
- %>
- <%@ 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.*" %>
- <%@ taglib uri="/vnex.tld" prefix="vnex" %>
- <%@ taglib uri="/vnex_organization.tld" prefix="org" %>
- <%@ taglib uri="/vnex_hr.tld" prefix="hr" %>
- <jsp:useBean id="hrProxyBean" class="com.vnex.intranet.hr.employer_info.proxy.MemberInfoProxyBean" scope="application" />
- <jsp:useBean id="dutyInfoBean" class="com.vnex.intranet.hr.employer_info.value.MemberDutyInfo" scope="page" />
- <jsp:useBean id="businessSession" class="com.vnex.intranet.pub.BusinessSession" scope="session" />
- <jsp:setProperty name="dutyInfoBean" property="*" />
- <%
- Collection pageColl = new ArrayList();
- int emp_id = -1;
- int chgMainDivisionId = -1;
- int chgMainDutyId = -1;
- String name = "";
- String str = request.getParameter("emp_id");
- if ( str != null )
- {
- emp_id = Integer.parseInt( str );
- dutyInfoBean.setEmpId( emp_id );
- }
- str = request.getParameter("name");
- if ( str != null )
- {
- name = new String(str);
- }
- String start = request.getParameter("start");
- //MemberDutyDAO mi = new MemberDutyDAO();
- if ( request.getParameter("doAdd") != null && dutyInfoBean.getEmpId() > 0 )
- {
- dutyInfoBean.setAssignId( businessSession.getEmpId() );
- hrProxyBean.dutyCreate( dutyInfoBean );
- }
- if ( request.getParameter("doDel") != null && dutyInfoBean.getEmpId() > 0 && request.getParameter("delId") != null)
- {
- String[] delId = request.getParameterValues("delId");
- for ( int i=0; i<delId.length; i++ )
- {
- hrProxyBean.dutyRemove( dutyInfoBean.getEmpId(), Integer.parseInt( delId[i].substring(1) ) );
- }
- }
- int deIdTemp = -1;
- if ( request.getParameter("doChange") != null && dutyInfoBean.getEmpId() > 0 )
- {
- if ( request.getParameter("divisionId") != null )
- deIdTemp = Integer.parseInt( request.getParameter("divisionId") );
- }
- if( request.getParameter("doModifyMainDuty") != null)
- {
- System.out.println("nn**********************Processing the if condition()");
- System.out.println("nn**********************request.getParameter("divisionId")"+request.getParameter("divisionId"));
- System.out.println("nn**********************request.getParameter("dutyId") "+request.getParameter("dutyId") );
- if( request.getParameter("divisionId") != null )
- chgMainDivisionId = Integer.parseInt(request.getParameter("divisionId") );
- if( request.getParameter("dutyId") != null )
- chgMainDutyId = Integer.parseInt( request.getParameter("dutyId") );
- if(chgMainDivisionId > 0 && chgMainDutyId > 0 && emp_id > 0)
- {
- try
- {
- System.out.println("nnProcessing the method:hrProxyBean.modifyIsMainDuty()");
- hrProxyBean.modifyIsMainDuty( chgMainDutyId, chgMainDivisionId , emp_id);
- }
- catch(Exception e)
- {
- System.out.println("Exception :"+e.getMessage());
- }
- }
- }
- System.out.println("Jsp find the emp_id"+emp_id);
- pageColl = hrProxyBean.dutyFind( emp_id );
- %>
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
- <HTML>
- <jsp:include page="/vnex/page/FORM_HEAD.jsp" />
- <script language="JavaScript" src="/vnex/validate.js"></script>
- <script language="javascript" src="/vnex/util/strUtil.js"></script>
- <script language=JavaScript>
- function submitAdd()
- {
- if (form1.divisionId.selectedIndex < 0)
- {
- alert("你必须选择部门!");
- form1.divisionId.focus();
- return false;
- }
- if (form1.dutyId.selectedIndex < 0)
- {
- alert("你必须选择职位!");
- form1.dutyId.focus();
- return false;
- }
- form1.action= "/mainctrl/intranet/hr/role_set?doAdd=1";
- form1.submit();
- }
- function change(select)
- {
- form1.action="/mainctrl/intranet/hr/role_set?doChange=1";
- form1.submit();
- }
- function checkIfValidForDel(ob,division,dutyName)
- {
- if( ob.value.charAt(0)=="N" && ob.checked == true )
- {
- alert("<%=name%>"+"在"+division+"担任了两个或两个以上职位,您当前选中想要删除的"+dutyName+"职位是"+"<%=name%>"+"在"+division+"担任的主要职位,您必须给" +"<%=name%>"+ "在"+division+"部门另指定一个主要职位然后再选择删除.");
- return false;
- }
- else
- {
- return false;
- }
- }
- function submitDel()
- {
- if(form1.delId == null)
- {
- alert("目前没有数据可供删除!");
- return false;
- }
- if(!isChecked(form1.delId))
- {
- alert("您没有选择要删除的项!");
- return false;
- }
- for(var i=0;i<document.form1.delId.length;i++)
- {
- if (document.form1.delId[i].checked)
- {
- if( document.form1.delId[i].value.charAt(0)=="N" )
- {
- alert("根据职位设定的原则,您必须保证每一个员工在其任职的每一个部门有而且仅有一个主要职位,n如果"+"<%=name%>"+"在一个部门担任了两个或两个以上的职位(其中会有一个而且仅有一个为主要职位),当您试图去删除其在某部门担任的主要职务时,n请您先将"+"<%=name%>"+"在该部门担任的主要职务标记更换到他在该部门担任的另一个职务上以后再选中删除.");
- return false;
- }
- }
- }
- if ( confirm("你确认要删除您选中的项吗?") )
- {
- form1.action= "/mainctrl/intranet/hr/role_set?doDel=1";
- form1.submit();
- }
- else return false;
- }
- function domodifyMainDuty( ob, dutyId,divisionId,empId)
- {
- if(ob.value == "Y")
- {
- //alert("Y"+dutyId);
- return false;
- }
- if(ob.value == "N")
- {
- ob.checked = false;
- form1.action = "/mainctrl/intranet/hr/role_set?doModifyMainDuty=1&dutyId="+dutyId+"&empId="+empId+"&divisionId="+divisionId;
- form1.submit();
- }
- return false;
- }
- </script>
- <BODY text=#000000 vLink=#000000 aLink=#000000 link=#000000 bgColor=#ffffff topMargin=20 leftmargin="0" marginwidth="0" marginheight="0">
- <script language="JavaScript1.2" src="/vnex/menu/dockmenu_hr.js"></script>
- <script language="JavaScript" src="/vnex/menu/dockmenu.js"></script>
- <DIV align=center>
- <form name="form1" method="post" action="/mainctrl/intranet/hr/role_set?emp_id=<%= emp_id %>">
- <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 class=title cellspacing=1 width="600" border=0>
- <tr>
- <td colspan="6" 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></td>
- </tr>
- <tr bgcolor="#fafafa">
- <td colspan="6" height="30">
- <%
- if ( pageColl.size() > 0 )
- {
- %>
- <input type="button" value="删除" name="B22" onClick="submitDel()" class=text>
- <%
- }
- %>
- </td>
- </tr>
- <tr>
- <td width="40" align="center"><font class=strong>选择</font></td>
- <td width="140" align="center"><font class=strong>设定时间</font></td>
- <td width="140" align="center"><font class=strong>部门</font></td>
- <td width="140" align="center"><font class=strong>主管</font></td>
- <td width="140" align="center"> <font class=strong>职务</font></td>
- <td width="10" align="center"> <font class=strong>主</font></td>
- </tr>
- <%
- String bgcolor = null;
- int color_i = 0;
- Iterator iter = pageColl.iterator();
- while ( iter.hasNext() )
- {
- MemberDutyInfo mdi = (MemberDutyInfo)iter.next();
- color_i++;
- if( color_i%2==0 )
- {
- bgcolor = "#e0e0e0";
- }
- else
- {
- bgcolor = "#fafafa";
- }
- %>
- <tr bgcolor="<%= bgcolor %>">
- <td width="40" align="center"><font class=strongw>
- <input type="checkbox" name="delId" value="<%= hrProxyBean.isValidForDel(mdi.getDutyId(),emp_id)?"Y":"N"%><%= mdi.getDutyId() %>" onclick = "checkIfValidForDel(this,'<%= mdi.getDivisionName() %>','<%= mdi.getDutyName() %>')">
- </font></td>
- <td width="140" align="center"><%= MyDateFormat.myDate(mdi.getAssignDate()) %></td>
- <td align="center" width="140"><%= mdi.getDivisionName() %></td>
- <td width="140" align="center"><%= mdi.getManagerName() %></td>
- <td width="140" align="center"><%= mdi.getDutyName() %></td>
- <td width="10" align="center"><input type="radio" name="radio<%=mdi.getDutyId()%>" value="<%=mdi.getIsMainDuty()?"Y":"N"%>" <% if( mdi.getIsMainDuty() == true ) out.print("checked");%> onclick = "domodifyMainDuty(this,'<%= mdi.getDutyId() %>','<%=mdi.getDivisionId()%>','<%=emp_id%>')" ></td>
- </tr>
- <%
- }
- %>
- </table>
- <hr size="1" color="#ffffff">
- <table class=title cellspacing=1 width="600" border=0>
- <tr>
- <td bgcolor="#e0e0e0" width="21%"><font class=strong> 姓名:</font></td>
- <td bgcolor="#e0e0e0" width="79%"><%= name %></td>
- </tr>
- <tr>
- <td bgcolor="#fafafa" width="21%"><font class=strong> 部门:</font></td>
- <td bgcolor="#fafafa" width="79%">
- <!--部门列表开始-->
- <select name="divisionId" class=choice onChange=change(this)>
- <option value="-1">------------请选择部门------------</option>
- <org:DivisionList>
- <vnex:items select='<%= deIdTemp+"" %>' >
- <option value=<org:DivisionAttribute attribute="id"/> <org:DivisionAttribute attribute="isSelected"/> >
- <org:DivisionAttribute attribute="levelStr"/>+<org:DivisionAttribute attribute="name"/></option>
- </vnex:items>
- </org:DivisionList>
- </select>
- <!--部门列表结束-->
- </td>
- </tr>
- <tr bgcolor="#e0e0e0">
- <td width="21%"><font class=strong> 职位:</font></td>
- <td width="79%">
- <select name="dutyId">
- <%
- try
- {
- System.out.println("deIdTemp:"+deIdTemp);
- %>
- <hr:DutyList divisionId='<%= deIdTemp %>'>
- <vnex:items >
- <option value="<hr:DutyAttribute attribute="id" />" >
- <hr:DutyAttribute attribute='<%= null %>' /></option>
- </vnex:items>
- </hr:DutyList>
- <%
- }
- catch(Exception e)
- {
- System.out.println("Error at Employee_role_setting.jsp at the DutyList tag:"+e.getMessage());
- }
- %>
- </select>
- </td>
- </tr>
- <tr bgcolor="#fafafa">
- <td width="21%"><font class=strong> 主要职务:</font></td>
- <td width="79%">
- <input type="checkbox" name="isMainDuty" value=true >
- </td>
- </tr>
- <tr bgcolor="#fafafa" align="center">
- <td colspan="2" height="30">
- <input type=button value=新增 name=B3 class=text onclick="submitAdd()">
- <input type="reset" value="重置" name="B2" class=text>
- <input type="button" value="返回" name="B23" onClick="location='/mainctrl/intranet/hr/search_result?start=<%= start %>'" 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=emp_id value=<%= emp_id %> >
- <input type=hidden name=name value=<%= name %> >
- <input type=hidden name=start value=<%= start %> >
- </form></DIV>
- </BODY></HTML>