You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

584 lines
25 KiB

11 months ago
<!DOCTYPE html>
<html lang="en">
10 months ago
11 months ago
<head>
<meta charset="UTF-8">
4 months ago
<title>人员信息管理</title>
11 months ago
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
10 months ago
content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
11 months ago
<link rel="stylesheet" href="../../static/css/font.css">
<link rel="stylesheet" href="../../static/css/weadmin.css">
<link rel="stylesheet" href="../../lib/ztree/zTreeStyle.css">
<!-- 让IE8/9支持媒体查询从而兼容栅格 -->
<!--[if lt IE 9]>
<script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
<script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<style>
.inline {
display: inline-block;
vertical-align: top;
}
.layui-table-body {
/*max-height: 400px;*/
overflow-y: auto;
}
10 months ago
11 months ago
#searchTxt {
width: 180px;
border: 1px solid #dedede;
border-radius: 3px;
height: 37px;
padding-left: 13px;
vertical-align: top;
}
10 months ago
11 months ago
#search {
border: none;
margin-left: 12px;
}
10 months ago
11 months ago
#iconDel {
position: absolute;
10 months ago
right: 92px;
top: 10px;
11 months ago
display: none;
}
10 months ago
11 months ago
.aaa {
background-color: #FBFBFB;
10 months ago
border: 1px solid #e6e6e6;
color: #C9C9C9;
11 months ago
cursor: not-allowed;
opacity: 1;
}
</style>
</head>
10 months ago
11 months ago
<body>
10 months ago
<div class="weadmin-nav">
11 months ago
<span class="layui-breadcrumb" id="super">
<a href="">首页</a>
<a href="">业务管理</a>
<a href="">单位维护</a>
<a>
4 months ago
<cite>人员信息管理</cite></a>
11 months ago
</span>
<span class="layui-breadcrumb" id="other">
10 months ago
<a href="">首页</a>
<a href="">业务管理</a>
<a>
4 months ago
<cite>人员信息管理</cite></a>
10 months ago
</span>
<a class="layui-btn layui-btn-sm" style="line-height:1.6em;margin-top:3px;float:right"
href="javascript:location.replace(location.href);" title="刷新">
<i class="layui-icon layui-icon-refresh-3" style="line-height:30px"></i>
</a>
</div>
<div class="weadmin-body">
<table border=0 align=left width="100%">
<tr>
<td align=left valign=top style="BORDER-RIGHT: #999999 1px dashed;width:170px" id="first_td">
<div class="selectModel" id="treeDiv">
<div class='pc_selectModel_tree'>
<div class='ztree' id='mytree'></div>
11 months ago
</div>
10 months ago
</div>
</td>
<td align=left valign=top style="padding-left:10px">
<form class="layui-form" lay-filter="listForm">
<div class="layui-input-inline" style="float: left;margin:0 0 5px 0">
4 months ago
<input type="text" value="" id="searchTxt" placeholder="请输入姓名"><i class="layui-icon"
10 months ago
id="iconDel">×</i>
<buttin class="layui-btn" id="search">搜索</buttin>
11 months ago
</div>
10 months ago
<div style="float:right">
<div class="layui-btn add" onclick="addOrg();" type="button"><i class="layui-icon"></i>添加
11 months ago
</div>
10 months ago
<div class="layui-btn layui-btn-warm switchBtn" data-type="switchDepartMent" type="button">
<span class="layui-icon layui-icon-shrink-right"></span>调整部门
</div>
<div class="layui-btn layui-btn-danger delBtn" data-type="getCheckLength" type="button"><i
class="layui-icon"></i>批量删除
</div>
<div class="layui-btn layui-btn-normal exportBtn" data-type="export" type="button">
<span class="layui-icon layui-icon-download-circle"></span>导出全部账号
</div>
<span id="importAcc" style="display:none;">
<div class="layui-btn add" onclick="importTemplate();" type="button"><i
class="layui-icon"></i>下载导入模板</div>
<div class="layui-btn layui-btn-warm" type="button" onclick="importExcel();">
<span class="layui-icon layui-icon-shrink-right"></span>导入excel
</div>
</span>
<!--
11 months ago
<div class="layui-btn layui-btn-normal" onclick="backList();" >
<span class="layui-icon layui-icon-return hide"></span>返回
</div>
-->
10 months ago
</div>
<div class="layui-form-item">
<table class="layui-table" lay-filter="demo" id="idTest"></table>
<script type="text/html" id="barDemo">
11 months ago
<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
10 months ago
<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="res">配置资源</a>
11 months ago
<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="resetpwd">重置密码</a>
10 months ago
<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="unBind">微信解绑</a>
10 months ago
<!--
11 months ago
{{#if(d.apply_status==1){ }}
10 months ago
//<a class="layui-btn layui-btn-normal layui-btn-xs aaa" title="正在进行调转,不能进行其它操作">调转申请</a>
//<a class="layui-btn layui-btn-normal layui-btn-xs aaa" title="正在进行调转,不能进行其它操作">异动处理</a>
11 months ago
{{#}else{ }}
10 months ago
//<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="transferApply">调转申请</a>
//<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="changeStatus">异动处理</a>
11 months ago
{{#} }}
10 months ago
-->
11 months ago
</script>
10 months ago
</div>
<input type="hidden" value="" id="dep_id">
<input type="hidden" value="" id="click_id">
</form>
</td>
</tr>
</table>
</div>
<script src="../../lib/layui/layui.js"></script>
<script>
layui.extend({
admin: '{/}../../static/js/admin'
});
layui.use(['form', 'jquery', 'admin', 'table', 'laytpl'], function () {
var form = layui.form,
$ = layui.jquery,
admin = layui.admin,
table = layui.table,
laytpl = layui.laytpl;
var org_id = "";
var area_id = GetQueryString('area_id');
var org_type_id = GetQueryString('org_type_id');//单位类型iD
var setting1 = {
view: {
selectedMulti: false
},
data: {
simpleData: {
enable: true,
idKey: "org_id",
pIdKey: "parent_id",
rootPId: 0
}
},
callback: {
onClick: zTreeOnClick,
11 months ago
}
10 months ago
};
var org_id = "";
var info = getcookie();
// 超管 单位管理员 显示教师导入
if (info.identity_id == 1 || info.identity_id == 4) {
$("#importAcc").show();
11 months ago
}
10 months ago
// 加载部门树
$(function () {
if (getcookie().identity_id == 4) {//单位管理员
org_id = getcookie().bureau_id;
$("#super").hide();
$("#other").show();
} else {
org_id = GetQueryString('org_id');
$("#super").show();
$("#other").hide();
}
$.getScript("../../lib/jquery-3.6.0.min.js").done(function () {
$.getScript("../../lib/ztree/jquery.ztree.core-3.5.min.js").done(function () {
$.ajax({
type: "GET",
async: false,
url: '/dsBase/organization/getOrgTreeByBureauId?bureau_id=' + org_id,
dataType: "json",
success: function (data) {
if (data.code == 0) {
for (var i = 0; i < data.data.length; i++) {
data.data[i].name = data.data[i].org_name;
}
var zNodes = data.data;
var jquery = window.$.fn.zTree;
jquery.init($("#mytree"), setting1, zNodes);
var treeObj = jquery.getZTreeObj("mytree");
$("#dep_id").val(org_id);
var parentNode = "";
if ($("#click_id").val() !== "") {
getTeaList($("#click_id").val());
parentNode = treeObj.getNodeByParam("org_id", $("#click_id").val());// 选中指定节点
} else {
parentNode = treeObj.getNodeByParam("org_id", $("#dep_id").val());// 选中指定节点
getTeaList(org_id);
}
treeObj.selectNode(parentNode);
// var firNodeId = treeObj.getNodes()[0].id;
// var t = jquery.init($("#mytree"), setting1, zNodes);
// var node = t.getNodeByParam("id", org_id);
// console.log(node);
// t.selectNode(node, true);
treeObj.expandAll(true);
// var nodes = treeObj.getSelectedNodes();
//getList(nodes[0].bureau_id);
11 months ago
10 months ago
}
11 months ago
}
10 months ago
});
11 months ago
10 months ago
})
11 months ago
})
10 months ago
});
11 months ago
10 months ago
$("#treeDiv").height($(window).height() - 80);
11 months ago
10 months ago
// 点击区划树
function zTreeOnClick(event, treeId, treeNode) {
console.log(treeNode.org_id);
$("#dep_id").val(treeNode.org_id);
$("#click_id").val(treeNode.org_id);
getTeaList(treeNode.org_id);
11 months ago
10 months ago
}
11 months ago
10 months ago
// 根节点 bureau_id获取列表
function getList(id) {
table.render({
elem: '#idTest'
, url: '/dsBase/teacher/getTeacherListByBureauId'
, where: {
bureau_id: id
}
, cols: [[
{ type: 'checkbox', fixed: 'left', align: 'center' }
, { field: '', title: '序号', align: 'center', type: 'numbers', width: 80, fixed: true }
4 months ago
, { field: 'person_name', title: '姓名', align: 'center' }
, { field: 'telephone', title: '手机号', align: 'center' }
10 months ago
, { field: 'xb', title: '性别', align: 'center' }
, { field: 'login_name', title: '登录名', align: 'center' }
, { field: 'original_pwd', title: '初始密码', align: 'center' }
, { fixed: 'right', title: '操作', toolbar: '#barDemo', align: 'center', width: 280, fixed: 'right' }
]]
, page: true
, height: 'full'
, done: function () {
$("[data-field='xb']").children().each(function () {
if ($(this).text() == '1') {
$(this).text("男")
} else if ($(this).text() == '2') {
$(this).text("女")
}
})
}
});
}
11 months ago
10 months ago
// org_id获取列表
function getTeaList(id) {
// 教师列表渲染
table.render({
elem: '#idTest'
, url: '/dsBase/teacher/getTeacherListByOrgId'
, where: {
org_id: id,
person_name: $("#searchTxt").val()
}
, cols: [[
{ type: 'checkbox', fixed: 'left', align: 'center' }
4 months ago
, { field: '', title: '序号', align: 'center', type: 'numbers', width: 50, fixed: true }
, { field: 'person_name', title: '姓名', align: 'center' }
10 months ago
, { field: 'xb', title: '性别', align: 'center' }
4 months ago
, { field: 'telephone', title: '手机号', align: 'center' }
10 months ago
, { field: 'login_name', title: '登录名', align: 'center' }
, { field: 'original_pwd', title: '初始密码', align: 'center' }
4 months ago
, { fixed: 'right', title: '操作', toolbar: '#barDemo', align: 'center', width: 340, fixed: 'right' }
10 months ago
]]
, page: true
, done: function () {
$("[data-field='xb']").children().each(function () {
if ($(this).text() == '1') {
$(this).text("男")
} else if ($(this).text() == '2') {
$(this).text("女")
}
})
$(".aaa").hover(function () {
$(this).css('color', '#C9C9C9')
}, function () {
11 months ago
10 months ago
})
}
11 months ago
});
}
10 months ago
window.backList = function () {
window.location.href = document.referrer;
return false;
11 months ago
}
10 months ago
table.on('tool(demo)', function (obj) {
var data = obj.data;
console.log(data)
if (obj.event === 'del') {
layer.confirm('确定删除 ' + data.person_name + ' 吗?', { icon: 0 }, function (index) {
del(data.person_id);
});
} else if (obj.event === 'edit') {
WeAdminShow('编辑', './edit.html?person_id=' + data.person_id + '&dep_id=' + $("#dep_id").val() + '&bureau_id=' + org_id, 550, window.height);
} else if (obj.event === 'res') {
10 months ago
WeAdminShow('配置资源', './duty.html?person_id=' + data.person_id, 800, 600);
10 months ago
} else if (obj.event === 'resetpwd') {
layer.confirm('确定重置 ' + data.person_name + ' 密码吗?', { icon: 0 }, function (index) {
resetPwd(data.person_id);
});
10 months ago
} else if (obj.event === 'unBind') {
layer.confirm('确定要将该用户的微信解绑吗?', { icon: 0 }, function (index) {
unBind(data.person_id);
});
10 months ago
} else if (obj.event === 'transferApply') {
var info = getcookie();
if (info.identity_id == 1) {
WeAdminShow('调转申请', './superTransferApply.html?person_id=' + data.person_id + '&bureau_id=' + org_id, 800, 630);
} else {
11 months ago
10 months ago
WeAdminShow('调转申请', './transferApply.html?person_id=' + data.person_id + '&bureau_id=' + org_id, 800, 630);
}
} else if (obj.event === 'changeStatus') {
WeAdminShow('异动处理', './changeStatus.html?person_id=' + data.person_id + '&bureau_id=' + org_id, 450, 330);
11 months ago
}
10 months ago
});
11 months ago
10 months ago
form.on('select(sel1)', function (data) {
$("#sel4").val(data.value);
table.reload('idTest', {
where: {
org_id: $("#sel1").val(),
person_name: $("#searchTxt").val()
}
, page: {
curr: 1
}
});
});
// 表格重载
window.reloadtable = function () {
console.log("sel1=" + $("#sel1").val())
table.reload('idTest', {
where: {
org_id: $("#sel1").val(),
person_name: $("#searchTxt").val()
}
, page: {
curr: 1
}
});
11 months ago
10 months ago
}
11 months ago
10 months ago
// 添加教师
window.addOrg = function () {
10 months ago
WeAdminShow('添加', './add.html?dep_id=' + $("#dep_id").val() + '&bureau_id=' + org_id, 550, 500);
11 months ago
10 months ago
}
11 months ago
10 months ago
// 删除教师
function del(ids) {
$.ajax({
type: "POST",
dataType: "json",
url: "/dsBase/teacher/deleteTeacher",
data: {
person_ids: ids
},
success: function (data) {
if (data.success) {
layer.msg("删除成功", { icon: 1, time: 2000, shade: 0.1 });
reloadtable();
} else {
layer.alert("删除失败", { icon: 0, time: 2000, shade: 0.1 });
}
11 months ago
10 months ago
},
error: function (data) {
return;
11 months ago
}
10 months ago
})
11 months ago
10 months ago
}
11 months ago
10 months ago
//重置密码
function resetPwd(ids) {
$.ajax({
type: "POST",
dataType: "json",
url: "/dsBase/loginPerson/ResetPwd",
data: {
person_id: ids
},
success: function (data) {
if (data.success) {
layer.msg("重置密码成功!", { icon: 1, time: 2000, shade: 0.1 });
reloadtable();
11 months ago
} else {
10 months ago
layer.alert(data.message, { icon: 0, time: 2000, shade: 0.1 });
11 months ago
}
10 months ago
11 months ago
}
10 months ago
})
}
11 months ago
10 months ago
function unBind(ids) {
$.ajax({
type: "POST",
dataType: "json",
url: "/dsBase/teacher/clearWxOpenId",
data: {
person_id: ids
},
success: function (data) {
if (data.success) {
layer.msg("微信解绑成功!", { icon: 1, time: 2000, shade: 0.1 });
reloadtable();
} else {
layer.alert(data.message, { icon: 0, time: 2000, shade: 0.1 });
}
}
})
}
10 months ago
// 批量删除教师
var active = {
getCheckLength: function () { //获取选中数目
var checkStatus = table.checkStatus('idTest')
, data = checkStatus.data;
console.log(data);
if (data.length == 0) {
4 months ago
layer.msg("请先选择要删除的人员!", { icon: 5, time: 2000 })
10 months ago
} else if (data.length > 0) {
var systemIds = "";
for (var i = 0; i < data.length; i++) {
if (i == data.length - 1) {
systemIds += data[i].person_id;
} else {
systemIds += data[i].person_id + ",";
}
}
if (data.length == 1) {
layer.confirm('确定删除 ' + data[0].person_name + ' 吗?', { icon: 0 }, function (index) {
del(systemIds);
});
11 months ago
} else {
10 months ago
layer.confirm('确定要批量删除' + data.length + '个教师吗?', { icon: 0 }, function (index) {
del(systemIds);
});
}
}
},
switchDepartMent: function () { //获取选中数目
var checkStatus = table.checkStatus('idTest')
, data = checkStatus.data;
console.log(data);
if (data.length == 0) {
4 months ago
layer.msg("请先选择要调整部门的人员!", { icon: 5, time: 2000 })
10 months ago
} else if (data.length > 0) {
var systemIds = "";
for (var i = 0; i < data.length; i++) {
if (i == data.length - 1) {
systemIds += data[i].person_id;
} else {
systemIds += data[i].person_id + ",";
}
11 months ago
}
10 months ago
WeAdminShow('调整部门', './setDepList.html?org_id=' + org_id + '&ids=' + systemIds, 350, window.height);
11 months ago
}
10 months ago
},
export: function () {
window.location.href = "/dsBase/teacher/getTeacherListByBureauIdForExcel?bureau_id=" + org_id;
11 months ago
}
10 months ago
};
11 months ago
10 months ago
$('.delBtn').on('click', function () {
var type = $(this).data('type');
active[type] ? active[type].call(this) : '';
});
$('.switchBtn').on('click', function () {
var type = $(this).data('type');
active[type] ? active[type].call(this) : '';
});
$('.exportBtn').on('click', function () {
var type = $(this).data('type');
active[type] ? active[type].call(this) : '';
});
11 months ago
10 months ago
// 搜索
$("#search").click(function () {
reloadtable();
})
$("#iconDel").click(function () {
if ($("#searchTxt").val() !== "") {
$("#searchTxt").val("");
$(this).hide();
}
11 months ago
reloadtable();
10 months ago
})
$("#searchTxt").blur(function () {
if ($("#searchTxt").val() !== "") {
$("#iconDel").show();
} else {
$("#iconDel").hide();
}
})
// 回车搜索
$("#searchTxt").keyup(function (e) {
if (e.keyCode == 13) {
reloadtable();
}
})
// 下载模板
window.importTemplate = function () {
window.location.href = '/dsBase/teacher/getImportTemplate';
}
// 导入excel
window.importExcel = function () {
4 months ago
WeAdminShow('导入人员', './importExcel.html?org_id=' + $("#dep_id").val() + "&identity=" + info.identity_id, 600, 300);
11 months ago
}
10 months ago
$(window).resize(function () {
console.log(window.height);
console.log(window.innerWidth);
$(".layui-table-view").css('width', window.innerWidth - 235);
$(".layui-table-view").height(window.height)
})
11 months ago
})
10 months ago
</script>
11 months ago
</body>
10 months ago
11 months ago
</html>