From 09d00cd810cebc2b78c3928a8673f569cbffe165 Mon Sep 17 00:00:00 2001
From: yubo <autumnal_wind@yeah.net>
Date: 星期三, 11 三月 2026 19:27:17 +0800
Subject: [PATCH] feat(dashboard): 添加四险提醒统计功能和导出功能
---
src/views/dashboard/sfzUser.vue | 45 +++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 43 insertions(+), 2 deletions(-)
diff --git a/src/views/dashboard/sfzUser.vue b/src/views/dashboard/sfzUser.vue
index 7f4cda7..725b4ac 100644
--- a/src/views/dashboard/sfzUser.vue
+++ b/src/views/dashboard/sfzUser.vue
@@ -17,6 +17,10 @@
<el-button class="filter-item" type="success" @click="reset">
{{ $t('table.reset') }}
</el-button>
+ <!-- 新增导出按钮 -->
+ <el-button class="filter-item" type="warning" @click="handleExport">
+ 导出
+ </el-button>
</div>
<el-table
ref="multipleTable"
@@ -91,7 +95,8 @@
btime: null,
etime: null,
index: null,
- number: null
+ number: null,
+ timeRange: null
}, // 查询参数
sort: {}, // 排序
pagination: { // 分页参数
@@ -102,7 +107,22 @@
defaultProps: {
children: 'children',
label: 'label'
- }
+ },
+ // 导出配置
+ exportConfig: {
+ selectedFields: [
+ 'empNumb', // 编号
+ 'allDeptName', // 部门(护卫点)
+ 'jobName', // 岗位
+ 'empName', // 姓名
+ 'certificateNumb', // 身份证号码
+ 'certificateValidity', // 身份证有效期
+ 'empStatus' // 员工状态
+ ],
+ exportUrl: 'hr/empBaseInfo/export/sfz', // 需要后端提供对应接口
+ fileName: '身份证到期员工列表.xls'
+ },
+ selectIndex: 0 // 存储传入的时间筛选索引
}
},
computed: {
@@ -131,6 +151,7 @@
this.queryParams.etime = etime
this.queryParams.index = index
this.queryParams.number = number
+ this.selectIndex = index !== null ? index : 0 // 保存传入的 index
this.queryParams.name = null
this.search()
},
@@ -148,6 +169,26 @@
},
cancleChoose() {
this.$emit('cancleChooseUser')
+ },
+ // 导出方法
+ handleExport() {
+ const params = {
+ ...this.queryParams,
+ index: this.queryParams.index !== null ? this.queryParams.index : this.selectIndex,
+ timeRange: this.queryParams.index !== null ? this.queryParams.index : this.selectIndex,
+ exportField: this.exportConfig.selectedFields.join(',')
+ }
+
+ this.$download(
+ this.exportConfig.exportUrl,
+ params,
+ this.exportConfig.fileName
+ ).then(() => {
+ this.$message({
+ message: '下载成功!',
+ type: 'success'
+ })
+ })
}
}
}
--
Gitblit v1.8.0