|
|
<!DOCTYPE html>
|
|
|
<html>
|
|
|
|
|
|
<head>
|
|
|
<meta charset="UTF-8">
|
|
|
<title>添加会员-WeAdmin Frame型后台管理系统-WeAdmin 1.0</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>
|
|
|
.layui-form-label {
|
|
|
width: 100px!important;
|
|
|
}
|
|
|
input[type='text'] {
|
|
|
width: 320px!important;
|
|
|
}
|
|
|
</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 ">
|
|
|
<input type="text" id="name" name="name" lay-verify="contentLength" max="10" min="2" autocomplete="off" class="layui-input">
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="layui-form-item hide" id="school">
|
|
|
<label for="name" class="layui-form-label">
|
|
|
<span class="we-red">*</span>学校分类:
|
|
|
</label>
|
|
|
<div class="layui-input-inline">
|
|
|
<span style="margin-right:55px">
|
|
|
<input type="radio" value="1" name="is_school" title="是" lay-verify="required">
|
|
|
</span>
|
|
|
<span >
|
|
|
<input type="radio" value="0" name="is_school" title="否" lay-verify="required" checked="checked">
|
|
|
</span>
|
|
|
</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 ">
|
|
|
<input type="text" id="sort_id" name="sort_id" lay-verify="required|number" autocomplete="off" class="layui-input">
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="layui-form-item">
|
|
|
<label for="code" class="layui-form-label">
|
|
|
<span class="we-red">*</span>编码:
|
|
|
</label>
|
|
|
<div class="layui-input-inline ">
|
|
|
<input type="text" id="code" name="code" lay-verify="contentLength" max="2" min="2" 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="">确定</button>
|
|
|
</div>
|
|
|
</form>
|
|
|
</div>
|
|
|
<script src="../../lib/layui/layui.js" charset="utf-8"></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 id;
|
|
|
$(function () {
|
|
|
id=GetQueryString("id");
|
|
|
level=GetQueryString("level");
|
|
|
console.log(level);
|
|
|
if(level==2){
|
|
|
$("#school").show();
|
|
|
}
|
|
|
})
|
|
|
verifyLength();
|
|
|
//监听提交
|
|
|
form.on('submit(add)', function(data) {
|
|
|
|
|
|
var f=data.field;
|
|
|
console.log(f);
|
|
|
var data={};
|
|
|
if(level==2){
|
|
|
data={
|
|
|
name:f.name,
|
|
|
parent_id:id,
|
|
|
sort_id:f.sort_id,
|
|
|
code:f.code,
|
|
|
is_school:f.is_school
|
|
|
}
|
|
|
}else{
|
|
|
data={
|
|
|
name:f.name,
|
|
|
parent_id:id,
|
|
|
sort_id:f.sort_id,
|
|
|
code:f.code
|
|
|
}
|
|
|
}
|
|
|
|
|
|
$.ajax({
|
|
|
type : "POST",
|
|
|
async : false,
|
|
|
dataType : "json",
|
|
|
url :"/FengHuang/base/addOrgTypePrincipalshipNode",
|
|
|
data:data,
|
|
|
success : function(data) {
|
|
|
if(data.success){
|
|
|
var nodeId=data.result["id"];
|
|
|
layer.msg("增加成功", {icon: 1,time:1000,shade : [0.5 , '#000' , true]},function() {
|
|
|
var index = parent.layer.getFrameIndex(window.name);
|
|
|
parent.layer.close(index);
|
|
|
// var html =window.parent.loadTr(nodeId);
|
|
|
window.parent.reloadTree(id,nodeId);
|
|
|
});
|
|
|
|
|
|
}else{
|
|
|
layer.alert(data.message, {icon: 0});
|
|
|
return false;
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
|
|
|
return false;
|
|
|
});
|
|
|
|
|
|
});
|
|
|
</script>
|
|
|
</body>
|
|
|
|
|
|
</html> |