📄 deptmt.asp
字号:
<%@ Language=VBScript Transaction="Required"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>人力资源管理系统</title>
<link href="../include/type.css" rel="stylesheet" type="text/css">
</head>
<body>
<!--#include file="../Include/conn.asp"-->
<!--#include file="../Include/Head.asp"-->
<!--#include file="../Include/Syscheck.asp"-->
<script type="text/javascript" src="../Include/regtest.js"></script>
<div id="content" style="position:absolute; width:90%; height:115px; z-index:3; left: 48px; top: 178px;">
<%
call checkin_sys(session("UsersId"),session("PerId"),1)
dim dname,dman,dfunction,dhigh,dstate,dlevel,dps,dstation,ddate1,ddate2,ddate3,dreason1,dreason2
dim op,res,i
dim e_id,o_id
'e_id = request.QueryString("id")
op = request.QueryString("op")
set res = server.CreateObject("adodb.recordset")
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''部门及功能选项列表
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
if op = "" then '
%>
<script type="text/javascript" src="../Include/ajaxrequest.js"></script>
<script type="text/javascript">
function ajaxfuct(num,dno,rson,op)
{
// 创建AJAX对象
var ajaxobj=new AJAXRequest();
ajaxobj.method="post";
// 设置回调函数,输出响应内容
ajaxobj.callback=function(xmlobj)
{
if (op=="3")
{
document.getElementById("ts"+dno).innerHTML=xmlobj.responseText;
if(xmlobj.responseText=="已撤消!")
{
document.getElementById("ts"+dno).parentElement.children[3].innerHTML="<center>撤消</center>";
document.getElementById("ts"+dno).parentElement.children[0].innerHTML=" ";
document.getElementById("ts"+dno).parentElement.children[5].innerHTML=" ";
}
}
}
// 发送请求
ajaxobj.send("deptmt_back.asp?hi="+num+"&rt="+rson+"&op="+op);
}
function rcheck()
{
var temp;
temp=document.getElementsByName("checkbox1");
var i;
var j=0;
for (i=0;i<temp.length;i++)
{
if (temp[i].checked==true)
{
j=j+1;
}
}
if (j>1)
{
document.con_dept.submit();
}
else
{
alert("请选择至少两个部门!");
}
}
function input(id,dno)
{
document.getElementById("ts"+dno).innerHTML="输入撤消理由<INPUT type='text' name='reason'><a href='#' onclick='ajaxfuct('+id+',this.value,'+dno+',2)'>确定</a>"
}
</SCRIPT>
<img src="..\images\sub01_05.jpg" align="absmiddle" ><font color="#183978" size="3" face="华文仿宋">部门信息列表</font>
<%
dim currentpage,rowcount
currentpage=Request.QueryString("page")
if currentpage="" then
currentpage="1"
end if
res.open "select a.dept_id,a.dept_meanid,a.dept_name,a.dept_station,b.dlevel_name from dept as a inner join deptlevel as b on a.dept_level = b.dept_level where a.dept_state='启用'",conn,1,1
i=0
%>
<!-- 查出部门信息,循环显示-->
<form action="deptmt.asp?op=5" method="post" name="con_dept">
<%
res.PageSize=5
res.AbsolutePage=currentpage
%>
<table width="90%" border="1" align="center" cellpadding="0" cellspacing="0" class="table1">
<tr bgcolor="#eeeeee" height="25">
<td width="3%" align="center"> </td>
<td width="8%" align="center">部门编号</td>
<td width="8%" align="center">部门名称</td>
<td width="8%" align="center">办公地点</td>
<td width="8%" align="center">部门级别</td>
<td width="25%" align="center">操作选项</td>
<td width="40%" align="center">提示</td>
</tr>
<%while not res.eof and rowcount<res.PageSize%>
<tr height="25">
<td width="5%" align="center">
<%
if res(4)<>"最高" then
%>
<input type="checkbox" name="checkbox1" value="<%=res(0)%>">
<%
else
Response.Write " "
end if
%>
</td>
<td align="center"><%=res(1)%></td>
<td align="center"><%=res(2)%></td>
<td align="center"><%=res(3)%></td>
<td align="center"><%=res(4)%></td>
<td align="center">
<%
if res(4)<>"最高" then
%>
<a href="deptmt.asp?op=1&id=<%=res(0)%>">查看</a>
<a href="deptmt.asp?op=2&id=<%=res(0)%>">编辑</a>
<a href="deptmt.asp?op=3&id=<%=res(0)%>">调整</a>
<a href="#" onclick="javascript:var num=confirm('确实要撤消吗?');if(num==true){document.getElementById('sp<%=i%>').style.display='inline';}">撤销</a>
<%
else
Response.Write "系统设置"
end if
%>
</td>
<td id="ts<%=i%>">
<span id="sp<%=i%>" style="display:none;">撤消理由
<INPUT type='text' name='reason' onkeyup="testlen(this,10)">
<a href='#' onclick="var a=/^([A-Za-z0-9-]|[\u0391-\uFFE5])+$/;if(a.test(this.parentElement.children[0].value)==true){ajaxfuct('<%=res(0)%>','<%=i%>',this.parentElement.children[0].value,'3');}else{alert('输入无效字符!');}">确定</a>
<a href='#' onclick="this.parentElement.style.display='none';">取消</a>
</span>
</td>
</tr>
<%
res.movenext
rowcount=rowcount+1
i=i+1
wend
%>
</table>
<p></p>
<center>
<a href="deptmt.asp?page=1">首页</a>
<a href="deptmt.asp?page=<%
if currentpage-1<=1 then
Response.Write "1"
else
Response.Write currentpage-1
end if
%>">上页</a>
<a href="deptmt.asp?page=<%
if currentpage+1>=res.PageCount then
Response.Write res.PageCount
else
Response.Write currentpage+1
end if
%>">下页</a>
<a href="deptmt.asp?page=<%=res.PageCount%>">尾页</a>
</center>
</form>
<center>
<input type="button" value="创建部门" onclick="document.location='deptmt.asp?op=5'" class="button" id=button2 name=button2>
<input type="button" value="合并部门" onClick="rcheck();" class="button" id=button3 name=button3>
</center>
<%
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''部门详细信息查看
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
elseif op="1" then '查询部门详细信息
dim s_id
s_id=request.QueryString("id")
res.open "select a.Dept_meanid,a.Dept_name,a.Dept_man,a.Dept_fctdescription,a.High_dept,b.dlevel_name,a.Dept_state,a.Dept_remark,a.Dept_station,a.Dept_createdate,a.Dept_deledate,a.Dept_adjustdate,a.Dept_delereason,a.Dept_adjustreason from dept as a inner join deptlevel as b on a.dept_level = b.dept_level where dept_id='"&s_id&"'",conn,3,3
%>
<img src="..\images\sub01_05.jpg" align="absmiddle" ><font color="#183978" size="3" face="华文仿宋">部门详细信息</font>
<table width="87%" border="1" align="center" cellpadding="10" cellspacing="0" class="table1">
<tr align="center">
<td width="17%" class="td1"><span class="STYLE1">部门ID:</span></td>
<td width="16%"><%=res(0)%></td>
<td width="12%" class="td1"><span class="STYLE1">部门名称:</span></td>
<td width="21%"><%=res(1)%></td>
<td width="13%" class="td1"><span class="STYLE1">部门负责人:</span></td>
<td width="21%"><%
dim t_res
set t_res=server.CreateObject("ADODB.recordset")
t_res.open "select personnel_name from personnel where personnel_deptman=1 and personnel_state!='离职' and dept_id="&s_id,conn,3,3
'Response.Write t_res.RecordCount
'Response.End
if t_res.RecordCount=0 then
Response.Write "请在员工档案中设置!"
else
while not t_res.eof=true
Response.Write t_res.Fields(0).Value&";"
t_res.movenext
wend
end if
t_res.Close
set t_res=nothing
%></td>
</tr>
<tr align="center">
<td class="td1"><span class="STYLE1">部门功能描述:</span></td>
<td colspan="5"><div align="left"><%=res(3)%></div></td>
</tr>
<tr align="center">
<td class="td1"><span class="STYLE1">上级部门:</span></td>
<td><%=res(4)%></td>
<td class="td1"><span class="STYLE1">部门状态:</span></td>
<td><%=res(6)%></td>
<td class="td1"><span class="STYLE1">部门等级:</span></td>
<td><%=res(5)%></td>
</tr>
<tr align="center">
<td class="td1"><span class="STYLE1">部门备注:</span></td>
<td colspan="3"><div align="left"> <%=res(7)%></div></td>
<td class="td1"><span class="STYLE1">办公地点:</span></td>
<td><%=res(8)%></td>
</tr>
<tr align="center">
<td class="td1"><span class="STYLE1">创建日期:</span></td>
<td> <%=res(9)%></td>
<td class="td1"><span class="STYLE1">撤销日期:</span></td>
<td> <%=res(10)%></td>
<td class="td1"><span class="STYLE1">调整时间:</span></td>
<td><div align="center"> <%=res(11)%></div></td>
</tr>
<tr align="center">
<td class="td1"><span class="STYLE1">撤销理由:</span></td>
<td colspan="5"><div align="left"> <%=res(12)%></div></td>
</tr>
<tr align="center">
<td class="td1"><span class="STYLE1">调整理由:</span></td>
<td colspan="5"><div align="left"> <%=res(13)%></div></td>
</tr>
</table>
<table width="87%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="70%" height="58"> </td>
<td width="30%"><div align="center">
<a href="deptmt.asp">返回</a>
<a href="deptmt.asp?op=2&id=<%=s_id%>">编辑</a></div>
</td>
</tr>
</table>
<%
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''' 创建新部门操作 '''''''''
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
elseif op="5" then ' 创建新部门 输入新部门信息
e_id=request.Form("checkbox1") '当部门合并时接收
if e_id<>"" then
response.write " <img src='..\images\sub01_05.jpg' align='absmiddle'><font color='#183978' size='3' face='华文仿宋'>输入合并后新部门信息</font> "
else
response.write " <img src='..\images\sub01_05.jpg' align='absmiddle' ><font color='#183978' size='3' face='华文仿宋'>输入部门信息</font> "
end if
%>
<script type="text/javascript" src="../Include/ajaxrequest.js"></script>
<script type="text/javascript">
function ajaxfuct(num,op)
{
// 创建AJAX对象
var ajaxobj=new AJAXRequest();
ajaxobj.method="post";
// 设置回调函数,输出响应内容
ajaxobj.callback=function(xmlobj)
{
if (op=="1")
{
document.getElementById("r_name").innerHTML=xmlobj.responseText;
if (xmlobj.responseText=="此部门名已存在!")
{
alert("请重新输入!")
document.new_dept.name.focus();
}
}
else if(op=="2")
{
document.getElementById("dept_l").innerHTML=xmlobj.responseText;
}
}
// 发送请求
ajaxobj.send("deptmt_back.asp?hi="+num+"&op="+op);
}
//-->
</SCRIPT>
<form action="deptmt.asp?op=6" method="post" name="new_dept" onSubmit="return Validator.Validate(this,2)">
<table width="87%" border="1" align="center" cellpadding="10" cellspacing="0" class="table1">
<tr align="center">
<td width="17%" class="td1"><span class="STYLE1">部门ID:</span></td>
<td width="16%" colspan="2"> <div align="left">
此项为系统自动分配
</div></td>
<td width="12%"class="td1"><span class="STYLE1">部门名称:</span></td>
<td width="21%" colspan="2" align="left">
<input type="text" size="16" name="name" onBlur="ajaxfuct(document.new_dept.name.value,'1')" dataType="CEN" msg="部门名称输入无效字符" onkeyup="testlen(this,10,0)">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -