From 3d213c064d4e6906e720fd9c3a6ccc055be24104 Mon Sep 17 00:00:00 2001
From: yubo <autumnal_wind@yeah.net>
Date: 星期二, 10 三月 2026 19:52:18 +0800
Subject: [PATCH] feat(remind): 添加员工退休提醒页面导出功能
---
src/views/remind/retirement.vue | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 56 insertions(+), 3 deletions(-)
diff --git a/src/views/remind/retirement.vue b/src/views/remind/retirement.vue
index 09f62a1..5cb8fce 100644
--- a/src/views/remind/retirement.vue
+++ b/src/views/remind/retirement.vue
@@ -36,12 +36,14 @@
>解骋</span>
</template>
</el-table-column>
- <el-table-column show-overflow-tooltip prop="empNumb" label="员工编号" width="120" />
+ <el-table-column show-overflow-tooltip prop="empNumb" label="员工编号" width="160" />
<el-table-column show-overflow-tooltip prop="allDeptName" label="部门(护卫点)" />
<el-table-column show-overflow-tooltip prop="jobName" label="岗位" width="100" />
<el-table-column show-overflow-tooltip prop="empName" label="姓名" width="100" />
+ <el-table-column show-overflow-tooltip prop="sex" label="性别" width="100" :formatter="sexFormatter" />
<el-table-column show-overflow-tooltip prop="certificateNumb" label="身份证号码" width="160" />
<el-table-column show-overflow-tooltip prop="birthdate" label="出生日期" width="120" />
+ <el-table-column show-overflow-tooltip prop="age" label="年龄" width="120" />
</el-table>
<pagination
v-show="total>0"
@@ -142,16 +144,24 @@
<el-button @click="dialogIsShow()">取 消</el-button>
</div>
</el-dialog>
+ <!-- 通用导出对话框 -->
+ <export-dialog
+ :visible.sync="exportDialogVisible"
+ :selected-fields="exportConfig.selectedFields"
+ @confirm="handleExportConfirm"
+ />
</div>
</template>
<script>
import Pagination from '@/components/Pagination'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import { dateDifference } from '@/utils/myUtil'
+import ExportDialog from '@/components/ExportEmpBase.vue'
export default {
components: {
- Pagination
+ Pagination,
+ ExportDialog
},
data() {
return {
@@ -226,6 +236,25 @@
beginDate: [{ required: true, message: '请选择合同开始日期', trigger: 'change' }],
endDate: [{ required: true, validator: this.endDate }],
remark: [{ max: 512, message: '长度不超过512个字符', trigger: 'blur' }]
+ },
+ exportDialogVisible: false,
+ // 导出配置(每个模块自定义)
+ exportConfig: {
+ // 默认选中的字段(根据模块需要配置)
+ selectedFields: [
+ 'empNumb', // 员工编号
+ 'allDeptName', // 部门(护卫点)
+ 'jobName', // 岗位
+ 'empName', // 姓名
+ 'sexName', // 性别
+ 'certificateNumb', // 身份证号码
+ 'birthdate', // 出生日期
+ 'age' // 年龄
+ ],
+ // 导出接口地址
+ exportUrl: 'hr/empBaseInfo/export/retirement',
+ // 导出文件名
+ fileName: '员工退休提醒.xls'
}
}
},
@@ -252,7 +281,6 @@
params.pageNum = this.pagination.num
params.delFlag = 0
params.empStatus = 0
-
this.$get('hr/empBaseInfo/retire/alert', {
...params
}).then((r) => {
@@ -265,6 +293,10 @@
this.sort.field = val.prop
this.sort.order = val.order
this.fetch()
+ },
+ sexFormatter(row, column, cellValue) {
+ const option = this.sexOptions.find(item => item.dicItemCode === cellValue)
+ return option ? option.dicItemName : cellValue
},
// 续签合同
goOn(row) {
@@ -385,6 +417,27 @@
})
}
})
+ },
+ // 显示导出对话框
+ showDcyg() {
+ this.exportDialogVisible = true
+ },
+ // 确认导出
+ handleExportConfirm(selectedFields) {
+ const params = { ...this.queryParams }
+ params.empStatus = '0'
+ params.exportField = selectedFields.join(',')
+
+ this.$download(
+ this.exportConfig.exportUrl,
+ { ...params },
+ this.exportConfig.fileName
+ ).then(() => {
+ this.$message({
+ message: '下载成功!',
+ type: 'success'
+ })
+ })
}
}
}
--
Gitblit v1.8.0