Merge branch 'master' of https://gitee.com/feng93/guns into 7.0.2-develop

# Conflicts:
#	src/main/webapp/assets/modular/system/organization/organization_edit.js
pull/69/head
fengshuonan 2021-03-25 20:41:26 +08:00
commit 5c5f28e20f
7 changed files with 66 additions and 35 deletions

View File

@ -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("修改成功!");

View File

@ -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}

View File

@ -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;
});
});

View File

@ -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;
});

View File

@ -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>

View File

@ -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>

View File

@ -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>