261 lines
10 KiB
Vue
Raw Normal View History

<template>
<view class="modultInfo">
<headers :showBack="true" :themeType="'white'">
<view class="headerName">
{{type==1?'合同':type==2?'体检':type==3?'保险':type==4?'安全教育':''}}
</view>
</headers>
<view class="content">
<view class="info_wrap" v-if="type==1">
<!-- <view class="title">
<text class="state1" v-if="info.length==0">未签订</text>
<text class="state2" v-else>已签订</text>
</view> -->
<view class="detailInfo" v-for="(item,index) in info" :key="index">
<view>合同编号{{item.contractNumber}}</view>
<view>合同类型{{item.contractType==1?'纸质合同':item.contractType==2?'电子合同':''}}</view>
<view>合同期限{{item.laborContractType==1?'固定期限合同':item.laborContractType==2?'以完成一定工作为期限的合同':''}}
</view>
<view>生效日期{{item.contractBeginDate}}</view>
<view>失效日期{{item.contractEndDate}}</view>
<view>工资核定方式{{
item.wagesVerificationType == 1
? "按天"
: item.wagesVerificationType == 2
? "按小时"
: item.wagesVerificationType == 3
? "按月"
: item.wagesVerificationType == 4
? "按件"
: ""
}}</view>
<view>合同附件
<text v-for="(val, valIndex) in item.fileList" @click="handlePreview(val.url)" :key="valIndex"
style="cursor: pointer;margin-right:10rpx">{{val.name}}</text>
</view>
</view>
<view class="no_data" v-if="info.length == 0">
<image src="/static/noData.png"></image>
<view>暂无数据</view>
</view>
</view>
<view class="info_wrap" v-if="type==2">
<!-- <view class="title">
<text class="state1" v-if="info.length==0">未体检</text>
<text class="state2" v-else>已体检</text>
</view> -->
<view class="detailInfo" v-for="(item,index) in info" :key="index">
<view>身高{{item.personHeight}}cm</view>
<view>体重{{item.personWeight}}kg</view>
<view>体检日期{{item.physicalsTime}}</view>
<view>体检状态{{item.state==1?'未体检':item.state==2?'体检合格':item.state==1?'体检不合格':''}}</view>
<view>结论{{item.conclusion}}</view>
</view>
<view class="no_data" v-if="info.length == 0">
<image src="/static/noData.png"></image>
<view>暂无数据</view>
</view>
</view>
<view class="info_wrap" v-if="type==3">
<!-- <view class="title">
<text class="state1" v-if="info.length==0">未购买</text>
<text class="state2" v-else>已购买</text>
</view> -->
<view class="detailInfo" v-for="(item,index) in info" :key="index">
<view>保险购买日期{{item.insuranceTime}}</view>
<view>保险到期日期{{item.expireTime}}</view>
<view>保险状态{{item.state==1?'未购买':item.state==2?'已购买':''}}</view>
<view>险种{{item.insuranceType}}</view>
<view>城乡居民医疗保险{{item.medicalInsurance==1?'否':item.medicalInsurance==2?'是':''}}</view>
<view>城乡居民养老保险{{item.endowmentInsurance==1?'否':item.endowmentInsurance==2?'是':''}}</view>
</view>
<view class="no_data" v-if="info.length == 0">
<image src="/static/noData.png"></image>
<view>暂无数据</view>
</view>
</view>
<view class="info_wrap" v-if="type==4">
<!-- <view class="title">
<text class="state1" v-if="info.length==0">未培训</text>
<text class="state2" v-else>已培训</text>
</view> -->
<view class="detailInfo" v-for="(item,index) in info" :key="index">
<!-- <view>培训类型 {{
item.eduType == 1
? "入场三级教育"
: item.eduType == 2
? "定期安全教育"
: item.eduType == 3
? "安全技术交底"
: item.eduType == 4
? "VR安全教育"
: ""
}}</view> -->
<view>考试时间{{item.startExamTime}}</view>
<view>考试科目{{item.subjectName}}</view>
<view>考试分数{{item.score}}</view>
<view>是否合格{{item.isPass == 1 ? "是":item.isPass == 0? "否":''}}</view>
</view>
<view class="no_data" v-if="info.length == 0">
<image src="/static/noData.png"></image>
<view>暂无数据</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
type: 1,
info: null,
workerId: "",
idCard: "",
}
},
onLoad(option) {
this.type = Number(option.type);
this.workerId = option.workerId;
this.idCard = option.idCard;
this.info = uni.getStorageSync('moduleInfo');
this.getFileInfo();
if (this.type == 4) { // 安全教育考试数据特殊处理
this.getDangerItemRecord();
}
},
methods: {
// 获取考试数据
getExamDataList() {
this.sendRequest({
url: 'xmgl/workerInfo/getTrainRecordsByWorkerId',
method: 'post',
data: {
projectSn: JSON.parse(uni.getStorageSync('projectDetail')).projectSn,
workerId: this.workerId,
},
success: res => {
if (res.code == 200) {
this.info = res.result;
}
}
})
},
getDangerItemRecord() {
this.sendRequest({
url: 'exam/trainRecord/page',
method: 'post',
data: {
projectSn: JSON.parse(uni.getStorageSync('projectDetail')).projectSn,
// workerId: this.workerId,
idCard: this.idCard,
isReEducation: 0,
pageNo: 1,
pageSize: -1
},
success: res => {
if (res.code == 200) {
this.info = res.result.records;
}
}
})
},
//获取附件信息
getFileInfo() {
let data = JSON.parse(JSON.stringify(this.info))
if (this.type == 1) {
//获取合同照片
if (data.length > 0 && data[0].imageUrl) {
let arr = data[0].imageUrl.split(",");
let fileList = [];
arr.forEach((item) => {
let valArr = item.split("*");
fileList.push({
name: valArr[0],
url: valArr[1]
});
});
data[0].fileList = fileList;
} else {
if (data.length > 0) {
data[0].fileList = [];
}
}
}
this.info = data;
},
//预览文件
handlePreview(url) {
let type = url.split('.')[1];
if (type == 'doc' || type == 'xls' || type == 'ppt' || type == 'pdf' || type == 'docx' || type == 'xlsx' ||
type ==
'pptx') {
uni.openDocument({
filePath: this.url_config + 'image/' + url,
})
} else {
let fileList = [];
fileList = [this.url_config + 'image/' + url];
uni.previewImage({
current: 0,
urls: fileList
})
}
},
}
}
</script>
<style lang="scss" scoped>
.info_wrap {
text-align: center;
padding-bottom: 2rpx;
}
.detailInfo {
text-align: left;
padding: 20rpx 30rpx;
box-sizing: border-box;
margin: 20rpx 0 40rpx;
box-shadow: 0 0px 20rpx rgba(220, 220, 220, 0.8);
font-size: 30rpx;
line-height: 44rpx;
}
.no_data {
position: fixed;
top: 35%;
// transform: translateY(-50%);
left: 50%;
transform: translateX(-50%);
padding-top: 60rpx;
text-align: center;
color: rgba(0, 0, 0, 0.5);
font-size: 28rpx;
uni-image {
width: 162rpx;
height: 130rpx;
display: block;
margin: 0 auto;
margin-bottom: 40rpx;
}
}
.info_wrap .title {
font-size: 30rpx;
margin-top: 16rpx;
}
.title .state1 {
color: red;
}
.title .state2 {
color: #4181FE;
}
</style>