|
|
|
@ -6,7 +6,8 @@
|
|
|
|
|
<title>添加部门</title>
|
|
|
|
|
<meta name="renderer" content="webkit">
|
|
|
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
|
|
|
|
<meta name="viewport"
|
|
|
|
|
content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
|
|
|
|
<link rel="stylesheet" href="../../static/css/font.css">
|
|
|
|
|
<link rel="stylesheet" href="../../static/css/weadmin.css">
|
|
|
|
|
<link rel="stylesheet" href="../../lib/layui/css/layui.css">
|
|
|
|
@ -24,7 +25,7 @@
|
|
|
|
|
border-radius: 3px;
|
|
|
|
|
font-size: 15px;
|
|
|
|
|
padding-left: 6px;
|
|
|
|
|
color:#666;
|
|
|
|
|
color: #666;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
</head>
|
|
|
|
@ -32,14 +33,15 @@
|
|
|
|
|
<body>
|
|
|
|
|
<div class="weadmin-body">
|
|
|
|
|
<form class="layui-form">
|
|
|
|
|
<div class="layui-form-item">
|
|
|
|
|
<label for="name" class="layui-form-label">
|
|
|
|
|
<span class="we-red">*</span>部门名称:
|
|
|
|
|
</label>
|
|
|
|
|
<div class="layui-input-inline textinput">
|
|
|
|
|
<input type="text" id="name" name="name" lay-verify="required|contentLength" min="2" max="64" autocomplete="off" class="layui-input">
|
|
|
|
|
<div class="layui-form-item">
|
|
|
|
|
<label for="name" class="layui-form-label">
|
|
|
|
|
<span class="we-red">*</span>部门名称:
|
|
|
|
|
</label>
|
|
|
|
|
<div class="layui-input-inline textinput">
|
|
|
|
|
<input type="text" id="name" name="name" lay-verify="required|contentLength" min="2" max="64"
|
|
|
|
|
autocomplete="off" class="layui-input">
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="layui-form-item">
|
|
|
|
|
<label for="name" class="layui-form-label">
|
|
|
|
|
<span class="we-red">*</span>部门类型:
|
|
|
|
@ -50,103 +52,114 @@
|
|
|
|
|
</select>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="layui-form-item">
|
|
|
|
|
<label for="sort_id" class="layui-form-label">
|
|
|
|
|
<span class="we-red">*</span>排序号:
|
|
|
|
|
</label>
|
|
|
|
|
<div class="layui-input-inline textinput">
|
|
|
|
|
<input type="text" id="sort_id" name="sort_id" lay-verify="required|number|contentLength" max="6" autocomplete="off" class="layui-input">
|
|
|
|
|
<div class="layui-form-item">
|
|
|
|
|
<label for="sort_id" class="layui-form-label">
|
|
|
|
|
<span class="we-red">*</span>排序号:
|
|
|
|
|
</label>
|
|
|
|
|
<div class="layui-input-inline textinput">
|
|
|
|
|
<input type="text" id="sort_id" name="sort_id" lay-verify="required|number|contentLength" max="6"
|
|
|
|
|
autocomplete="off" class="layui-input">
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="layui-form-item">
|
|
|
|
|
<label for="" class="layui-form-label">
|
|
|
|
|
</label>
|
|
|
|
|
<button class="layui-btn" lay-filter="add" lay-submit="" id="save">确定</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="layui-form-item">
|
|
|
|
|
<label for="" class="layui-form-label">
|
|
|
|
|
</label>
|
|
|
|
|
<button class="layui-btn" lay-filter="add" lay-submit="" id="save">确定</button>
|
|
|
|
|
</div>
|
|
|
|
|
</form>
|
|
|
|
|
</div>
|
|
|
|
|
<script src="../../lib/layui/layui.js" ></script>
|
|
|
|
|
<script src="../../lib/layui/layui.js"></script>
|
|
|
|
|
<script src="../../lib/template.js"></script>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
layui.extend({
|
|
|
|
|
admin: '{/}../../static/js/admin'
|
|
|
|
|
});
|
|
|
|
|
layui.use(['form','jquery','admin', 'layer'], function() {
|
|
|
|
|
layui.use(['form', 'jquery', 'admin', 'layer'], function () {
|
|
|
|
|
var form = layui.form,
|
|
|
|
|
$ = layui.jquery,
|
|
|
|
|
admin = layui.admin,
|
|
|
|
|
layer = layui.layer;
|
|
|
|
|
var area_id="";
|
|
|
|
|
var level_id="";
|
|
|
|
|
var area_id = "";
|
|
|
|
|
var level_id = "";
|
|
|
|
|
var org_id = GetQueryString("org_id");
|
|
|
|
|
var parent_id = GetQueryString("parent_id");
|
|
|
|
|
var org_type_id = GetQueryString("org_type");
|
|
|
|
|
var school_type_id = GetQueryString("school_type");
|
|
|
|
|
|
|
|
|
|
if(school_type_id != "361" && school_type_id != "451")
|
|
|
|
|
{
|
|
|
|
|
console.log(school_type_id);
|
|
|
|
|
if (school_type_id != "361" && school_type_id != "451") {
|
|
|
|
|
$('#orgType').append(`
|
|
|
|
|
<option value="0">部门</option>
|
|
|
|
|
`)
|
|
|
|
|
form.render();
|
|
|
|
|
}else{
|
|
|
|
|
console.log("222222222");
|
|
|
|
|
$('#orgType').append(`
|
|
|
|
|
} else {
|
|
|
|
|
console.log("111111");
|
|
|
|
|
console.log(parent_id);
|
|
|
|
|
console.log("111111");
|
|
|
|
|
if (parent_id == "0") {
|
|
|
|
|
$('#orgType').append(`
|
|
|
|
|
<option value="0">部门</option>
|
|
|
|
|
<option value="1">院系</option>
|
|
|
|
|
<option value="2">专业</option>
|
|
|
|
|
`)
|
|
|
|
|
} else {
|
|
|
|
|
if (org_type_id == "0") {
|
|
|
|
|
$('#orgType').append(`
|
|
|
|
|
<option value="0">部门</option>
|
|
|
|
|
`)
|
|
|
|
|
} else {
|
|
|
|
|
if (org_type_id == "1") {
|
|
|
|
|
$('#orgType').append(`
|
|
|
|
|
<option value="0">部门</option>
|
|
|
|
|
<option value="2">专业</option>
|
|
|
|
|
`)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
form.render();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$("#name").focus();
|
|
|
|
|
verifyLength();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//监听提交
|
|
|
|
|
form.on('submit(add)', function(data) {
|
|
|
|
|
form.on('submit(add)', function (data) {
|
|
|
|
|
var orgType = data.field.orgType;
|
|
|
|
|
var org_name=$("#name").val();
|
|
|
|
|
var sort_id=$("#sort_id").val();
|
|
|
|
|
var org_name = $("#name").val();
|
|
|
|
|
var sort_id = $("#sort_id").val();
|
|
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
type : "POST",
|
|
|
|
|
async : false,
|
|
|
|
|
dataType : "json",
|
|
|
|
|
url :"/FengHuang/organization/addOrg",
|
|
|
|
|
data:{
|
|
|
|
|
org_name:org_name,
|
|
|
|
|
parent_org_id:org_id,
|
|
|
|
|
sort_id:sort_id,
|
|
|
|
|
department_type_id:orgType
|
|
|
|
|
type: "POST",
|
|
|
|
|
async: false,
|
|
|
|
|
dataType: "json",
|
|
|
|
|
url: "/FengHuang/organization/addOrg",
|
|
|
|
|
data: {
|
|
|
|
|
org_name: org_name,
|
|
|
|
|
parent_org_id: org_id,
|
|
|
|
|
sort_id: sort_id,
|
|
|
|
|
department_type_id: orgType
|
|
|
|
|
},
|
|
|
|
|
success : function(data) {
|
|
|
|
|
if(data.success){
|
|
|
|
|
layer.msg("增加成功", {icon: 1,time:1000,shade : [0.5 , '#000' , true]}, function() {
|
|
|
|
|
success: function (data) {
|
|
|
|
|
if (data.success) {
|
|
|
|
|
layer.msg("增加成功", {icon: 1, time: 1000, shade: [0.5, '#000', true]}, function () {
|
|
|
|
|
var index = parent.layer.getFrameIndex(window.name);
|
|
|
|
|
parent.layer.close(index);
|
|
|
|
|
window.parent.loadTree();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
layer.alert(data.message, {icon: 0})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|