mirror of https://gitee.com/stylefeng/guns
parent
1de486a34f
commit
99b0ac99d6
|
@ -14,7 +14,6 @@ layui.use(['form', 'admin', 'HttpRequest', 'xmSelect'], function () {
|
|||
|
||||
// 初始化组织树
|
||||
new HttpRequest(Feng.ctxPath + "/hrOrganization/treeLayui", '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("修改成功!");
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue