系统用户界面增加身份证上传
parent
6703fc0bd1
commit
c9fb9f9f56
|
@ -104,6 +104,7 @@ public class SysUser extends BaseEntity
|
|||
/** 角色对象 */
|
||||
private List<SysRole> roles;
|
||||
|
||||
private String userInfos;
|
||||
/** 角色组 */
|
||||
private Long[] roleIds;
|
||||
|
||||
|
@ -119,6 +120,14 @@ public class SysUser extends BaseEntity
|
|||
return workType;
|
||||
}
|
||||
|
||||
public String getUserInfos() {
|
||||
return userInfos;
|
||||
}
|
||||
|
||||
public void setUserInfos(String userInfos) {
|
||||
this.userInfos = userInfos;
|
||||
}
|
||||
|
||||
public void setWorkType(Long workType) {
|
||||
this.workType = workType;
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="isActive" column="is_active" />
|
||||
<result property="phonenumber" column="phonenumber" />
|
||||
<result property="sex" column="sex" />
|
||||
<result property="userInfos" column="user_infos" />
|
||||
<result property="avatar" column="avatar" />
|
||||
<result property="password" column="password" />
|
||||
<result property="status" column="status" />
|
||||
|
@ -65,7 +66,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
select u.user_id, u.com_id, com.dept_name as com_name, u.dept_id, u.user_name, u.nick_name, ex.user_type,ex.work_type, u.card_code, u.email
|
||||
, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
|
||||
d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.dept_short_name, d.dept_code, d.dept_type, d.order_num, d.leader, d.status as dept_status,
|
||||
r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status,com.dept_name com_dept_name
|
||||
r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status,com.dept_name com_dept_name,u.user_infos
|
||||
from sys_user u
|
||||
left join sys_dept d on u.dept_id = d.dept_id
|
||||
left join sys_dept com on u.com_id = com.dept_id
|
||||
|
@ -208,6 +209,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="avatar != null and avatar != ''">avatar,</if>
|
||||
<if test="phonenumber != null and phonenumber != ''">phonenumber,</if>
|
||||
<if test="sex != null and sex != ''">sex,</if>
|
||||
<if test="userInfos != null and userInfos != ''">user_infos,</if>
|
||||
<if test="password != null and password != ''">password,</if>
|
||||
<if test="status != null and status != ''">status,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
|
@ -224,6 +226,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="avatar != null and avatar != ''">#{avatar},</if>
|
||||
<if test="phonenumber != null and phonenumber != ''">#{phonenumber},</if>
|
||||
<if test="sex != null and sex != ''">#{sex},</if>
|
||||
<if test="userInfos != null and userInfos != ''">#{userInfos},</if>
|
||||
<if test="password != null and password != ''">#{password},</if>
|
||||
<if test="status != null and status != ''">#{status},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
|
@ -244,6 +247,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="email != null ">email = #{email},</if>
|
||||
<if test="phonenumber != null ">phonenumber = #{phonenumber},</if>
|
||||
<if test="sex != null and sex != ''">sex = #{sex},</if>
|
||||
<if test="userInfos != null and userInfos != ''">user_infos = #{userInfos},</if>
|
||||
<if test="avatar != null and avatar != ''">avatar = #{avatar},</if>
|
||||
<if test="password != null and password != ''">password = #{password},</if>
|
||||
<if test="status != null and status != ''">status = #{status},</if>
|
||||
|
|
|
@ -145,6 +145,7 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu
|
|||
sysUser.setUpdateTime(DateUtils.getNowDate());
|
||||
sysUser.setComId(proProjectInfoSubdeptsUsers.getComId());
|
||||
sysUser.setDeptId(proProjectInfoSubdeptsUsers.getProjectId());
|
||||
sysUser.setUserInfos(proProjectInfoSubdeptsUsers.getUserInfos());
|
||||
String subDeptType = proProjectInfoSubdeptsUsers.getSubDeptType();
|
||||
// 判断单位类型
|
||||
if(Objects.nonNull(subDeptType)){
|
||||
|
|
|
@ -434,6 +434,7 @@ public class SysUserServiceImpl implements ISysUserService
|
|||
data.put("userId",user.getUserId());
|
||||
data.put("userName",user.getNickName());
|
||||
data.put("cardType","1");
|
||||
data.put("userInfos",user.getUserInfos());
|
||||
data.put("workType",user.getWorkType());
|
||||
data.put("cardCode",user.getCardCode());
|
||||
data.put("userSex",user.getSex());
|
||||
|
|
|
@ -1,196 +1,196 @@
|
|||
import request from '@/utils/request'
|
||||
import request from "@/utils/request";
|
||||
import { parseStrEmpty } from "@/utils/ruoyi";
|
||||
|
||||
// 查询用户列表
|
||||
export function listUser(query) {
|
||||
return request({
|
||||
url: '/system/user/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
url: "/system/user/list",
|
||||
method: "get",
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
|
||||
// 查询用户详细
|
||||
export function getUser(userId) {
|
||||
return request({
|
||||
url: '/system/user/' + parseStrEmpty(userId),
|
||||
method: 'get'
|
||||
})
|
||||
url: "/system/user/" + parseStrEmpty(userId),
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
|
||||
// 按手机号码查询用户
|
||||
export function selectByPhone(phone) {
|
||||
return request({
|
||||
url: '/system/user/selectByPhone/' + phone,
|
||||
method: 'get'
|
||||
})
|
||||
url: "/system/user/selectByPhone/" + phone,
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// 新增用户
|
||||
export function addUser(data) {
|
||||
return request({
|
||||
url: '/system/user',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
url: "/system/user",
|
||||
method: "post",
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
|
||||
// 修改用户
|
||||
export function updateUser(data) {
|
||||
return request({
|
||||
url: '/system/user',
|
||||
method: 'put',
|
||||
url: "/system/user",
|
||||
method: "put",
|
||||
data: {
|
||||
userId:data.userId,
|
||||
nickName:data.nickName,
|
||||
userType:data.userType,
|
||||
workType:data.workType,
|
||||
sex:data.sex,
|
||||
status:data.status,
|
||||
postIds:data.postIds,
|
||||
roles:data.roles,
|
||||
comId:data.comId,
|
||||
deptId:data.deptId,
|
||||
roleIds:data.roleIds
|
||||
}
|
||||
})
|
||||
userId: data.userId,
|
||||
nickName: data.nickName,
|
||||
userType: data.userType,
|
||||
workType: data.workType,
|
||||
sex: data.sex,
|
||||
status: data.status,
|
||||
userInfos: data.userInfos,
|
||||
postIds: data.postIds,
|
||||
roles: data.roles,
|
||||
comId: data.comId,
|
||||
deptId: data.deptId,
|
||||
roleIds: data.roleIds,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
// 删除用户
|
||||
export function delUser(userId) {
|
||||
return request({
|
||||
url: '/system/user/' + userId,
|
||||
method: 'delete'
|
||||
})
|
||||
url: "/system/user/" + userId,
|
||||
method: "delete",
|
||||
});
|
||||
}
|
||||
|
||||
// 用户密码重置
|
||||
export function resetUserPwd(userId, password) {
|
||||
const data = {
|
||||
userId,
|
||||
password
|
||||
}
|
||||
password,
|
||||
};
|
||||
return request({
|
||||
url: '/system/user/resetPwd',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
url: "/system/user/resetPwd",
|
||||
method: "put",
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
|
||||
// 用户状态修改
|
||||
export function changeUserStatus(userId, status) {
|
||||
const data = {
|
||||
userId,
|
||||
status
|
||||
}
|
||||
status,
|
||||
};
|
||||
return request({
|
||||
url: '/system/user/changeStatus',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
url: "/system/user/changeStatus",
|
||||
method: "put",
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
|
||||
// 查询用户个人信息
|
||||
export function getUserProfile() {
|
||||
return request({
|
||||
url: '/system/user/profile',
|
||||
method: 'get'
|
||||
})
|
||||
url: "/system/user/profile",
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
|
||||
// 修改用户个人信息
|
||||
export function updateUserProfile(data) {
|
||||
return request({
|
||||
url: '/system/user/profile',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
url: "/system/user/profile",
|
||||
method: "put",
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
|
||||
// 用户密码重置
|
||||
export function updateUserPwd(oldPassword, newPassword) {
|
||||
const data = {
|
||||
oldPassword,
|
||||
newPassword
|
||||
}
|
||||
newPassword,
|
||||
};
|
||||
return request({
|
||||
url: '/system/user/profile/updatePwd',
|
||||
method: 'put',
|
||||
params: data
|
||||
})
|
||||
url: "/system/user/profile/updatePwd",
|
||||
method: "put",
|
||||
params: data,
|
||||
});
|
||||
}
|
||||
|
||||
// 用户头像上传
|
||||
export function uploadAvatar(data) {
|
||||
return request({
|
||||
url: '/system/user/profile/avatar',
|
||||
method: 'post',
|
||||
url: "/system/user/profile/avatar",
|
||||
method: "post",
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
"Content-Type": "multipart/form-data",
|
||||
},
|
||||
data: data
|
||||
})
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
|
||||
// 查询授权角色
|
||||
export function getAuthRole(userId) {
|
||||
return request({
|
||||
url: '/system/user/authRole/' + userId,
|
||||
method: 'get'
|
||||
})
|
||||
url: "/system/user/authRole/" + userId,
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
|
||||
// 保存授权角色
|
||||
export function updateAuthRole(data) {
|
||||
return request({
|
||||
url: '/system/user/authRole',
|
||||
method: 'put',
|
||||
params: data
|
||||
})
|
||||
url: "/system/user/authRole",
|
||||
method: "put",
|
||||
params: data,
|
||||
});
|
||||
}
|
||||
|
||||
// 查询部门下拉树结构
|
||||
export function deptTreeSelect() {
|
||||
return request({
|
||||
url: '/system/user/deptTree',
|
||||
method: 'get'
|
||||
})
|
||||
url: "/system/user/deptTree",
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
|
||||
// 查询部门下拉树结构
|
||||
export function deptFirTreeSelect() {
|
||||
return request({
|
||||
url: '/system/user/deptTree',
|
||||
method: 'get'
|
||||
})
|
||||
url: "/system/user/deptTree",
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
|
||||
export function getUserComs(userId){
|
||||
export function getUserComs(userId) {
|
||||
return request({
|
||||
url: '/system/user/profile/getUserComps/'+userId,
|
||||
method: 'get'
|
||||
})
|
||||
url: "/system/user/profile/getUserComps/" + userId,
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
|
||||
export function activeUserCom(userCom){
|
||||
export function activeUserCom(userCom) {
|
||||
return request({
|
||||
url:'/system/user/activeUserCom',
|
||||
method:'post',
|
||||
data:userCom
|
||||
})
|
||||
url: "/system/user/activeUserCom",
|
||||
method: "post",
|
||||
data: userCom,
|
||||
});
|
||||
}
|
||||
|
||||
export function reload(){
|
||||
export function reload() {
|
||||
return request({
|
||||
url: '/system/user/reload',
|
||||
method: 'get'
|
||||
})
|
||||
url: "/system/user/reload",
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
|
||||
export function getUserByName(userName){
|
||||
export function getUserByName(userName) {
|
||||
return request({
|
||||
url: '/system/user/getUserByName/'+userName,
|
||||
method: 'get'
|
||||
})
|
||||
url: "/system/user/getUserByName/" + userName,
|
||||
method: "get",
|
||||
});
|
||||
}
|
|
@ -128,7 +128,7 @@
|
|||
<el-button v-if="scope.row.subDeptType != '4' && scope.row.subDeptType != '5'" link disabled> - </el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="人员岗位" align="center" prop="craftPost" v-if="1==2">
|
||||
<el-table-column label="人员岗位" align="center" prop="craftPost">
|
||||
<template #default="scope">
|
||||
{{ getWorkType(scope.row.workType) }}
|
||||
</template>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<div class="app-container sys-user-manage">
|
||||
<el-row :gutter="20">
|
||||
<!--部门数据-->
|
||||
<el-col :span="4" :xs="24">
|
||||
|
@ -123,14 +123,15 @@
|
|||
</el-row>
|
||||
|
||||
<!-- 添加或修改用户配置对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="880px" append-to-body>
|
||||
<el-dialog :title="title" v-model="open" width="880px" append-to-body modal-class="sys-user-manage-dlg">
|
||||
<el-form :model="form" :rules="rules" ref="userRef" label-width="88px">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="所属部门" prop="deptId">
|
||||
<el-tree-select ref="selTreeDept" v-if="data.mode == 'add'" v-model="form.deptId" :data="deptOptions"
|
||||
:props="{ value: 'id', label: 'label', children: 'children' }" value-key="id"
|
||||
placeholder="请选择所属部门" check-strictly style="width:100%" @change="v=>handleChangeDept(v)" />
|
||||
<el-tree-select ref="selTreeDept" v-if="data.mode == 'add'" v-model="form.deptId"
|
||||
:data="deptOptions" :props="{ value: 'id', label: 'label', children: 'children' }"
|
||||
value-key="id" placeholder="请选择所属部门" check-strictly style="width:100%"
|
||||
@change="v => handleChangeDept(v)" />
|
||||
<el-tag type="primary" v-else>{{ form.dept?.deptName }}</el-tag>
|
||||
</el-form-item>
|
||||
|
||||
|
@ -221,9 +222,25 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" v-if="form.userType == '99'">
|
||||
<el-form-item label="身份证信息" prop="cardImgPos">
|
||||
<el-col :span="8">
|
||||
<div class="div-header">头像面</div>
|
||||
<image-upload v-model="form.cardImgPos" :limit="1" class="identification-card-1"
|
||||
@change="doImageUpload(1)" />
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="div-header">国徽面</div>
|
||||
<image-upload v-model="form.cardImgInv" :limit="1" class="identification-card-2" />
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="div-header">人脸识别头像</div>
|
||||
<image-upload v-model="form.avatar" :limit="1" class="face-image" />
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<!--
|
||||
<el-form-item label="入场近照" prop="avatar">
|
||||
<image-upload v-model="form.avatar" :limit="1" />
|
||||
</el-form-item>
|
||||
</el-form-item>-->
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
@ -371,6 +388,44 @@ function getDeptTree() {
|
|||
getUserWorkType();
|
||||
});
|
||||
};
|
||||
|
||||
//图片上传
|
||||
function doImageUpload(type) {
|
||||
setTimeout(() => {
|
||||
let url = '';
|
||||
if (type == 1) {
|
||||
url = form.value.cardImgPos;
|
||||
if (url) {
|
||||
url = location.origin + url;
|
||||
//url="http://62.234.3.186/statics/2025/01/19/4491f170cd1609142f9a6f097cbf681f_20250119000046A004.jpg"
|
||||
proxy.$http.get(`/system/tools/id/front?url=${url}`).then(d => {
|
||||
form.value.userName = d.data.name || form.value.userName || '';
|
||||
form.value.certificateCode = d.data.cardId || form.value.certificateCode || '';
|
||||
form.value.address = d.data.address || form.value.address || '';
|
||||
form.value.nativePlace = d.data.native || form.value.native || '';
|
||||
let nation = d.data.nation || "";
|
||||
if (nation) {
|
||||
let tmps = data.nationOpts.filter(it => it.indexOf(nation) >= 0);
|
||||
if (tmps.length > 0) {
|
||||
form.value.nation = tmps[0] || form.value.nation || '';
|
||||
}
|
||||
}
|
||||
let sex = d.data.sex || '';
|
||||
if (sex) {
|
||||
form.value.sex = sex ? (sex == '男' ? "0" : "1") : form.value.sex;
|
||||
}
|
||||
let birthDay = d.data.birthDay;
|
||||
if (birthDay && birthDay.length == 8) {
|
||||
birthDay = birthDay.substr(0, 4) + "-" + birthDay.substr(4, 2) + "-" + birthDay.substr(6);
|
||||
form.value.birthDay = birthDay || form.value.birthDay;
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
}, 800);
|
||||
}
|
||||
|
||||
//用于用户增加的查询
|
||||
function doQueryUser() {
|
||||
selectByPhone(form.value.phonenumber).then(d => {
|
||||
|
@ -598,6 +653,9 @@ function reset() {
|
|||
nickName: undefined,
|
||||
password: undefined,
|
||||
phonenumber: undefined,
|
||||
cardImgPos: undefined,
|
||||
cardImgInv: undefined,
|
||||
avatar: undefined,
|
||||
email: undefined,
|
||||
sex: undefined,
|
||||
status: "0",
|
||||
|
@ -652,6 +710,10 @@ function handleUpdate(row) {
|
|||
phonenumber: [{ required: true, message: "手机号码不能为空", trigger: "blur" }, { pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/, message: "请输入正确的手机号码", trigger: "blur" }]
|
||||
}
|
||||
form.value = response.data;
|
||||
let obj = proxy.$tryToJson(response.data.userInfos || "{}");
|
||||
form.value.userInfos = obj;
|
||||
form.value.cardImgPos = obj.cardImgPos || "";
|
||||
form.value.cardImgInv = obj.cardImgInv || "";
|
||||
postOptions.value = response.posts;
|
||||
form.value.postIds = response.postIds;
|
||||
form.value.roleIds = response.roleIds;
|
||||
|
@ -667,9 +729,9 @@ function handleUpdate(row) {
|
|||
title.value = "修改用户";
|
||||
form.value.password = "";
|
||||
data.mode = 'edit'
|
||||
let oldRoleIds=form.value.roleIds
|
||||
handleChangeDept(form.value.deptId,()=>{
|
||||
form.value.roleIds=oldRoleIds;
|
||||
let oldRoleIds = form.value.roleIds
|
||||
handleChangeDept(form.value.deptId, () => {
|
||||
form.value.roleIds = oldRoleIds;
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -686,7 +748,7 @@ function getWorkType(wt) {
|
|||
}
|
||||
|
||||
/** 根据单位选择角色 */
|
||||
function handleChangeDept(value,cb) {
|
||||
function handleChangeDept(value, cb) {
|
||||
form.value.roleIds = [];
|
||||
getDeptRole(value).then(response => {
|
||||
roleOptions.value = response.data;
|
||||
|
@ -718,6 +780,11 @@ function submitForm() {
|
|||
data.loading = true;
|
||||
proxy.$refs["userRef"].validate(valid => {
|
||||
if (valid) {
|
||||
debugger
|
||||
let obj = form.value.userInfos || {};
|
||||
obj.cardImgPos = form.value.cardImgPos;
|
||||
obj.cardImgInv = form.value.cardImgInv;
|
||||
form.value.userInfos = JSON.stringify(obj);
|
||||
if (form.value.userId != undefined) {
|
||||
updateUser(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
|
@ -727,6 +794,7 @@ function submitForm() {
|
|||
data.loading = false;
|
||||
});
|
||||
} else {
|
||||
form.value.userInfos = JSON.stringify(obj);
|
||||
addUser(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("新增成功");
|
||||
open.value = false;
|
||||
|
@ -759,3 +827,62 @@ getDeptTree();
|
|||
getList();
|
||||
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.sys-user-manage-dlg {
|
||||
.identification-card-1 {
|
||||
.el-upload--picture-card {
|
||||
width: 240px;
|
||||
background-image: url("../../../assets/images/card1.svg");
|
||||
background-repeat: no-repeat;
|
||||
background-position: center;
|
||||
}
|
||||
|
||||
.el-upload__tip {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.el-upload-list--picture-card {
|
||||
.el-upload-list__item {
|
||||
width: 240px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.identification-card-2 {
|
||||
.el-upload--picture-card {
|
||||
width: 240px;
|
||||
background-image: url("../../../assets/images/card2.svg");
|
||||
background-repeat: no-repeat;
|
||||
background-position: center;
|
||||
background-size: 60%;
|
||||
}
|
||||
|
||||
.el-upload__tip {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.el-upload-list--picture-card {
|
||||
.el-upload-list__item {
|
||||
width: 240px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.face-image {
|
||||
&>div {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.el-upload--picture-card {
|
||||
background-image: url("../../../assets/images/face.svg");
|
||||
background-repeat: no-repeat;
|
||||
background-position: center;
|
||||
background-size: 60%;
|
||||
}
|
||||
|
||||
.el-upload__tip {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
Loading…
Reference in New Issue