|
|
<!DOCTYPE html>
|
|
|
<html>
|
|
|
|
|
|
<head>
|
|
|
<meta charset="UTF-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">
|
|
|
<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">
|
|
|
<!-- 让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>
|
|
|
select {
|
|
|
width: 180px;
|
|
|
height: 38px;
|
|
|
line-height: 38px;
|
|
|
border: 1px solid #ccc;
|
|
|
border-radius: 3px;
|
|
|
font-size: 15px;
|
|
|
padding-left: 6px;
|
|
|
color:#666;
|
|
|
}
|
|
|
</style>
|
|
|
</head>
|
|
|
|
|
|
<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>
|
|
|
</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>
|
|
|
</div>
|
|
|
<div class="layui-form-item">
|
|
|
<label for="" class="layui-form-label">
|
|
|
</label>
|
|
|
<button class="layui-btn" lay-filter="save" lay-submit="" id="save">确定</button>
|
|
|
</div>
|
|
|
</form>
|
|
|
</div>
|
|
|
<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() {
|
|
|
var form = layui.form,
|
|
|
$ = layui.jquery,
|
|
|
admin = layui.admin,
|
|
|
layer = layui.layer;
|
|
|
var org_id=GetQueryString("org_id");
|
|
|
var dep_id=GetQueryString("dep_id");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
window.getOrgInfoById=function (id) {
|
|
|
$.ajax({
|
|
|
type:"GET",
|
|
|
dataType:"json",
|
|
|
url:"/FengHuang/organization/getOrgInfoById?org_id="+id,
|
|
|
success:function (data) {
|
|
|
$("#name").val(data.data[0].org_name);
|
|
|
// $("#code").val(data.data[0].org_code);
|
|
|
$("#sort_id").val(data.data[0].sort_id);
|
|
|
// setTimeout(function () {
|
|
|
// $("#sel3 option[value='"+data.data[0].parent_id+"']").attr("selected",true);
|
|
|
// $("#sel3").attr("disabled",true);
|
|
|
// },10)
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
|
|
|
$(function () {
|
|
|
getOrgInfoById(dep_id);
|
|
|
})
|
|
|
|
|
|
$("#name").focus();
|
|
|
verifyLength();
|
|
|
|
|
|
|
|
|
//监听提交
|
|
|
form.on('submit(save)', function(data) {
|
|
|
var org_name=$("#name").val();
|
|
|
var sort_id=$("#sort_id").val();
|
|
|
// if(org_name==""){
|
|
|
// layer.alert("请输入部门名称",{icon:0})
|
|
|
// return;
|
|
|
// }
|
|
|
// if(sort_id==""){
|
|
|
// layer.alert("请输入排序号",{icon:0})
|
|
|
// return;
|
|
|
// }
|
|
|
|
|
|
$.ajax({
|
|
|
type : "POST",
|
|
|
async : false,
|
|
|
dataType : "json",
|
|
|
url :"/FengHuang/organization/updateOrg",
|
|
|
data:{
|
|
|
org_id:dep_id,
|
|
|
org_name:org_name,
|
|
|
parent_org_id:org_id,
|
|
|
sort_id:sort_id,
|
|
|
main_school_id:-1,
|
|
|
master_id:-1,
|
|
|
},
|
|
|
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{
|
|
|
layer.alert(data.message, {icon: 0})
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
return false;
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
</script>
|
|
|
</body>
|
|
|
|
|
|
</html> |