<template>
|
<div class="app-container">
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
<el-form-item label="用户姓名" prop="userName">
|
<el-input
|
v-model="queryParams.name"
|
placeholder="请输入用户姓名"
|
clearable
|
@keyup.enter.native="handleQuery"
|
/>
|
</el-form-item>
|
<el-form-item label="身份证号" prop="idCard">
|
<el-input
|
v-model="queryParams.idCardNum"
|
placeholder="请输入身份证号"
|
clearable
|
@keyup.enter.native="handleQuery"
|
/>
|
</el-form-item>
|
<el-form-item>
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
</el-form-item>
|
</el-form>
|
|
<el-row :gutter="10" class="mb8">
|
<el-col :span="1.5">
|
<el-button
|
type="primary"
|
plain
|
icon="el-icon-refresh"
|
size="mini"
|
@click="resetQuery"
|
v-hasPermi="['system:experts:add']"
|
>同步数据</el-button>
|
</el-col>
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getPage"></right-toolbar>
|
</el-row>
|
<el-table v-loading="loading" :data="dataList">
|
<el-table-column type="index" label="序号" width="55" align="center" />
|
<el-table-column label="姓名" align="center" prop="name" />
|
<el-table-column label="性别" align="center" prop="sex">
|
<template #default="scope">
|
{{ scope.row.sex == 0?'男':scope.row.sex == 1?'女':'未知' }}
|
</template>
|
</el-table-column>
|
<el-table-column label="身份证号" align="center" prop="idCardNum">
|
<template #default="scope">
|
{{scope.row.idCardNum | peridcardtm}}
|
</template>
|
</el-table-column>
|
<el-table-column label="电话" align="center" prop="phone"/>
|
<el-table-column label="民族" align="center" prop="nationCode">
|
<template #default="scope">
|
{{getNationName(scope.row.nationCode)}}
|
</template>
|
</el-table-column>
|
<el-table-column label="所属单位" align="center" prop="resumeList">
|
<template #default="scope">
|
{{ scope.row.resumeList.map(i=>i.unit).join(',') }}
|
</template>
|
</el-table-column>
|
<el-table-column label="最高学历" align="center" prop="highestEducation"/>
|
<el-table-column label="作业证书" align="center" prop="certCount">
|
<template #default="scope">
|
<el-button v-if="scope.row.certCount>0" type="text" @click="openCert(scope.row)">{{ scope.row.certCount }}</el-button>
|
<span v-else>{{scope.row.certCount}}</span>
|
</template>
|
</el-table-column>
|
<el-table-column label="关联作业次数" align="center" prop="workCount"/>
|
<el-table-column label="违章次数" align="center" prop="violationCount"/>
|
<el-table-column label="证件照片" align="center" prop="photoPath">
|
<template #default="scope">
|
<el-button type="text" v-if="scope.row.photoPath && scope.row.photoPath !==''" @click="viewFile(scope.row.photoPath)">预览</el-button>
|
<span type="text" v-else>暂无</span>
|
</template>
|
</el-table-column>
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<template #default="scope">
|
<!-- <el-button-->
|
<!-- size="mini"-->
|
<!-- type="text"-->
|
<!-- icon="el-icon-edit"-->
|
<!-- @click="openPeople(scope.row,'edit')"-->
|
<!-- >编辑</el-button>-->
|
<el-button
|
size="mini"
|
type="text"
|
icon="el-icon-view"
|
@click="openPeople(scope.row,'view')"
|
>查看</el-button>
|
</template>
|
</el-table-column>
|
</el-table>
|
<pagination
|
v-show="total>0"
|
:total="total"
|
:page.sync="queryParams.pageNum"
|
:limit.sync="queryParams.pageSize"
|
@pagination="getPage"
|
/>
|
<peopleDialog ref="peopleDialog"></peopleDialog>
|
<certDialog ref="certDialog" @closeDialog="resetQuery"></certDialog>
|
</div>
|
</template>
|
|
<script>
|
import { getPeoplePage } from "@/api/notCoalMine/people";
|
import peopleDialog from "./components/peopleDialog";
|
import axios from "axios";
|
import {getToken} from "@/utils/auth";
|
import certDialog from "@/views/notCoalMine/nPeopleManage/components/certDialog"
|
export default {
|
name: "nPeopleManage",
|
dicts: ['sys_nation_code'],
|
components: { peopleDialog, certDialog },
|
data() {
|
return {
|
loading: false,
|
showSearch: true,
|
total: 0,
|
dataList: [],
|
queryParams: {
|
idCardNum: '',
|
name: '',
|
pageNum: 1,
|
pageSize: 10
|
}
|
};
|
},
|
created() {
|
const t = this
|
t.getPage()
|
},
|
methods: {
|
async getPage(){
|
const t = this
|
t.loading = true
|
const res = await getPeoplePage(t.queryParams)
|
if(res.code == 200){
|
t.dataList = res.rows
|
t.total = res.total
|
}else{
|
t.$message({
|
message: res.msg,
|
type: 'warning'
|
})
|
}
|
t.loading = false
|
},
|
getNationName(code){
|
let obj = JSON.parse(JSON.stringify(this.dict.type.sys_nation_code)).find(i=>i.value == code)
|
if(obj){
|
return obj.label
|
}else{
|
return '未知'
|
}
|
},
|
openPeople(data,type){
|
this.$refs.peopleDialog.openDialog(data,type)
|
},
|
handleChange(){
|
|
},
|
handleQuery(){
|
this.queryParams.pageNum = 1
|
this.getPage()
|
},
|
resetQuery(){
|
this.queryParams={
|
idCardNum: '',
|
name: '',
|
pageNum: 1,
|
pageSize: 10
|
}
|
this.getPage()
|
},
|
handleAdd(){
|
|
},
|
viewFile(file){
|
const t = this
|
if(file.substring(0, 1) !== '/'){
|
t.$message.error('无效的图片地址')
|
return
|
}
|
axios.get(process.env.VUE_APP_BASE_API + file,{headers:{'Content-Type': 'application/json','Authorization': "Bearer " + getToken()},responseType: 'blob',timeout: 3000}).then(res=>{
|
if (res) {
|
const link = document.createElement('a')
|
let blob = new Blob([res.data],{type: res.data.type})
|
link.style.display = "none";
|
link.href = URL.createObjectURL(blob); // 创建URL
|
window.open(link.href)
|
} else {
|
t.$message.error('获取文件失败')
|
}
|
}).catch(function(err){
|
// if(err == 'Error: Network Error'){
|
// t.$message.error('获取文件失败')
|
// }else if(err == 'Error: Request failed with status code 404'){
|
// t.$message.error('获取文件失败')
|
// }else{
|
t.$message.error(err)
|
// }
|
})
|
},
|
openCert(data){
|
this.$refs.certDialog.openDialog(data)
|
},
|
}
|
};
|
</script>
|