| | |
| | | <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" |
| | |
| | | <el-table-column show-overflow-tooltip prop="allDeptName" label="部门(护卫点)" width="300" /> |
| | | <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="certificateNumb" label="身份证号码" /> |
| | | <el-table-column show-overflow-tooltip prop="certificateValidity" label="身份证有效期" /> |
| | | <el-table-column show-overflow-tooltip prop="certificateNumb" label="身份证号码" min-width="120" /> |
| | | <el-table-column show-overflow-tooltip prop="certificateValidity" label="身份证有效期" min-width="120" /> |
| | | <el-table-column show-overflow-tooltip prop="empStatus" label="员工状态" width="100"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ gzdStateList[scope.row.empStatus] }} </span> |
| | |
| | | btime: null, |
| | | etime: null, |
| | | index: null, |
| | | number: null |
| | | number: null, |
| | | timeRange: null |
| | | }, // 查询参数 |
| | | sort: {}, // 排序 |
| | | pagination: { // 分页参数 |
| | | size: 5, |
| | | size: 15, |
| | | num: 1 |
| | | }, |
| | | list: [], // 给table显示的数据 |
| | | defaultProps: { |
| | | children: 'children', |
| | | label: 'label' |
| | | } |
| | | }, |
| | | // 导出配置 |
| | | exportConfig: { |
| | | selectedFields: [ |
| | | 'empNumb', // 编号 |
| | | 'allDeptName', // 部门(护卫点) |
| | | 'jobName', // 岗位 |
| | | 'empName', // 姓名 |
| | | 'certificateNumb', // 身份证号码 |
| | | 'certificateValidity', // 身份证有效期 |
| | | 'empStatus' // 员工状态 |
| | | ], |
| | | exportUrl: 'hr/empBaseInfo/export/sfz', // 需要后端提供对应接口 |
| | | fileName: '身份证到期员工列表.xls' |
| | | }, |
| | | selectIndex: 0 // 存储传入的时间筛选索引 |
| | | } |
| | | }, |
| | | computed: { |
| | |
| | | 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() |
| | | }, |
| | |
| | | }, |
| | | 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' |
| | | }) |
| | | }) |
| | | } |
| | | } |
| | | } |