feat(user): 添加员工转正提醒导出功能
- 移除原有的搜索和重置按钮,替换为导出按钮
- 新增导出配置对象,包含选中的字段列表
- 添加导出URL和文件名配置
- 实现handleExport方法处理导出逻辑
- 集成下载服务并添加成功提示消息
- 配置员工编号、部门、岗位等15个导出字段
| | |
| | | > |
| | | <div class="app-container"> |
| | | <div class="filter-container" style="margin-left: -340px;"> |
| | | <el-input v-model="queryParams.name" placeholder="姓名/身份证号/护卫点/员工编号" class="filter-item search-item" /> |
| | | <el-button class="filter-item" type="primary" @click="search"> |
| | | {{ $t('table.search') }} |
| | | </el-button> |
| | | <el-button class="filter-item" type="success" @click="reset"> |
| | | {{ $t('table.reset') }} |
| | | <el-button class="filter-item" type="warning" @click="handleExport"> |
| | | 导出 |
| | | </el-button> |
| | | </div> |
| | | <el-table |
| | |
| | | defaultProps: { |
| | | children: 'children', |
| | | label: 'label' |
| | | }, |
| | | // 导出配置 |
| | | exportConfig: { |
| | | selectedFields: [ |
| | | 'empNumb', // 员工编号 |
| | | 'allDeptName', // 部门(护卫点) |
| | | 'jobName', // 岗位 |
| | | 'empName', // 姓名 |
| | | 'certificateNumb', // 身份证号码 |
| | | 'birthdate', // 出生日期 |
| | | 'insuranceTypeName', // 社保档位 |
| | | 'socialNumb', // 社保电脑号 |
| | | 'entryDate', // 入职日期 |
| | | 'probationDate', // 转正日期 |
| | | 'probationStatusName' // 转正状态 |
| | | ], |
| | | exportUrl: 'hr/empBaseInfo/export/probation', |
| | | fileName: '员工转正提醒.xls' |
| | | } |
| | | } |
| | | }, |
| | |
| | | }, |
| | | cancleChoose() { |
| | | this.$emit('cancleChooseUser') |
| | | }, |
| | | // 导出方法 |
| | | handleExport() { |
| | | const params = { |
| | | ...this.queryParams, |
| | | delFlag: 0, |
| | | empStatus: 0, |
| | | exportField: this.exportConfig.selectedFields.join(',') |
| | | } |
| | | |
| | | this.$download( |
| | | this.exportConfig.exportUrl, |
| | | params, |
| | | this.exportConfig.fileName |
| | | ).then(() => { |
| | | this.$message({ |
| | | message: '下载成功!', |
| | | type: 'success' |
| | | }) |
| | | }) |
| | | } |
| | | } |
| | | } |