862 lines
21 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="deetailPage">
<view class="fixedheader">
<headers :showBack="true">
<view class="headerName">
查看检查记录
</view>
</headers>
<view class="tab flex2" style="background-color: #fff;">
<view class="tabType" @click="changeTab(1)" :class="checkedTab==1?'checkedTab':'noCheckTab'">检查详细</view>
<view class="tabType" @click="changeTab(2)" :class="checkedTab==2?'checkedTab':'noCheckTab'">审批流程</view>
</view>
</view>
<view class="content record" :style="{paddingTop: (mobileTopHeight + 100) * 1.5 + 'rpx'}" v-if="checkedTab==1">
<view class="type flex2">
<view class="textColor">检查部位</view>
<view class="textRight">{{basicInfo.regionName}}</view>
</view>
<view class="type flex2" v-if="recordType == 1">
<view class="textColor">问题描述</view>
<view class="textRight">{{basicInfo.problemDescription}}</view>
</view>
<view class="type flex2" v-if="recordType == 1">
<view class="textColor">问题分类</view>
<view class="textRight">{{basicInfo.dangerItemContent}}</view>
</view>
<view class="type flex2" v-else>
<view class="textColor">排查分类</view>
<view class="textRight">{{basicInfo.dangerItemContent}}</view>
</view>
<view class="type flex2">
<view class="textColor">补充说明</view>
<!-- <pre class="pre">{{basicInfo.dangerDesc}}</pre> -->
<view class="textRight">{{basicInfo.dangerDesc}}</view>
</view>
<view class="type flex2" v-if="recordType == 1">
<view class="textColor">整改要求</view>
<view class="textRight">{{basicInfo.remark}}</view>
</view>
<!-- <view class="type flex2">
<view class="textColor">分部工程</view>
<view class="textRight">{{basicInfo.subsectionName}}</view>
</view>
<view class="type flex2">
<view class="textColor">分项工程</view>
<view class="textRight">{{basicInfo.subentryName}}</view>
</view>
<view class="type flex2">
<view class="textColor">巡检楼层</view>
<view class="textRight">{{basicInfo.floor}}</view>
</view> -->
<view class="type flex2">
<view class="textColor">事件描述</view>
<view class="textRight">{{basicInfo.addedDescription}}</view>
</view>
<view class="type flex2" v-if="recordType == 1">
<view class="textColor">问题等级</view>
<view class="textRight">
{{basicInfo.level==1?'一级':basicInfo.level==2?'二级':basicInfo.level==3?'三级':basicInfo.level==4?'四级':''}}
</view>
</view>
<view class="type flex2" v-if="recordType == 1">
<view class="textColor">紧急程度</view>
<view class="textRight">
{{basicInfo.urgentLevel==1?'一般':basicInfo.urgentLevel==2?'严重':basicInfo.urgentLevel==3?'紧要':''}}
</view>
</view>
<view class="type flex2">
<view class="textColor">检查人</view>
<view class="textRight">{{basicInfo.inspectManName}}</view>
</view>
<view class="type flex2">
<view class="textColor">检查时间</view>
<view class="textRight">{{basicInfo.inspectTime}}</view>
</view>
<!-- <view class="type flex2">
<view>图纸定位:</view>
<view>{{basicInfo.rectifyPeopleName}}</view>
</view> -->
<view class="type flex2" v-if="COMPANY != 'zjwj'">
<view class="textColor">分包单位</view>
<view class="textRight">{{basicInfo.enterpriseName}}</view>
</view>
<view class="type flex2" v-if="recordType == 1">
<view class="textColor">整改时限</view>
<view class="textRight">{{basicInfo.changeLimitTime}}</view>
</view>
<view class="type flex2" v-if="recordType == 1">
<view class="textColor">整改人</view>
<view class="textRight">{{basicInfo.changeName}}</view>
</view>
<view class="type flex2" v-if="recordType == 1">
<view class="textColor">复查人</view>
<view class="textRight">{{basicInfo.reviewName}}</view>
</view>
<view class="type flex2" v-if="recordType == 1">
<view class="textColor">核检人</view>
<view class="textRight">{{basicInfo.verifyManName}}</view>
</view>
<!-- <view class="type flex2" v-if="recordType == 1">
<view>通知人:</view>
<view >{{basicInfo.notifyPersonName}}</view>
<view v-else>{{basicInfo.notifyPerson}}</view>
</view> -->
<view class="type flex2" v-if="recordType == 1">
<view class="textColor">现场整改</view>
<view class="textRight">
{{basicInfo.status==2||basicInfo.status==3||basicInfo.status==4||basicInfo.status==6?'未完成':basicInfo.status==5?'已完成':''}}
</view>
</view>
<view class="type">
<view class="textColor">上传图片</view>
<view class="accessory">
<image @click="previewImage(item.split('*')[1])" v-if="imgFileList.length>0"
v-for="(item,index) in imgFileList" :key="index" :src="item.split('*')[1]" class="accessoryImg">
</image>
</view>
</view>
<view style="margin-top: 20rpx;">
<view class="textColor" style="width: 120rpx;">视频/音频附件</view>
<view @click="playVideo(item.split('*')[1],'video')" v-if="videoFileList.length>0"
v-for="(item,index) in videoFileList" :key="index"
style="line-height: 28rpx; color: #4181FE;width: 95%;white-space: nowrap; overflow: hidden;text-overflow: ellipsis;">
{{item.split('*')[0]}}
</view>
</view>
<view class="backBtn" v-if="basicInfo.status == 2 && issueInfoList.length == 0 &&
basicInfo.inspectManId == userInfo.userId && btnEditAuth">
<view class="btn-option" @click="backCheckRecord">撤回</view>
</view>
<view class="editBtn" v-if="basicInfo.status == 6 &&
basicInfo.inspectManId == userInfo.userId">
<view class="btn-delete" @click="deleteCheckRecord" v-if="btnDeleteAuth">删除检查</view>
<view class="btn-resubmit" @click="resubmitCheckRecord" v-if="btnEditAuth">重新提交</view>
</view>
</view>
<view class="content record" :style="{paddingTop: (mobileTopHeight + 100) * 1.5 + 'rpx'}" v-if="checkedTab==2">
<view v-if="issueInfoList.length>0">
<ul class="flex table_title">
<li>发起顺序</li>
<li>人员</li>
<li>时间</li>
<li>状态</li>
</ul>
<view v-for="(item,index) in issueInfoList" :key="index">
<ul class="flex table_item" @click="handleShowItem(index)">
<li>
<span class="table_index">{{index}}</span>{{item.typeName}}
</li>
<li>
<!-- {{item.createUserName}}{{item.peopleName}} -->
{{item.createUserName}}
</li>
<li>
{{item.rectifyTime}}
<!-- {{item.createTime.split(' ')[0]}} -->
</li>
<li>
<span
:class="{'table_error': item.status == 1, 'table_success': item.status == 2}">{{item.statusText}}</span>
<span class="icon-down" v-show="item.isShow"></span>
<span class="icon-right" v-show="!item.isShow"></span>
</li>
</ul>
<view class="table_content" v-show="item.isShow">
<view class="message imgList" style="font-size: 28rpx;" v-if="item.type == 1 && item.violatorId">
<span>违章人员:</span>
<span>{{ personList.find(ele => ele.id == item.violatorId).workerName }}</span>
</view>
<view class="imgList">
<ul>
<li class="img-item" v-for="(item2, index2) in item.fileUrl" :key="index2">
<image :src="item2" @click="previewImage(item2)" />
</li>
</ul>
</view>
<view class="message" style="font-size: 28rpx;">
<span>补充说明</span>
<span>{{item.additionalRemarks}}</span>
</view>
</view>
</view>
</view>
<view class="noData" v-if="issueInfoList.length==0">
<image class="noDataImg" src="../../../static/noData.png"></image>
<view>暂无数据</view>
</view>
<view class="approveBtn">
<view class="btn"
v-if="
btnEditAuth && userInfo.userId == basicInfo.changeId && entryType == 2 && issueInfoList.length <= 0 || userInfo.userId == basicInfo.changeId && entryType == 2 && issueInfoList.length > 0 && issueInfoList[issueInfoList.length-1].statusText !== '已整改'"
@click="replyBtn(1)">整改回复</view>
</view>
<view class="approveBtn">
<view class="btn"
v-if="btnEditAuth && userInfo.userId==basicInfo.reviewId && entryType == 3 && issueInfoList.length > 0 && issueInfoList[issueInfoList.length-1].type !== 2"
@click="replyBtn(2)">复查回复</view>
</view>
<view class="approveBtn">
<view class="btn"
v-if="btnEditAuth && userInfo.userId==basicInfo.verifyManId && entryType == 4 && issueInfoList.length > 0 && issueInfoList[issueInfoList.length-1].type !== 3"
@click="replyBtn(3)">核验回复</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
mobileTopHeight: 0,
checkedTab: 1,
imgFileList: [],
videoFileList: [],
basicInfo: {},
issueInfoList: [],
userInfo: {},
entryType: '',
recordType: 1, // 1为安全问题 2为排查记录
id: '',
btnEditAuth: true,
btnDeleteAuth: true,
projectSn: "",
personList:[],
}
},
onLoad(option) {
this.btnEditAuth = this.checkBtnPermission({
key: 'inspectionLedger_edit',
menuPath: '/project/safeSame/inspectionLedger'
})
this.btnDeleteAuth = this.checkBtnPermission({
key: 'inspectionLedger_delete',
menuPath: '/project/safeSame/inspectionLedger'
})
this.id = option.id;
this.userInfo = JSON.parse(uni.getStorageSync('userInfo'));
this.entryType = Number(option.type)
this.projectSn = JSON.parse(uni.getStorageSync('projectDetail')).projectSn;
this.getPointAreaFn();
},
onShow() {
this.getBasicInfo();
this.getIssueInfo();
},
mounted() {
var that = this
uni.getSystemInfo({
success(res) {
that.mobileTopHeight = res.statusBarHeight ? res.statusBarHeight : 0;
uni.setStorageSync('systemInfo',res)
console.log(res)
}
})
console.log('this.mobileTopHeight',this.mobileTopHeight)
},
methods: {
// 获取违章人员列表
getPointAreaFn() {
let requestData = {
projectSn: this.projectSn,
};
this.sendRequest({
url: 'xmgl/workerInfo/getLaborManagementInfoList',
method: 'post',
data: requestData,
success: (res) => {
console.log(res);
this.personList = res.result;
},
})
},
// 重新提交
resubmitCheckRecord() {
uni.navigateTo({
url: '/pages/projectEnd/safeSame/editIssue?id=' + this.id
})
},
// 删除检查单
deleteCheckRecord() {
let that = this;
uni.showModal({
title: '提示',
content: '您确定要删除吗?',
success: async (res) => {
if (res.confirm) {
this.sendRequest({
url: 'xmgl/xzSecurityQualityInspectionRecord/delete',
method: 'post',
data: {
id: that.id
},
success: res => {
uni.showToast({
title: res.message
})
setTimeout(function() {
uni.redirectTo({
url: '/pages/projectEnd/safeSame/list?type=1'
})
}, 500)
}
})
}
}
});
},
// 撤回检查单
backCheckRecord() {
let that = this;
uni.showModal({
title: '提示',
content: '您确定要撤回吗?',
success: async (res) => {
if (res.confirm) {
this.sendRequest({
url: 'xmgl/xzSecurityQualityInspectionRecord/revocation',
method: 'post',
data: {
id: that.id
},
success: res => {
uni.showToast({
title: res.message
})
setTimeout(function() {
uni.redirectTo({
url: '/pages/projectEnd/safeSame/list?type=1'
})
}, 500)
}
})
}
}
});
},
handleShowItem(index) {
this.issueInfoList[index].isShow = !this.issueInfoList[index].isShow
let newObj = this.issueInfoList[index]
this.issueInfoList.splice(index, 1, newObj)
// console.log(index, this.issueInfoList[index])
},
//切换tab
changeTab(type) {
this.checkedTab = type;
if (type == 1) {
this.getBasicInfo();
} else {
this.getIssueInfo();
}
},
//获取基本信息
getBasicInfo() {
let that = this;
this.sendRequest({
url: 'xmgl/xzSecurityQualityInspectionRecord/selectQualityInspectionRecordById',
method: 'post',
data: {
id: that.id
},
success: res => {
console.log(res.result, this.userInfo)
that.recordType = res.result.recordType
that.basicInfo = res.result;
console.log('获取基本信息---', that.basicInfo);
if (res.result.imageUrl) {
that.imgFileList = res.result.imageUrl.split(',');
}
if (res.result.fileUrl) {
that.videoFileList = res.result.fileUrl.split(',');
}
}
})
},
//获取整改信息
getIssueInfo() {
let that = this;
this.sendRequest({
url: 'xmgl/xzSecurityQualityRectifyRecord/selectRectifyRecordList',
method: 'post',
data: {
qualityId: that.id
},
success: res => {
console.log(res.result)
// console.log(JSON.parse(res.result[0].fileUrl))
that.issueInfoList = res.result;
that.issueInfoList.forEach((item, index) => {
if (item.fileUrl) {
let imgList = [];
if (item.fileUrl.startsWith("[") && item.fileUrl.endsWith("]")) {
let fileListI = JSON.parse(item.fileUrl);
fileListI.forEach((file) => {
let url = file.url;
if (!url.startsWith("http://")) {
url = that.url_config + 'image/' + url;
}
imgList.push(url);
});
} else {
let fileListI = item.fileUrl.split(",");
fileListI.forEach((url) => {
if (!url.startsWith("http://")) {
url = that.url_config + 'image/' + url;
}
imgList.push(url);
});
}
item.fileUrl = imgList;
} else {
item.fileUrl = [];
}
if (item.type == 1) {
item.typeName = '整改人'
item.peopleName = this.basicInfo.changeName
} else if (item.type == 2) {
item.typeName = '复查人'
item.peopleName = this.basicInfo.reviewName
} else if (item.type == 3) {
item.typeName = '核验人'
item.peopleName = this.basicInfo.inspectManName
}
if (item.status == 1) {
item.isPass = false
} else {
item.isPass = true
}
item.isShow = false
if (item.type == 1 && item.status == 1) {
item.statusText = '未整改'
} else if (item.type == 1 && item.status == 2) {
item.statusText = '已整改'
} else if (item.type == 2 && item.status == 1) {
item.statusText = '复查不合格'
} else if (item.type == 2 && item.status == 2) {
item.statusText = '复查合格'
} else if (item.type == 3 && item.status == 1) {
item.statusText = '核验不合格'
} else if (item.type == 3 && item.status == 2) {
item.statusText = '核验合格'
}
})
}
})
},
//新增回复
replyBtn(type) {
let stateId = this.issueInfoList.length > 0 ? this.issueInfoList[this.issueInfoList.length - 1].id : '';
let createId = this.basicInfo.creatorId ? this.basicInfo.creatorId : this.basicInfo.inspectManId
uni.navigateTo({
url: './reply?id=' + this.id + '&type=' + type + '&stateId=' + stateId + '&createId=' +
createId
})
},
//播放视频
playVideo(url, type) {
uni.navigateTo({
url: '../carWashManage/mediaPlay?url=' + url + '&type=' + type
})
},
//预览图片
previewImage(url) {
uni.previewImage({
urls: [url]
})
}
}
}
</script>
<style scoped lang="scss">
.fixedheader{
position: fixed;
top: 0;
left: 0;
width: 100%;
z-index: 2;
.headerName{
z-index: 1;
}
}
.flex {
display: flex;
align-items: center;
}
.flex2 {
display: flex;
align-items: center;
/* justify-content: space-between; */
}
.flex3 {
display: flex;
}
.deetailPage {
width: 100%;
height: 100%;
}
.tab {
width: 100%;
height: 90rpx;
text-align: center;
box-shadow: 0 0 20rpx rgba(194, 194, 194, 0.5);
}
.tabType {
width: 50%;
line-height: 43px;
border-bottom: 1px solid rgba(194, 194, 194, 0.2);
}
.checkedTab {
color: #4181FE;
border-bottom: 4rpx solid #4181FE;
}
.noCheckTab {
padding-bottom: 4rpx;
}
.content {
width: 100%;
box-sizing: border-box;
padding: 20rpx 16rpx
}
.type {
font-size: 30rpx;
line-height: 80rpx;
border-bottom: 1px solid rgba(194, 194, 194, 0.2);
}
.pre {
padding: 20rpx 30rpx;
background-color: rgba(194, 194, 194, 0.2);
min-height: 100rpx;
width: 100%;
white-space: pre-wrap;
word-wrap: break-word;
box-sizing: border-box;
line-height: initial;
}
.accessory {
width: 100%;
height: 70px;
padding: 0 20rpx;
box-sizing: border-box;
}
.accessoryImg {
width: 110rpx;
height: 120rpx;
margin-right: 16rpx;
}
.userImg {
width: 50rpx;
height: 50rpx;
border-radius: 50%;
box-shadow: 0px 0 30rpx rgba(194, 194, 194, 0.5);
margin-top: 10rpx;
}
.bubble {
margin-left: 36rpx;
width: 90%;
box-sizing: border-box;
}
.bubble .bubble_content {
width: 90%;
background-color: #fff;
padding: 20rpx 30rpx;
display: inline-block;
border-radius: 6px;
position: relative;
box-shadow: -4rpx 0 30rpx rgba(194, 194, 194, 0.5);
position: relative;
}
.bubble .bubble_content::after {
content: '';
border: 8px solid #ffffff00;
border-right: 8px solid #fff;
position: absolute;
top: 20rpx;
left: -30rpx;
}
.record {
/* background-color: rgba(234, 234, 234, 0.4); */
padding-bottom: 120rpx;
}
.bubble_content .name {
font-size: 30rpx;
margin: 20rpx 0;
}
.time {
color: rgba(153, 153, 153, 1);
font-size: 24rpx;
font-family: PingFangSC-Regular;
}
.item_title {
margin: 20rpx 0;
font-family: PingFangSC-Regular;
font-size: 28rpx;
opacity: 0.8;
}
.approveBtn {
position: fixed;
bottom: 30rpx;
width: calc(100% - 60rpx);
box-sizing: border-box;
z-index: 99;
}
.approveBtn .btn {
width: 70%;
line-height: 80rpx;
background-color: #4181FE;
color: #fff;
text-align: center;
border-radius: 60rpx;
margin: 0 auto;
box-shadow: 0 10rpx 10rpx rgba(65, 129, 254, 0.3);
}
.approveBtn .btn:active {
background-color: rgba(65, 129, 254, 0.8);
}
.backBtn {
position: fixed;
bottom: 0px;
left: 0px;
width: 100%;
box-sizing: border-box;
z-index: 99;
}
.backBtn .btn-option {
width: 100%;
line-height: 80rpx;
background-color: #4181FE;
color: #fff;
text-align: center;
}
.backBtn .btn-option:active {
background-color: rgba(65, 129, 254, 0.8);
}
.editBtn {
position: fixed;
bottom: 0px;
left: 0px;
width: 100%;
display: flex;
align-items: center;
box-sizing: border-box;
z-index: 99;
}
.editBtn .btn-delete {
width: 50%;
line-height: 80rpx;
background-color: #D51C1C;
color: #fff;
text-align: center;
}
.editBtn .btn-resubmit {
width: 50%;
line-height: 80rpx;
background-color: #5382F6;
color: #fff;
text-align: center;
}
.pass_wrap {
position: absolute;
top: 100px;
right: 40rpx;
z-index: 10;
}
.pass_icon {
width: 80px;
height: 80px;
}
.noData {
text-align: center;
font-size: 32rpx;
margin-top: 240rpx;
color: #bed0fb;
}
.noDataImg {
width: 250rpx;
height: 196rpx;
}
.table_title {
list-style: none;
justify-content: space-between;
padding-left: 0;
align-items: center;
height: 56rpx;
border-bottom: 1px solid #f1f1f1;
}
.table_title li {
flex: 1;
text-align: center;
line-height: 56rpx;
}
.table_index {
display: block;
border-radius: 50%;
color: #fff;
background: #488DEC;
width: 32rpx;
height: 36rpx;
text-align: center;
line-height: 36rpx;
margin-right: 10rpx;
}
.table_success {
display: block;
color: #13B98C;
background: rgba(19, 185, 140, 0.2);
line-height: 32rpx;
padding: 6rpx;
}
.table_error {
display: block;
color: #EA3941;
background: rgba(234, 57, 65, 0.2);
line-height: 32rpx;
padding: 6rpx;
}
.table_item {
list-style: none;
justify-content: space-between;
padding-left: 0;
align-items: center;
height: 100rpx;
border-bottom: 1px solid #f1f1f1;
}
.table_item li {
flex: 1;
text-align: center;
font-size: 24rpx;
line-height: 40rpx;
display: flex;
justify-content: center;
align-items: center;
}
.table_item li:last-child {
justify-content: flex-end;
}
.table_item li:nth-child(1) {
flex: none;
width: 136rpx;
}
.table_title li:nth-child(1) {
flex: none;
width: 136rpx;
}
.icon-down {
height: 16rpx;
width: 16rpx;
background: url(../../../static/icon-down-black.png) center no-repeat;
background-size: 100%;
margin-left: 4rpx;
}
.icon-right {
height: 16rpx;
width: 16rpx;
background: url(../../../static/icon-right.png) center no-repeat;
background-size: 100%;
margin-left: 8rpx;
}
.table_content {
/* background: #f1f1f1; */
padding: 28rpx;
}
.imgList {
margin-bottom: 20rpx;
}
.imgList ul {
list-style: none;
padding: 0;
display: flex;
flex-wrap: wrap;
align-items: center;
}
.imgList ul li {
width: 30%;
height: 100px;
margin: 0 10rpx;
margin-bottom: 20rpx;
}
.imgList ul li image {
width: 100%;
height: 100%;
}
.textRight {
margin-left: 40rpx;
width: 80%;
}
.textColor {
color: gray;
width: 68px;
}
</style>