📄 staffadd.jsp
字号:
<%@ page contentType="text/html; charset=GBK" %>
<%@ page import="com.doone.uurm.Sys_Organise,
com.doone.uurm.UserFactory,
com.doone.data.*,
com.doone.uurm.WebAuth,
java.util.*,
com.doone.fj1w.common.SystemConfig" %>
<%request.setCharacterEncoding("GBK");%>
<%String sPurvICode="NGB003001002";%>
<%
WebAuth auth = WebAuth.getInstance(request);
if ( ! auth.IsAuthed() ) {
out.write("<script language=\"javascript\">self.parent.location.replace(\"" + request.getContextPath() + "/view/login/login.jsp" + "\");</script>");
return;
}
else if ( ! auth.CheckPurv(sPurvICode) ) {
out.write("<script language=javascript src=\"../../common/script/RightForbidden.js\"></script>");
return;
}
long parentId = 0;
if ( request.getParameter("pid") != null )
parentId = Long.parseLong(request.getParameter("pid"));
DataTable postlist=UserFactory.getPostList(parentId);
Calendar cal = Calendar.getInstance();
String createtime= Integer.toString(cal.get(Calendar.YEAR))+"-"+
Integer.toString(cal.get(Calendar.MONTH)) +"-"+Integer.toString(cal.get(Calendar.DAY_OF_MONTH));
// 如果有通知功能,可以使用随机密码。
//String passwd=UserFactory.getRandomPassword(8);
String passwd="888888";
%>
<html>
<head>
<title>人员管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gbk" />
<link href="../../common/style/main.css" rel="stylesheet" type="text/css" />
<script language="JavaScript" src="../../common/script/ChangeStyle.js"></script>
<script language="JavaScript" src="../../common/mainTool.js"></script>
<link rel="stylesheet" type="text/css" media="all" href="../calendar/calendar-blue2.css"/>
<script type="text/javascript" src="../calendar/calendar.js"></script>
<script type="text/javascript" src="../calendar/calendar-zh.js"></script>
<script type="text/javascript" src="../calendar/calendar-action.js"></script>
<style>
<!--
input,select {width: 100%;}
-->
</style>
<script language="JavaScript">
function checker(OBJ)
{
var sOrg='';
//如果只有单项,则检查是否有选择
if(typeof(OBJ.ORGANISEID.length)=="undefined")
{
if(OBJ.ORGANISEID.checked)
{sOrg='HaveChecked'}
}
else //如果是多项,则检查数组中是否有选择
{
for(I=0;I< OBJ.ORGANISEID.length;I++)
{
if(OBJ.ORGANISEID[I].checked)
{sOrg='HaveChecked'}
}
for(I=0;I< OBJ.ORGANISEID.length;I++)
{
if(OBJ.ORGANISEID[I].checked)
{sOrg='HaveChecked'}
}
}
if(sOrg=='') return false;
else
return true;
}
function check(theForm) {
if(theForm.STAFFCODE.value=="") {
alert("请填写工号!");
theForm.STAFFCODE.focus();
return false;
}
if(theForm.NAME.value=="")
{
alert("请填写姓名!");
theForm.NAME.focus();
return false;
}
if(theForm.PWD.value=="")
{
alert("请填写密码!");
theForm.PWD.focus();
return false;
}
if(!checker(theForm))
{
alert("请选择岗位!");
return false;
}
if(theForm.STAFFCODE.value.length>=15)
{
alert("请正确填写工号/帐号,不大于15位的字母或数字!");
theForm.STAFFCODE.focus();
return false;
}
if(theForm.BIRTHDAY.value.length>0)
{
if(!CheckDate(theForm.BIRTHDAY.value))
{
alert("请正确填写出生日期,例如“1975-01-01”!");
theForm.BIRTHDAY.focus();
return false;
}
}
if(theForm.EMAIL.value.length>0) {
if(!ChackEmail(theForm.EMAIL.value)) {
alert("请正确填写电子信箱地址,\n例如:\nuser@163.com");
theForm.EMAIL.focus();
return false;
}
}
if ( theForm.RELATIONTEL.value.length > 0 ){
if(!CheckPhone(theForm.RELATIONTEL.value)){
alert("请正确填写联系电话,\n例如:\n0591-87654321\n或87654321\n");
theForm.RELATIONTEL.focus();
return false;
}
}
if(theForm.MODILESID.value.length>0)
{
if(!fucCheckNUM(theForm.MODILESID.value))
{
alert("请正确填写手机号码,数字型!");
theForm.MODILESID.focus();
return false;
}
}
if(theForm.POSTALCODE.value.length>0)
{
if(!CheckPost(theForm.POSTALCODE.value))
{
alert("请正确填写邮政编码,6个数字!");
theForm.POSTALCODE.focus();
return false;
}
}
if ( theForm.STARTTIME.value.length > 0 ) {
if(!CheckDate(theForm.STARTTIME.value))
{
alert("请正确填写有效起始时间,例如“2005-01-01”!");
theForm.STARTTIME.focus();
return false;
}
}
if ( theForm.ENDTIME.value.length > 0 ) {
if(!CheckDate(theForm.ENDTIME.value))
{
alert("请正确填写截止有效时间,例如“2008-01-01”!");
theForm.ENDTIME.focus();
return false;
}
}
return true;
}
</script>
</head>
<body>
<div id="overDiv" style="z-index: 1000; visibility: hidden; position: absolute"></div>
<form action="<%= request.getContextPath()%>/insertpostmember" method="get" name="insertfrm" onsubmit="return check(this);">
<input name="id" type="hidden" value='<%= parentId%>' />
<table width="100%" border="0" cellpadding="2" cellspacing="1" class="InnerTable">
<tr>
<td class="OuterHead" colspan="4">
<table width="100%" border="0" cellspacing="0" cellpadding="1">
<tr class="InnerHead">
<td colspan="2">
<jsp:include page="../../common/inc_top.jsp" >
<jsp:param name="purvCode" value="<%=sPurvICode%>"/>
</jsp:include>
</td>
</tr>
<tr>
<td nowrap="nowrap" style="text-align: left">
<span id="ItemTitle"><font face="webdings">8</font>添加人员</span>
</td>
<td align="right" nowrap>
<span id="ItemTitle">当前组织:<%
String orgFullName = Sys_Organise.getFullName(new DacClient(), parentId);
if ( orgFullName == null || orgFullName.length() == 0 ) {
orgFullName = "根组织";
}
else {
String[] names = orgFullName.split("-->");
if ( names.length > 3 ) {
orgFullName = names[0] + "-->……-->" + names[names.length-1];
}
}
out.print(orgFullName);
%></span>
</td>
</tr>
</table>
</td>
</tr><%
if( postlist.getRows().getCount()==0) {
out.print("<tr><td align='left' colspan='4'>提示信息:当前组织下没有任何岗位,请先添加岗位后,再添加职员。</td></tr>");
}
else { %>
<tr>
<td class="InnerHead" style="text-align: right" width="18%">
<font color="red">*</font>工号/帐号</td>
<td class="InnerMain" width="32%">
<input name="STAFFCODE" type="text" maxlength="9" tabIndex="1"></input></td>
<td class="InnerHead" style="text-align: right" width="18%">
出生日期</td>
<td class="InnerMain" width="32%" nowrap="nowrap">
<input type="text" name="BIRTHDAY" id="BIRTHDAY" size="15" style="width: 80%" /><span style="cursor:hand"
onclick="return showCalendar('BIRTHDAY', '%Y-%m-%d', false, true);">
<img border="0" src="../calendar/date_botton.gif" width="20" height="14">
</td>
</tr>
<tr>
<td class="InnerHead" style="text-align: right">
<font color="red">*</font>密码</td>
<td class="InnerMain">
<input name="PWD" type="text" maxlength="32" tabIndex="2" value="<%=passwd%>"></td>
<td class="InnerHead" style="text-align: right">
邮件地址</td>
<td class="InnerMain">
<input name="EMAIL" type="text" size="50" tabIndex="22" maxlength="50"></input></td>
</tr>
<tr>
<td class="InnerHead" style="text-align: right">
<font color="red">*</font>姓名</td>
<td class="InnerMain">
<input name="NAME" type="text" size="50" maxlength="20" tabIndex="3"></input></td>
<td class="InnerHead" style="text-align: right">
职务</td>
<td class="InnerMain">
<input name="DUTY" type="text" size="50" maxlength="30" tabIndex="23"></input>
</td>
</tr>
<tr>
<td class="InnerHead" style="text-align: right">性别</td>
<td class="InnerMain">
<span style="display:none;"><input name="SEX" type="radio" value="0" tabIndex="4" checked style="width:20px;" />保密</span>
<input name="SEX" type="radio" value="1" tabIndex="5" style="width:20px;" id="SEX_1" /><label for="SEX_1">男</label>
<input name="SEX" type="radio" value="2" tabIndex="6" style="width:20px;" id="SEX_2" /><label for="SEX_2">女</label>
</td>
<td class="InnerHead" style="text-align: right">
登记时间</td>
<td class="InnerHead"><div style="border: inset 1px #909090" align="left"><%=createtime%></div>
</td>
</tr>
<tr>
<td class="InnerHead" style="text-align: right">证件名称</td>
<td class="InnerMain">
<select name="CARTNAME" tabIndex="7">
<% DataTable cartnameList=SystemConfig.getConfigList(SystemConfig.CARTNAME);
for(int i=0;i<cartnameList.getRows().getCount();i++)
{
if(i==0)
{
out.println("<option value=\""+cartnameList.getRow(i).getString("paravalue")+"\" selected>"+cartnameList.getRow(i).getString("paradesc")+"</option>");
}
else
{
out.println("<option value=\""+cartnameList.getRow(i).getString("paravalue")+"\">"+cartnameList.getRow(i).getString("paradesc")+"</option>");
}
}
%>
</select>
</td>
<td class="InnerHead" style="text-align: right">
政治面貌</td>
<td class="InnerMain">
<select name="POLITICS" tabIndex="27">
<% DataTable politicsList=SystemConfig.getConfigList(SystemConfig.POLITICS);
for(int i=0;i<politicsList.getRows().getCount();i++)
{
if(i==0)
{
out.println("<option value=\""+politicsList.getRow(i).getString("paravalue")+"\" selected>"+politicsList.getRow(i).getString("paradesc")+"</option>");
}
else
{
out.println("<option value=\""+politicsList.getRow(i).getString("paravalue")+"\">"+politicsList.getRow(i).getString("paradesc")+"</option>");
}
}
%>
</select></td>
</tr>
<tr>
<td class="InnerHead" style="text-align: right">证件号码</td>
<td class="InnerMain">
<input name="CARTNO" type="text" size="50" maxlength="20" tabIndex="8"></input></td>
<td class="InnerHead" style="text-align: right">
教育程度</td>
<td class="InnerMain">
<select name="EDUCATION" tabIndex="28">
<% DataTable eduList=SystemConfig.getConfigList(SystemConfig.EDUCATION);
for(int i=0;i<eduList.getRows().getCount();i++)
{
if(i==0)
{
out.println("<option value=\""+eduList.getRow(i).getString("paravalue")+"\" selected>"+eduList.getRow(i).getString("paradesc")+"</option>");
}
else
{
out.println("<option value=\""+eduList.getRow(i).getString("paravalue")+"\">"+eduList.getRow(i).getString("paradesc")+"</option>");
}
}
%>
</select>
</td>
</tr>
<tr>
<td class="InnerHead" style="text-align: right">联系电话</td>
<td class="InnerMain">
<input name="RELATIONTEL" type="text" size="50" maxlength="30" tabIndex="9"></input></td>
<td class="InnerHead" style="text-align: right">
家庭电话</td>
<td class="InnerMain">
<input name="FAMILYTEL" type="text" size="50" maxlength="30" tabIndex="29"></input></td>
</tr>
<tr>
<td class="InnerHead" style="text-align: right">
手机号码</td>
<td class="InnerMain">
<input name="MODILESID" type="text" size="50" maxlength="30" tabIndex="10"></input></td>
<td class="InnerHead" style="text-align: right">
邮政编码</td>
<td class="InnerMain">
<input name="POSTALCODE" type="text" size="50" maxlength="30" tabIndex="30"></input></td>
</tr>
<tr>
<td class="InnerHead" style="text-align: right">
家庭地址</td>
<td class="InnerMain" colspan="3">
<input name="FAMILYADDRESS" type="text" size="50" maxlength="30" tabIndex="31"></input></td>
</tr>
<tr>
<td class="InnerHead" colspan="4" style="text-align: left">
员工与组织关系</td>
</tr>
<tr>
<td class="InnerHead" style="text-align: right">
<font color="red">*</font>岗位选择</td>
<td class="InnerMain" colspan="3"><%
int count = 1;
for(int i=0;i<postlist.getRows().getCount();i++) {
if (! postlist.getRow(i).getString("STATE").equalsIgnoreCase("E") ) continue;%>
<input name="ORGANISEID" type="checkbox" size="50" maxlength="30" tabIndex="<%= i+40%>" value="<%=postlist.getRow(i).getString("OrganiseId")%>" style="width: 20px;" id="ORGANISEID_<%=postlist.getRow(i).getString("OrganiseId")%>"><label for="ORGANISEID_<%=postlist.getRow(i).getString("OrganiseId")%>"><%=postlist.getRow(i).getString("name")%></label><%
if ( (count++)%3 == 0 ) {
out.print("<br>");
}
} %>
<input name="TECHLEVEL" type="hidden" size="50" maxlength="30" value="1"></input>
</td>
</tr>
<tr>
<td class="InnerHead" style="text-align: right">有效起始时间</td>
<td class="InnerMain">
<input name="STARTTIME" id="STARTTIME" type="text" maxlength="20" tabIndex="50" style="width: 80%;" /><span
style="cursor:hand" onclick="return showCalendar('STARTTIME', '%Y-%m-%d', false, true);">
<img border="0" src="../calendar/date_botton.gif" width="20" height="14">
</td>
<td class="InnerHead" style="text-align: right">截止有效时间</td>
<td class="InnerMain">
<input name="ENDTIME" id="ENDTIME" type="text" maxlength="20" style="width: 80%;" /><span
style="cursor:hand" onclick="return showCalendar('ENDTIME', '%Y-%m-%d', false, true);">
<img border="0" src="../calendar/date_botton.gif" width="20" height="14">
</td>
</tr>
<tr>
<td class="InnerHead" style="text-align: right">岗位状态</td>
<td class="InnerMain" colspan="3">
<input id="STATE_E" name="STATE" type="radio" value="E" checked style="width: 20px;"> <label for="STATE_E">在用</label>
<input id="STATE_D" name="STATE" type="radio" value="D" style="width: 20px;"> <label for="STATE_D">禁止</label></td>
</tr>
<tr class="OuterFoot">
<td class="InnerMain" colspan="4" align="right">
<input type="submit" class="button" value="确认" style="width: 50px;">
<input type="reset" class="button" value="关闭" style="width: 50px;" onclick="self.close();">
</td>
</tr>
</table>
</form>
<%
}
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -