From 92ed0a5020611148d6fcc636abce6b7177f64e37 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9E=97=E9=94=A6=E5=B3=B0?= <498533950@qq,com>
Date: Thu, 25 Mar 2021 09:27:16 +0800
Subject: [PATCH 2/2] =?UTF-8?q?1=E3=80=81=E6=96=B0=E5=A2=9E=E5=B8=90?=
=?UTF-8?q?=E5=8F=B7=E7=9A=84=E6=97=B6=E5=80=99=E4=B8=80=E4=BA=9B=E6=94=B9?=
=?UTF-8?q?=E4=B8=BA=E9=9D=9E=E5=BF=85=E5=A1=AB=E5=8F=8A=E5=AF=B9=E5=BA=94?=
=?UTF-8?q?=E7=9A=84=E9=AA=8C=E8=AF=81=E6=96=B9=E5=BC=8F=E7=9A=84=E4=BF=AE?=
=?UTF-8?q?=E6=94=B9=202=E3=80=81=E5=B8=90=E5=8F=B7=E5=88=B7=E8=A1=A8?=
=?UTF-8?q?=E7=9A=84=E8=81=8C=E4=BD=8D=E7=9A=84=E6=98=BE=E7=A4=BA=203?=
=?UTF-8?q?=E3=80=81=E6=9C=BA=E6=9E=84=E9=87=8C=E7=9A=84=E8=81=8C=E4=BD=8D?=
=?UTF-8?q?=E6=94=B9=E4=B8=BA=E9=9D=9E=E5=BF=85=E5=A1=AB?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../db/migration/V1.0_20210214_1017__init.sql | 2 +-
.../webapp/assets/modular/system/user/user.js | 2 +-
.../assets/modular/system/user/user_add.js | 3 +-
.../assets/modular/system/user/user_edit.js | 28 +++++++++++++------
.../pages/modular/system/user/user_add.html | 25 ++++++++++-------
.../pages/modular/system/user/user_edit.html | 24 ++++++++++------
6 files changed, 52 insertions(+), 32 deletions(-)
diff --git a/src/main/resources/db/migration/V1.0_20210214_1017__init.sql b/src/main/resources/db/migration/V1.0_20210214_1017__init.sql
index eabc5a0d..d60b4f9b 100644
--- a/src/main/resources/db/migration/V1.0_20210214_1017__init.sql
+++ b/src/main/resources/db/migration/V1.0_20210214_1017__init.sql
@@ -1380,7 +1380,7 @@ CREATE TABLE `sys_user_org` (
`user_org_id` bigint(20) NOT NULL COMMENT '企业员工主键id',
`user_id` bigint(20) NOT NULL COMMENT '用户id',
`org_id` bigint(20) NOT NULL COMMENT '所属机构id',
- `position_id` bigint(20) NOT NULL COMMENT '职位id',
+ `position_id` bigint(20) NULL COMMENT '职位id',
`create_time` datetime(0) NULL DEFAULT NULL COMMENT '添加时间',
`create_user` bigint(20) NULL DEFAULT NULL COMMENT '添加人',
`update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
diff --git a/src/main/webapp/assets/modular/system/user/user.js b/src/main/webapp/assets/modular/system/user/user.js
index 26c5c641..60bd87c5 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 4f3865cb..12d181d8 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 056d7a94..b325e1d4 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/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 @@