<template>
|
<el-dialog
|
:title="title"
|
top="80px"
|
width="80%"
|
:close-on-click-modal="false"
|
:close-on-press-escape="false"
|
:visible.sync="isVisible"
|
:before-close="beforeClose"
|
>
|
<div class="app-container">
|
<div class="filter-container" style="margin-left: -340px;">
|
<el-button class="filter-item" type="warning" @click="handleExport">
|
导出
|
</el-button>
|
</div>
|
<el-table
|
ref="multipleTable"
|
:data="list"
|
row-key="empId"
|
stripe
|
border
|
:cell-style="{padding:'7px 0','text-align':'center'}"
|
:header-cell-style="{'height':'5.3vh','background-color':'#e6e6e6','text-align':'center'}"
|
style="width: 100%;"
|
>
|
<el-table-column show-overflow-tooltip type="index" width="55" label="序号" />
|
<el-table-column show-overflow-tooltip prop="empNumb" label="编号" width="120" />
|
<el-table-column show-overflow-tooltip prop="allDeptName" label="部门(护卫点)" />
|
<el-table-column show-overflow-tooltip prop="jobName" label="岗位" width="80" />
|
<el-table-column show-overflow-tooltip prop="empName" label="姓名" width="100" />
|
<el-table-column show-overflow-tooltip prop="certificateNumb" label="身份证号码" width="160" />
|
<el-table-column show-overflow-tooltip prop="sex" label="性别" width="60" />
|
<el-table-column show-overflow-tooltip prop="age" label="年龄" width="80" />
|
<el-table-column show-overflow-tooltip prop="education" label="学历" width="80" />
|
<el-table-column show-overflow-tooltip prop="nativePlace" label="籍贯" width="150" />
|
<el-table-column show-overflow-tooltip prop="telePhone" label="联系电话" width="110" />
|
<el-table-column show-overflow-tooltip prop="empTypeName" label="员工类型" width="80" />
|
<el-table-column show-overflow-tooltip prop="insuranceTypeName" label="社保档位" width="240" />
|
</el-table>
|
<pagination
|
v-show="total>0"
|
:total="total"
|
:page.sync="pagination.num"
|
:limit.sync="pagination.size"
|
@pagination="search"
|
/>
|
<el-button type="danger" @click="cancleChoose">关闭</el-button>
|
</div>
|
</el-dialog>
|
</template>
|
<script>
|
// 引用翻页组件
|
import Pagination from '@/components/Pagination'
|
|
export default {
|
components: {
|
Pagination
|
},
|
props: {
|
dialogVisible: {
|
type: Boolean,
|
default: false
|
},
|
title: {
|
type: String,
|
default: ''
|
},
|
multipleselect: {
|
type: Boolean,
|
default: false
|
}
|
},
|
data() {
|
return {
|
show: false,
|
headerHeight: '70px',
|
deptTree: [],
|
selection: [],
|
multipleSelection: [],
|
total: 0, // 总数量
|
queryParams: {
|
name: null,
|
btime: null,
|
etime: null,
|
index: null,
|
number: null
|
}, // 查询参数
|
sort: {}, // 排序
|
pagination: { // 分页参数
|
size: 5,
|
num: 1
|
},
|
probationStatusOptions: [],
|
list: [], // 给table显示的数据
|
defaultProps: {
|
children: 'children',
|
label: 'label'
|
},
|
// 导出配置
|
exportConfig: {
|
selectedFields: [
|
'empNumb', // 编号
|
'allDeptName', // 部门(护卫点)
|
'jobName', // 岗位
|
'empName', // 姓名
|
'certificateNumb', // 身份证号码
|
'sexName', // 性别
|
'age', // 年龄
|
'educationName', // 学历
|
'nativePlaceName', // 籍贯
|
'telePhone', // 联系电话
|
'empTypeName', // 员工类型
|
'insuranceTypeName' // 社保档位
|
],
|
exportUrl: 'hr/empBaseInfo/export/insurance',
|
fileName: '四险员工列表.xls'
|
},
|
selectIndex: 0 // 存储传入的时间筛选索引
|
}
|
},
|
computed: {
|
isVisible: {
|
get() {
|
return this.dialogVisible
|
}
|
}
|
},
|
mounted() {
|
setTimeout(() => {
|
this.getDicts('PROBATIONSTATUS').then(response => {
|
this.probationStatusOptions = response.data
|
})
|
}, 1000)
|
},
|
methods: {
|
probationStatusFormat(row, column) {
|
return this.selectDictLabel(this.probationStatusOptions, row.probationStatus)
|
},
|
beforeClose(done) {
|
this.$emit('cancleChooseUser')
|
},
|
search() {
|
this.fetch({
|
...this.queryParams
|
})
|
},
|
reset() {
|
this.queryParams.name = null
|
this.search()
|
},
|
// 翻页方法
|
setjobUser(btime, etime, index, number) {
|
this.queryParams.btime = btime
|
this.queryParams.etime = etime
|
this.queryParams.index = index
|
this.queryParams.number = number
|
this.queryParams.name = null
|
this.selectIndex = index !== null ? index : 0 // 保存传入的 index
|
this.pagination.num = 1
|
this.search()
|
},
|
fetch(params = {}) {
|
var that = this
|
params.pageSize = this.pagination.size
|
params.pageNum = this.pagination.num
|
params.delFlag = 0
|
params.empStatus = 0
|
|
// 添加 index 参数
|
if (params.timeRange === undefined || params.timeRange === null) {
|
params.timeRange = this.selectIndex
|
}
|
|
this.$get('hr/empBaseInfo/insurance/alert', {
|
...params
|
}).then((r) => {
|
const data = r.data.data
|
that.total = data.total
|
that.list = data.rows
|
})
|
},
|
cancleChoose() {
|
this.$emit('cancleChooseUser')
|
},
|
// 导出方法
|
handleExport() {
|
const params = {
|
...this.queryParams,
|
index: this.selectIndex, // 使用当前查询的 index
|
delFlag: 0,
|
empStatus: 0,
|
exportField: this.exportConfig.selectedFields.join(',')
|
}
|
|
this.$download(
|
this.exportConfig.exportUrl,
|
params,
|
this.exportConfig.fileName
|
).then(() => {
|
this.$message({
|
message: '下载成功!',
|
type: 'success'
|
})
|
})
|
}
|
}
|
}
|
</script>
|
<style lang="scss" scoped>
|
.link_button {
|
color: #169BD5;
|
}
|
|
.del_button {
|
color: #D9001B;
|
}
|
</style>
|