diff --git a/src/main/webapp/assets/modular/system/organization/organization_edit.js b/src/main/webapp/assets/modular/system/organization/organization_edit.js index 231d8147..a0e6c2a8 100644 --- a/src/main/webapp/assets/modular/system/organization/organization_edit.js +++ b/src/main/webapp/assets/modular/system/organization/organization_edit.js @@ -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("修改成功!"); diff --git a/src/main/webapp/assets/modular/system/user/user.js b/src/main/webapp/assets/modular/system/user/user.js index bce9b816..6c912657 100644 --- a/src/main/webapp/assets/modular/system/user/user.js +++ b/src/main/webapp/assets/modular/system/user/user.js @@ -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} diff --git a/src/main/webapp/assets/modular/system/user/user_add.js b/src/main/webapp/assets/modular/system/user/user_add.js index bdfb4123..911ac537 100644 --- a/src/main/webapp/assets/modular/system/user/user_add.js +++ b/src/main/webapp/assets/modular/system/user/user_add.js @@ -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; }); }); diff --git a/src/main/webapp/assets/modular/system/user/user_edit.js b/src/main/webapp/assets/modular/system/user/user_edit.js index df476af1..e1f2ca63 100644 --- a/src/main/webapp/assets/modular/system/user/user_edit.js +++ b/src/main/webapp/assets/modular/system/user/user_edit.js @@ -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; }); diff --git a/src/main/webapp/pages/modular/system/organization/organization_edit.html b/src/main/webapp/pages/modular/system/organization/organization_edit.html index d85ae23e..784441d2 100644 --- a/src/main/webapp/pages/modular/system/organization/organization_edit.html +++ b/src/main/webapp/pages/modular/system/organization/organization_edit.html @@ -7,7 +7,7 @@
-
+
diff --git a/src/main/webapp/pages/modular/system/user/user_add.html b/src/main/webapp/pages/modular/system/user/user_add.html index 2c2d7864..7a4bc378 100644 --- a/src/main/webapp/pages/modular/system/user/user_add.html +++ b/src/main/webapp/pages/modular/system/user/user_add.html @@ -33,9 +33,9 @@
- +
- +
@@ -45,23 +45,28 @@
- +
- +
- +
- +
-
- +
- + +
+
+
+ +
+
@@ -78,7 +83,7 @@
- +
diff --git a/src/main/webapp/pages/modular/system/user/user_edit.html b/src/main/webapp/pages/modular/system/user/user_edit.html index 39c05be1..3189c170 100644 --- a/src/main/webapp/pages/modular/system/user/user_edit.html +++ b/src/main/webapp/pages/modular/system/user/user_edit.html @@ -17,9 +17,9 @@
- +
- +
@@ -29,22 +29,28 @@
- +
- +
- +
- +
- +
- + +
+
+
+ +
+
@@ -61,7 +67,7 @@
- +