员工代码
This commit is contained in:
@@ -19,7 +19,10 @@
|
||||
"mcp__database-server__list_tables",
|
||||
"mcp__database-server__describe_table",
|
||||
"mcp__database-server__list_insights",
|
||||
"mcp__database-server__alter_table"
|
||||
"mcp__database-server__alter_table",
|
||||
"mcp__database-server__write_query",
|
||||
"Bash(mvn dependency:tree:*)",
|
||||
"Bash(javac:*)"
|
||||
]
|
||||
},
|
||||
"enabledMcpjsonServers": [
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
│ 信息维护 > 员工信息管理 │
|
||||
├─────────────────────────────────────────────────────────────┤
|
||||
│ ┌───────────────────────────────────────────────────────┐ │
|
||||
│ │ 搜索区: [姓名] [柜员号] [所属机构号] [身份证号] [状态▼] │ │
|
||||
│ │ 搜索区: [姓名] [柜员号] [所属部门] [身份证号] [状态▼] │ │
|
||||
│ │ [搜索] [重置] │ │
|
||||
│ └───────────────────────────────────────────────────────┘ │
|
||||
│ ┌───────────────────────────────────────────────────────┐ │
|
||||
@@ -16,9 +16,9 @@
|
||||
│ └───────────────────────────────────────────────────────┘ │
|
||||
│ ┌───────────────────────────────────────────────────────┐ │
|
||||
│ │ ┌───┬─────┬───────┬───────┬─────────┬─────┬─────────┐ │ │
|
||||
│ │ │□ │姓名 │柜员号 │身份证号│所属机构 │状态 │ 操作 │ │ │
|
||||
│ │ │□ │姓名 │柜员号 │身份证号│所属部门 │状态 │ 操作 │ │ │
|
||||
│ │ ├───┼─────┼───────┼───────┼─────────┼─────┼─────────┤ │ │
|
||||
│ │ │□ │张三 │001 │110... │1001 │在职 │详情|编辑│ │ │
|
||||
│ │ │□ │张三 │001 │110... │总部 │在职 │详情|编辑│ │ │
|
||||
│ │ │ │ │ │ │ │ │删除 │ │ │
|
||||
│ │ └───┴─────┴───────┴───────┴─────────┴─────┴─────────┘ │ │
|
||||
│ │ < 1 2 3 4 5 ... 10 > │ │
|
||||
@@ -99,8 +99,8 @@ ruoyi-ui/src/
|
||||
employeeId: Number,
|
||||
name: String,
|
||||
tellerNo: String,
|
||||
orgNo: String, // 部门 ID (dept_id)
|
||||
orgName: String, // 部门名称 (用于显示)
|
||||
deptId: Number, // 所属部门ID
|
||||
deptName: String, // 所属部门名称
|
||||
idCard: String,
|
||||
phone: String,
|
||||
hireDate: String,
|
||||
@@ -116,7 +116,7 @@ ruoyi-ui/src/
|
||||
employeeId: Number | null,
|
||||
name: String,
|
||||
tellerNo: String,
|
||||
orgNo: String, // 部门 ID (dept_id)
|
||||
deptId: Number, // 所属部门ID
|
||||
idCard: String,
|
||||
phone: String,
|
||||
hireDate: String,
|
||||
@@ -136,10 +136,10 @@ ruoyi-ui/src/
|
||||
| 接口名 | 方法 | 路径 | 说明 |
|
||||
|--------|------|------|------|
|
||||
| listEmployee | GET | /dpc/employee/list | 查询员工列表 |
|
||||
| getEmployee | GET | /dpc/employee/{id} | 获取员工详情 |
|
||||
| getEmployee | GET | /dpc/employee/{employeeId} | 获取员工详情 |
|
||||
| addEmployee | POST | /dpc/employee | 新增员工 |
|
||||
| updateEmployee | PUT | /dpc/employee | 编辑员工 |
|
||||
| delEmployee | DELETE | /dpc/employee/{ids} | 删除员工 |
|
||||
| delEmployee | DELETE | /dpc/employee/{employeeIds} | 删除员工 |
|
||||
| importTemplate | POST | /dpc/employee/importTemplate | 下载导入模板 |
|
||||
| importData | POST | /dpc/employee/importData | 导入员工信息 |
|
||||
|
||||
|
||||
@@ -8,14 +8,14 @@
|
||||
## 1. API 接口层开发
|
||||
|
||||
### 1.1 创建 API 接口文件
|
||||
- [ ] 创建 `ruoyi-ui/src/api/dpcEmployee.js` 文件
|
||||
- [ ] 实现 `listEmployee(query)` - 查询员工列表
|
||||
- [ ] 实现 `getEmployee(employeeId)` - 获取员工详情
|
||||
- [ ] 实现 `addEmployee(data)` - 新增员工
|
||||
- [ ] 实现 `updateEmployee(data)` - 编辑员工
|
||||
- [ ] 实现 `delEmployee(employeeIds)` - 删除员工
|
||||
- [ ] 实现 `importTemplate()` - 下载导入模板
|
||||
- [ ] 实现 `importData(data, updateSupport)` - 导入员工信息
|
||||
- [x] 创建 `ruoyi-ui/src/api/dpcEmployee.js` 文件
|
||||
- [x] 实现 `listEmployee(query)` - 查询员工列表
|
||||
- [x] 实现 `getEmployee(employeeId)` - 获取员工详情
|
||||
- [x] 实现 `addEmployee(data)` - 新增员工
|
||||
- [x] 实现 `updateEmployee(data)` - 编辑员工
|
||||
- [x] 实现 `delEmployee(employeeIds)` - 删除员工
|
||||
- [x] 实现 `importTemplate()` - 下载导入模板
|
||||
- [x] 实现 `importData(data, updateSupport)` - 导入员工信息
|
||||
|
||||
**验证**: API 文件包含所有7个接口方法,路径与后端 API 文档一致。
|
||||
|
||||
@@ -24,38 +24,38 @@
|
||||
## 2. 主页面组件开发
|
||||
|
||||
### 2.1 创建主页面文件
|
||||
- [ ] 创建 `ruoyi-ui/src/views/dpcEmployee/` 目录
|
||||
- [ ] 创建 `ruoyi-ui/src/views/dpcEmployee/index.vue` 文件
|
||||
- [x] 创建 `ruoyi-ui/src/views/dpcEmployee/` 目录
|
||||
- [x] 创建 `ruoyi-ui/src/views/dpcEmployee/index.vue` 文件
|
||||
|
||||
**验证**: 文件创建成功,可正常访问。
|
||||
|
||||
### 2.2 实现页面基础结构
|
||||
- [ ] 实现 `<template>` 基础布局
|
||||
- [ ] 实现搜索筛选区的表单(含部门树选择器)
|
||||
- [ ] 实现操作按钮区(新增、导入)
|
||||
- [ ] 实现员工列表表格
|
||||
- [ ] 实现分页组件
|
||||
- [x] 实现 `<template>` 基础布局
|
||||
- [x] 实现搜索筛选区的表单(含部门树选择器)
|
||||
- [x] 实现操作按钮区(新增、导入)
|
||||
- [x] 实现员工列表表格
|
||||
- [x] 实现分页组件
|
||||
|
||||
**验证**: 页面可正常渲染,布局符合设计文档。
|
||||
|
||||
### 2.3 实现数据管理逻辑
|
||||
- [ ] 定义 `data()` 数据结构
|
||||
- [x] 定义 `data()` 数据结构
|
||||
- `loading` - 加载状态
|
||||
- `employeeList` - 员工列表数据
|
||||
- `total` - 总记录数
|
||||
- `queryParams` - 查询参数
|
||||
- `showSearch` - 搜索区显示状态
|
||||
- [ ] 实现 `getList()` 方法 - 查询员工列表
|
||||
- [ ] 实现 `handleQuery()` 方法 - 搜索
|
||||
- [ ] 实现 `resetQuery()` 方法 - 重置搜索条件
|
||||
- [x] 实现 `getList()` 方法 - 查询员工列表
|
||||
- [x] 实现 `handleQuery()` 方法 - 搜索
|
||||
- [x] 实现 `resetQuery()` 方法 - 重置搜索条件
|
||||
|
||||
**验证**: 页面加载时正确显示员工列表,搜索和重置功能正常。
|
||||
|
||||
### 2.4 实现列表表格
|
||||
- [ ] 添加表格列:复选框、姓名、柜员号、身份证号、所属部门、电话、状态、操作
|
||||
- [ ] 实现状态标签显示(在职/离职)
|
||||
- [ ] 实现操作列按钮:详情、编辑、删除
|
||||
- [ ] 实现 `handleSelectionChange()` 方法 - 多选处理
|
||||
- [x] 添加表格列:复选框、姓名、柜员号、身份证号、所属部门、电话、状态、操作
|
||||
- [x] 实现状态标签显示(在职/离职)
|
||||
- [x] 实现操作列按钮:详情、编辑、删除
|
||||
- [x] 实现 `handleSelectionChange()` 方法 - 多选处理
|
||||
|
||||
**验证**: 列表正确显示所有字段,状态标签正确着色。
|
||||
|
||||
@@ -64,9 +64,9 @@
|
||||
## 3. 新增/编辑弹窗开发
|
||||
|
||||
### 3.1 实现弹窗结构
|
||||
- [ ] 添加新增/编辑弹窗的 `<el-dialog>`
|
||||
- [ ] 实现弹窗标题动态显示
|
||||
- [ ] 实现员工基本信息表单
|
||||
- [x] 添加新增/编辑弹窗的 `<el-dialog>`
|
||||
- [x] 实现弹窗标题动态显示
|
||||
- [x] 实现员工基本信息表单
|
||||
- 姓名输入框(必填,最大100字符)
|
||||
- 柜员号输入框(必填,最大50字符)
|
||||
- 所属部门选择器(el-tree-select,关联 sys_dept)
|
||||
@@ -78,40 +78,40 @@
|
||||
**验证**: 弹窗可正常打开和关闭,表单字段正确显示。
|
||||
|
||||
### 3.2 实现亲属子表单
|
||||
- [ ] 添加亲属信息区域
|
||||
- [ ] 实现"+ 添加亲属"按钮
|
||||
- [ ] 实现亲属列表表格(亲属姓名、身份证号、电话、关系、操作)
|
||||
- [ ] 实现亲属行的删除按钮
|
||||
- [ ] 添加 `relatives` 数据字段
|
||||
- [x] 添加亲属信息区域
|
||||
- [x] 实现"+ 添加亲属"按钮
|
||||
- [x] 实现亲属列表表格(亲属姓名、身份证号、电话、关系、操作)
|
||||
- [x] 实现亲属行的删除按钮
|
||||
- [x] 添加 `relatives` 数据字段
|
||||
|
||||
**验证**: 可以动态添加和删除亲属行。
|
||||
|
||||
### 3.3 实现表单验证
|
||||
- [ ] 定义 `rules` 验证规则
|
||||
- [x] 定义 `rules` 验证规则
|
||||
- 姓名:必填,最大100字符
|
||||
- 柜员号:必填,最大50字符
|
||||
- 身份证号:必填,格式校验(18位)
|
||||
- 电话:选填,格式校验(11位手机号)
|
||||
- 亲属姓名:必填
|
||||
- [ ] 实现 `reset()` 方法 - 重置表单
|
||||
- [ ] 实现 `cancel()` 方法 - 取消操作
|
||||
- [x] 实现 `reset()` 方法 - 重置表单
|
||||
- [x] 实现 `cancel()` 方法 - 取消操作
|
||||
|
||||
**验证**: 表单验证规则正确触发,错误提示显示正确。
|
||||
|
||||
### 3.4 实现新增逻辑
|
||||
- [ ] 实现 `handleAdd()` 方法 - 打开新增弹窗
|
||||
- [ ] 实现 `submitForm()` 方法 - 提交新增
|
||||
- [ ] 集成 `addEmployee` API
|
||||
- [ ] 处理成功/失败响应
|
||||
- [x] 实现 `handleAdd()` 方法 - 打开新增弹窗
|
||||
- [x] 实现 `submitForm()` 方法 - 提交新增
|
||||
- [x] 集成 `addEmployee` API
|
||||
- [x] 处理成功/失败响应
|
||||
|
||||
**验证**: 可以成功新增员工及其亲属信息。
|
||||
|
||||
### 3.5 实现编辑逻辑
|
||||
- [ ] 实现 `handleUpdate(row)` 方法 - 打开编辑弹窗
|
||||
- [ ] 集成 `getEmployee` API 获取详情
|
||||
- [ ] 回显员工信息和亲属列表
|
||||
- [ ] 修改 `submitForm()` 方法处理编辑提交
|
||||
- [ ] 集成 `updateEmployee` API
|
||||
- [x] 实现 `handleUpdate(row)` 方法 - 打开编辑弹窗
|
||||
- [x] 集成 `getEmployee` API 获取详情
|
||||
- [x] 回显员工信息和亲属列表
|
||||
- [x] 修改 `submitForm()` 方法处理编辑提交
|
||||
- [x] 集成 `updateEmployee` API
|
||||
|
||||
**验证**: 可以成功编辑员工信息和亲属信息,数据正确回显。
|
||||
|
||||
@@ -120,18 +120,18 @@
|
||||
## 4. 详情弹窗开发
|
||||
|
||||
### 4.1 实现详情弹窗结构
|
||||
- [ ] 添加详情弹窗的 `<el-dialog>`
|
||||
- [ ] 实现员工基本信息展示区(只读)
|
||||
- [ ] 实现亲属列表展示区(只读)
|
||||
- [ ] 实现"暂无亲属信息"提示
|
||||
- [x] 添加详情弹窗的 `<el-dialog>`
|
||||
- [x] 实现员工基本信息展示区(只读)
|
||||
- [x] 实现亲属列表展示区(只读)
|
||||
- [x] 实现"暂无亲属信息"提示
|
||||
|
||||
**验证**: 详情弹窗正确显示员工信息和亲属列表。
|
||||
|
||||
### 4.2 实现详情查看逻辑
|
||||
- [ ] 添加 `detailOpen` 数据字段
|
||||
- [ ] 添加 `employeeDetail` 数据字段
|
||||
- [ ] 实现 `handleDetail(row)` 方法
|
||||
- [ ] 集成 `getEmployee` API
|
||||
- [x] 添加 `detailOpen` 数据字段
|
||||
- [x] 添加 `employeeDetail` 数据字段
|
||||
- [x] 实现 `handleDetail(row)` 方法
|
||||
- [x] 集成 `getEmployee` API
|
||||
|
||||
**验证**: 点击详情按钮可正确查看员工完整信息。
|
||||
|
||||
@@ -140,11 +140,11 @@
|
||||
## 5. 删除功能开发
|
||||
|
||||
### 5.1 实现删除逻辑
|
||||
- [ ] 实现 `handleDelete(row)` 方法
|
||||
- [ ] 添加删除确认对话框
|
||||
- [ ] 集成 `delEmployee` API
|
||||
- [ ] 处理成功/失败响应
|
||||
- [ ] 删除后刷新列表
|
||||
- [x] 实现 `handleDelete(row)` 方法
|
||||
- [x] 添加删除确认对话框
|
||||
- [x] 集成 `delEmployee` API
|
||||
- [x] 处理成功/失败响应
|
||||
- [x] 删除后刷新列表
|
||||
|
||||
**验证**: 可以成功删除员工记录,删除确认对话框正常显示。
|
||||
|
||||
@@ -153,21 +153,21 @@
|
||||
## 6. 导入功能开发
|
||||
|
||||
### 6.1 实现导入弹窗
|
||||
- [ ] 添加导入弹窗的 `<el-dialog>`
|
||||
- [ ] 实现 `<el-upload>` 组件
|
||||
- [ ] 配置上传参数(headers, action, 限制文件类型)
|
||||
- [ ] 实现"更新已存在数据"复选框
|
||||
- [ ] 实现"下载模板"链接
|
||||
- [x] 添加导入弹窗的 `<el-dialog>`
|
||||
- [x] 实现 `<el-upload>` 组件
|
||||
- [x] 配置上传参数(headers, action, 限制文件类型)
|
||||
- [x] 实现"更新已存在数据"复选框
|
||||
- [x] 实现"下载模板"链接
|
||||
|
||||
**验证**: 导入弹窗正常显示,可以正确选择文件。
|
||||
|
||||
### 6.2 实现导入逻辑
|
||||
- [ ] 添加 `upload` 数据对象
|
||||
- [ ] 实现 `handleImport()` 方法 - 打开导入弹窗
|
||||
- [ ] 实现 `importTemplate()` 方法 - 下载模板
|
||||
- [ ] 实现 `handleFileUploadProgress()` - 上传进度
|
||||
- [ ] 实现 `handleFileSuccess()` - 上传成功处理
|
||||
- [ ] 实现 `submitFileForm()` - 提交文件
|
||||
- [x] 添加 `upload` 数据对象
|
||||
- [x] 实现 `handleImport()` 方法 - 打开导入弹窗
|
||||
- [x] 实现 `importTemplate()` 方法 - 下载模板
|
||||
- [x] 实现 `handleFileUploadProgress()` - 上传进度
|
||||
- [x] 实现 `handleFileSuccess()` - 上传成功处理
|
||||
- [x] 实现 `submitFileForm()` - 提交文件
|
||||
|
||||
**验证**: 可以成功下载模板,上传文件后正确显示导入结果。
|
||||
|
||||
@@ -176,11 +176,11 @@
|
||||
## 7. 权限控制
|
||||
|
||||
### 7.1 实现按钮权限控制
|
||||
- [ ] 新增按钮添加 `v-hasPermi="['dpc:employee:add']"`
|
||||
- [ ] 编辑按钮添加 `v-hasPermi="['dpc:employee:edit']"`
|
||||
- [ ] 删除按钮添加 `v-hasPermi="['dpc:employee:remove']"`
|
||||
- [ ] 详情按钮添加 `v-hasPermi="['dpc:employee:query']"`
|
||||
- [ ] 导入按钮添加 `v-hasPermi="['dpc:employee:import']"`
|
||||
- [x] 新增按钮添加 `v-hasPermi="['dpc:employee:add']"`
|
||||
- [x] 编辑按钮添加 `v-hasPermi="['dpc:employee:edit']"`
|
||||
- [x] 删除按钮添加 `v-hasPermi="['dpc:employee:remove']"`
|
||||
- [x] 详情按钮添加 `v-hasPermi="['dpc:employee:query']"`
|
||||
- [x] 导入按钮添加 `v-hasPermi="['dpc:employee:import']"`
|
||||
|
||||
**验证**: 按钮根据用户权限正确显示或隐藏。
|
||||
|
||||
@@ -189,23 +189,23 @@
|
||||
## 8. 样式和交互优化
|
||||
|
||||
### 9.1 实现加载状态
|
||||
- [ ] 列表加载时显示 loading 遮罩
|
||||
- [ ] 提交表单时禁用提交按钮
|
||||
- [ ] 文件上传时显示上传进度
|
||||
- [x] 列表加载时显示 loading 遮罩
|
||||
- [x] 提交表单时禁用提交按钮
|
||||
- [x] 文件上传时显示上传进度
|
||||
|
||||
**验证**: 各种加载状态正确显示。
|
||||
|
||||
### 9.2 实现用户反馈
|
||||
- [ ] 操作成功显示成功提示
|
||||
- [ ] 操作失败显示错误提示
|
||||
- [ ] 导入结果显示详细信息
|
||||
- [x] 操作成功显示成功提示
|
||||
- [x] 操作失败显示错误提示
|
||||
- [x] 导入结果显示详细信息
|
||||
|
||||
**验证**: 用户反馈消息清晰友好。
|
||||
|
||||
### 9.3 响应式布局
|
||||
- [ ] 搜索筛选区响应式布局
|
||||
- [ ] 表格支持横向滚动
|
||||
- [ ] 弹窗适配小屏幕
|
||||
- [x] 搜索筛选区响应式布局
|
||||
- [x] 表格支持横向滚动
|
||||
- [x] 弹窗适配小屏幕
|
||||
|
||||
**验证**: 页面在不同屏幕尺寸下正常显示。
|
||||
|
||||
@@ -242,12 +242,12 @@
|
||||
## 10. 菜单配置
|
||||
|
||||
### 11.1 数据库菜单配置
|
||||
- [ ] 在 `sys_menu` 表中插入"信息维护"父菜单(如果不存在)
|
||||
- [ ] 在 `sys_menu` 表中插入"员工信息管理"子菜单
|
||||
- [ ] 配置菜单路由为 `dpcEmployee`
|
||||
- [ ] 配置菜单组件为 `dpcEmployee/index`
|
||||
- [ ] 配置菜单权限标识
|
||||
- [ ] 配置菜单图标
|
||||
- [x] 在 `sys_menu` 表中插入"信息维护"父菜单(如果不存在)
|
||||
- [x] 在 `sys_menu` 表中插入"员工信息管理"子菜单
|
||||
- [x] 配置菜单路由为 `employee`
|
||||
- [x] 配置菜单组件为 `dpcEmployee/index`
|
||||
- [x] 配置菜单权限标识
|
||||
- [x] 配置菜单图标
|
||||
|
||||
**验证**: 菜单正确显示,点击可跳转到员工信息管理页面。
|
||||
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
package com.ruoyi.common.utils;
|
||||
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* 身份证号校验工具类
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class IdCardUtil {
|
||||
|
||||
/**
|
||||
* 18位身份证号正则表达式
|
||||
*/
|
||||
private static final Pattern ID_CARD_PATTERN = Pattern.compile(
|
||||
"^[1-9]\\d{5}(18|19|20)\\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\\d|3[01])\\d{3}[\\dXx]$"
|
||||
);
|
||||
|
||||
/**
|
||||
* 身份证号加权因子
|
||||
*/
|
||||
private static final int[] ID_CARD_WEIGHT = {7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2};
|
||||
|
||||
/**
|
||||
* 身份证号校验码对应值
|
||||
*/
|
||||
private static final char[] ID_CARD_CHECK_CODE = {'1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2'};
|
||||
|
||||
/**
|
||||
* 校验身份证号格式
|
||||
*
|
||||
* @param idCard 身份证号
|
||||
* @return 是否有效
|
||||
*/
|
||||
public static boolean isValid(String idCard) {
|
||||
if (StringUtils.isEmpty(idCard)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// 基本格式校验
|
||||
if (!ID_CARD_PATTERN.matcher(idCard).matches()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// 校验码验证
|
||||
return checkVerifyCode(idCard);
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验身份证校验码
|
||||
*
|
||||
* @param idCard 身份证号
|
||||
* @return 校验码是否正确
|
||||
*/
|
||||
private static boolean checkVerifyCode(String idCard) {
|
||||
char[] chars = idCard.toCharArray();
|
||||
int sum = 0;
|
||||
|
||||
// 计算前17位与加权因子的乘积之和
|
||||
for (int i = 0; i < 17; i++) {
|
||||
sum += (chars[i] - '0') * ID_CARD_WEIGHT[i];
|
||||
}
|
||||
|
||||
// 取模得到校验码索引
|
||||
int checkCodeIndex = sum % 11;
|
||||
char expectedCheckCode = ID_CARD_CHECK_CODE[checkCodeIndex];
|
||||
|
||||
// 比较校验码(不区分大小写)
|
||||
return Character.toUpperCase(chars[17]) == expectedCheckCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取校验错误信息
|
||||
*
|
||||
* @param idCard 身份证号
|
||||
* @return 错误信息,如果正确返回null
|
||||
*/
|
||||
public static String getErrorMessage(String idCard) {
|
||||
if (StringUtils.isEmpty(idCard)) {
|
||||
return "身份证号不能为空";
|
||||
}
|
||||
|
||||
if (idCard.length() != 18) {
|
||||
return "身份证号长度必须为18位";
|
||||
}
|
||||
|
||||
if (!ID_CARD_PATTERN.matcher(idCard).matches()) {
|
||||
return "身份证号格式不正确";
|
||||
}
|
||||
|
||||
if (!checkVerifyCode(idCard)) {
|
||||
return "身份证号校验码不正确";
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -8,13 +8,14 @@ import com.ruoyi.common.core.page.PageDomain;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.page.TableSupport;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.dpc.domain.DpcEmployee;
|
||||
import com.ruoyi.dpc.domain.dto.DpcEmployeeAddDTO;
|
||||
import com.ruoyi.dpc.domain.dto.DpcEmployeeEditDTO;
|
||||
import com.ruoyi.dpc.domain.dto.DpcEmployeeQueryDTO;
|
||||
import com.ruoyi.dpc.domain.excel.DpcEmployeeExcel;
|
||||
import com.ruoyi.dpc.domain.vo.DpcEmployeeVO;
|
||||
import com.ruoyi.dpc.service.IDpcEmployeeService;
|
||||
import com.ruoyi.dpc.utils.EasyExcelUtil;
|
||||
import com.ruoyi.dpc.utils.handler.EmployeeStatusSheetWriteHandler;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
@@ -49,7 +50,7 @@ public class DpcEmployeeController extends BaseController {
|
||||
public TableDataInfo list(DpcEmployeeQueryDTO queryDTO) {
|
||||
// 使用MyBatis Plus分页
|
||||
PageDomain pageDomain = TableSupport.buildPageRequest();
|
||||
Page<DpcEmployee> page = new Page<>(pageDomain.getPageNum(), pageDomain.getPageSize());
|
||||
Page<DpcEmployeeVO> page = new Page<>(pageDomain.getPageNum(), pageDomain.getPageSize());
|
||||
Page<DpcEmployeeVO> result = employeeService.selectEmployeePage(page, queryDTO);
|
||||
return getDataTable(result.getRecords(), result.getTotal());
|
||||
}
|
||||
@@ -62,9 +63,8 @@ public class DpcEmployeeController extends BaseController {
|
||||
@Log(title = "员工信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, DpcEmployeeQueryDTO queryDTO) {
|
||||
List<DpcEmployee> list = employeeService.selectEmployeeListForExport(queryDTO);
|
||||
ExcelUtil<DpcEmployee> util = new ExcelUtil<>(DpcEmployee.class);
|
||||
util.exportExcel(response, list, "员工信息数据");
|
||||
List<DpcEmployeeExcel> list = employeeService.selectEmployeeListForExport(queryDTO);
|
||||
EasyExcelUtil.exportExcel(response, list, DpcEmployeeExcel.class, "员工信息");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -116,8 +116,7 @@ public class DpcEmployeeController extends BaseController {
|
||||
@Operation(summary = "下载导入模板")
|
||||
@PostMapping("/importTemplate")
|
||||
public void importTemplate(HttpServletResponse response) {
|
||||
ExcelUtil<DpcEmployee> util = new ExcelUtil<>(DpcEmployee.class);
|
||||
util.importTemplateExcel(response, "员工信息数据");
|
||||
EasyExcelUtil.importTemplateExcel(response, DpcEmployeeExcel.class, "员工信息", new EmployeeStatusSheetWriteHandler());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -128,27 +127,8 @@ public class DpcEmployeeController extends BaseController {
|
||||
@Log(title = "员工信息", businessType = BusinessType.IMPORT)
|
||||
@PostMapping("/importData")
|
||||
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception {
|
||||
ExcelUtil<DpcEmployee> util = new ExcelUtil<>(DpcEmployee.class);
|
||||
List<DpcEmployee> list = util.importExcel(file.getInputStream());
|
||||
List<DpcEmployeeAddDTO> addDTOList = convertToAddDTOList(list);
|
||||
String message = employeeService.importEmployee(addDTOList, updateSupport);
|
||||
List<DpcEmployeeExcel> list = EasyExcelUtil.importExcel(file.getInputStream(), DpcEmployeeExcel.class);
|
||||
String message = employeeService.importEmployee(list, updateSupport);
|
||||
return success(message);
|
||||
}
|
||||
|
||||
/**
|
||||
* 转换为AddDTO列表
|
||||
*/
|
||||
private List<DpcEmployeeAddDTO> convertToAddDTOList(List<DpcEmployee> list) {
|
||||
return list.stream().map(entity -> {
|
||||
DpcEmployeeAddDTO dto = new DpcEmployeeAddDTO();
|
||||
dto.setName(entity.getName());
|
||||
dto.setTellerNo(entity.getTellerNo());
|
||||
dto.setDeptId(entity.getDeptId());
|
||||
dto.setIdCard(entity.getIdCard());
|
||||
dto.setPhone(entity.getPhone());
|
||||
dto.setHireDate(entity.getHireDate());
|
||||
dto.setStatus(entity.getStatus());
|
||||
return dto;
|
||||
}).toList();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,13 +8,14 @@ import com.ruoyi.common.core.page.PageDomain;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.page.TableSupport;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.dpc.domain.DpcIntermediaryBlacklist;
|
||||
import com.ruoyi.dpc.domain.dto.DpcIntermediaryBlacklistAddDTO;
|
||||
import com.ruoyi.dpc.domain.dto.DpcIntermediaryBlacklistEditDTO;
|
||||
import com.ruoyi.dpc.domain.dto.DpcIntermediaryBlacklistQueryDTO;
|
||||
import com.ruoyi.dpc.domain.excel.DpcIntermediaryBlacklistExcel;
|
||||
import com.ruoyi.dpc.domain.vo.DpcIntermediaryBlacklistVO;
|
||||
import com.ruoyi.dpc.service.IDpcIntermediaryBlacklistService;
|
||||
import com.ruoyi.dpc.utils.EasyExcelUtil;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
@@ -62,9 +63,8 @@ public class DpcIntermediaryBlacklistController extends BaseController {
|
||||
@Log(title = "中介黑名单", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, DpcIntermediaryBlacklistQueryDTO queryDTO) {
|
||||
List<DpcIntermediaryBlacklist> list = intermediaryService.selectIntermediaryListForExport(queryDTO);
|
||||
ExcelUtil<DpcIntermediaryBlacklist> util = new ExcelUtil<>(DpcIntermediaryBlacklist.class);
|
||||
util.exportExcel(response, list, "中介黑名单数据");
|
||||
List<DpcIntermediaryBlacklistExcel> list = intermediaryService.selectIntermediaryListForExport(queryDTO);
|
||||
EasyExcelUtil.exportExcel(response, list, DpcIntermediaryBlacklistExcel.class, "中介黑名单");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -116,8 +116,7 @@ public class DpcIntermediaryBlacklistController extends BaseController {
|
||||
@Operation(summary = "下载导入模板")
|
||||
@PostMapping("/importTemplate")
|
||||
public void importTemplate(HttpServletResponse response) {
|
||||
ExcelUtil<DpcIntermediaryBlacklist> util = new ExcelUtil<>(DpcIntermediaryBlacklist.class);
|
||||
util.importTemplateExcel(response, "中介黑名单数据");
|
||||
EasyExcelUtil.importTemplateExcel(response, DpcIntermediaryBlacklistExcel.class, "中介黑名单");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -128,25 +127,8 @@ public class DpcIntermediaryBlacklistController extends BaseController {
|
||||
@Log(title = "中介黑名单", businessType = BusinessType.IMPORT)
|
||||
@PostMapping("/importData")
|
||||
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception {
|
||||
ExcelUtil<DpcIntermediaryBlacklist> util = new ExcelUtil<>(DpcIntermediaryBlacklist.class);
|
||||
List<DpcIntermediaryBlacklist> list = util.importExcel(file.getInputStream());
|
||||
List<DpcIntermediaryBlacklistAddDTO> addDTOList = convertToAddDTOList(list);
|
||||
String message = intermediaryService.importIntermediary(addDTOList, updateSupport);
|
||||
List<DpcIntermediaryBlacklistExcel> list = EasyExcelUtil.importExcel(file.getInputStream(), DpcIntermediaryBlacklistExcel.class);
|
||||
String message = intermediaryService.importIntermediary(list, updateSupport);
|
||||
return success(message);
|
||||
}
|
||||
|
||||
/**
|
||||
* 转换为AddDTO列表
|
||||
*/
|
||||
private List<DpcIntermediaryBlacklistAddDTO> convertToAddDTOList(List<DpcIntermediaryBlacklist> list) {
|
||||
return list.stream().map(entity -> {
|
||||
DpcIntermediaryBlacklistAddDTO dto = new DpcIntermediaryBlacklistAddDTO();
|
||||
dto.setName(entity.getName());
|
||||
dto.setCertificateNo(entity.getCertificateNo());
|
||||
dto.setIntermediaryType(entity.getIntermediaryType());
|
||||
dto.setStatus(entity.getStatus());
|
||||
dto.setRemark(entity.getRemark());
|
||||
return dto;
|
||||
}).toList();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
@@ -28,31 +27,24 @@ public class DpcEmployee implements Serializable {
|
||||
private Long employeeId;
|
||||
|
||||
/** 姓名 */
|
||||
@Excel(name = "姓名")
|
||||
private String name;
|
||||
|
||||
/** 柜员号 */
|
||||
@Excel(name = "柜员号")
|
||||
private String tellerNo;
|
||||
|
||||
/** 所属部门ID */
|
||||
@Excel(name = "所属部门ID")
|
||||
private Long deptId;
|
||||
|
||||
/** 身份证号 */
|
||||
@Excel(name = "身份证号")
|
||||
private String idCard;
|
||||
|
||||
/** 电话 */
|
||||
@Excel(name = "电话")
|
||||
private String phone;
|
||||
|
||||
/** 入职时间 */
|
||||
@Excel(name = "入职时间", dateFormat = "yyyy-MM-dd")
|
||||
private Date hireDate;
|
||||
|
||||
/** 状态 */
|
||||
@Excel(name = "状态", readConverterExp = "0=在职,1=离职")
|
||||
private String status;
|
||||
|
||||
/** 创建者 */
|
||||
|
||||
@@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
@@ -31,19 +30,15 @@ public class DpcEmployeeRelative implements Serializable {
|
||||
private Long employeeId;
|
||||
|
||||
/** 亲属姓名 */
|
||||
@Excel(name = "亲属姓名")
|
||||
private String relativeName;
|
||||
|
||||
/** 亲属身份证号 */
|
||||
@Excel(name = "亲属身份证号")
|
||||
private String relativeIdCard;
|
||||
|
||||
/** 亲属手机号 */
|
||||
@Excel(name = "亲属手机号")
|
||||
private String relativePhone;
|
||||
|
||||
/** 与员工关系 */
|
||||
@Excel(name = "与员工关系")
|
||||
private String relationship;
|
||||
|
||||
/** 创建者 */
|
||||
|
||||
@@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
@@ -28,23 +27,18 @@ public class DpcIntermediaryBlacklist implements Serializable {
|
||||
private Long intermediaryId;
|
||||
|
||||
/** 姓名/机构名称 */
|
||||
@Excel(name = "姓名/机构名称")
|
||||
private String name;
|
||||
|
||||
/** 证件号 */
|
||||
@Excel(name = "证件号")
|
||||
private String certificateNo;
|
||||
|
||||
/** 中介类型 */
|
||||
@Excel(name = "中介类型", readConverterExp = "1=个人,2=机构")
|
||||
private String intermediaryType;
|
||||
|
||||
/** 状态 */
|
||||
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
|
||||
private String status;
|
||||
|
||||
/** 备注 */
|
||||
@Excel(name = "备注")
|
||||
private String remark;
|
||||
|
||||
/** 创建者 */
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.ruoyi.dpc.domain.dto;
|
||||
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.Pattern;
|
||||
import jakarta.validation.constraints.Size;
|
||||
@@ -24,38 +23,31 @@ public class DpcEmployeeAddDTO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 姓名 */
|
||||
@Excel(name = "姓名")
|
||||
@NotBlank(message = "姓名不能为空")
|
||||
@Size(max = 100, message = "姓名长度不能超过100个字符")
|
||||
private String name;
|
||||
|
||||
/** 柜员号 */
|
||||
@Excel(name = "柜员号")
|
||||
@NotBlank(message = "柜员号不能为空")
|
||||
@Size(max = 50, message = "柜员号长度不能超过50个字符")
|
||||
private String tellerNo;
|
||||
|
||||
/** 所属部门ID */
|
||||
@Excel(name = "所属部门ID")
|
||||
private Long deptId;
|
||||
|
||||
/** 身份证号 */
|
||||
@Excel(name = "身份证号")
|
||||
@NotBlank(message = "身份证号不能为空")
|
||||
@Pattern(regexp = "^[1-9]\\d{5}(18|19|20)\\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\\d|3[01])\\d{3}[0-9Xx]$", message = "身份证号格式不正确")
|
||||
private String idCard;
|
||||
|
||||
/** 电话 */
|
||||
@Excel(name = "电话")
|
||||
@Pattern(regexp = "^1[3-9]\\d{9}$", message = "电话格式不正确")
|
||||
private String phone;
|
||||
|
||||
/** 入职时间 */
|
||||
@Excel(name = "入职时间", dateFormat = "yyyy-MM-dd")
|
||||
private Date hireDate;
|
||||
|
||||
/** 状态 */
|
||||
@Excel(name = "状态", readConverterExp = "0=在职,1=离职")
|
||||
@NotBlank(message = "状态不能为空")
|
||||
private String status;
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.ruoyi.dpc.domain.dto;
|
||||
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Pattern;
|
||||
import jakarta.validation.constraints.Size;
|
||||
@@ -28,35 +27,28 @@ public class DpcEmployeeEditDTO implements Serializable {
|
||||
private Long employeeId;
|
||||
|
||||
/** 姓名 */
|
||||
@Excel(name = "姓名")
|
||||
@Size(max = 100, message = "姓名长度不能超过100个字符")
|
||||
private String name;
|
||||
|
||||
/** 柜员号 */
|
||||
@Excel(name = "柜员号")
|
||||
@Size(max = 50, message = "柜员号长度不能超过50个字符")
|
||||
private String tellerNo;
|
||||
|
||||
/** 所属部门ID */
|
||||
@Excel(name = "所属部门ID")
|
||||
private Long deptId;
|
||||
|
||||
/** 身份证号 */
|
||||
@Excel(name = "身份证号")
|
||||
@Pattern(regexp = "^[1-9]\\d{5}(18|19|20)\\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\\d|3[01])\\d{3}[0-9Xx]$", message = "身份证号格式不正确")
|
||||
private String idCard;
|
||||
|
||||
/** 电话 */
|
||||
@Excel(name = "电话")
|
||||
@Pattern(regexp = "^1[3-9]\\d{9}$", message = "电话格式不正确")
|
||||
private String phone;
|
||||
|
||||
/** 入职时间 */
|
||||
@Excel(name = "入职时间", dateFormat = "yyyy-MM-dd")
|
||||
private Date hireDate;
|
||||
|
||||
/** 状态 */
|
||||
@Excel(name = "状态", readConverterExp = "0=在职,1=离职")
|
||||
private String status;
|
||||
|
||||
/** 亲属列表 */
|
||||
|
||||
@@ -26,7 +26,7 @@ public class DpcEmployeeQueryDTO implements Serializable {
|
||||
/** 所属部门ID */
|
||||
private Long deptId;
|
||||
|
||||
/** 身份证号(精确查询) */
|
||||
/** 身份证号(模糊查询) */
|
||||
private String idCard;
|
||||
|
||||
/** 状态 */
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.ruoyi.dpc.domain.dto;
|
||||
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.Pattern;
|
||||
import jakarta.validation.constraints.Size;
|
||||
@@ -22,23 +21,19 @@ public class DpcEmployeeRelativeAddDTO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 亲属姓名 */
|
||||
@Excel(name = "亲属姓名")
|
||||
@NotBlank(message = "亲属姓名不能为空")
|
||||
@Size(max = 100, message = "亲属姓名长度不能超过100个字符")
|
||||
private String relativeName;
|
||||
|
||||
/** 亲属身份证号 */
|
||||
@Excel(name = "亲属身份证号")
|
||||
@Pattern(regexp = "^[1-9]\\d{5}(18|19|20)\\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\\d|3[01])\\d{3}[0-9Xx]$", message = "亲属身份证号格式不正确")
|
||||
private String relativeIdCard;
|
||||
|
||||
/** 亲属手机号 */
|
||||
@Excel(name = "亲属手机号")
|
||||
@Pattern(regexp = "^1[3-9]\\d{9}$", message = "亲属手机号格式不正确")
|
||||
private String relativePhone;
|
||||
|
||||
/** 与员工关系 */
|
||||
@Excel(name = "与员工关系")
|
||||
@NotBlank(message = "与员工关系不能为空")
|
||||
@Size(max = 50, message = "与员工关系长度不能超过50个字符")
|
||||
private String relationship;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.ruoyi.dpc.domain.dto;
|
||||
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.Size;
|
||||
|
||||
@@ -19,28 +18,23 @@ public class DpcIntermediaryBlacklistAddDTO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 姓名/机构名称 */
|
||||
@Excel(name = "姓名/机构名称")
|
||||
@NotBlank(message = "姓名/机构名称不能为空")
|
||||
@Size(min = 1, max = 100, message = "姓名/机构名称长度不能超过100个字符")
|
||||
private String name;
|
||||
|
||||
/** 证件号 */
|
||||
@Excel(name = "证件号")
|
||||
@Size(max = 50, message = "证件号长度不能超过50个字符")
|
||||
private String certificateNo;
|
||||
|
||||
/** 中介类型 */
|
||||
@Excel(name = "中介类型", readConverterExp = "1=个人,2=机构")
|
||||
@NotBlank(message = "中介类型不能为空")
|
||||
private String intermediaryType;
|
||||
|
||||
/** 状态 */
|
||||
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
|
||||
@NotBlank(message = "状态不能为空")
|
||||
private String status;
|
||||
|
||||
/** 备注 */
|
||||
@Excel(name = "备注")
|
||||
@Size(max = 500, message = "备注长度不能超过500个字符")
|
||||
private String remark;
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.ruoyi.dpc.domain.dto;
|
||||
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
@@ -24,28 +23,23 @@ public class DpcIntermediaryBlacklistEditDTO implements Serializable {
|
||||
private Long intermediaryId;
|
||||
|
||||
/** 姓名/机构名称 */
|
||||
@Excel(name = "姓名/机构名称")
|
||||
@NotBlank(message = "姓名/机构名称不能为空")
|
||||
@Size(min = 1, max = 100, message = "姓名/机构名称长度不能超过100个字符")
|
||||
private String name;
|
||||
|
||||
/** 证件号 */
|
||||
@Excel(name = "证件号")
|
||||
@Size(max = 50, message = "证件号长度不能超过50个字符")
|
||||
private String certificateNo;
|
||||
|
||||
/** 中介类型 */
|
||||
@Excel(name = "中介类型", readConverterExp = "1=个人,2=机构")
|
||||
@NotBlank(message = "中介类型不能为空")
|
||||
private String intermediaryType;
|
||||
|
||||
/** 状态 */
|
||||
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
|
||||
@NotBlank(message = "状态不能为空")
|
||||
private String status;
|
||||
|
||||
/** 备注 */
|
||||
@Excel(name = "备注")
|
||||
@Size(max = 500, message = "备注长度不能超过500个字符")
|
||||
private String remark;
|
||||
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.ruoyi.dpc.domain.excel;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
||||
import com.ruoyi.dpc.utils.converter.EmployeeStatusConverter;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 员工信息Excel导入导出对象
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-01-28
|
||||
*/
|
||||
@Data
|
||||
public class DpcEmployeeExcel implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 姓名 */
|
||||
@ExcelProperty(value = "姓名", index = 0)
|
||||
@ColumnWidth(15)
|
||||
private String name;
|
||||
|
||||
/** 柜员号 */
|
||||
@ExcelProperty(value = "柜员号", index = 1)
|
||||
@ColumnWidth(15)
|
||||
private String tellerNo;
|
||||
|
||||
/** 所属部门ID */
|
||||
@ExcelProperty(value = "所属部门ID", index = 2)
|
||||
@ColumnWidth(15)
|
||||
private Long deptId;
|
||||
|
||||
/** 身份证号 */
|
||||
@ExcelProperty(value = "身份证号", index = 3)
|
||||
@ColumnWidth(20)
|
||||
private String idCard;
|
||||
|
||||
/** 电话 */
|
||||
@ExcelProperty(value = "电话", index = 4)
|
||||
@ColumnWidth(15)
|
||||
private String phone;
|
||||
|
||||
/** 入职时间 */
|
||||
@ExcelProperty(value = "入职时间", index = 5)
|
||||
@ColumnWidth(15)
|
||||
private Date hireDate;
|
||||
|
||||
/** 状态 */
|
||||
@ExcelProperty(value = "状态", converter = EmployeeStatusConverter.class, index = 6)
|
||||
@ColumnWidth(10)
|
||||
private String status;
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.ruoyi.dpc.domain.excel;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 员工亲属Excel导入导出对象
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-01-28
|
||||
*/
|
||||
@Data
|
||||
public class DpcEmployeeRelativeExcel implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 亲属姓名 */
|
||||
@ExcelProperty(value = "亲属姓名", index = 0)
|
||||
@ColumnWidth(15)
|
||||
private String relativeName;
|
||||
|
||||
/** 亲属身份证号 */
|
||||
@ExcelProperty(value = "亲属身份证号", index = 1)
|
||||
@ColumnWidth(20)
|
||||
private String relativeIdCard;
|
||||
|
||||
/** 亲属手机号 */
|
||||
@ExcelProperty(value = "亲属手机号", index = 2)
|
||||
@ColumnWidth(15)
|
||||
private String relativePhone;
|
||||
|
||||
/** 与员工关系 */
|
||||
@ExcelProperty(value = "与员工关系", index = 3)
|
||||
@ColumnWidth(15)
|
||||
private String relationship;
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.ruoyi.dpc.domain.excel;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
||||
import com.ruoyi.dpc.utils.converter.IntermediaryStatusConverter;
|
||||
import com.ruoyi.dpc.utils.converter.IntermediaryTypeConverter;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 中介人员黑名单Excel导入导出对象
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-01-27
|
||||
*/
|
||||
@Data
|
||||
public class DpcIntermediaryBlacklistExcel implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 姓名/机构名称 */
|
||||
@ExcelProperty(value = "姓名/机构名称", index = 0)
|
||||
@ColumnWidth(20)
|
||||
private String name;
|
||||
|
||||
/** 证件号 */
|
||||
@ExcelProperty(value = "证件号", index = 1)
|
||||
@ColumnWidth(20)
|
||||
private String certificateNo;
|
||||
|
||||
/** 中介类型 */
|
||||
@ExcelProperty(value = "中介类型", converter = IntermediaryTypeConverter.class, index = 2)
|
||||
@ColumnWidth(15)
|
||||
private String intermediaryType;
|
||||
|
||||
/** 状态 */
|
||||
@ExcelProperty(value = "状态", converter = IntermediaryStatusConverter.class, index = 3)
|
||||
@ColumnWidth(10)
|
||||
private String status;
|
||||
|
||||
/** 备注 */
|
||||
@ExcelProperty(value = "备注", index = 4)
|
||||
@ColumnWidth(30)
|
||||
private String remark;
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
package com.ruoyi.dpc.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.dpc.domain.DpcEmployee;
|
||||
import com.ruoyi.dpc.domain.dto.DpcEmployeeAddDTO;
|
||||
import com.ruoyi.dpc.domain.dto.DpcEmployeeEditDTO;
|
||||
import com.ruoyi.dpc.domain.dto.DpcEmployeeQueryDTO;
|
||||
import com.ruoyi.dpc.domain.excel.DpcEmployeeExcel;
|
||||
import com.ruoyi.dpc.domain.vo.DpcEmployeeVO;
|
||||
|
||||
import java.util.List;
|
||||
@@ -32,15 +32,15 @@ public interface IDpcEmployeeService {
|
||||
* @param queryDTO 查询条件
|
||||
* @return 员工VO分页结果
|
||||
*/
|
||||
Page<DpcEmployeeVO> selectEmployeePage(Page<DpcEmployee> page, DpcEmployeeQueryDTO queryDTO);
|
||||
Page<DpcEmployeeVO> selectEmployeePage(Page<DpcEmployeeVO> page, DpcEmployeeQueryDTO queryDTO);
|
||||
|
||||
/**
|
||||
* 查询员工列表(用于导出)
|
||||
*
|
||||
* @param queryDTO 查询条件
|
||||
* @return 员工实体集合
|
||||
* @return 员工Excel实体集合
|
||||
*/
|
||||
List<DpcEmployee> selectEmployeeListForExport(DpcEmployeeQueryDTO queryDTO);
|
||||
List<DpcEmployeeExcel> selectEmployeeListForExport(DpcEmployeeQueryDTO queryDTO);
|
||||
|
||||
/**
|
||||
* 查询员工详情
|
||||
@@ -77,9 +77,9 @@ public interface IDpcEmployeeService {
|
||||
/**
|
||||
* 导入员工数据
|
||||
*
|
||||
* @param addDTOList 新增DTO列表
|
||||
* @param excelList Excel实体列表
|
||||
* @param isUpdateSupport 是否更新支持
|
||||
* @return 结果
|
||||
*/
|
||||
String importEmployee(List<DpcEmployeeAddDTO> addDTOList, Boolean isUpdateSupport);
|
||||
String importEmployee(List<DpcEmployeeExcel> excelList, Boolean isUpdateSupport);
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.ruoyi.dpc.domain.DpcIntermediaryBlacklist;
|
||||
import com.ruoyi.dpc.domain.dto.DpcIntermediaryBlacklistAddDTO;
|
||||
import com.ruoyi.dpc.domain.dto.DpcIntermediaryBlacklistEditDTO;
|
||||
import com.ruoyi.dpc.domain.dto.DpcIntermediaryBlacklistQueryDTO;
|
||||
import com.ruoyi.dpc.domain.excel.DpcIntermediaryBlacklistExcel;
|
||||
import com.ruoyi.dpc.domain.vo.DpcIntermediaryBlacklistVO;
|
||||
|
||||
import java.util.List;
|
||||
@@ -38,9 +39,9 @@ public interface IDpcIntermediaryBlacklistService {
|
||||
* 查询中介黑名单列表(用于导出)
|
||||
*
|
||||
* @param queryDTO 查询条件
|
||||
* @return 中介黑名单实体集合
|
||||
* @return 中介黑名单Excel实体集合
|
||||
*/
|
||||
List<DpcIntermediaryBlacklist> selectIntermediaryListForExport(DpcIntermediaryBlacklistQueryDTO queryDTO);
|
||||
List<DpcIntermediaryBlacklistExcel> selectIntermediaryListForExport(DpcIntermediaryBlacklistQueryDTO queryDTO);
|
||||
|
||||
/**
|
||||
* 查询中介黑名单详细
|
||||
@@ -77,9 +78,9 @@ public interface IDpcIntermediaryBlacklistService {
|
||||
/**
|
||||
* 导入中介黑名单数据
|
||||
*
|
||||
* @param addDTOList 新增DTO列表
|
||||
* @param excelList Excel实体列表
|
||||
* @param isUpdateSupport 是否更新支持
|
||||
* @return 结果
|
||||
*/
|
||||
String importIntermediary(List<DpcIntermediaryBlacklistAddDTO> addDTOList, Boolean isUpdateSupport);
|
||||
String importIntermediary(List<DpcIntermediaryBlacklistExcel> excelList, Boolean isUpdateSupport);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.ruoyi.dpc.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.common.utils.IdCardUtil;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.dpc.domain.DpcEmployee;
|
||||
import com.ruoyi.dpc.domain.DpcEmployeeRelative;
|
||||
@@ -9,6 +10,7 @@ import com.ruoyi.dpc.domain.dto.DpcEmployeeAddDTO;
|
||||
import com.ruoyi.dpc.domain.dto.DpcEmployeeEditDTO;
|
||||
import com.ruoyi.dpc.domain.dto.DpcEmployeeQueryDTO;
|
||||
import com.ruoyi.dpc.domain.dto.DpcEmployeeRelativeAddDTO;
|
||||
import com.ruoyi.dpc.domain.excel.DpcEmployeeExcel;
|
||||
import com.ruoyi.dpc.domain.vo.DpcEmployeeVO;
|
||||
import com.ruoyi.dpc.mapper.DpcEmployeeMapper;
|
||||
import com.ruoyi.dpc.mapper.DpcEmployeeRelativeMapper;
|
||||
@@ -20,7 +22,6 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 员工信息 服务层处理
|
||||
@@ -62,7 +63,7 @@ public class DpcEmployeeServiceImpl implements IDpcEmployeeService {
|
||||
* @return 员工VO分页结果
|
||||
*/
|
||||
@Override
|
||||
public Page<DpcEmployeeVO> selectEmployeePage(Page<DpcEmployee> page, DpcEmployeeQueryDTO queryDTO) {
|
||||
public Page<DpcEmployeeVO> selectEmployeePage(Page<DpcEmployeeVO> page, DpcEmployeeQueryDTO queryDTO) {
|
||||
// 使用关联查询获取部门名称
|
||||
Page<DpcEmployeeVO> voPage = new Page<>(page.getCurrent(), page.getSize());
|
||||
Page<DpcEmployeeVO> resultPage = employeeMapper.selectEmployeePageWithDept(voPage, queryDTO);
|
||||
@@ -83,12 +84,17 @@ public class DpcEmployeeServiceImpl implements IDpcEmployeeService {
|
||||
* 查询员工列表(用于导出)
|
||||
*
|
||||
* @param queryDTO 查询条件
|
||||
* @return 员工实体集合
|
||||
* @return 员工Excel实体集合
|
||||
*/
|
||||
@Override
|
||||
public List<DpcEmployee> selectEmployeeListForExport(DpcEmployeeQueryDTO queryDTO) {
|
||||
public List<DpcEmployeeExcel> selectEmployeeListForExport(DpcEmployeeQueryDTO queryDTO) {
|
||||
LambdaQueryWrapper<DpcEmployee> wrapper = buildQueryWrapper(queryDTO);
|
||||
return employeeMapper.selectList(wrapper);
|
||||
List<DpcEmployee> list = employeeMapper.selectList(wrapper);
|
||||
return list.stream().map(employee -> {
|
||||
DpcEmployeeExcel excel = new DpcEmployeeExcel();
|
||||
BeanUtils.copyProperties(employee, excel);
|
||||
return excel;
|
||||
}).toList();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -214,14 +220,14 @@ public class DpcEmployeeServiceImpl implements IDpcEmployeeService {
|
||||
/**
|
||||
* 导入员工数据
|
||||
*
|
||||
* @param addDTOList 新增DTO列表
|
||||
* @param excelList Excel实体列表
|
||||
* @param isUpdateSupport 是否更新支持
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public String importEmployee(List<DpcEmployeeAddDTO> addDTOList, Boolean isUpdateSupport) {
|
||||
if (StringUtils.isNull(addDTOList) || addDTOList.isEmpty()) {
|
||||
public String importEmployee(List<DpcEmployeeExcel> excelList, Boolean isUpdateSupport) {
|
||||
if (StringUtils.isNull(excelList) || excelList.isEmpty()) {
|
||||
return "至少需要一条数据";
|
||||
}
|
||||
|
||||
@@ -230,8 +236,12 @@ public class DpcEmployeeServiceImpl implements IDpcEmployeeService {
|
||||
StringBuilder successMsg = new StringBuilder();
|
||||
StringBuilder failureMsg = new StringBuilder();
|
||||
|
||||
for (DpcEmployeeAddDTO addDTO : addDTOList) {
|
||||
for (DpcEmployeeExcel excel : excelList) {
|
||||
try {
|
||||
// 转换为AddDTO
|
||||
DpcEmployeeAddDTO addDTO = new DpcEmployeeAddDTO();
|
||||
BeanUtils.copyProperties(excel, addDTO);
|
||||
|
||||
// 验证数据
|
||||
validateEmployeeData(addDTO, isUpdateSupport);
|
||||
|
||||
@@ -243,7 +253,7 @@ public class DpcEmployeeServiceImpl implements IDpcEmployeeService {
|
||||
successMsg.append("<br/>").append(successNum).append("、").append(addDTO.getName()).append(" 导入成功");
|
||||
} catch (Exception e) {
|
||||
failureNum++;
|
||||
failureMsg.append("<br/>").append(failureNum).append("、").append(addDTO.getName()).append(" 导入失败:");
|
||||
failureMsg.append("<br/>").append(failureNum).append("、").append(excel.getName()).append(" 导入失败:");
|
||||
failureMsg.append(e.getMessage());
|
||||
}
|
||||
}
|
||||
@@ -265,7 +275,7 @@ public class DpcEmployeeServiceImpl implements IDpcEmployeeService {
|
||||
wrapper.like(StringUtils.isNotEmpty(queryDTO.getName()), DpcEmployee::getName, queryDTO.getName())
|
||||
.eq(StringUtils.isNotEmpty(queryDTO.getTellerNo()), DpcEmployee::getTellerNo, queryDTO.getTellerNo())
|
||||
.eq(queryDTO.getDeptId() != null, DpcEmployee::getDeptId, queryDTO.getDeptId())
|
||||
.eq(StringUtils.isNotEmpty(queryDTO.getIdCard()), DpcEmployee::getIdCard, queryDTO.getIdCard())
|
||||
.like(StringUtils.isNotEmpty(queryDTO.getIdCard()), DpcEmployee::getIdCard, queryDTO.getIdCard())
|
||||
.eq(StringUtils.isNotEmpty(queryDTO.getStatus()), DpcEmployee::getStatus, queryDTO.getStatus())
|
||||
.orderByDesc(DpcEmployee::getCreateTime);
|
||||
return wrapper;
|
||||
@@ -275,6 +285,26 @@ public class DpcEmployeeServiceImpl implements IDpcEmployeeService {
|
||||
* 验证员工数据
|
||||
*/
|
||||
private void validateEmployeeData(DpcEmployeeAddDTO addDTO, Boolean isUpdateSupport) {
|
||||
// 验证必填字段
|
||||
if (StringUtils.isEmpty(addDTO.getName())) {
|
||||
throw new RuntimeException("姓名不能为空");
|
||||
}
|
||||
if (StringUtils.isEmpty(addDTO.getTellerNo())) {
|
||||
throw new RuntimeException("柜员号不能为空");
|
||||
}
|
||||
if (StringUtils.isEmpty(addDTO.getIdCard())) {
|
||||
throw new RuntimeException("身份证号不能为空");
|
||||
}
|
||||
if (StringUtils.isEmpty(addDTO.getStatus())) {
|
||||
throw new RuntimeException("状态不能为空");
|
||||
}
|
||||
|
||||
// 验证身份证号格式
|
||||
String idCardError = IdCardUtil.getErrorMessage(addDTO.getIdCard());
|
||||
if (idCardError != null) {
|
||||
throw new RuntimeException(idCardError);
|
||||
}
|
||||
|
||||
// 检查柜员号唯一性
|
||||
LambdaQueryWrapper<DpcEmployee> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(DpcEmployee::getTellerNo, addDTO.getTellerNo());
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.ruoyi.dpc.domain.DpcIntermediaryBlacklist;
|
||||
import com.ruoyi.dpc.domain.dto.DpcIntermediaryBlacklistAddDTO;
|
||||
import com.ruoyi.dpc.domain.dto.DpcIntermediaryBlacklistEditDTO;
|
||||
import com.ruoyi.dpc.domain.dto.DpcIntermediaryBlacklistQueryDTO;
|
||||
import com.ruoyi.dpc.domain.excel.DpcIntermediaryBlacklistExcel;
|
||||
import com.ruoyi.dpc.domain.vo.DpcIntermediaryBlacklistVO;
|
||||
import com.ruoyi.dpc.mapper.DpcIntermediaryBlacklistMapper;
|
||||
import com.ruoyi.dpc.service.IDpcIntermediaryBlacklistService;
|
||||
@@ -66,12 +67,17 @@ public class DpcIntermediaryBlacklistServiceImpl implements IDpcIntermediaryBlac
|
||||
* 查询中介黑名单列表(用于导出)
|
||||
*
|
||||
* @param queryDTO 查询条件
|
||||
* @return 中介黑名单实体集合
|
||||
* @return 中介黑名单Excel实体集合
|
||||
*/
|
||||
@Override
|
||||
public List<DpcIntermediaryBlacklist> selectIntermediaryListForExport(DpcIntermediaryBlacklistQueryDTO queryDTO) {
|
||||
public List<DpcIntermediaryBlacklistExcel> selectIntermediaryListForExport(DpcIntermediaryBlacklistQueryDTO queryDTO) {
|
||||
LambdaQueryWrapper<DpcIntermediaryBlacklist> wrapper = buildQueryWrapper(queryDTO);
|
||||
return intermediaryMapper.selectList(wrapper);
|
||||
List<DpcIntermediaryBlacklist> list = intermediaryMapper.selectList(wrapper);
|
||||
return list.stream().map(entity -> {
|
||||
DpcIntermediaryBlacklistExcel excel = new DpcIntermediaryBlacklistExcel();
|
||||
BeanUtils.copyProperties(entity, excel);
|
||||
return excel;
|
||||
}).toList();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -126,13 +132,13 @@ public class DpcIntermediaryBlacklistServiceImpl implements IDpcIntermediaryBlac
|
||||
/**
|
||||
* 导入中介黑名单数据
|
||||
*
|
||||
* @param addDTOList 新增DTO列表
|
||||
* @param excelList Excel实体列表
|
||||
* @param isUpdateSupport 是否更新支持
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public String importIntermediary(List<DpcIntermediaryBlacklistAddDTO> addDTOList, Boolean isUpdateSupport) {
|
||||
if (addDTOList == null || addDTOList.isEmpty()) {
|
||||
public String importIntermediary(List<DpcIntermediaryBlacklistExcel> excelList, Boolean isUpdateSupport) {
|
||||
if (excelList == null || excelList.isEmpty()) {
|
||||
return "至少需要一条数据";
|
||||
}
|
||||
|
||||
@@ -141,8 +147,12 @@ public class DpcIntermediaryBlacklistServiceImpl implements IDpcIntermediaryBlac
|
||||
StringBuilder successMsg = new StringBuilder();
|
||||
StringBuilder failureMsg = new StringBuilder();
|
||||
|
||||
for (DpcIntermediaryBlacklistAddDTO addDTO : addDTOList) {
|
||||
for (DpcIntermediaryBlacklistExcel excel : excelList) {
|
||||
try {
|
||||
// 转换为AddDTO
|
||||
DpcIntermediaryBlacklistAddDTO addDTO = new DpcIntermediaryBlacklistAddDTO();
|
||||
BeanUtils.copyProperties(excel, addDTO);
|
||||
|
||||
// 验证数据
|
||||
validateIntermediaryData(addDTO);
|
||||
|
||||
@@ -154,7 +164,7 @@ public class DpcIntermediaryBlacklistServiceImpl implements IDpcIntermediaryBlac
|
||||
successMsg.append("<br/>").append(successNum).append("、").append(addDTO.getName()).append(" 导入成功");
|
||||
} catch (Exception e) {
|
||||
failureNum++;
|
||||
failureMsg.append("<br/>").append(failureNum).append("、").append(addDTO.getName()).append(" 导入失败:");
|
||||
failureMsg.append("<br/>").append(failureNum).append("、").append(excel.getName()).append(" 导入失败:");
|
||||
failureMsg.append(e.getMessage());
|
||||
}
|
||||
}
|
||||
@@ -185,6 +195,17 @@ public class DpcIntermediaryBlacklistServiceImpl implements IDpcIntermediaryBlac
|
||||
* 验证中介数据
|
||||
*/
|
||||
private void validateIntermediaryData(DpcIntermediaryBlacklistAddDTO addDTO) {
|
||||
// 验证必填字段
|
||||
if (StringUtils.isEmpty(addDTO.getName())) {
|
||||
throw new RuntimeException("姓名/机构名称不能为空");
|
||||
}
|
||||
if (StringUtils.isEmpty(addDTO.getIntermediaryType())) {
|
||||
throw new RuntimeException("中介类型不能为空");
|
||||
}
|
||||
if (StringUtils.isEmpty(addDTO.getStatus())) {
|
||||
throw new RuntimeException("状态不能为空");
|
||||
}
|
||||
|
||||
// 验证中介类型
|
||||
if (!"1".equals(addDTO.getIntermediaryType()) && !"2".equals(addDTO.getIntermediaryType())) {
|
||||
throw new RuntimeException("中介类型只能填写'个人'或'机构'");
|
||||
|
||||
157
ruoyi-dpc/src/main/java/com/ruoyi/dpc/utils/EasyExcelUtil.java
Normal file
157
ruoyi-dpc/src/main/java/com/ruoyi/dpc/utils/EasyExcelUtil.java
Normal file
@@ -0,0 +1,157 @@
|
||||
package com.ruoyi.dpc.utils;
|
||||
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.alibaba.excel.write.handler.WriteHandler;
|
||||
import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* EasyExcel工具类
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
||||
public class EasyExcelUtil {
|
||||
|
||||
/**
|
||||
* 导出Excel
|
||||
*
|
||||
* @param response 响应对象
|
||||
* @param list 数据列表
|
||||
* @param clazz 实体类
|
||||
* @param sheetName 工作表名称
|
||||
* @param <T> 泛型
|
||||
*/
|
||||
public static <T> void exportExcel(HttpServletResponse response, List<T> list, Class<T> clazz, String sheetName) {
|
||||
try {
|
||||
setResponseHeader(response, sheetName);
|
||||
EasyExcel.write(response.getOutputStream(), clazz)
|
||||
.sheet(sheetName)
|
||||
.registerWriteHandler(new LongestMatchColumnWidthStyleStrategy())
|
||||
.doWrite(list);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException("导出Excel失败", e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出Excel(指定数据)
|
||||
*
|
||||
* @param response 响应对象
|
||||
* @param list 数据列表
|
||||
* @param clazz 实体类
|
||||
* @param sheetName 工作表名称
|
||||
* @param fileName 文件名称
|
||||
* @param <T> 泛型
|
||||
*/
|
||||
public static <T> void exportExcel(HttpServletResponse response, List<T> list, Class<T> clazz, String sheetName, String fileName) {
|
||||
try {
|
||||
setResponseHeader(response, fileName);
|
||||
EasyExcel.write(response.getOutputStream(), clazz)
|
||||
.sheet(sheetName)
|
||||
.registerWriteHandler(new LongestMatchColumnWidthStyleStrategy())
|
||||
.doWrite(list);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException("导出Excel失败", e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入Excel
|
||||
*
|
||||
* @param fileName 文件名
|
||||
* @param clazz 实体类
|
||||
* @param <T> 泛型
|
||||
* @return 数据列表
|
||||
*/
|
||||
public static <T> List<T> importExcel(String fileName, Class<T> clazz) {
|
||||
try {
|
||||
return EasyExcel.read(fileName).head(clazz).sheet().doReadSync();
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("导入Excel失败", e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入Excel(通过输入流)
|
||||
*
|
||||
* @param inputStream 输入流
|
||||
* @param clazz 实体类
|
||||
* @param <T> 泛型
|
||||
* @return 数据列表
|
||||
*/
|
||||
public static <T> List<T> importExcel(java.io.InputStream inputStream, Class<T> clazz) {
|
||||
try {
|
||||
return EasyExcel.read(inputStream).head(clazz).sheet().doReadSync();
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("导入Excel失败", e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载导入模板
|
||||
*
|
||||
* @param response 响应对象
|
||||
* @param clazz 实体类
|
||||
* @param sheetName 工作表名称
|
||||
* @param <T> 泛型
|
||||
*/
|
||||
public static <T> void importTemplateExcel(HttpServletResponse response, Class<T> clazz, String sheetName) {
|
||||
try {
|
||||
setResponseHeader(response, sheetName + "模板");
|
||||
EasyExcel.write(response.getOutputStream(), clazz)
|
||||
.sheet(sheetName)
|
||||
.registerWriteHandler(new LongestMatchColumnWidthStyleStrategy())
|
||||
.doWrite(List.of());
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException("下载导入模板失败", e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载导入模板(带自定义处理器)
|
||||
*
|
||||
* @param response 响应对象
|
||||
* @param clazz 实体类
|
||||
* @param sheetName 工作表名称
|
||||
* @param handlers 自定义写入处理器
|
||||
* @param <T> 泛型
|
||||
*/
|
||||
@SafeVarargs
|
||||
public static <T> void importTemplateExcel(HttpServletResponse response, Class<T> clazz, String sheetName,
|
||||
WriteHandler... handlers) {
|
||||
try {
|
||||
setResponseHeader(response, sheetName + "模板");
|
||||
var writerBuilder = EasyExcel.write(response.getOutputStream(), clazz)
|
||||
.sheet(sheetName)
|
||||
.registerWriteHandler(new LongestMatchColumnWidthStyleStrategy());
|
||||
// 注册所有自定义处理器
|
||||
for (WriteHandler handler : handlers) {
|
||||
writerBuilder.registerWriteHandler(handler);
|
||||
}
|
||||
writerBuilder.doWrite(List.of());
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException("下载导入模板失败", e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置响应头
|
||||
*
|
||||
* @param response 响应对象
|
||||
* @param fileName 文件名
|
||||
*/
|
||||
private static void setResponseHeader(HttpServletResponse response, String fileName) {
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setCharacterEncoding("utf-8");
|
||||
String encodedFileName = URLEncoder.encode(fileName, StandardCharsets.UTF_8).replaceAll("\\+", "%20");
|
||||
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + encodedFileName + ".xlsx");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.ruoyi.dpc.utils.converter;
|
||||
|
||||
import com.alibaba.excel.converters.Converter;
|
||||
import com.alibaba.excel.enums.CellDataTypeEnum;
|
||||
import com.alibaba.excel.metadata.GlobalConfiguration;
|
||||
import com.alibaba.excel.metadata.data.ReadCellData;
|
||||
import com.alibaba.excel.metadata.data.WriteCellData;
|
||||
import com.alibaba.excel.metadata.property.ExcelContentProperty;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 员工状态转换器
|
||||
* 0=在职, 1=离职
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class EmployeeStatusConverter implements Converter<String> {
|
||||
|
||||
private static final Map<String, String> CODE_TO_DESC = new HashMap<>();
|
||||
private static final Map<String, String> DESC_TO_CODE = new HashMap<>();
|
||||
|
||||
static {
|
||||
CODE_TO_DESC.put("0", "在职");
|
||||
CODE_TO_DESC.put("1", "离职");
|
||||
DESC_TO_CODE.put("在职", "0");
|
||||
DESC_TO_CODE.put("离职", "1");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> supportJavaTypeKey() {
|
||||
return String.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CellDataTypeEnum supportExcelTypeKey() {
|
||||
return CellDataTypeEnum.STRING;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String convertToJavaData(ReadCellData<?> cellData, ExcelContentProperty contentProperty,
|
||||
GlobalConfiguration globalConfiguration) {
|
||||
String value = cellData.getStringValue();
|
||||
if (value == null) {
|
||||
return null;
|
||||
}
|
||||
// 支持中文和代码两种格式
|
||||
if (DESC_TO_CODE.containsKey(value)) {
|
||||
return DESC_TO_CODE.get(value);
|
||||
}
|
||||
// 如果是纯数字,直接返回
|
||||
if (value.matches("\\d")) {
|
||||
return value;
|
||||
}
|
||||
throw new IllegalArgumentException("无效的员工状态: " + value + ", 请使用: 在职/离职 或 0/1");
|
||||
}
|
||||
|
||||
@Override
|
||||
public WriteCellData<?> convertToExcelData(String value, ExcelContentProperty contentProperty,
|
||||
GlobalConfiguration globalConfiguration) {
|
||||
String desc = CODE_TO_DESC.getOrDefault(value, value);
|
||||
return new WriteCellData<>(desc);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.ruoyi.dpc.utils.converter;
|
||||
|
||||
import com.alibaba.excel.converters.Converter;
|
||||
import com.alibaba.excel.enums.CellDataTypeEnum;
|
||||
import com.alibaba.excel.metadata.GlobalConfiguration;
|
||||
import com.alibaba.excel.metadata.data.ReadCellData;
|
||||
import com.alibaba.excel.metadata.data.WriteCellData;
|
||||
import com.alibaba.excel.metadata.property.ExcelContentProperty;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 中介黑名单状态转换器
|
||||
* 0=正常, 1=停用
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class IntermediaryStatusConverter implements Converter<String> {
|
||||
|
||||
private static final Map<String, String> CODE_TO_DESC = new HashMap<>();
|
||||
private static final Map<String, String> DESC_TO_CODE = new HashMap<>();
|
||||
|
||||
static {
|
||||
CODE_TO_DESC.put("0", "正常");
|
||||
CODE_TO_DESC.put("1", "停用");
|
||||
DESC_TO_CODE.put("正常", "0");
|
||||
DESC_TO_CODE.put("停用", "1");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> supportJavaTypeKey() {
|
||||
return String.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CellDataTypeEnum supportExcelTypeKey() {
|
||||
return CellDataTypeEnum.STRING;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String convertToJavaData(ReadCellData<?> cellData, ExcelContentProperty contentProperty,
|
||||
GlobalConfiguration globalConfiguration) {
|
||||
String value = cellData.getStringValue();
|
||||
if (value == null) {
|
||||
return null;
|
||||
}
|
||||
// 支持中文和代码两种格式
|
||||
if (DESC_TO_CODE.containsKey(value)) {
|
||||
return DESC_TO_CODE.get(value);
|
||||
}
|
||||
// 如果是纯数字,直接返回
|
||||
if (value.matches("\\d")) {
|
||||
return value;
|
||||
}
|
||||
throw new IllegalArgumentException("无效的状态: " + value + ", 请使用: 正常/停用 或 0/1");
|
||||
}
|
||||
|
||||
@Override
|
||||
public WriteCellData<?> convertToExcelData(String value, ExcelContentProperty contentProperty,
|
||||
GlobalConfiguration globalConfiguration) {
|
||||
String desc = CODE_TO_DESC.getOrDefault(value, value);
|
||||
return new WriteCellData<>(desc);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.ruoyi.dpc.utils.converter;
|
||||
|
||||
import com.alibaba.excel.converters.Converter;
|
||||
import com.alibaba.excel.enums.CellDataTypeEnum;
|
||||
import com.alibaba.excel.metadata.GlobalConfiguration;
|
||||
import com.alibaba.excel.metadata.data.ReadCellData;
|
||||
import com.alibaba.excel.metadata.data.WriteCellData;
|
||||
import com.alibaba.excel.metadata.property.ExcelContentProperty;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 中介类型转换器
|
||||
* 1=个人, 2=机构
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class IntermediaryTypeConverter implements Converter<String> {
|
||||
|
||||
private static final Map<String, String> CODE_TO_DESC = new HashMap<>();
|
||||
private static final Map<String, String> DESC_TO_CODE = new HashMap<>();
|
||||
|
||||
static {
|
||||
CODE_TO_DESC.put("1", "个人");
|
||||
CODE_TO_DESC.put("2", "机构");
|
||||
DESC_TO_CODE.put("个人", "1");
|
||||
DESC_TO_CODE.put("机构", "2");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> supportJavaTypeKey() {
|
||||
return String.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CellDataTypeEnum supportExcelTypeKey() {
|
||||
return CellDataTypeEnum.STRING;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String convertToJavaData(ReadCellData<?> cellData, ExcelContentProperty contentProperty,
|
||||
GlobalConfiguration globalConfiguration) {
|
||||
String value = cellData.getStringValue();
|
||||
if (value == null) {
|
||||
return null;
|
||||
}
|
||||
// 支持中文和代码两种格式
|
||||
if (DESC_TO_CODE.containsKey(value)) {
|
||||
return DESC_TO_CODE.get(value);
|
||||
}
|
||||
// 如果是纯数字,直接返回
|
||||
if (value.matches("\\d")) {
|
||||
return value;
|
||||
}
|
||||
throw new IllegalArgumentException("无效的中介类型: " + value + ", 请使用: 个人/机构 或 1/2");
|
||||
}
|
||||
|
||||
@Override
|
||||
public WriteCellData<?> convertToExcelData(String value, ExcelContentProperty contentProperty,
|
||||
GlobalConfiguration globalConfiguration) {
|
||||
String desc = CODE_TO_DESC.getOrDefault(value, value);
|
||||
return new WriteCellData<>(desc);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.ruoyi.dpc.utils.handler;
|
||||
|
||||
import com.alibaba.excel.write.handler.SheetWriteHandler;
|
||||
import com.alibaba.excel.write.metadata.holder.WriteSheetHolder;
|
||||
import com.alibaba.excel.write.metadata.holder.WriteWorkbookHolder;
|
||||
import org.apache.poi.ss.usermodel.DataValidation;
|
||||
import org.apache.poi.ss.usermodel.DataValidationHelper;
|
||||
import org.apache.poi.ss.usermodel.Sheet;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.poi.ss.util.CellRangeAddressList;
|
||||
|
||||
/**
|
||||
* 员工状态下拉框处理器
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class EmployeeStatusSheetWriteHandler implements SheetWriteHandler {
|
||||
|
||||
@Override
|
||||
public void afterSheetCreate(WriteWorkbookHolder writeWorkbookHolder, WriteSheetHolder writeSheetHolder) {
|
||||
Sheet sheet = writeSheetHolder.getSheet();
|
||||
Workbook workbook = writeWorkbookHolder.getWorkbook();
|
||||
DataValidationHelper helper = sheet.getDataValidationHelper();
|
||||
|
||||
// 创建下拉框数据列表
|
||||
String[] statusList = {"在职", "离职"};
|
||||
|
||||
// 设置状态下拉框,从第2行开始(第1行是表头),第7列(状态列,索引为6)
|
||||
CellRangeAddressList addressList = new CellRangeAddressList(1, 10000, 6, 6);
|
||||
|
||||
// 创建显式列表约束
|
||||
DataValidation validation = helper.createValidation(
|
||||
helper.createExplicitListConstraint(statusList),
|
||||
addressList
|
||||
);
|
||||
|
||||
// 设置提示信息
|
||||
validation.createPromptBox("状态选择", "请选择员工状态:在职或离职");
|
||||
validation.setShowPromptBox(true);
|
||||
|
||||
// 设置错误提示
|
||||
validation.createErrorBox("状态错误", "请从下拉框中选择有效的状态值!");
|
||||
validation.setShowErrorBox(true);
|
||||
|
||||
sheet.addValidationData(validation);
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.dpc.mapper.DpcEmployeeMapper">
|
||||
|
||||
<!-- 员工基本信息ResultMap(用于列表查询,不包含亲属) -->
|
||||
<resultMap type="com.ruoyi.dpc.domain.vo.DpcEmployeeVO" id="DpcEmployeeVOResult">
|
||||
<id property="employeeId" column="employee_id"/>
|
||||
<result property="name" column="name"/>
|
||||
@@ -15,7 +16,11 @@
|
||||
<result property="hireDate" column="hire_date"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<collection property="relatives" ofType="com.ruoyi.dpc.domain.vo.DpcEmployeeRelativeVO">
|
||||
</resultMap>
|
||||
|
||||
<!-- 员工详情ResultMap(包含亲属信息) -->
|
||||
<resultMap type="com.ruoyi.dpc.domain.vo.DpcEmployeeVO" id="DpcEmployeeWithRelativesResult" extends="DpcEmployeeVOResult">
|
||||
<collection property="relatives" ofType="DpcEmployeeRelativeVO" notNullColumn="relative_id">
|
||||
<id property="relativeId" column="relative_id"/>
|
||||
<result property="employeeId" column="employee_id"/>
|
||||
<result property="relativeName" column="relative_name"/>
|
||||
@@ -42,7 +47,7 @@
|
||||
AND e.dept_id = #{query.deptId}
|
||||
</if>
|
||||
<if test="query.idCard != null and query.idCard != ''">
|
||||
AND e.id_card = #{query.idCard}
|
||||
AND e.id_card LIKE CONCAT('%', #{query.idCard}, '%')
|
||||
</if>
|
||||
<if test="query.status != null and query.status != ''">
|
||||
AND e.status = #{query.status}
|
||||
@@ -51,11 +56,13 @@
|
||||
ORDER BY e.create_time DESC
|
||||
</select>
|
||||
|
||||
<select id="selectEmployeeWithRelatives" parameterType="Long" resultMap="DpcEmployeeVOResult">
|
||||
<select id="selectEmployeeWithRelatives" parameterType="Long" resultMap="DpcEmployeeWithRelativesResult">
|
||||
SELECT
|
||||
e.employee_id, e.name, e.teller_no, e.dept_id, e.id_card, e.phone, e.hire_date, e.status, e.create_time,
|
||||
d.dept_name,
|
||||
r.relative_id, r.employee_id, r.relative_name, r.relative_id_card, r.relative_phone, r.relationship
|
||||
FROM dpc_employee e
|
||||
LEFT JOIN sys_dept d ON e.dept_id = d.dept_id
|
||||
LEFT JOIN dpc_employee_relative r ON e.employee_id = r.employee_id
|
||||
WHERE e.employee_id = #{employeeId}
|
||||
</select>
|
||||
|
||||
61
ruoyi-ui/src/api/dpcEmployee.js
Normal file
61
ruoyi-ui/src/api/dpcEmployee.js
Normal file
@@ -0,0 +1,61 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询员工列表
|
||||
export function listEmployee(query) {
|
||||
return request({
|
||||
url: '/dpc/employee/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询员工详细
|
||||
export function getEmployee(employeeId) {
|
||||
return request({
|
||||
url: '/dpc/employee/' + employeeId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增员工
|
||||
export function addEmployee(data) {
|
||||
return request({
|
||||
url: '/dpc/employee',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改员工
|
||||
export function updateEmployee(data) {
|
||||
return request({
|
||||
url: '/dpc/employee',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除员工
|
||||
export function delEmployee(employeeIds) {
|
||||
return request({
|
||||
url: '/dpc/employee/' + employeeIds,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 下载导入模板
|
||||
export function importTemplate() {
|
||||
return request({
|
||||
url: '/dpc/employee/importTemplate',
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
// 导入员工
|
||||
export function importData(data, updateSupport) {
|
||||
return request({
|
||||
url: '/dpc/employee/importData?updateSupport=' + updateSupport,
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
743
ruoyi-ui/src/views/dpcEmployee/index.vue
Normal file
743
ruoyi-ui/src/views/dpcEmployee/index.vue
Normal file
@@ -0,0 +1,743 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
|
||||
<el-form-item label="姓名" prop="name">
|
||||
<el-input
|
||||
v-model="queryParams.name"
|
||||
placeholder="请输入姓名"
|
||||
clearable
|
||||
style="width: 240px"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="柜员号" prop="tellerNo">
|
||||
<el-input
|
||||
v-model="queryParams.tellerNo"
|
||||
placeholder="请输入柜员号"
|
||||
clearable
|
||||
style="width: 240px"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属部门" prop="deptId">
|
||||
<treeselect v-model="queryParams.deptId" :options="deptOptions" :show-count="true" placeholder="请选择所属部门" clearable style="width: 240px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="身份证号" prop="idCard">
|
||||
<el-input
|
||||
v-model="queryParams.idCard"
|
||||
placeholder="请输入身份证号"
|
||||
clearable
|
||||
style="width: 240px"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="状态" clearable style="width: 240px">
|
||||
<el-option label="全部" value="" />
|
||||
<el-option label="在职" value="0" />
|
||||
<el-option label="离职" value="1" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['dpc:employee:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-upload2"
|
||||
size="mini"
|
||||
@click="handleImport"
|
||||
v-hasPermi="['dpc:employee:import']"
|
||||
>导入</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="employeeList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="姓名" align="center" prop="name" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="柜员号" align="center" prop="tellerNo" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="身份证号" align="center" prop="idCard" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="所属部门" align="center" prop="deptName" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="电话" align="center" prop="phone" width="120"/>
|
||||
<el-table-column label="状态" align="center" prop="status" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.status === '0'" type="success">在职</el-tag>
|
||||
<el-tag v-else type="danger">离职</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="200">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-view"
|
||||
@click="handleDetail(scope.row)"
|
||||
v-hasPermi="['dpc:employee:query']"
|
||||
>详情</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['dpc:employee:edit']"
|
||||
>编辑</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['dpc:employee:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="1200px" append-to-body class="employee-edit-dialog">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="90px">
|
||||
<!-- 基本信息 -->
|
||||
<div class="section-header">基本信息</div>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="姓名" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入姓名" maxlength="100" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="柜员号" prop="tellerNo">
|
||||
<el-input v-model="form.tellerNo" placeholder="请输入柜员号" maxlength="50" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="所属部门" prop="deptId">
|
||||
<treeselect v-model="form.deptId" :options="enabledDeptOptions" :show-count="true" placeholder="请选择所属部门" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="身份证号" prop="idCard">
|
||||
<el-input v-model="form.idCard" placeholder="请输入身份证号" maxlength="18" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="电话" prop="phone">
|
||||
<el-input v-model="form.phone" placeholder="请输入电话" maxlength="11" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="入职时间" prop="hireDate">
|
||||
<el-date-picker v-model="form.hireDate" type="date" placeholder="选择入职时间" value-format="yyyy-MM-dd" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio label="0">在职</el-radio>
|
||||
<el-radio label="1">离职</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 亲属信息 -->
|
||||
<div class="section-header" style="margin-top: 24px;">
|
||||
<span>亲属信息</span>
|
||||
<span v-if="form.relatives && form.relatives.length > 0" class="relative-count">({{ form.relatives.length }}人)</span>
|
||||
<el-button type="text" icon="el-icon-plus" @click="addRelative">添加亲属</el-button>
|
||||
</div>
|
||||
<el-table :data="form.relatives" border size="small" v-if="form.relatives && form.relatives.length > 0" class="relatives-table">
|
||||
<el-table-column type="index" label="序号" width="50" align="center" />
|
||||
<el-table-column label="亲属姓名" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.relativeName" placeholder="亲属姓名" size="small" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="身份证号" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.relativeIdCard" placeholder="身份证号" size="small" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="电话" align="center" width="130">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.relativePhone" placeholder="电话" size="small" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="关系" align="center" width="140">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.relationship" placeholder="关系" size="small" filterable allow-create>
|
||||
<el-option label="配偶" value="配偶" />
|
||||
<el-option label="父亲" value="父亲" />
|
||||
<el-option label="母亲" value="母亲" />
|
||||
<el-option label="子女" value="子女" />
|
||||
<el-option label="兄弟姐妹" value="兄弟姐妹" />
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="60">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" icon="el-icon-delete" @click="removeRelative(scope.$index)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div v-else class="empty-relatives">
|
||||
<i class="el-icon-info"></i>
|
||||
<span>暂无亲属信息</span>
|
||||
<el-button type="text" @click="addRelative">立即添加</el-button>
|
||||
</div>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="cancel">取消</el-button>
|
||||
<el-button type="primary" @click="submitForm">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 详情对话框 -->
|
||||
<el-dialog title="员工详情" :visible.sync="detailOpen" width="900px" append-to-body class="employee-detail-dialog">
|
||||
<div class="detail-container">
|
||||
<!-- 基本信息卡片 -->
|
||||
<div class="info-section">
|
||||
<div class="section-title">
|
||||
<i class="el-icon-user"></i>
|
||||
<span>基本信息</span>
|
||||
</div>
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="姓名">{{ employeeDetail.name || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="柜员号">{{ employeeDetail.tellerNo || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="所属部门">{{ employeeDetail.deptName || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="身份证号">{{ employeeDetail.idCard || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="电话">{{ employeeDetail.phone || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="入职时间">
|
||||
{{ employeeDetail.hireDate ? parseTime(employeeDetail.hireDate, '{y}-{m}-{d}') : '-' }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="状态">
|
||||
<el-tag v-if="employeeDetail.status === '0'" type="success" size="small">在职</el-tag>
|
||||
<el-tag v-else type="danger" size="small">离职</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="创建时间">
|
||||
{{ employeeDetail.createTime ? parseTime(employeeDetail.createTime) : '-' }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
|
||||
<!-- 亲属信息卡片 -->
|
||||
<div class="info-section" style="margin-top: 20px;">
|
||||
<div class="section-title">
|
||||
<i class="el-icon-s-custom"></i>
|
||||
<span>亲属信息</span>
|
||||
<el-tag v-if="employeeDetail.relatives && employeeDetail.relatives.length > 0" size="mini" type="info" style="margin-left: 10px;">
|
||||
共 {{ employeeDetail.relatives.length }} 人
|
||||
</el-tag>
|
||||
</div>
|
||||
<div v-if="employeeDetail.relatives && employeeDetail.relatives.length > 0" class="relatives-container">
|
||||
<el-table :data="employeeDetail.relatives" border style="width: 100%" size="small">
|
||||
<el-table-column label="序号" type="index" width="60" align="center" />
|
||||
<el-table-column label="亲属姓名" align="center" prop="relativeName" min-width="100" />
|
||||
<el-table-column label="身份证号" align="center" prop="relativeIdCard" min-width="180" />
|
||||
<el-table-column label="电话" align="center" prop="relativePhone" width="130" />
|
||||
<el-table-column label="关系" align="center" prop="relationship" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-tag size="mini" type="primary">{{ scope.row.relationship }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div v-else class="empty-relatives">
|
||||
<i class="el-icon-info"></i>
|
||||
<span>暂无亲属信息</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="detailOpen = false" icon="el-icon-close">关 闭</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 导入对话框 -->
|
||||
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body @close="handleImportDialogClose" v-loading="upload.isUploading" element-loading-text="正在导入数据,请稍候..." element-loading-spinner="el-icon-loading" element-loading-background="rgba(0, 0, 0, 0.7)">
|
||||
<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
|
||||
>
|
||||
<i class="el-icon-upload"></i>
|
||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||
<div class="el-upload__tip" slot="tip">
|
||||
<el-checkbox v-model="upload.updateSupport" />是否更新已经存在的员工数据
|
||||
<el-link type="primary" :underline="false" style="font-size: 12px; vertical-align: baseline;" @click="importTemplate">下载模板</el-link>
|
||||
</div>
|
||||
<div class="el-upload__tip" slot="tip">
|
||||
<span>仅允许导入"xls"或"xlsx"格式文件。</span>
|
||||
</div>
|
||||
</el-upload>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitFileForm" :loading="upload.isUploading">确 定</el-button>
|
||||
<el-button @click="upload.open = false" :disabled="upload.isUploading">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {addEmployee, delEmployee, getEmployee, listEmployee, updateEmployee} from "@/api/dpcEmployee";
|
||||
import {deptTreeSelect} from "@/api/system/user";
|
||||
import {getToken} from "@/utils/auth";
|
||||
import Treeselect from "@riophae/vue-treeselect";
|
||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||
|
||||
// 身份证号校验正则
|
||||
const idCardPattern = /^[1-9]\d{5}(18|19|20)\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])\d{3}[\dXx]$/;
|
||||
// 手机号校验正则
|
||||
const phonePattern = /^1[3|4|5|6|7|8|9][0-9]\d{8}$/;
|
||||
|
||||
export default {
|
||||
name: "Employee",
|
||||
components: { Treeselect },
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 员工表格数据
|
||||
employeeList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 是否显示详情弹出层
|
||||
detailOpen: false,
|
||||
// 员工详情
|
||||
employeeDetail: {},
|
||||
// 所有部门树选项
|
||||
deptOptions: undefined,
|
||||
// 过滤掉已禁用部门树选项
|
||||
enabledDeptOptions: undefined,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
name: null,
|
||||
tellerNo: null,
|
||||
deptId: null,
|
||||
idCard: null,
|
||||
status: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
name: [
|
||||
{ required: true, message: "姓名不能为空", trigger: "blur" },
|
||||
{ max: 100, message: "姓名长度不能超过100个字符", trigger: "blur" }
|
||||
],
|
||||
tellerNo: [
|
||||
{ required: true, message: "柜员号不能为空", trigger: "blur" },
|
||||
{ max: 50, message: "柜员号长度不能超过50个字符", trigger: "blur" }
|
||||
],
|
||||
idCard: [
|
||||
{ required: true, message: "身份证号不能为空", trigger: "blur" },
|
||||
{ pattern: idCardPattern, message: "请输入正确的18位身份证号", trigger: "blur" }
|
||||
],
|
||||
phone: [
|
||||
{ pattern: phonePattern, message: "请输入正确的11位手机号", trigger: "blur" }
|
||||
],
|
||||
status: [
|
||||
{ required: true, message: "请选择状态", trigger: "change" }
|
||||
]
|
||||
},
|
||||
// 导入参数
|
||||
upload: {
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否禁用上传
|
||||
isUploading: false,
|
||||
// 是否更新已经存在的数据
|
||||
updateSupport: 0,
|
||||
// 设置上传的请求头部
|
||||
headers: { Authorization: "Bearer " + getToken() },
|
||||
// 上传的地址
|
||||
url: process.env.VUE_APP_BASE_API + "/dpc/employee/importData"
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.getDeptTree();
|
||||
},
|
||||
methods: {
|
||||
/** 查询员工列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listEmployee(this.queryParams).then(response => {
|
||||
this.employeeList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 查询部门下拉树结构 */
|
||||
getDeptTree() {
|
||||
deptTreeSelect().then(response => {
|
||||
this.deptOptions = response.data;
|
||||
this.enabledDeptOptions = this.filterDisabledDept(JSON.parse(JSON.stringify(response.data)));
|
||||
});
|
||||
},
|
||||
// 过滤禁用的部门
|
||||
filterDisabledDept(deptList) {
|
||||
return deptList.filter(dept => {
|
||||
if (dept.disabled) {
|
||||
return false;
|
||||
}
|
||||
if (dept.children && dept.children.length) {
|
||||
dept.children = this.filterDisabledDept(dept.children);
|
||||
}
|
||||
return true;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
employeeId: null,
|
||||
name: null,
|
||||
tellerNo: null,
|
||||
deptId: null,
|
||||
idCard: null,
|
||||
phone: null,
|
||||
hireDate: null,
|
||||
status: "0",
|
||||
relatives: []
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
/** 多选框选中数据 */
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.employeeId);
|
||||
this.single = selection.length !== 1;
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "新增员工";
|
||||
},
|
||||
/** 详情按钮操作 */
|
||||
handleDetail(row) {
|
||||
const employeeId = row.employeeId;
|
||||
getEmployee(employeeId).then(response => {
|
||||
this.employeeDetail = response.data;
|
||||
this.detailOpen = true;
|
||||
});
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const employeeId = row.employeeId || this.ids[0];
|
||||
getEmployee(employeeId).then(response => {
|
||||
this.form = response.data;
|
||||
if (!this.form.relatives) {
|
||||
this.form.relatives = [];
|
||||
}
|
||||
this.open = true;
|
||||
this.title = "编辑员工";
|
||||
});
|
||||
},
|
||||
/** 添加亲属 */
|
||||
addRelative() {
|
||||
if (!this.form.relatives) {
|
||||
this.form.relatives = [];
|
||||
}
|
||||
this.form.relatives.push({
|
||||
relativeId: null,
|
||||
relativeName: null,
|
||||
relativeIdCard: null,
|
||||
relativePhone: null,
|
||||
relationship: null
|
||||
});
|
||||
},
|
||||
/** 删除亲属 */
|
||||
removeRelative(index) {
|
||||
this.form.relatives.splice(index, 1);
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
// 验证亲属信息
|
||||
if (this.form.relatives && this.form.relatives.length > 0) {
|
||||
for (let i = 0; i < this.form.relatives.length; i++) {
|
||||
const relative = this.form.relatives[i];
|
||||
// 验证亲属姓名
|
||||
if (!relative.relativeName || relative.relativeName.trim() === '') {
|
||||
this.$modal.msgError("第" + (i + 1) + "行亲属姓名不能为空");
|
||||
return;
|
||||
}
|
||||
// 验证关系
|
||||
if (!relative.relationship || relative.relationship.trim() === '') {
|
||||
this.$modal.msgError("第" + (i + 1) + "行关系不能为空");
|
||||
return;
|
||||
}
|
||||
// 验证亲属手机号格式(填写时才验证)
|
||||
if (relative.relativePhone && !phonePattern.test(relative.relativePhone)) {
|
||||
this.$modal.msgError("第" + (i + 1) + "行亲属手机号格式不正确");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.form.employeeId != null) {
|
||||
updateEmployee(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addEmployee(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const employeeIds = row.employeeId || this.ids;
|
||||
this.$modal.confirm('是否确认删除员工编号为"' + employeeIds + '"的数据项?').then(function() {
|
||||
return delEmployee(employeeIds);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 导入按钮操作 */
|
||||
handleImport() {
|
||||
this.upload.title = "员工数据导入";
|
||||
this.upload.open = true;
|
||||
},
|
||||
/** 导入对话框关闭事件 */
|
||||
handleImportDialogClose() {
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.upload) {
|
||||
this.$refs.upload.clearFiles();
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 下载模板操作 */
|
||||
importTemplate() {
|
||||
this.download('dpc/employee/importTemplate', {}, `员工信息模板_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
// 文件上传中处理
|
||||
handleFileUploadProgress(event, file, fileList) {
|
||||
this.upload.isUploading = true;
|
||||
},
|
||||
// 文件上传成功处理
|
||||
handleFileSuccess(response, file, fileList) {
|
||||
this.upload.isUploading = false;
|
||||
this.upload.open = false;
|
||||
this.getList();
|
||||
this.$alert(response.msg, "导入结果", {
|
||||
dangerouslyUseHTMLString: true,
|
||||
customClass: 'import-result-dialog'
|
||||
});
|
||||
},
|
||||
// 提交上传文件
|
||||
submitFileForm() {
|
||||
this.$refs.upload.submit();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.detail-form .el-form-item {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
/* 详情弹窗样式 */
|
||||
.employee-detail-dialog .detail-container {
|
||||
padding: 10px 0;
|
||||
}
|
||||
|
||||
.employee-detail-dialog .info-section {
|
||||
background: #f9fafb;
|
||||
border-radius: 8px;
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
.employee-detail-dialog .section-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 15px;
|
||||
font-weight: 600;
|
||||
color: #303133;
|
||||
margin-bottom: 12px;
|
||||
padding-bottom: 10px;
|
||||
border-bottom: 1px solid #e4e7ed;
|
||||
}
|
||||
|
||||
.employee-detail-dialog .section-title i {
|
||||
margin-right: 6px;
|
||||
color: #409eff;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.employee-detail-dialog .el-descriptions {
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.employee-detail-dialog .relatives-container {
|
||||
background: #fff;
|
||||
border-radius: 4px;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.employee-detail-dialog .empty-relatives {
|
||||
text-align: center;
|
||||
padding: 30px 0;
|
||||
color: #909399;
|
||||
background: #fff;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.employee-detail-dialog .empty-relatives i {
|
||||
font-size: 40px;
|
||||
color: #c0c4cc;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.employee-detail-dialog .empty-relatives span {
|
||||
display: block;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
/* 编辑弹窗样式 */
|
||||
.employee-edit-dialog .section-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 16px;
|
||||
padding-bottom: 8px;
|
||||
border-bottom: 1px solid #e4e7ed;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
color: #303133;
|
||||
}
|
||||
|
||||
.employee-edit-dialog .section-header span:first-child {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.employee-edit-dialog .relative-count {
|
||||
color: #909399;
|
||||
font-size: 12px;
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
.employee-edit-dialog .el-form-item {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.employee-edit-dialog .el-radio {
|
||||
margin-right: 20px;
|
||||
}
|
||||
|
||||
.employee-edit-dialog .relatives-table {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.employee-edit-dialog .relatives-table .el-form-item {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.employee-edit-dialog .empty-relatives {
|
||||
text-align: center;
|
||||
padding: 30px 0;
|
||||
color: #909399;
|
||||
border: 1px dashed #dcdfe6;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.employee-edit-dialog .empty-relatives i {
|
||||
font-size: 32px;
|
||||
color: #c0c4cc;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
.employee-edit-dialog .empty-relatives span {
|
||||
font-size: 13px;
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
/* 导入结果弹窗样式 */
|
||||
.import-result-dialog {
|
||||
max-height: 70vh;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.import-result-dialog .el-message-box__content {
|
||||
max-height: 60vh;
|
||||
overflow-y: auto;
|
||||
padding: 10px 20px;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user