|
|
|
@ -42,27 +42,16 @@
|
|
|
|
|
<script type="text/html" id="table-toolbar">
|
|
|
|
|
|
|
|
|
|
<button class="pear-btn pear-btn-primary pear-btn-md" lay-event="add">
|
|
|
|
|
<i class="layui-icon layui-icon-add-1"></i>
|
|
|
|
|
新增
|
|
|
|
|
<i class="layui-icon layui-icon-success"></i>
|
|
|
|
|
确认当前学期数据
|
|
|
|
|
</button>
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<script type="text/html" id="table-bar">
|
|
|
|
|
|
|
|
|
|
<span class="woo-tool-span woo-tool-text-span" data-tool-sort="120" lay-event="edit"><a
|
|
|
|
|
class="woo-theme-color">编辑</a></span>
|
|
|
|
|
<span class="woo-tool-span woo-tool-text-span" lay-event="viewSign"><a
|
|
|
|
|
class="woo-theme-color">查看签名</a></span>
|
|
|
|
|
|
|
|
|
|
<i class="woo-tool-text-delimiter"></i>
|
|
|
|
|
<span class="woo-tool-span woo-tool-text-span" data-tool-sort="120" lay-event="remove"><a
|
|
|
|
|
class="woo-theme-color">删除</a></span>
|
|
|
|
|
|
|
|
|
|
<i class="woo-tool-text-delimiter"></i>
|
|
|
|
|
<span class="woo-tool-span woo-tool-text-span" data-tool-sort="120" lay-event="orgMgmt"><a
|
|
|
|
|
class="woo-theme-color">部门维护</a></span>
|
|
|
|
|
|
|
|
|
|
<i class="woo-tool-text-delimiter"></i>
|
|
|
|
|
<span class="woo-tool-span woo-tool-text-span" data-tool-sort="120" lay-event="personMgmt"><a
|
|
|
|
|
class="woo-theme-color">人员维护</a></span>
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
@ -71,91 +60,12 @@
|
|
|
|
|
<script src="../../../component/pear/base64.js"></script>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
layui.use(['table', 'form', 'jquery', 'common', 'dtree', 'laytpl'], function () {
|
|
|
|
|
layui.use(['table', 'form', 'jquery', 'laytpl'], function () {
|
|
|
|
|
var table = layui.table;
|
|
|
|
|
var form = layui.form;
|
|
|
|
|
var $ = layui.jquery;
|
|
|
|
|
var common = layui.common;
|
|
|
|
|
var dtree = layui.dtree;
|
|
|
|
|
var laytpl = layui.laytpl;
|
|
|
|
|
|
|
|
|
|
var areaId = "0";
|
|
|
|
|
var levelId = "0";
|
|
|
|
|
var selectAreaId = "0";
|
|
|
|
|
var editH = "385px";
|
|
|
|
|
|
|
|
|
|
//获取登录人员信息
|
|
|
|
|
var loginPersonInfo = getPersonLoginInfo($);
|
|
|
|
|
if (loginPersonInfo.identity_id == "1") {
|
|
|
|
|
editH = "435px";
|
|
|
|
|
$("#selectTreeDiv").show();
|
|
|
|
|
var globalInfo = getGlobalInfo($, Base64.encode("install_area"));
|
|
|
|
|
areaId = globalInfo.data[0].global_value;
|
|
|
|
|
levelId = "2";
|
|
|
|
|
selectTreeRender(areaId);
|
|
|
|
|
selectOrgTypeRender();
|
|
|
|
|
} else if (loginPersonInfo.identity_id == 2) {
|
|
|
|
|
areaId = loginPersonInfo.city_id;
|
|
|
|
|
levelId = "2";
|
|
|
|
|
selectTreeRender(areaId);
|
|
|
|
|
selectOrgTypeRender();
|
|
|
|
|
} else {
|
|
|
|
|
areaId = loginPersonInfo.area_id;
|
|
|
|
|
levelId = "3";
|
|
|
|
|
selectTreeRender(areaId);
|
|
|
|
|
selectOrgTypeRender();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//单位类型
|
|
|
|
|
function selectOrgTypeRender() {
|
|
|
|
|
$.ajax({
|
|
|
|
|
type: "GET",
|
|
|
|
|
async: false,
|
|
|
|
|
url: "/QingLong/base/getOrgTypePrincipalshipForTreeTable?is_school=0&parent_id=" + levelId,
|
|
|
|
|
success: function (res) {
|
|
|
|
|
var orgTypeSelectTpl = orgTypeScript.innerHTML,
|
|
|
|
|
orgTypeView = document.getElementById('orgTypeView');
|
|
|
|
|
laytpl(orgTypeSelectTpl).render(res.data, function (html) {
|
|
|
|
|
orgTypeView.innerHTML = html;
|
|
|
|
|
});
|
|
|
|
|
form.render();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//下拉树
|
|
|
|
|
function selectTreeRender(areaId) {
|
|
|
|
|
dtree.render({
|
|
|
|
|
elem: "#selectTree",
|
|
|
|
|
selectInitVal: areaId,
|
|
|
|
|
initLevel: "2",
|
|
|
|
|
method: 'get',
|
|
|
|
|
url: "/QingLong/dm/getAreaNew?parent_id=" + areaId,
|
|
|
|
|
select: true,
|
|
|
|
|
icon: "-1",
|
|
|
|
|
selectInputName: {
|
|
|
|
|
recordData: "recordData"
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
dtree.on('node("selectTree")', function (obj) {
|
|
|
|
|
if (obj.param.leaf) {
|
|
|
|
|
levelId = "3";
|
|
|
|
|
} else {
|
|
|
|
|
levelId = "2";
|
|
|
|
|
}
|
|
|
|
|
selectOrgTypeRender();
|
|
|
|
|
// var param = dtree.selectVal("selectTree");
|
|
|
|
|
areaId = obj.param.nodeId;
|
|
|
|
|
tableRender();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
form.on('select(orgTypeId)', function (data) {
|
|
|
|
|
tableRender();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
tableRender();
|
|
|
|
|
|
|
|
|
|
function tableRender() {
|
|
|
|
@ -234,70 +144,9 @@
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
window.remove = function (obj) {
|
|
|
|
|
layer.confirm('确定要删除该单位吗?', {
|
|
|
|
|
icon: 3,
|
|
|
|
|
title: '提示'
|
|
|
|
|
}, function (index) {
|
|
|
|
|
layer.close(index);
|
|
|
|
|
let loading = layer.load();
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "/QingLong/organization/deleteBureauById",
|
|
|
|
|
data: { bureau_id: obj.data.org_id },
|
|
|
|
|
type: 'post',
|
|
|
|
|
success: function (result) {
|
|
|
|
|
layer.close(loading);
|
|
|
|
|
if (result.success) {
|
|
|
|
|
layer.msg('成功删除!', {
|
|
|
|
|
icon: 1,
|
|
|
|
|
time: 1000
|
|
|
|
|
}, function () {
|
|
|
|
|
table.reload('data-table');
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
layer.msg(result.message, {
|
|
|
|
|
icon: 2,
|
|
|
|
|
time: 1000
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
error: function (xhr, status, error) {
|
|
|
|
|
layer.close(loading);
|
|
|
|
|
console.log('请求出错:' + error + ',' + status);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
window.orgMgmt = function (obj) {
|
|
|
|
|
var url = "/QingLong/view/ywgl/bmwh/index.html?level=" + levelId + "&area_id=" + areaId + "&org_id=" + obj.data.org_id;
|
|
|
|
|
parent.layui.admin.closeTab('bmwh');
|
|
|
|
|
parent.layui.admin.addTab('bmwh', "部门维护", url)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
window.personMgmt = function (obj) {
|
|
|
|
|
var url = "/QingLong/view/ywgl/rywh/index.html?bureau_id=" + obj.data.org_id;
|
|
|
|
|
parent.layui.admin.closeTab('rywh');
|
|
|
|
|
parent.layui.admin.addTab('rywh', "人员维护", url)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
window.refresh = function (param) {
|
|
|
|
|
table.reload('data-table');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//获取随机数
|
|
|
|
|
window.randomFrom = function (lowerValue, upperValue) {
|
|
|
|
|
return Math.floor(Math.random() * (upperValue - lowerValue + 1) + lowerValue);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//点击任何地方关闭下拉树
|
|
|
|
|
$("body").on("click", function (event) {
|
|
|
|
|
$("div[dtree-id][dtree-select]").removeClass("layui-form-selected");
|
|
|
|
|
$("div[dtree-id][dtree-card]").removeClass("dtree-select-show layui-anim layui-anim-upbit");
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
</body>
|
|
|
|
|