完善客户需求
This commit is contained in:
parent
915ac72596
commit
fe787e5772
|
|
@ -187,6 +187,18 @@ public class PsyUserProfileController extends BaseController
|
|||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取学员档案列表(仅包含拥有学员角色的用户)
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('psychology:profile:list')")
|
||||
@GetMapping("/student/list")
|
||||
public TableDataInfo studentList(PsyUserProfile profile)
|
||||
{
|
||||
startPage();
|
||||
List<PsyUserProfile> list = profileService.selectStudentProfileList(profile);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增档案
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ spring:
|
|||
druid:
|
||||
# 主库数据源
|
||||
master:
|
||||
url: jdbc:mysql://127.0.0.1:3306/ry_xinli?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
||||
url: jdbc:mysql://1.15.149.240:3306/ry_xinli?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
||||
username: ry_xinli
|
||||
password: ZLZBcfGtsWJe5r4z
|
||||
# 从库数据源
|
||||
|
|
|
|||
|
|
@ -1,24 +1,3 @@
|
|||
Application Version: ${ruoyi.version}
|
||||
Spring Boot Version: ${spring-boot.version}
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// _ooOoo_ //
|
||||
// o8888888o //
|
||||
// 88" . "88 //
|
||||
// (| ^_^ |) //
|
||||
// O\ = /O //
|
||||
// ____/`---'\____ //
|
||||
// .' \\| |// `. //
|
||||
// / \\||| : |||// \ //
|
||||
// / _||||| -:- |||||- \ //
|
||||
// | | \\\ - /// | | //
|
||||
// | \_| ''\---/'' | | //
|
||||
// \ .-\__ `-` ___/-. / //
|
||||
// ___`. .' /--.--\ `. . ___ //
|
||||
// ."" '< `.___\_<|>_/___.' >'"". //
|
||||
// | | : `- \`.;`\ _ /`;.`/ - ` : | | //
|
||||
// \ \ `-. \_ __\ /__ _/ .-` / / //
|
||||
// ========`-.____`-.___\_____/___.-`____.-'======== //
|
||||
// `=---=' //
|
||||
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ //
|
||||
// AI心理健康测评系统 永不宕机 永无BUG //
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
|
|||
|
|
@ -29,12 +29,12 @@ public class SysUser extends BaseEntity
|
|||
@Excel(name = "部门编号", type = Type.IMPORT)
|
||||
private Long deptId;
|
||||
|
||||
/** 用户账号 */
|
||||
@Excel(name = "登录名称")
|
||||
/** 用户账号(信息编号/登录账号) */
|
||||
@Excel(name = "信息编号")
|
||||
private String userName;
|
||||
|
||||
/** 用户昵称 */
|
||||
@Excel(name = "用户名称")
|
||||
/** 用户真实姓名(罪犯姓名) */
|
||||
@Excel(name = "罪犯姓名")
|
||||
private String nickName;
|
||||
|
||||
/** 用户邮箱 */
|
||||
|
|
@ -55,6 +55,9 @@ public class SysUser extends BaseEntity
|
|||
/** 密码 */
|
||||
private String password;
|
||||
|
||||
/** 注册类型 */
|
||||
private String registerType;
|
||||
|
||||
/** 账号状态(0正常 1停用) */
|
||||
@Excel(name = "账号状态", readConverterExp = "0=正常,1=停用")
|
||||
private String status;
|
||||
|
|
@ -106,10 +109,6 @@ public class SysUser extends BaseEntity
|
|||
@Excel(name = "身份证号")
|
||||
private String idCard;
|
||||
|
||||
/** 生日 */
|
||||
@Excel(name = "生日", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date birthday;
|
||||
|
||||
/** 学历 */
|
||||
@Excel(name = "学历")
|
||||
private String education;
|
||||
|
|
@ -171,6 +170,7 @@ public class SysUser extends BaseEntity
|
|||
}
|
||||
|
||||
@Xss(message = "用户昵称不能包含脚本字符")
|
||||
@NotBlank(message = "姓名不能为空")
|
||||
@Size(min = 0, max = 30, message = "用户昵称长度不能超过30个字符")
|
||||
public String getNickName()
|
||||
{
|
||||
|
|
@ -248,6 +248,16 @@ public class SysUser extends BaseEntity
|
|||
this.password = password;
|
||||
}
|
||||
|
||||
public String getRegisterType()
|
||||
{
|
||||
return registerType;
|
||||
}
|
||||
|
||||
public void setRegisterType(String registerType)
|
||||
{
|
||||
this.registerType = registerType;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
|
|
@ -380,16 +390,6 @@ public class SysUser extends BaseEntity
|
|||
this.idCard = idCard;
|
||||
}
|
||||
|
||||
public Date getBirthday()
|
||||
{
|
||||
return birthday;
|
||||
}
|
||||
|
||||
public void setBirthday(Date birthday)
|
||||
{
|
||||
this.birthday = birthday;
|
||||
}
|
||||
|
||||
public String getEducation()
|
||||
{
|
||||
return education;
|
||||
|
|
|
|||
|
|
@ -42,6 +42,14 @@ public interface PsyUserProfileMapper
|
|||
*/
|
||||
public List<PsyUserProfile> selectProfileList(PsyUserProfile profile);
|
||||
|
||||
/**
|
||||
* 查询学员档案列表(仅包含拥有学员角色的用户)
|
||||
*
|
||||
* @param profile 档案信息
|
||||
* @return 档案集合
|
||||
*/
|
||||
public List<PsyUserProfile> selectStudentProfileList(PsyUserProfile profile);
|
||||
|
||||
/**
|
||||
* 新增档案
|
||||
*
|
||||
|
|
|
|||
|
|
@ -90,6 +90,19 @@ public class PsyUserProfileServiceImpl implements IPsyUserProfileService
|
|||
return profileMapper.selectProfileList(profile);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询学员档案列表(仅包含拥有学员角色的用户)
|
||||
*
|
||||
* @param profile 档案信息
|
||||
* @return 档案集合
|
||||
*/
|
||||
@Override
|
||||
@com.ddnai.common.annotation.DataScope(deptAlias = "d", userAlias = "u")
|
||||
public List<PsyUserProfile> selectStudentProfileList(PsyUserProfile profile)
|
||||
{
|
||||
return profileMapper.selectStudentProfileList(profile);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增档案
|
||||
*
|
||||
|
|
@ -531,14 +544,36 @@ public class PsyUserProfileServiceImpl implements IPsyUserProfileService
|
|||
|
||||
if (failureNum > 0)
|
||||
{
|
||||
if (successNum == 0)
|
||||
{
|
||||
// 全部失败,保持原有行为:抛出异常
|
||||
failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:");
|
||||
throw new ServiceException(failureMsg.toString());
|
||||
}
|
||||
else
|
||||
{
|
||||
successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:");
|
||||
// 部分成功、部分失败:同时返回成功和失败统计,前端可一次性展示
|
||||
StringBuilder resultMsg = new StringBuilder();
|
||||
resultMsg.append("本次导入完成:共 ")
|
||||
.append(successNum + failureNum)
|
||||
.append(" 条,其中成功 ")
|
||||
.append(successNum)
|
||||
.append(" 条,失败 ")
|
||||
.append(failureNum)
|
||||
.append(" 条。成功明细如下:");
|
||||
|
||||
resultMsg.append(successMsg);
|
||||
failureMsg.insert(0, "<br/><br/>失败明细如下:");
|
||||
resultMsg.append(failureMsg);
|
||||
return resultMsg.toString();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// 全部成功
|
||||
successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:");
|
||||
return successMsg.toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -42,6 +42,14 @@ public interface IPsyUserProfileService
|
|||
*/
|
||||
public List<PsyUserProfile> selectProfileList(PsyUserProfile profile);
|
||||
|
||||
/**
|
||||
* 查询学员档案列表(仅包含拥有学员角色的用户)
|
||||
*
|
||||
* @param profile 档案信息
|
||||
* @return 档案集合
|
||||
*/
|
||||
public List<PsyUserProfile> selectStudentProfileList(PsyUserProfile profile);
|
||||
|
||||
/**
|
||||
* 新增档案
|
||||
*
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="sex" column="sex" />
|
||||
<result property="avatar" column="avatar" />
|
||||
<result property="password" column="password" />
|
||||
<result property="registerType" column="register_type" />
|
||||
<result property="status" column="status" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="loginIp" column="login_ip" />
|
||||
|
|
@ -48,7 +49,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</resultMap>
|
||||
|
||||
<sql id="selectUserVo">
|
||||
select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.pwd_update_date, u.create_by, u.create_time, u.remark,
|
||||
select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.register_type, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.pwd_update_date, u.create_by, u.create_time, u.remark,
|
||||
d.dept_id, d.parent_id, d.ancestors, d.dept_name, 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
|
||||
from sys_user u
|
||||
|
|
@ -58,7 +59,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</sql>
|
||||
|
||||
<select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult">
|
||||
select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from sys_user u
|
||||
select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.register_type, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from sys_user u
|
||||
left join sys_dept d on u.dept_id = d.dept_id
|
||||
where u.del_flag = '0'
|
||||
<if test="userId != null and userId != 0">
|
||||
|
|
@ -158,6 +159,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="email != null and email != ''">email,</if>
|
||||
<if test="avatar != null and avatar != ''">avatar,</if>
|
||||
<if test="phonenumber != null and phonenumber != ''">phonenumber,</if>
|
||||
<if test="registerType != null and registerType != ''">register_type,</if>
|
||||
<if test="sex != null and sex != ''">sex,</if>
|
||||
<if test="password != null and password != ''">password,</if>
|
||||
<if test="status != null and status != ''">status,</if>
|
||||
|
|
@ -172,6 +174,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="email != null and email != ''">#{email},</if>
|
||||
<if test="avatar != null and avatar != ''">#{avatar},</if>
|
||||
<if test="phonenumber != null and phonenumber != ''">#{phonenumber},</if>
|
||||
<if test="registerType != null and registerType != ''">#{registerType},</if>
|
||||
<if test="sex != null and sex != ''">#{sex},</if>
|
||||
<if test="password != null and password != ''">#{password},</if>
|
||||
<if test="status != null and status != ''">#{status},</if>
|
||||
|
|
@ -189,6 +192,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="nickName != null and nickName != ''">nick_name = #{nickName},</if>
|
||||
<if test="email != null ">email = #{email},</if>
|
||||
<if test="phonenumber != null ">phonenumber = #{phonenumber},</if>
|
||||
<if test="registerType != null and registerType != ''">register_type = #{registerType},</if>
|
||||
<if test="sex != null and sex != ''">sex = #{sex},</if>
|
||||
<if test="avatar != null and avatar != ''">avatar = #{avatar},</if>
|
||||
<if test="password != null and password != ''">password = #{password},</if>
|
||||
|
|
|
|||
|
|
@ -91,11 +91,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="infoNumber != null and infoNumber != ''">
|
||||
AND p.info_number like concat('%', #{infoNumber}, '%')
|
||||
</if>
|
||||
<if test="phone != null and phone != ''">
|
||||
AND u.phonenumber like concat('%', #{phone}, '%')
|
||||
<if test="prison != null and prison != ''">
|
||||
AND p.prison like concat('%', #{prison}, '%')
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND u.status = #{status}
|
||||
<if test="prisonArea != null and prisonArea != ''">
|
||||
AND p.prison_area like concat('%', #{prisonArea}, '%')
|
||||
</if>
|
||||
<if test="gender != null and gender != ''">
|
||||
AND p.gender = #{gender}
|
||||
</if>
|
||||
<if test="nation != null and nation != ''">
|
||||
AND p.nation like concat('%', #{nation}, '%')
|
||||
</if>
|
||||
<if test="educationLevel != null and educationLevel != ''">
|
||||
AND p.education_level = #{educationLevel}
|
||||
</if>
|
||||
<if test="crimeName != null and crimeName != ''">
|
||||
AND p.crime_name like concat('%', #{crimeName}, '%')
|
||||
</if>
|
||||
<if test="params.beginTime != null and params.beginTime != ''">
|
||||
AND date_format(u.create_time,'%Y%m%d') >= date_format(#{params.beginTime},'%Y%m%d')
|
||||
|
|
@ -195,5 +207,70 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</foreach>
|
||||
</delete>
|
||||
|
||||
<!-- 查询学员用户档案列表:只返回拥有学员角色的用户 -->
|
||||
<select id="selectStudentProfileList" parameterType="com.ddnai.system.domain.psychology.PsyUserProfile" resultMap="PsyUserProfileResult">
|
||||
select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar as user_avatar, u.phonenumber as phone, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by as user_create_by, u.create_time as user_create_time, u.remark as user_remark,
|
||||
d.dept_name, d.leader,
|
||||
p.profile_id, p.profile_type, p.profile_data, p.avatar, p.id_card, p.birthday,
|
||||
p.prison, p.prison_area, p.gender, p.nation, p.education_level, p.crime_name,
|
||||
p.sentence_term, p.sentence_start_date, p.sentence_end_date, p.entry_date,
|
||||
p.info_number, p.create_by, p.create_time, p.update_by, p.update_time, p.remark
|
||||
from sys_user u
|
||||
left join sys_dept d on u.dept_id = d.dept_id
|
||||
left join psy_user_profile p on u.user_id = p.user_id
|
||||
inner join sys_user_role ur on u.user_id = ur.user_id
|
||||
inner join sys_role r on ur.role_id = r.role_id
|
||||
where u.del_flag = '0'
|
||||
and (
|
||||
lower(r.role_key) = 'student'
|
||||
or r.role_name like '%学员%'
|
||||
or r.role_id = 101
|
||||
)
|
||||
<if test="userId != null and userId != 0">
|
||||
AND u.user_id = #{userId}
|
||||
</if>
|
||||
<if test="userName != null and userName != ''">
|
||||
AND u.user_name like concat('%', #{userName}, '%')
|
||||
</if>
|
||||
<if test="profileType != null and profileType != ''">
|
||||
AND p.profile_type = #{profileType}
|
||||
</if>
|
||||
<if test="idCard != null and idCard != ''">
|
||||
AND p.id_card like concat('%', #{idCard}, '%')
|
||||
</if>
|
||||
<if test="infoNumber != null and infoNumber != ''">
|
||||
AND p.info_number like concat('%', #{infoNumber}, '%')
|
||||
</if>
|
||||
<if test="prison != null and prison != ''">
|
||||
AND p.prison like concat('%', #{prison}, '%')
|
||||
</if>
|
||||
<if test="prisonArea != null and prisonArea != ''">
|
||||
AND p.prison_area like concat('%', #{prisonArea}, '%')
|
||||
</if>
|
||||
<if test="gender != null and gender != ''">
|
||||
AND p.gender = #{gender}
|
||||
</if>
|
||||
<if test="nation != null and nation != ''">
|
||||
AND p.nation like concat('%', #{nation}, '%')
|
||||
</if>
|
||||
<if test="educationLevel != null and educationLevel != ''">
|
||||
AND p.education_level = #{educationLevel}
|
||||
</if>
|
||||
<if test="crimeName != null and crimeName != ''">
|
||||
AND p.crime_name like concat('%', #{crimeName}, '%')
|
||||
</if>
|
||||
<if test="params.beginTime != null and params.beginTime != ''">
|
||||
AND date_format(u.create_time,'%Y%m%d') >= date_format(#{params.beginTime},'%Y%m%d')
|
||||
</if>
|
||||
<if test="params.endTime != null and params.endTime != ''">
|
||||
AND date_format(u.create_time,'%Y%m%d') <= date_format(#{params.endTime},'%Y%m%d')
|
||||
</if>
|
||||
<if test="deptId != null and deptId != 0">
|
||||
AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId}, ancestors) ))
|
||||
</if>
|
||||
${params.dataScope}
|
||||
order by u.create_time desc
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
|
|
|
|||
|
|
@ -9,6 +9,15 @@ export function listProfile(query) {
|
|||
})
|
||||
}
|
||||
|
||||
// 查询学员档案列表(仅包含拥有学员角色的用户)
|
||||
export function listStudentProfile(query) {
|
||||
return request({
|
||||
url: '/psychology/profile/student/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询档案详细
|
||||
export function getProfile(profileId) {
|
||||
return request({
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@
|
|||
<script>
|
||||
import { startAssessment, pausedAssessmentList, resumeAssessment } from "@/api/psychology/assessment";
|
||||
import { listScale } from "@/api/psychology/scale";
|
||||
import { listProfile } from "@/api/psychology/profile";
|
||||
import { listStudentProfile } from "@/api/psychology/profile";
|
||||
|
||||
export default {
|
||||
name: "AssessmentStart",
|
||||
|
|
@ -263,14 +263,13 @@ export default {
|
|||
});
|
||||
}
|
||||
},
|
||||
/** 加载用户档案列表 */
|
||||
/** 加载学员用户档案列表(用于选择被测评人,小页加载) */
|
||||
loadProfiles() {
|
||||
const params = {
|
||||
pageNum: 1,
|
||||
pageSize: 1000 // 加载更多用户档案
|
||||
pageSize: 100 // 加载一页学员档案用于选择
|
||||
}
|
||||
listProfile(params).then(response => {
|
||||
// 确保获取到正确的数据结构
|
||||
listStudentProfile(params).then(response => {
|
||||
if (response.rows && Array.isArray(response.rows)) {
|
||||
this.profileList = response.rows
|
||||
} else if (Array.isArray(response.data)) {
|
||||
|
|
@ -278,10 +277,10 @@ export default {
|
|||
} else {
|
||||
this.profileList = []
|
||||
}
|
||||
console.log('Loaded user profiles:', this.profileList)
|
||||
console.log('Loaded student profiles:', this.profileList)
|
||||
}).catch(error => {
|
||||
console.error('Failed to load user profiles:', error)
|
||||
this.$message.error('加载用户档案失败,请重试')
|
||||
console.error('Failed to load student profiles:', error)
|
||||
this.$message.error('加载学员档案失败,请重试')
|
||||
})
|
||||
},
|
||||
/** 加载暂停的测评 */
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@ export default {
|
|||
roleId: studentRoleId,
|
||||
status: '0',
|
||||
pageNum: 1,
|
||||
pageSize: 1000, // 设置足够大的值以获取所有匹配的学员用户
|
||||
pageSize: 200,
|
||||
userName: keyword || undefined,
|
||||
phonenumber: keyword || undefined
|
||||
}).then(response => {
|
||||
|
|
|
|||
|
|
@ -1,39 +1,6 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
|
||||
<el-form-item label="用户名称" prop="userName">
|
||||
<el-input
|
||||
v-model="queryParams.userName"
|
||||
placeholder="请输入用户名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- 用户ID已隐藏,只使用信息编号 -->
|
||||
<el-form-item label="手机号码" prop="phone">
|
||||
<el-input
|
||||
v-model="queryParams.phone"
|
||||
placeholder="请输入手机号码"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="档案状态" clearable>
|
||||
<el-option label="在押" value="0" />
|
||||
<el-option label="释放" value="1" />
|
||||
<el-option label="外出" value="2" />
|
||||
<el-option label="假释" value="3" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="档案类型" prop="profileType">
|
||||
<el-select v-model="queryParams.profileType" placeholder="档案类型" clearable>
|
||||
<el-option label="标准" value="standard" />
|
||||
<el-option label="儿童" value="child" />
|
||||
<el-option label="成人" value="adult" />
|
||||
<el-option label="老年" value="senior" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="信息编号" prop="infoNumber">
|
||||
<el-input
|
||||
v-model="queryParams.infoNumber"
|
||||
|
|
@ -42,6 +9,66 @@
|
|||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="罪犯姓名" prop="userName">
|
||||
<el-input
|
||||
v-model="queryParams.userName"
|
||||
placeholder="请输入罪犯姓名"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="监狱" prop="prison">
|
||||
<el-input
|
||||
v-model="queryParams.prison"
|
||||
placeholder="请输入监狱名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="监区" prop="prisonArea">
|
||||
<el-input
|
||||
v-model="queryParams.prisonArea"
|
||||
placeholder="请输入监区"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="性别" prop="gender">
|
||||
<el-select v-model="queryParams.gender" placeholder="请选择性别" clearable>
|
||||
<el-option label="男" value="0" />
|
||||
<el-option label="女" value="1" />
|
||||
<el-option label="未知" value="2" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="民族" prop="nation">
|
||||
<el-input
|
||||
v-model="queryParams.nation"
|
||||
placeholder="请输入民族"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="文化程度" prop="educationLevel">
|
||||
<el-select v-model="queryParams.educationLevel" placeholder="请选择文化程度" clearable>
|
||||
<el-option label="小学" value="小学" />
|
||||
<el-option label="初中" value="初中" />
|
||||
<el-option label="高中" value="高中" />
|
||||
<el-option label="中专" value="中专" />
|
||||
<el-option label="大专" value="大专" />
|
||||
<el-option label="本科" value="本科" />
|
||||
<el-option label="硕士" value="硕士" />
|
||||
<el-option label="博士" value="博士" />
|
||||
<el-option label="其他" value="其他" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="罪名" prop="crimeName">
|
||||
<el-input
|
||||
v-model="queryParams.crimeName"
|
||||
placeholder="请输入罪名"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
</el-form-item>
|
||||
|
|
@ -109,6 +136,11 @@
|
|||
<span>{{ scope.row.educationLevel || '-' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="出生日期" align="center" prop="birthday" width="120">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.birthday, '{y}-{m}-{d}') || '-' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="罪名" align="center" prop="crimeName" width="120">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.crimeName || '-' }}</span>
|
||||
|
|
@ -205,7 +237,7 @@
|
|||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="监狱" prop="prison">
|
||||
<el-form-item label="监狱" prop="prison" v-if="false">
|
||||
<el-input v-model="form.prison" placeholder="请输入监狱名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
|
@ -248,6 +280,19 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="出生日期" prop="birthday">
|
||||
<el-date-picker
|
||||
v-model="form.birthday"
|
||||
type="date"
|
||||
placeholder="选择出生日期"
|
||||
value-format="yyyy-MM-dd"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="罪名" prop="crimeName">
|
||||
<el-input v-model="form.crimeName" placeholder="请输入罪名" />
|
||||
</el-form-item>
|
||||
|
|
@ -307,8 +352,8 @@
|
|||
<el-form ref="userForm" :model="userForm" :rules="userRules" label-width="80px">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="用户昵称" prop="nickName">
|
||||
<el-input v-model="userForm.nickName" placeholder="请输入用户昵称" maxlength="30" />
|
||||
<el-form-item label="用户姓名" prop="nickName">
|
||||
<el-input v-model="userForm.nickName" placeholder="请输入用户姓名" maxlength="30" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
|
|
@ -331,8 +376,8 @@
|
|||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="用户名称" prop="userName">
|
||||
<el-input v-model="userForm.userName" placeholder="请输入用户名称" maxlength="30" />
|
||||
<el-form-item label="登录名称" prop="userName">
|
||||
<el-input v-model="userForm.userName" placeholder="请输入登录名称" maxlength="30" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
|
|
@ -389,7 +434,7 @@
|
|||
|
||||
<!-- 用户档案导入对话框 -->
|
||||
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
|
||||
<el-upload ref="upload" :limit="1" accept=".xlsx, .xls" :headers="upload.headers" :action="upload.url + '?updateSupport=' + upload.updateSupport" :disabled="upload.isUploading" :on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag>
|
||||
<el-upload ref="upload" :limit="1" accept=".xlsx, .xls" :headers="upload.headers" :action="upload.url + '?updateSupport=' + upload.updateSupport" :disabled="upload.isUploading" :on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :on-error="handleFileError" :auto-upload="false" drag>
|
||||
<i class="el-icon-upload"></i>
|
||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||
<div class="el-upload__tip text-center" slot="tip">
|
||||
|
|
@ -409,10 +454,8 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { listProfile, getProfile, getProfileByUserId, delProfile, addProfile, updateProfile, getUserInfo, addUserInProfile, getUserInfoById, updateUserInProfile, delUserInProfile } from "@/api/psychology/profile"
|
||||
import { listStudentProfile, getProfile, getProfileByUserId, delProfile, addProfile, updateProfile, getUserInfo, addUserInProfile, getUserInfoById, updateUserInProfile, delUserInProfile } from "@/api/psychology/profile"
|
||||
import { deptTreeSelect } from "@/api/system/user"
|
||||
import { allocatedUserList } from "@/api/system/role"
|
||||
import { listRole } from "@/api/system/role"
|
||||
import { getToken } from "@/utils/auth"
|
||||
import Treeselect from "@riophae/vue-treeselect"
|
||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css"
|
||||
|
|
@ -438,8 +481,6 @@ export default {
|
|||
total: 0,
|
||||
// 档案表格数据
|
||||
profileList: [],
|
||||
// 学员角色ID(缓存)
|
||||
studentRoleId: null,
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
|
|
@ -463,13 +504,15 @@ export default {
|
|||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
userName: undefined,
|
||||
userId: undefined,
|
||||
phone: undefined,
|
||||
status: undefined,
|
||||
profileType: undefined,
|
||||
idCard: undefined,
|
||||
infoNumber: undefined,
|
||||
userName: undefined,
|
||||
prison: undefined,
|
||||
prisonArea: undefined,
|
||||
gender: undefined,
|
||||
nation: undefined,
|
||||
educationLevel: undefined,
|
||||
crimeName: undefined,
|
||||
userId: undefined,
|
||||
deptId: undefined
|
||||
},
|
||||
// 表单参数
|
||||
|
|
@ -486,9 +529,6 @@ export default {
|
|||
{ required: true, message: "罪犯姓名不能为空", trigger: "blur" },
|
||||
{ pattern: /^[\u4e00-\u9fa5]+$/, message: "姓名只能输入汉字", trigger: "blur" }
|
||||
],
|
||||
prison: [
|
||||
{ required: true, message: "监狱不能为空", trigger: "blur" }
|
||||
],
|
||||
prisonArea: [
|
||||
{ required: true, message: "监区不能为空", trigger: "blur" }
|
||||
]
|
||||
|
|
@ -496,11 +536,11 @@ export default {
|
|||
// 用户表单校验
|
||||
userRules: {
|
||||
userName: [
|
||||
{ required: true, message: "用户名称不能为空", trigger: "blur" },
|
||||
{ min: 2, max: 20, message: '用户名称长度必须介于 2 和 20 之间', trigger: 'blur' }
|
||||
{ required: true, message: "登录名称不能为空", trigger: "blur" },
|
||||
{ min: 2, max: 20, message: '登录名称长度必须介于 2 和 20 之间', trigger: 'blur' }
|
||||
],
|
||||
nickName: [
|
||||
{ required: true, message: "用户昵称不能为空", trigger: "blur" }
|
||||
{ required: true, message: "用户姓名不能为空", trigger: "blur" }
|
||||
],
|
||||
password: [
|
||||
{ required: true, message: "用户密码不能为空", trigger: "blur" },
|
||||
|
|
@ -539,77 +579,31 @@ export default {
|
|||
}
|
||||
},
|
||||
created() {
|
||||
this.getStudentRoleId().then(() => {
|
||||
this.getList()
|
||||
})
|
||||
this.getDeptTree()
|
||||
this.getConfigKey("sys.user.initPassword").then(response => {
|
||||
this.initPassword = response.msg
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
/** 获取学员角色ID */
|
||||
getStudentRoleId() {
|
||||
return new Promise((resolve, reject) => {
|
||||
if (this.studentRoleId) {
|
||||
resolve(this.studentRoleId)
|
||||
return
|
||||
}
|
||||
// 先尝试从角色列表中找到学员角色
|
||||
listRole({}).then(response => {
|
||||
const roles = response.rows || []
|
||||
// 查找学员角色:roleId=101 或 roleKey='student' 或 roleName包含'学员'
|
||||
const studentRole = roles.find(role => {
|
||||
return (role.roleId === 101) ||
|
||||
(role.roleKey && role.roleKey.toLowerCase() === 'student') ||
|
||||
(role.roleName && role.roleName.includes('学员'))
|
||||
})
|
||||
if (studentRole && studentRole.roleId) {
|
||||
this.studentRoleId = studentRole.roleId
|
||||
resolve(this.studentRoleId)
|
||||
} else {
|
||||
// 如果找不到,尝试使用默认值101
|
||||
console.warn("未找到学员角色,使用默认值101")
|
||||
this.studentRoleId = 101
|
||||
resolve(this.studentRoleId)
|
||||
}
|
||||
}).catch(error => {
|
||||
console.error("获取角色列表失败:", error)
|
||||
// 如果获取角色列表失败,尝试使用默认值101
|
||||
this.studentRoleId = 101
|
||||
resolve(this.studentRoleId)
|
||||
})
|
||||
})
|
||||
},
|
||||
/** 查询档案列表 */
|
||||
/** 查询学员档案列表(后端分页) */
|
||||
getList() {
|
||||
this.loading = true
|
||||
// 为了正确过滤学员用户,需要获取所有数据(不分页或获取足够多的数据)
|
||||
const queryParams = {
|
||||
...this.queryParams,
|
||||
pageNum: 1,
|
||||
pageSize: 10000 // 获取足够多的数据,确保能过滤所有记录
|
||||
...this.queryParams
|
||||
}
|
||||
listProfile(queryParams).then(response => {
|
||||
listStudentProfile(queryParams).then(response => {
|
||||
const rows = response.rows || []
|
||||
// 为状态设置默认值,确保是字符串类型
|
||||
rows.forEach(row => {
|
||||
if (row.status === null || row.status === undefined || row.status === '') {
|
||||
row.status = '0' // 默认为"在押"
|
||||
row.status = '0'
|
||||
} else {
|
||||
row.status = String(row.status) // 确保是字符串类型
|
||||
row.status = String(row.status)
|
||||
}
|
||||
})
|
||||
// 如果已获取学员角色ID,过滤掉非学员用户
|
||||
if (this.studentRoleId) {
|
||||
this.filterStudentUsers(rows).then(filteredRows => {
|
||||
// 前端分页处理
|
||||
const pageNum = this.queryParams.pageNum || 1
|
||||
const pageSize = this.queryParams.pageSize || 10
|
||||
const start = (pageNum - 1) * pageSize
|
||||
const end = start + pageSize
|
||||
this.profileList = filteredRows.slice(start, end)
|
||||
this.total = filteredRows.length
|
||||
this.profileList = rows
|
||||
this.total = response.total || rows.length
|
||||
this.selectedRows = []
|
||||
this.ids = []
|
||||
this.single = true
|
||||
|
|
@ -621,103 +615,9 @@ export default {
|
|||
})
|
||||
this.loading = false
|
||||
}).catch(error => {
|
||||
console.error("过滤学员用户失败:", error)
|
||||
// 如果过滤失败,仍然显示所有用户(但不推荐)
|
||||
const pageNum = this.queryParams.pageNum || 1
|
||||
const pageSize = this.queryParams.pageSize || 10
|
||||
const start = (pageNum - 1) * pageSize
|
||||
const end = start + pageSize
|
||||
this.profileList = rows.slice(start, end)
|
||||
this.total = rows.length
|
||||
this.selectedRows = []
|
||||
this.ids = []
|
||||
this.single = true
|
||||
this.multiple = true
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.profileTable) {
|
||||
this.$refs.profileTable.clearSelection()
|
||||
}
|
||||
})
|
||||
console.error("查询学员档案列表失败:", error)
|
||||
this.loading = false
|
||||
})
|
||||
} else {
|
||||
// 如果还没有获取到学员角色ID,先获取再过滤
|
||||
this.getStudentRoleId().then(() => {
|
||||
this.filterStudentUsers(rows).then(filteredRows => {
|
||||
// 前端分页处理
|
||||
const pageNum = this.queryParams.pageNum || 1
|
||||
const pageSize = this.queryParams.pageSize || 10
|
||||
const start = (pageNum - 1) * pageSize
|
||||
const end = start + pageSize
|
||||
this.profileList = filteredRows.slice(start, end)
|
||||
this.total = filteredRows.length
|
||||
this.selectedRows = []
|
||||
this.ids = []
|
||||
this.single = true
|
||||
this.multiple = true
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.profileTable) {
|
||||
this.$refs.profileTable.clearSelection()
|
||||
}
|
||||
})
|
||||
this.loading = false
|
||||
}).catch(error => {
|
||||
console.error("过滤学员用户失败:", error)
|
||||
const pageNum = this.queryParams.pageNum || 1
|
||||
const pageSize = this.queryParams.pageSize || 10
|
||||
const start = (pageNum - 1) * pageSize
|
||||
const end = start + pageSize
|
||||
this.profileList = rows.slice(start, end)
|
||||
this.total = rows.length
|
||||
this.selectedRows = []
|
||||
this.ids = []
|
||||
this.single = true
|
||||
this.multiple = true
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.profileTable) {
|
||||
this.$refs.profileTable.clearSelection()
|
||||
}
|
||||
})
|
||||
this.loading = false
|
||||
})
|
||||
})
|
||||
}
|
||||
}).catch(error => {
|
||||
console.error("查询档案列表失败:", error)
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
/** 过滤学员用户 */
|
||||
filterStudentUsers(rows) {
|
||||
return new Promise((resolve, reject) => {
|
||||
if (!this.studentRoleId || rows.length === 0) {
|
||||
resolve(rows)
|
||||
return
|
||||
}
|
||||
// 获取所有学员用户ID列表
|
||||
allocatedUserList({
|
||||
roleId: this.studentRoleId,
|
||||
status: '0',
|
||||
pageNum: 1,
|
||||
pageSize: 10000
|
||||
}).then(response => {
|
||||
const studentUserIds = new Set()
|
||||
const studentUsers = response.rows || []
|
||||
studentUsers.forEach(user => {
|
||||
if (user.userId) {
|
||||
studentUserIds.add(user.userId)
|
||||
}
|
||||
})
|
||||
// 过滤出只包含学员用户的记录
|
||||
const filteredRows = rows.filter(row => {
|
||||
return row.userId && studentUserIds.has(row.userId)
|
||||
})
|
||||
resolve(filteredRows)
|
||||
}).catch(error => {
|
||||
console.error("获取学员用户列表失败:", error)
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
|
|
@ -737,6 +637,7 @@ export default {
|
|||
gender: undefined,
|
||||
nation: undefined,
|
||||
educationLevel: undefined,
|
||||
birthday: undefined,
|
||||
crimeName: undefined,
|
||||
sentenceTerm: undefined,
|
||||
sentenceStartDate: undefined,
|
||||
|
|
@ -973,6 +874,7 @@ export default {
|
|||
gender: (row && row.gender) || undefined,
|
||||
nation: (row && row.nation) || undefined,
|
||||
educationLevel: (row && row.educationLevel) || undefined,
|
||||
birthday: (row && row.birthday) || undefined,
|
||||
crimeName: (row && row.crimeName) || undefined,
|
||||
sentenceTerm: (row && row.sentenceTerm) || undefined,
|
||||
sentenceStartDate: undefined,
|
||||
|
|
@ -1046,12 +948,7 @@ export default {
|
|||
this.$modal.msgError("请选择要删除的记录")
|
||||
return
|
||||
}
|
||||
// 检查是否都是学员用户(非学员用户不能删除)
|
||||
this.checkStudentUsers(targets).then(isAllStudents => {
|
||||
if (!isAllStudents) {
|
||||
this.$modal.msgError("只能删除学员用户,系统管理员等非学员用户不能删除")
|
||||
return
|
||||
}
|
||||
|
||||
const profileIdSet = new Set()
|
||||
const userIdSet = new Set()
|
||||
const userIdsWithProfile = new Set() // 记录有档案的用户ID
|
||||
|
|
@ -1110,42 +1007,6 @@ export default {
|
|||
const errorMsg = error.msg || error.message || "删除失败"
|
||||
this.$modal.msgError(errorMsg)
|
||||
})
|
||||
}).catch(error => {
|
||||
console.error("检查学员用户失败:", error)
|
||||
this.$modal.msgError("检查用户角色失败,无法删除")
|
||||
})
|
||||
},
|
||||
/** 检查用户是否都是学员用户 */
|
||||
checkStudentUsers(targets) {
|
||||
return new Promise((resolve, reject) => {
|
||||
if (!this.studentRoleId || !targets || targets.length === 0) {
|
||||
resolve(false)
|
||||
return
|
||||
}
|
||||
// 获取所有学员用户ID列表
|
||||
allocatedUserList({
|
||||
roleId: this.studentRoleId,
|
||||
status: '0',
|
||||
pageNum: 1,
|
||||
pageSize: 10000
|
||||
}).then(response => {
|
||||
const studentUserIds = new Set()
|
||||
const studentUsers = response.rows || []
|
||||
studentUsers.forEach(user => {
|
||||
if (user.userId) {
|
||||
studentUserIds.add(user.userId)
|
||||
}
|
||||
})
|
||||
// 检查所有目标用户是否都是学员用户
|
||||
const allAreStudents = targets.every(item => {
|
||||
return item.userId && studentUserIds.has(item.userId)
|
||||
})
|
||||
resolve(allAreStudents)
|
||||
}).catch(error => {
|
||||
console.error("获取学员用户列表失败:", error)
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
|
|
@ -1170,10 +1031,20 @@ export default {
|
|||
handleFileSuccess(response, file, fileList) {
|
||||
this.upload.open = false
|
||||
this.upload.isUploading = false
|
||||
if (this.$refs.upload) {
|
||||
this.$refs.upload.clearFiles()
|
||||
}
|
||||
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true })
|
||||
this.getList()
|
||||
},
|
||||
// 文件上传失败处理
|
||||
handleFileError(err, file, fileList) {
|
||||
this.upload.isUploading = false
|
||||
if (this.$refs.upload) {
|
||||
this.$refs.upload.clearFiles()
|
||||
}
|
||||
this.$modal.msgError((err && (err.msg || err.message)) || "文件上传失败,请稍后重试或检查网络连接。")
|
||||
},
|
||||
// 提交上传文件
|
||||
submitFileForm() {
|
||||
const file = this.$refs.upload.uploadFiles
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
|
||||
<el-form-item label="用户名称" prop="userName">
|
||||
<el-form-item label="登录名称" prop="userName">
|
||||
<el-input
|
||||
v-model="queryParams.userName"
|
||||
placeholder="请输入用户名称"
|
||||
placeholder="请输入登录名称"
|
||||
clearable
|
||||
style="width: 240px"
|
||||
@keyup.enter.native="handleQuery"
|
||||
|
|
@ -61,8 +61,8 @@
|
|||
|
||||
<el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="用户名称" prop="userName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="用户昵称" prop="nickName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="登录名称" prop="userName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="用户姓名" prop="nickName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="邮箱" prop="email" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="手机" prop="phonenumber" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
|
|
|
|||
|
|
@ -2,10 +2,10 @@
|
|||
<!-- 授权用户 -->
|
||||
<el-dialog title="选择用户" :visible.sync="visible" width="800px" top="5vh" append-to-body>
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true">
|
||||
<el-form-item label="用户名称" prop="userName">
|
||||
<el-form-item label="登录名称" prop="userName">
|
||||
<el-input
|
||||
v-model="queryParams.userName"
|
||||
placeholder="请输入用户名称"
|
||||
placeholder="请输入登录名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
|
|
@ -26,8 +26,8 @@
|
|||
<el-row>
|
||||
<el-table @row-click="clickRow" ref="table" :data="userList" @selection-change="handleSelectionChange" height="260px">
|
||||
<el-table-column type="selection" width="55"></el-table-column>
|
||||
<el-table-column label="用户名称" prop="userName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="用户昵称" prop="nickName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="登录名称" prop="userName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="用户姓名" prop="nickName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="邮箱" prop="email" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="手机" prop="phonenumber" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<el-form ref="form" :model="form" label-width="80px">
|
||||
<el-row>
|
||||
<el-col :span="8" :offset="2">
|
||||
<el-form-item label="用户昵称" prop="nickName">
|
||||
<el-form-item label="用户姓名" prop="nickName">
|
||||
<el-input v-model="form.nickName" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
|
|
|||
|
|
@ -59,8 +59,9 @@
|
|||
<el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="50" align="center" />
|
||||
<el-table-column label="用户编号" align="center" key="userId" prop="userId" v-if="columns.userId.visible" />
|
||||
<el-table-column label="用户名称" align="center" key="userName" prop="userName" v-if="columns.userName.visible" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="用户昵称" align="center" key="nickName" prop="nickName" v-if="columns.nickName.visible" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="登录名称" align="center" key="userName" prop="userName" v-if="columns.userName.visible" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="用户姓名" align="center" key="nickName" prop="nickName" v-if="columns.nickName.visible" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="注册类型" align="center" key="registerType" prop="registerType" v-if="columns.registerType && columns.registerType.visible" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="部门" align="center" key="deptName" prop="dept.deptName" v-if="columns.deptName.visible" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="手机号码" align="center" key="phonenumber" prop="phonenumber" v-if="false" width="120" />
|
||||
<el-table-column label="状态" align="center" key="status" v-if="columns.status.visible">
|
||||
|
|
@ -114,8 +115,8 @@
|
|||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="用户昵称" prop="nickName">
|
||||
<el-input v-model="form.nickName" placeholder="请输入用户昵称/姓名" maxlength="30" @input="handleNickNameInput" />
|
||||
<el-form-item label="用户姓名" prop="nickName">
|
||||
<el-input v-model="form.nickName" placeholder="请输入用户姓名" maxlength="30" @input="handleNickNameInput" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
|
|
@ -125,18 +126,23 @@
|
|||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="注册类型" prop="registerType">
|
||||
<el-input v-model="form.registerType" placeholder="请输入注册类型" maxlength="30" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="手机号码" prop="phonenumber">
|
||||
<el-input v-model="form.phonenumber" placeholder="请输入手机号码" maxlength="11" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="邮箱" prop="email">
|
||||
<el-input v-model="form.email" placeholder="请输入邮箱" maxlength="50" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="性别" prop="sex">
|
||||
<el-select v-model="form.sex" placeholder="请选择性别">
|
||||
|
|
@ -144,6 +150,8 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="状态">
|
||||
<el-radio-group v-model="form.status">
|
||||
|
|
@ -173,24 +181,11 @@
|
|||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="生日" prop="birthday">
|
||||
<el-date-picker
|
||||
v-model="form.birthday"
|
||||
type="date"
|
||||
placeholder="选择生日"
|
||||
value-format="yyyy-MM-dd"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="学历" prop="education">
|
||||
<el-input v-model="form.education" placeholder="请输入学历" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="职业" prop="occupation">
|
||||
<el-input v-model="form.occupation" placeholder="请输入职业" />
|
||||
|
|
@ -256,7 +251,7 @@
|
|||
|
||||
<!-- 用户导入对话框 -->
|
||||
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
|
||||
<el-upload ref="upload" :limit="1" accept=".xlsx, .xls" :headers="upload.headers" :action="upload.url + '?updateSupport=' + upload.updateSupport" :disabled="upload.isUploading" :on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag>
|
||||
<el-upload ref="upload" :limit="1" accept=".xlsx, .xls" :headers="upload.headers" :action="upload.url + '?updateSupport=' + upload.updateSupport" :disabled="upload.isUploading" :on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :on-error="handleFileError" :auto-upload="false" drag>
|
||||
<i class="el-icon-upload"></i>
|
||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||
<div class="el-upload__tip text-center" slot="tip">
|
||||
|
|
@ -354,8 +349,9 @@ export default {
|
|||
// 列信息
|
||||
columns: {
|
||||
userId: { label: '用户编号', visible: true },
|
||||
userName: { label: '用户名称', visible: true },
|
||||
nickName: { label: '用户昵称', visible: true },
|
||||
userName: { label: '登录名称', visible: true },
|
||||
nickName: { label: '用户姓名', visible: true },
|
||||
registerType: { label: '注册类型', visible: true },
|
||||
deptName: { label: '部门', visible: true },
|
||||
phonenumber: { label: '手机号码', visible: false },
|
||||
status: { label: '状态', visible: true },
|
||||
|
|
@ -364,11 +360,11 @@ export default {
|
|||
// 表单校验
|
||||
rules: {
|
||||
userName: [
|
||||
{ required: true, message: "用户名称不能为空", trigger: "blur" },
|
||||
{ min: 2, max: 20, message: '用户名称长度必须介于 2 和 20 之间', trigger: 'blur' }
|
||||
{ required: true, message: "登录名称不能为空", trigger: "blur" },
|
||||
{ min: 2, max: 20, message: '登录名称长度必须介于 2 和 20 之间', trigger: 'blur' }
|
||||
],
|
||||
nickName: [
|
||||
{ required: true, message: "用户昵称不能为空", trigger: "blur" }
|
||||
{ required: true, message: "用户姓名不能为空", trigger: "blur" }
|
||||
],
|
||||
password: [
|
||||
{ required: true, message: "用户密码不能为空", trigger: "blur" },
|
||||
|
|
@ -470,6 +466,7 @@ export default {
|
|||
password: undefined,
|
||||
phonenumber: undefined,
|
||||
email: undefined,
|
||||
registerType: undefined,
|
||||
sex: undefined,
|
||||
status: "0",
|
||||
remark: undefined,
|
||||
|
|
@ -663,10 +660,20 @@ export default {
|
|||
handleFileSuccess(response, file, fileList) {
|
||||
this.upload.open = false
|
||||
this.upload.isUploading = false
|
||||
if (this.$refs.upload) {
|
||||
this.$refs.upload.clearFiles()
|
||||
}
|
||||
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true })
|
||||
this.getList()
|
||||
},
|
||||
// 文件上传失败处理
|
||||
handleFileError(err, file, fileList) {
|
||||
this.upload.isUploading = false
|
||||
if (this.$refs.upload) {
|
||||
this.$refs.upload.clearFiles()
|
||||
}
|
||||
this.$modal.msgError((err && (err.msg || err.message)) || "文件上传失败,请稍后重试或检查网络连接。")
|
||||
},
|
||||
// 提交上传文件
|
||||
submitFileForm() {
|
||||
const file = this.$refs.upload.uploadFiles
|
||||
|
|
|
|||
|
|
@ -12,9 +12,13 @@
|
|||
</div>
|
||||
<ul class="list-group list-group-striped">
|
||||
<li class="list-group-item">
|
||||
<svg-icon icon-class="user" />用户名称
|
||||
<svg-icon icon-class="user" />登录名称
|
||||
<div class="pull-right">{{ user.userName }}</div>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<svg-icon icon-class="edit" />注册类型
|
||||
<div class="pull-right">{{ user.registerType || '-' }}</div>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<svg-icon icon-class="phone" />手机号码
|
||||
<div class="pull-right">{{ user.phonenumber }}</div>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="用户昵称" prop="nickName">
|
||||
<el-form-item label="用户姓名" prop="nickName">
|
||||
<el-input v-model="form.nickName" maxlength="30" />
|
||||
</el-form-item>
|
||||
<el-form-item label="手机号码" prop="phonenumber">
|
||||
|
|
@ -37,7 +37,7 @@ export default {
|
|||
// 表单校验
|
||||
rules: {
|
||||
nickName: [
|
||||
{ required: true, message: "用户昵称不能为空", trigger: "blur" }
|
||||
{ required: true, message: "用户姓名不能为空", trigger: "blur" }
|
||||
],
|
||||
email: [
|
||||
{ required: true, message: "邮箱地址不能为空", trigger: "blur" },
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user