2022-06-08 15:48:09 +08:00

625 lines
17 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<view class="fullHeight">
<headers :showBack="true" :themeType="'white'">
<view class="headerName">
人员档案
</view>
</headers>
<view class="personDetail_content">
<view class="title_wrap">
<view class="flex">
<view class="flex">
<image class="photograph" @click="previewImage(workerInfo.fieldAcquisitionUrl,1)" :src="url_config+'image/'+workerInfo.fieldAcquisitionUrl"></image>
<image class="photograph" @click="previewImage(workerInfo.idCardBigPhotoUrl,2)" :src="url_config+'image/'+workerInfo.idCardBigPhotoUrl"></image>
</view>
<view class="user_info">
<view class="name">{{workerInfo.workerName}}</view>
<view class="code">{{workerInfo.idCard}}</view>
<view class="nation">民族{{workerInfo.nation}}</view>
</view>
<!-- 操作按钮 -->
<view style="width: 30px;height: 60px; text-align: center;" v-if="false">
<image class="more" src="../../../../static/personManage/more.png" @click="operateBtn"></image>
</view>
</view>
<view class="projectName">{{workerInfo.projectName}}</view>
<view v-if="workerInfo.personType==1">
<view class="project_info">
<text class="name">班组:</text>
<text>{{workerInfo.teamName}}</text>
</view>
<!-- <view class="project_info">
<text class="name">工种:</text>
<text>顾燕安-中建八局第三建设有限公司安装分公司</text>
</view> -->
<view class="project_info">
<text class="name">工号:</text>
<text>{{workerInfo.attendanceNumber}}</text>
</view>
</view>
<view v-else>
<view class="project_info">
<text class="name">部门:</text>
<text>{{workerInfo.departmentName}}</text>
</view>
<view class="project_info">
<text class="name">工号:</text>
<text>{{workerInfo.attendanceNumber}}</text>
</view>
</view>
<image src="../../../../static/header_bg.png" class="header_bg"></image>
<view class="title_dialog" v-if="operateType">
<view @click="editPersonState(1)" v-if="workerInfo.inserviceType==2">再次进场</view>
<view @click="editPersonState(2)" v-if="workerInfo.inserviceType==1">退场</view>
</view>
</view>
<view class="item_wrap flex">
<view class="flex item" @click="showItemDetails(1)">
<image class="margin_r_5" style="width: 46rpx;height:46rpx" src="../../../../static/personManage/ht.png"></image>
<text>合同</text>
<text class="state1" v-if="contractList.length>0">已签</text>
<text class="state2" v-else>未签</text>
</view>
<view class="flex item" @click="showItemDetails(2)">
<image class="margin_r_5" style="width: 42rpx;height:42rpx" src="../../../../static/personManage/tjzs.png"></image>
<text>体检</text>
<text class="state1" v-if="physicalsList.length>0">已体检</text>
<text class="state2" v-else>未体检</text>
</view>
<view class="flex item" @click="showItemDetails(3)">
<image class="margin_r_5" style="width: 38rpx;height:44rpx" src="../../../../static/personManage/bx.png"></image>
<text>保险</text>
</view>
<view class="flex item" @click="showItemDetails(4)">
<image class="margin_r_5" style="width: 43rpx;height:38rpx" src="../../../../static/personManage/jy.png"></image>
<text>安全教育</text>
</view>
<view class="flex item" @click="showItemDetails(5)" v-if="false">
<image class="margin_r_5" style="width: 35rpx;height:35rpx" src="../../../../static/personManage/qrCode.png"></image>
<text>二维码</text>
</view>
</view>
<view class="log_wrap">
<view class="flex" @click="showInfoList(1)">
<view class="flex">
<image class="margin_r_5" style="width: 33rpx;height:40rpx" src="../../../../static/personManage/zs.png"></image>
<text class="title">资格证书({{certificateList.length}})</text>
</view>
<view v-if="false">添加</view>
</view>
<view class="log_content" v-if="showCertificateList">
<view class="log_content_item" v-for="(item,index) in certificateList" :key="index">
<view>
<text>证书类型:</text>
<text>{{item.certificateTypeName}}</text>
</view>
<view>
<text>证书编号:</text>
<text>{{item.certificateNumber}}</text>
</view>
<view>
<text>技能等级:</text>
<text v-if="item.skillLevel==1">普工</text>
<text v-if="item.skillLevel==2">初级工</text>
<text v-if="item.skillLevel==3">中级工</text>
<text v-if="item.skillLevel==4">高级工</text>
<text v-if="item.skillLevel==5">技师</text>
<text v-if="item.skillLevel==6">高级技师</text>
</view>
<view>
<text>发证日期:</text>
<text>{{item.issueTime}}</text>
</view>
<view>
<text>截止日期:</text>
<text>{{item.effectTime}}</text>
</view>
<view>
<text>发证机关:</text>
<text>{{item.issueCompany}}</text>
</view>
<view class="flex">
<text>备注:</text>
<pre>{{item.remarks}}</pre>
</view>
<view class="flex3">
<text>附件:</text>
<image v-if="imgItem" v-for="(imgItem,imgIndex) in item.fileList" @click="previewImage(imgItem.url,2)" :key="imgIndex" :src="url_config+'image/'+imgItem.url"
style="width: 40px; height: 50px;"></image>
</view>
</view>
</view>
</view>
<view class="log_wrap">
<view class="flex" @click="showInfoList(2)">
<view class="flex">
<image class="margin_r_5" style="width: 37rpx;height:37rpx" src="../../../../static/personManage/cyjl.png"></image>
<text class="title">从业经历({{workExperienceList.length}})</text>
</view>
<view v-if="false">添加</view>
</view>
<view class="log_content" v-if="showWorkExperienceList">
<view class="log_content_item" v-for="(item,index) in workExperienceList" :key="index">
<view>
<text>参与项目:</text>
<text>{{item.projectName}}</text>
</view>
<view>
<text>入场日期:</text>
<text>{{item.enterDate}}</text>
</view>
<view>
<text>退场日期:</text>
<text>{{item.exitDate}}</text>
</view>
<view>
<text>工种:</text>
<text>{{item.typeName}}</text>
</view>
<view>
<text>班组/部门:</text>
<text>{{item.teamName}}</text>
</view>
</view>
</view>
</view>
<view class="log_wrap">
<view class="flex" @click="showInfoList(3)">
<view class="flex">
<image class="margin_r_5" style="width: 34rpx;height:43rpx" src="../../../../static/personManage/jl.png"></image>
<text class="title">奖励记录({{rewardList.length}})</text>
</view>
<view v-if="false">添加</view>
</view>
<view class="log_content" v-if="showRewardList">
<view class="log_content_item" v-for="(item,index) in rewardList" :key="index">
<view>
<text>发生时间:</text>
<text>{{item.eventTime}}</text>
</view>
<view>
<text>事件|奖励原因:</text>
<text>{{item.reason}}</text>
</view>
<view>
<text>奖励名称:</text>
<text>{{item.awardName}}</text>
</view>
<view class="flex">
<text>备注:</text>
<pre>{{item.remarks}}</pre>
</view>
<view class="flex3">
<text>附件:</text>
<image v-if="imgItem" v-for="(imgItem,imgIndex) in item.fileList" @click="previewImage(imgItem.url,2)" :key="imgIndex" :src="url_config+'image/'+imgItem.url" style="width: 40px; height: 50px;"></image>
</view>
</view>
</view>
</view>
<view class="log_wrap">
<view class="flex" @click="showInfoList(4)">
<view class="flex">
<image class="margin_r_5" style="width: 34rpx;height:34rpx" src="../../../../static/personManage/bljl.png"></image>
<text class="title">不良记录({{badList.length}})</text>
</view>
<view v-if="false">添加</view>
</view>
<view class="log_content" v-if="showBadList">
<view class="log_content_item" v-for="(item,index) in badList" :key="index">
<view>
<text>发生时间</text>
<text>{{item.eventTime}}</text>
</view>
<view>
<text>事件|发生原因</text>
<text>{{item.reason}}</text>
</view>
<view>
<text>严重程度</text>
<text>{{item.seriousGrade==1?'不严重':item.seriousGrade==2?'严重':item.seriousGrade==3?'非常严重':''}}</text>
</view>
<view class="flex">
<text>备注</text>
<pre>{{item.remarks}}</pre>
</view>
<view class="flex3">
<text>附件</text>
<image v-if="imgItem" v-for="(imgItem,imgIndex) in item.fileList" :key="imgIndex" @click="previewImage(imgItem.url,2)" :src="url_config+'image/'+imgItem.url" style="width: 40px; height: 50px;"></image>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
workerId: 0,
operateType: false,
workerInfo: {}, //基本信息
certificateList: [], //资格证书
workExperienceList: [], //从业信息
badList: [], //不良记录
rewardList: [], //--奖励记录
contractList: [], //合同列表
physicalsList: [], //体检列表
safeEducationList: [], //安全教育信息
monthAttendance: [],
insuranceList: [],
showBadList: false,
showRewardList: false,
showWorkExperienceList: false,
showCertificateList: false,
}
},
onLoad(options) {
this.workerId = options.id;
// this.getDetailsData();
},
onShow(){
this.getDetailsData();
},
methods: {
//获取详情数据
getDetailsData() {
this.sendRequest({
url: 'xmgl/workerInfo/viewWorkerInfoDetail',
method: 'post',
data: {
workerId: this.workerId,
},
success: res => {
if (res.code == 200) {
this.workerInfo = res.result.workerInfo;
//获取证书附件
if (res.result.certificateList.length > 0) {
res.result.certificateList.forEach((item) => {
item.certificateState = false; //设置可编辑状态
if (item.photoUrl) {
let arr = item.photoUrl.split("*");
item.fileList = [{
name: arr[0],
url: arr[1]
}];
} else {
item.fileList = [];
}
});
};
this.certificateList = res.result.certificateList; //资格证书
this.workExperienceList = res.result.workExperienceList; //从业信息
//获取不良记录附件
if (res.result.badList.length > 0) {
res.result.badList.forEach((item) => {
if (item.fileUrl) {
item.fileList = JSON.parse(item.fileUrl); //设置可编辑状态
}
});
}
//获取奖励记录附件
if (res.result.rewardList.length > 0) {
res.result.rewardList.forEach((item) => {
if (item.fileUrl) {
item.fileList = JSON.parse(item.fileUrl); //设置可编辑状态
} else {
item.fileList = [];
}
});
}
this.badList = res.result.badList; // 不良记录
this.rewardList = res.result.rewardList; // 奖励记录
this.insuranceList = res.result.insuranceList; //保险
this.contractList = res.result.contractList; //合同
this.physicalsList = res.result.physicalsList; //体检列表
this.safeEducationList = res.result.safeEducationList;//安全教育
}
}
})
},
//显示操作 进退场按钮
operateBtn() {
this.operateType = !this.operateType;
},
//进场 退场操作
editPersonState() {
},
//显示列表
showInfoList(type) {
switch (type) {
case 1:
if (this.certificateList.length == 0) {
this.showCertificateList = false;
} else {
this.showCertificateList = !this.showCertificateList;
}
break;
case 2:
if (this.workExperienceList.length == 0) {
this.showWorkExperienceList = false;
} else {
this.showWorkExperienceList = !this.showWorkExperienceList;
}
break;
case 3:
if (this.rewardList.length == 0) {
this.showRewardList = false;
} else {
this.showRewardList = !this.showRewardList;
}
break;
case 4:
if (this.badList.length == 0) {
this.showBadList = false;
} else {
this.showBadList = !this.showBadList;
}
break;
}
},
//预览图片
previewImage(url,type){
let fileList = [];
if(type==1 || type==2){
fileList = [this.url_config+'image/'+url]
}
uni.previewImage({
current:0,
urls:fileList
})
},
//查看信息详情
showItemDetails(type){
// type == 1.合同; 2.体检; 3.保险; 4安全教育; 5.二维码
let moduleInfo = null;
if(type==1){
moduleInfo = this.contractList;
}else if(type==2){
moduleInfo = this.physicalsList;
}else if(type==3){
moduleInfo = this.insuranceList;
}else if(type==4){
moduleInfo = this.safeEducationList;
};
uni.setStorageSync('moduleInfo',moduleInfo)
uni.navigateTo({
url:"./detailsMod?type="+type
})
},
}
}
</script>
<style>
.flex {
display: flex;
align-items: center;
}
.flex2 {
display: flex;
align-items: center;
justify-content: space-between;
}
.flex3 {
display: flex;
}
.personDetail_content {
padding: 15px 30rpx;
box-sizing: border-box;
width: 100%;
}
.personDetail_content .title_wrap {
width: 100%;
box-shadow: 0 4px 13px 0 rgba(212, 220, 236, 0.67);
box-sizing: border-box;
padding: 20px 28rpx 10px;
border-radius: 8px;
position: relative;
}
.header_bg {
position: absolute;
top: 0;
right: 0;
z-index: 1;
width: 568rpx;
height: 90rpx;
}
.photograph {
width: 116rpx;
height: 150rpx;
z-index: 111;
margin-right: 8px;
}
.more {
width: 47rpx;
height: 37rpx;
z-index: 2222;
}
.more:active {
background-color: #999;
}
.user_info {
margin-left: 2px;
width: 50%;
}
.user_info .name {
font-size: 34rpx;
line-height: 48rpx;
font-weight: 500;
color: #488DEC;
}
.user_info .code {
font-size: 26rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #2A2B5B;
line-height: 37rpx;
margin: 5px 0;
opacity: 0.8;
}
.user_info .nation {
font-size: 26rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #2A2B5B;
line-height: 37rpx;
opacity: 0.8;
margin-bottom: 4px;
}
.projectName {
font-size: 30rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 700;
color: #2A2B5B;
line-height: 42rpx;
margin-top: 15px;
}
.project_info {
font-size: 26rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #2A2B5B;
line-height: 26px;
}
.project_info .name {
color: #372D66;
opacity: 0.6;
}
.item_wrap {
width: 100%;
margin: 10px 0;
box-shadow: 0 4px 13px 0 rgba(212, 220, 236, 0.67);
padding: 10px 0 10px 28rpx;
box-sizing: border-box;
border-radius: 8px;
flex-wrap: wrap;
}
.item_wrap .item {
width: 33%;
font-size: 30rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #372D66;
line-height: 84rpx;
position: relative;
}
.item_wrap .item .state1{
position: absolute;
top: 0;
left: 58px;
padding: 3px 6px;
font-size: 20rpx;
background: #4181FE;
color: #fff;
line-height: 14px;
border-radius: 3px;
}
.item_wrap .item .state2{
position: absolute;
top: 0;
left: 58px;
padding: 3px 6px;
font-size: 20rpx;
background: red;
color: #fff;
line-height: 14px;
border-radius: 3px;
}
.margin_r_5 {
margin-right: 5px;
}
.log_wrap {
width: 100%;
margin: 10px 0;
box-shadow: 0 4px 13px 0 rgba(212, 220, 236, 0.67);
padding: 12px 28rpx;
box-sizing: border-box;
border-radius: 8px;
}
.log_wrap .title {
font-size: 30rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 700;
color: #2A2B5B;
line-height: 42rpx;
}
.log_wrap .log_content {
margin-top: 8px;
border-top: 1px solid #C8C7CC;
box-sizing: border-box;
padding-top: 8px;
}
.log_wrap .log_content_item {
background-color: #f1f7fe;
border-radius: 2px;
border: 1px dashed #888888;
font-size: 26rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #2A2B5B;
line-height: 40rpx;
box-sizing: border-box;
padding: 10px 28rpx;
margin-bottom: 8px;
}
.title_dialog {
position: absolute;
top: 20px;
right: 46px;
font-size: 12px;
line-height: 24px;
background-color: #fff;
width: 65px;
text-align: center;
z-index: 999;
border: 1px solid #999;
padding: 3px 8px;
border-radius: 2px;
}
</style>