mirror of https://gitee.com/stylefeng/guns
Merge branch 'master' of https://gitee.com/feng93/guns into 7.0.2-develop
# Conflicts: # src/main/webapp/assets/modular/system/organization/organization_edit.jspull/69/head
commit
5c5f28e20f
|
@ -14,7 +14,6 @@ layui.use(['form', 'admin', 'HttpRequest', 'xmSelect'], function () {
|
|||
|
||||
// 初始化组织树
|
||||
new HttpRequest(Feng.ctxPath + "/hrOrganization/tree", 'get', function (data) {
|
||||
console.log(result.data);
|
||||
organizationXmSel = xmSelect.render({
|
||||
el: '#organization',
|
||||
data: data.data,
|
||||
|
@ -33,11 +32,23 @@ layui.use(['form', 'admin', 'HttpRequest', 'xmSelect'], function () {
|
|||
});
|
||||
}).start();
|
||||
|
||||
var pId = organizationXmSel.getValue('valueStr');
|
||||
if (!pId) {
|
||||
$("#parentId").remove();
|
||||
}
|
||||
|
||||
//表单提交事件
|
||||
form.on('submit(btnSubmit)', function (data) {
|
||||
//获取机构id
|
||||
data.field.orgParentId = organizationXmSel.getValue('valueStr');
|
||||
|
||||
if (!pId) {
|
||||
data.field.orgParentId = "-1";
|
||||
}else {
|
||||
data.field.orgParentId = organizationXmSel.getValue('valueStr');
|
||||
}
|
||||
var orgId = $("[name = 'orgId']").val();
|
||||
if (orgId == data.field.orgParentId) {
|
||||
return Feng.error("不能选择本机构作为上级机构!");
|
||||
}
|
||||
var request = new HttpRequest(Feng.ctxPath + "/hrOrganization/edit", 'post', function (data) {
|
||||
admin.closeThisDialog();
|
||||
Feng.success("修改成功!");
|
||||
|
|
|
@ -174,7 +174,7 @@ layui.use(['layer', 'form', 'table', 'util', 'admin', 'tree', 'dropdown', 'xmSel
|
|||
{field: 'userId', hide: true, sort: true, title: '用户id'},
|
||||
{field: 'account', align: "center", sort: true, title: '账号'},
|
||||
{field: 'realName', align: "center", sort: true, title: '姓名'},
|
||||
{field: 'positionId', align: "center", sort: true, title: '职务'},
|
||||
{field: 'positionName', align: "center", sort: true, title: '职务'},
|
||||
{field: 'phone', align: "center", sort: true, title: '电话'},
|
||||
{field: 'status', align: "center", templet: '#statusTpl', title: '状态'},
|
||||
{title: '操作', toolbar: '#userTbBar', width: 300}
|
||||
|
|
|
@ -31,7 +31,6 @@ layui.use(['layer', 'form', 'admin', 'laydate', 'HttpRequest', 'xmSelect'], func
|
|||
positionXmSel = xmSelect.render({
|
||||
el: '#position',
|
||||
radio: true,
|
||||
layVerify: 'required',
|
||||
clickClose: true,
|
||||
data: data.data
|
||||
});
|
||||
|
@ -65,10 +64,10 @@ layui.use(['layer', 'form', 'admin', 'laydate', 'HttpRequest', 'xmSelect'], func
|
|||
Feng.success("添加成功!");
|
||||
admin.putTempData('formOk', true);
|
||||
}, function (data) {
|
||||
admin.closeThisDialog();
|
||||
Feng.error("添加失败!" + data.message);
|
||||
});
|
||||
request.set(data.field);
|
||||
request.start(true);
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
|
|
@ -15,14 +15,24 @@ layui.use(['layer', 'form', 'admin', 'laydate', 'HttpRequest', 'xmSelect'], func
|
|||
|
||||
// 初始化职位
|
||||
new HttpRequest(Feng.ctxPath + "/hrPosition/list", 'get', function (data) {
|
||||
positionXmSel = xmSelect.render({
|
||||
el: '#position',
|
||||
radio: true,
|
||||
clickClose: true,
|
||||
layVerify: 'required',
|
||||
data: data.data,
|
||||
initValue: [result.data.positionId]
|
||||
});
|
||||
let positionId = result.data.positionId;
|
||||
if (positionId) {
|
||||
positionXmSel = xmSelect.render({
|
||||
el: '#position',
|
||||
radio: true,
|
||||
clickClose: true,
|
||||
data: data.data,
|
||||
initValue: [positionId]
|
||||
});
|
||||
} else {
|
||||
positionXmSel = xmSelect.render({
|
||||
el: '#position',
|
||||
radio: true,
|
||||
clickClose: true,
|
||||
data: data.data,
|
||||
});
|
||||
}
|
||||
|
||||
}).start();
|
||||
|
||||
// 初始化组织树
|
||||
|
@ -71,11 +81,11 @@ layui.use(['layer', 'form', 'admin', 'laydate', 'HttpRequest', 'xmSelect'], func
|
|||
Feng.success("修改成功!");
|
||||
admin.putTempData('formOk', true);
|
||||
}, function (data) {
|
||||
admin.closeThisDialog();
|
||||
Feng.error("修改失败!" + data.message);
|
||||
});
|
||||
request.set(data.field);
|
||||
request.start(true);
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<div class="layui-form-item layui-row">
|
||||
<input name="orgId" type="hidden"/>
|
||||
|
||||
<div class="layui-inline layui-col-md12">
|
||||
<div class="layui-inline layui-col-md12" id="parentId">
|
||||
<label class="layui-form-label layui-form-required">上级机构</label>
|
||||
<div class="layui-input-block">
|
||||
<div id="organization" class="ew-xmselect-tree"></div>
|
||||
|
|
|
@ -33,9 +33,9 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="layui-inline layui-col-md6">
|
||||
<label class="layui-form-label layui-form-required">名称</label>
|
||||
<label class="layui-form-label ">姓名</label>
|
||||
<div class="layui-input-block">
|
||||
<input name="realName" placeholder="请输入姓名" type="text" class="layui-input" lay-verify="required" required/>
|
||||
<input name="realName" placeholder="请输入姓名" type="text" class="layui-input" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline layui-col-md6">
|
||||
|
@ -45,23 +45,28 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="layui-inline layui-col-md12">
|
||||
<label class="layui-form-label layui-form-required">生日</label>
|
||||
<label class="layui-form-label ">生日</label>
|
||||
<div class="layui-input-block">
|
||||
<input id="birthday" name="birthday" placeholder="请输入生日" type="text" class="layui-input date-icon" autocomplete="off" lay-verify="required" required/>
|
||||
<input id="birthday" name="birthday" placeholder="请输入生日" type="text" class="layui-input date-icon" autocomplete="off" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-inline layui-col-md6">
|
||||
<label class="layui-form-label layui-form-required">邮件</label>
|
||||
<label class="layui-form-label ">邮箱</label>
|
||||
<div class="layui-input-block">
|
||||
<input name="email" placeholder="请输入邮箱" type="text" class="layui-input" lay-verify="required|email" autocomplete="off" required/>
|
||||
<input name="email" placeholder="请输入邮箱" type="text" class="layui-input" autocomplete="off" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-inline layui-col-md6">
|
||||
<label class="layui-form-label layui-form-required">电话</label>
|
||||
<label class="layui-form-label ">手机</label>
|
||||
<div class="layui-input-block">
|
||||
<input name="phone" placeholder="请输入电话" type="text" class="layui-input" lay-verify="required" required/>
|
||||
<input name="phone" placeholder="请输入手机" type="text" class="layui-input" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline layui-col-md6">
|
||||
<label class="layui-form-label ">电话</label>
|
||||
<div class="layui-input-block">
|
||||
<input name="tel" placeholder="请输入电话" type="text" class="layui-input" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -78,7 +83,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="layui-inline layui-col-md12">
|
||||
<label class="layui-form-label layui-form-required">职位</label>
|
||||
<label class="layui-form-label ">职位</label>
|
||||
<div class="layui-input-block">
|
||||
<div id="position" class="xm-select-demo"></div>
|
||||
</div>
|
||||
|
|
|
@ -17,9 +17,9 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="layui-inline layui-col-md6">
|
||||
<label class="layui-form-label layui-form-required">名称</label>
|
||||
<label class="layui-form-label ">姓名</label>
|
||||
<div class="layui-input-block">
|
||||
<input name="realName" placeholder="请输入姓名" type="text" class="layui-input" lay-verify="required" required/>
|
||||
<input name="realName" placeholder="请输入姓名" type="text" class="layui-input" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline layui-col-md6">
|
||||
|
@ -29,22 +29,28 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="layui-inline layui-col-md12">
|
||||
<label class="layui-form-label layui-form-required">生日</label>
|
||||
<label class="layui-form-label ">生日</label>
|
||||
<div class="layui-input-block">
|
||||
<input id="birthday" name="birthday" placeholder="请输入生日" type="text" class="layui-input date-icon" autocomplete="off" lay-verify="required" required/>
|
||||
<input id="birthday" name="birthday" placeholder="请输入生日" type="text" class="layui-input date-icon" autocomplete="off" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-inline layui-col-md6">
|
||||
<label class="layui-form-label layui-form-required">邮件</label>
|
||||
<label class="layui-form-label ">邮箱</label>
|
||||
<div class="layui-input-block">
|
||||
<input name="email" placeholder="请输入邮箱" type="text" class="layui-input" lay-verify="required|email" autocomplete="off" required/>
|
||||
<input name="email" placeholder="请输入邮箱" type="text" class="layui-input" autocomplete="off" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline layui-col-md6">
|
||||
<label class="layui-form-label layui-form-required">电话</label>
|
||||
<label class="layui-form-label ">手机</label>
|
||||
<div class="layui-input-block">
|
||||
<input name="phone" placeholder="请输入电话" type="text" class="layui-input" lay-verify="required" required/>
|
||||
<input name="phone" placeholder="请输入手机" type="text" class="layui-input" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline layui-col-md6">
|
||||
<label class="layui-form-label ">电话</label>
|
||||
<div class="layui-input-block">
|
||||
<input name="tel" placeholder="请输入电话" type="text" class="layui-input" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -61,7 +67,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="layui-inline layui-col-md12">
|
||||
<label class="layui-form-label layui-form-required">职位</label>
|
||||
<label class="layui-form-label ">职位</label>
|
||||
<div id="demo1" class="xm-select-demo"></div>
|
||||
<div class="layui-input-block">
|
||||
<div id="position" class="xm-select-demo"></div>
|
||||
|
|
Loading…
Reference in New Issue