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.
150 lines
4.9 KiB
150 lines
4.9 KiB
<!DOCTYPE html>
|
|
<html lang="en">
|
|
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title></title>
|
|
<link rel="stylesheet" href="../../../component/pear/css/pear.css" />
|
|
<link rel="stylesheet" href="../../../component/ztree/zTreeStyle.css">
|
|
<style>
|
|
.require-star {
|
|
position: absolute;
|
|
width: 3px;
|
|
height: 14px;
|
|
background-color: #ea4335;
|
|
top: 12px;
|
|
right: 8px;
|
|
border-radius: 1.5px;
|
|
}
|
|
|
|
.input-width {
|
|
max-width: 455px
|
|
}
|
|
|
|
.layui-form-select {
|
|
width: 455px;
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body>
|
|
<form class="layui-form" action="">
|
|
<div class="mainBox">
|
|
<div class='ztree' id='mytree' style="margin-top: 10px;margin-left:10px"></div>
|
|
</div>
|
|
|
|
<div class="bottom">
|
|
<div class="button-container">
|
|
<button type="submit" class="pear-btn pear-btn-primary pear-btn-sm" lay-submit="" lay-filter="save">
|
|
<i class="layui-icon layui-icon-ok"></i>
|
|
提交
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
<script src="../../../component/layui/layui.js"></script>
|
|
<script src="../../../component/pear/pear.js"></script>
|
|
<script src="../../../admin/js/jquery-3.6.0.min.js"></script>
|
|
<script src="../../../component/ztree/jquery.ztree.core-3.5.min.js"></script>
|
|
<script src="../../../component/ztree/jquery.ztree.exedit-3.5.min.js"></script>
|
|
<script>
|
|
layui.use(['form', 'jquery', 'laytpl', 'laydate'], function () {
|
|
var form = layui.form;
|
|
var $ = layui.jquery;
|
|
|
|
|
|
var bureauId = GetQueryString("bureau_id");
|
|
var personId = GetQueryString("person_id");
|
|
var orgId = "";
|
|
|
|
var ztreeSetting = {
|
|
view: {
|
|
selectedMulti: false
|
|
},
|
|
data: {
|
|
simpleData: {
|
|
enable: true,
|
|
idKey: "org_id",
|
|
pIdKey: "parent_id",
|
|
rootPId: 0
|
|
},
|
|
key: {
|
|
name: "org_name"
|
|
}
|
|
},
|
|
callback: {
|
|
onClick: zTreeOnClick,
|
|
}
|
|
};
|
|
|
|
$.ajax({
|
|
type: "GET",
|
|
async: false,
|
|
url: '/QingLong/organization/getOrgTreeByBureauId?bureau_id=' + bureauId,
|
|
dataType: "json",
|
|
success: function (data) {
|
|
if (data.code == 0) {
|
|
var zTreeObj = $.fn.zTree.init($("#mytree"), ztreeSetting, data.data);
|
|
zTreeObj.expandAll(true);
|
|
}
|
|
}
|
|
});
|
|
|
|
function zTreeOnClick(event, treeId, treeNode) {
|
|
orgId = treeNode.org_id;
|
|
}
|
|
|
|
form.on('submit(save)', function (data) {
|
|
if (orgId == "") {
|
|
layer.msg("请选择调转部门!", {
|
|
icon: 2,
|
|
time: 1300
|
|
});
|
|
return false;
|
|
}
|
|
|
|
$.ajax({
|
|
url: "/QingLong/teacherYd/changeTransferPersonByAdmin",
|
|
data: {
|
|
"org_id": orgId,
|
|
"person_id": personId
|
|
},
|
|
type: 'post',
|
|
success: function (result) {
|
|
if (result.success) {
|
|
layer.msg("调转成功!", {
|
|
icon: 1,
|
|
time: 1300
|
|
}, function () {
|
|
parent.layer.close(parent.layer.getFrameIndex(window.name));
|
|
// parent.layui.table.reload("data-table");
|
|
parent.closeLayer();
|
|
});
|
|
} else {
|
|
layer.msg(result.message, {
|
|
icon: 2,
|
|
time: 2000
|
|
});
|
|
}
|
|
}
|
|
});
|
|
return false;
|
|
});
|
|
|
|
|
|
|
|
function GetQueryString(name, istop) {
|
|
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
|
|
var r = window.location.search.substr(1).match(reg);
|
|
if (typeof (istop) != "undefined") r = top.location.search.substr(1).match(reg);
|
|
|
|
if (r != null) return unescape(r[2]);
|
|
return null;
|
|
}
|
|
|
|
});
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html> |