2025-01-04 17:20:45 +08:00

583 lines
14 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="dangerbig-details">
<headers class="fixedheader" :themeType="true" :showBack="true">
<view class="headerName">
动火作业详情
</view>
</headers>
<view :style="{ 'padding-top': statusBarHeight + 45 + 'px' }">
<view class="detail-content">
<view class="list">
<view class="list-info">
作业票编号<text class="detail-data">{{detailData.workTicketCode}}</text>
</view>
<!-- <view class="list-info">
电气焊操作证标号<text class="detail-data">{{detailData.firemanAndCertificateNo || ''}}</text>
</view> -->
<view class="list-info">
动火时间<text class="detail-data"
v-if="detailData.hotWorkExecutionBeginTime && detailData.hotWorkExecutionEndTime">{{detailData.hotWorkExecutionBeginTime+'-'+detailData.hotWorkExecutionEndTime}}</text>
</view>
<view class="list-info">
动火地点和动火部位:<text class="detail-data">{{detailData.fireLocationAndFirePart}}</text>
</view>
<view class="" v-if="isShow">
<view class="list-info">
动火作业执行单位:<text class="detail-data">{{detailData.operatingUnitName}}</text>
</view>
<view class="list-info">
动火作业级别:<text class="detail-data">{{detailData.hotWorkLevel}}</text>
</view>
<view class="list-info">
动火作业人及电气焊操作证标号:<text class="detail-data">{{detailData.homeworkerName}}</text>
</view>
<view class="list-info">
动火监护人:<text class="detail-data">{{detailData.guardianName}}</text>
</view>
<view class="list-info">
动火负责人:<text class="detail-data">{{detailData.assignmentPersonInChargeName}}</text>
</view>
<view class="list-info">
动火地点所属单位:<text class="detail-data">{{detailData.jobApplicationUnitName}}</text>
</view>
<view class="safe-mesure">
<view class="safe-btn" @click="goSafeMesure">查看安全措施</view>
</view>
</view>
<view v-if="COMPANY != 'longguang'" class="more-btn" @click="isShow=!isShow">
{{isShow ? "收起详情":"展开详情"}}
<uni-icons :type="isShow ? 'arrowup':'arrowdown'"></uni-icons>
</view>
</view>
<view class="detail-nav" v-if="COMPANY != 'longguang'">
<scroll-view class="scrollx-wrap" scroll-x>
<view class="nav-list">
<view class="nav-item" :class="{'active-nav': activeIndex == item.id}"
v-for="(item,index) in navList" :key="index" @click="checkNav(item)">
{{item.name}}
</view>
</view>
</scroll-view>
<view class="detail-wrap">
<plan ref="list" v-if="componentName == 'plan'" :detailId="detailId" :type="10" :info="detailData"></plan>
<safe ref="list" v-if="componentName == 'safe'" :detailId="detailId" :type="10" :info="detailData"></safe>
<side ref="list" v-if="componentName == 'side'" :detailId="detailId" :type="10" :info="detailData"></side>
<workFinally ref="list" v-if="componentName =='workFinally'" :detailId="detailId" :type="10"
:info="detailData"></workFinally>
</view>
</view>
<!-- <view class="add-btn" v-if="activeIndex != 7 && activeIndex != 2 && !(activeIndex == 1 && detailData.engineeringState == 3) -->
<view class="add-btn" v-if="activeIndex != 7 && userInfo.userId === detailData.assignmentPersonInCharge
&& COMPANY != 'longguang' && detailData.finalAcceptanceStatus !== 2 && isShowBtn && btnAuth" @click="addForm">
<uni-icons v-if="activeIndex == 5" type="camera" size="30" color="#fff"></uni-icons>
<uni-icons v-else type="plusempty" size="30" color="#fff"></uni-icons>
<span>+</span>
</view>
</view>
</view>
<view class="fixed" :class="{show:showIframe}" v-if="show" @click="show=false">
<view class="iframeMain" @click.stop="show=true">
<video v-if="getType(iframeUrl) == 'video'" class="iframe" :src="iframeUrl"></video>
<image v-else-if="getType(iframeUrl) == 'image'" class="iframe" :src="iframeUrl" mode="aspectFit">
</image>
<iframe v-else class="iframe" ref="iframe" :src="iframeUrl" frameborder="0"></iframe>
</view>
</view>
</view>
</template>
<script>
import plan from './plan.vue'
import safe from './safe.vue'
import side from './side.vue'
import workFinally from './workFinally.vue'
import {
isVideoLink,
isImageLink,
openOutsideFile,
openLocalFile,
removeNetWorkFileTemp
} from '@/utils/tool.js'
export default {
components: {
plan,
safe,
side,
workFinally,
},
data() {
return {
statusBarHeight: 0,
isShow: false,
componentName: "plan",
navList: [{
id: 1,
name: "当前进度"
}, {
id: 2,
name: "安全检查"
}, {
id: 3,
name: "施工旁站"
}, {
id: 4,
name: "最终验收"
}],
activeIndex: 1,
detailId: "",
detailData: {},
isShowBtn: null,
userInfo: {},
btnAuth: true,
showIframe: false,
show: false,
iframeUrl: ""
}
},
onReachBottom() {
console.log(1, this.$refs['list'])
},
onPullDownRefresh() {
console.log(2)
},
onShow() {
this.userInfo = JSON.parse(uni.getStorageSync('userInfo'))
this.statusBarHeight = uni.getStorageSync('systemInfo').statusBarHeight;
// this.initData()
this.getWork()
let that = this;
setTimeout(function() {
console.log(that.$refs, 777)
console.log(that.$refs.listBox, 777)
if (that.$refs['list'] && that.$refs['list'].initData) {
console.log(777888)
that.$refs['list'].initData()
}
}, 200)
},
onLoad(val) {
this.btnAuth = this.checkBtnPermission({
key: 'fireWork_add',
menuPath: '/project/specialWork/newFireWork'
})
this.detailId = val.id
},
onUnload() {
removeNetWorkFileTemp();
},
mounted() {},
methods: {
getType(url) {
if (isImageLink(url)) {
return "image"
} else if (isVideoLink(url)) {
return "video"
} else {
return ''
}
},
downloadFile(url) {
// 下载所有的文件
let name = url.substring(url.lastIndexOf('/') + 1);
console.log(name, "文件名称");
if (isVideoLink(url) || isImageLink(url)) {
// 是图片和视频
this.show = true;
this.showIframe = true;
this.iframeUrl = this.url_config + 'image/' + url;
} else {
// openOutsideFile(`${this.url_config}image/${url}`)
openLocalFile(name,`${this.url_config}image/${url}`)
}
return;
},
//预览图片
previewImage(url) {
uni.previewImage({
urls: [url]
})
},
getWork() {
this.sendRequest({
url: 'xmgl/xzSpecialOperationFireSafetyNew/queryById',
method: 'get',
data: {
id: this.detailId
},
success: res => {
uni.hideLoading()
// if(res.code==200){
// this.listData = res.result.records
// }
this.detailData = res.result
if (this.detailData.firemanAndCertificateNo) {
this.detailData.firemanAndCertificateNo = JSON.parse(this.detailData
.firemanAndCertificateNo).join('、')
}
if (this.detailData.fieldWorkingEnvironment) {
this.detailData.fieldWorkingEnvironment = JSON.parse(this.detailData
.fieldWorkingEnvironment)
this.detailData.fieldWorkingEnvironment.map(item => {
item.url = this.url_config + 'image/' + item.url
})
}
if (this.detailData.safetyAndTechnologyDisclosure) {
this.detailData.safetyAndTechnologyDisclosure = JSON.parse(this.detailData
.safetyAndTechnologyDisclosure)
// this.detailData.safetyAndTechnologyDisclosure.map(item => {
// item.url = this.url_config + 'image/' + item.url
// })
}
// let str = '';
// if(res.result.chooseTypeDescribeList){
// this.detailData.describeName
// res.result.chooseTypeDescribeList.map((item,index) => {
// if(index == res.result.chooseTypeDescribeList.length - 1){
// str = str + item.describeName
// } else {
// str = str + item.describeName + ','
// }
// })
// console.log(str,123456789)
// this.detailData.describeName = str;
// }
this.getApply()
}
})
},
goSafeMesure() {
uni.navigateTo({
url: "./newSafeMesure?detailId=" + this.detailId
})
},
getApply() {
console.log("=====================================================detail");
console.log(this.detailData);
this.sendRequest({
url: 'xmgl/xzDangerousEngineeringAcceptance/list',
method: 'get',
data: {
engineeringId: this.detailData.id,
projectSn: JSON.parse(uni.getStorageSync('projectDetail')).projectSn,
type: 10
},
success: res => {
uni.hideLoading()
console.log("xmgl/xzDangerousEngineeringAcceptance/list", res);
let result = res.result
if (res.result.length > 0) {
if (res.result[0].acceptanceResult === null) this.isShowBtn = false
if (res.result[0].acceptanceResult === 1) this.isShowBtn = false
if (res.result[0].acceptanceResult === 2) this.isShowBtn = true
} else {
this.isShowBtn = true
}
}
})
},
checkNav(val) {
this.activeIndex = val.id
if (val.id == 1) {
this.componentName = "plan"
} else if (val.id == 2) {
this.componentName = "safe"
} else if (val.id == 3) {
this.componentName = "side"
} else if (val.id == 4) {
this.componentName = "workFinally"
}
},
addForm() {
if (this.activeIndex == 1) {
uni.navigateTo({
url: './addPlan?id=' + this.detailId + '&type=10'
})
} else if (this.activeIndex == 2) {
if (uni.getStorageSync('dangerData')) {
uni.removeStorageSync('dangerData');
}
if (uni.getStorageSync('detailData')) {
uni.removeStorageSync('detailData');
}
uni.navigateTo({
// url:'../safeManage/addExamine?type=1&engineeringId='+this.detailId + '&moduleType=safeCheck'
url: '../../safeSame/addIssue?type=10&engineeringId=' + this.detailId +
'&moduleType=safeCheck'
})
} else if (this.activeIndex == 3) {
uni.navigateTo({
url: './addSide?id=' + this.detailId + '&type=10'
})
} else if (this.activeIndex == 4) {
if (this.isShowBtn) {
uni.navigateTo({
url: './addWorkFinally?id=' + this.detailId + '&workTicketCode=' + this.detailData
.workTicketCode + '&type=10'
})
} else {
uni.showToast({
title: '请勿重复操作',
icon: "none",
duration: 2000
});
}
}
}
}
}
</script>
<style lang="scss" scoped>
.fixed {
position: fixed;
z-index: 9999;
left: 0;
top: 0;
right: 0;
bottom: 0;
background-color: rgba(0, 0, 0, .3);
display: none;
&.show {
display: initial;
}
}
.iframeMain {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
width: 650rpx;
font-size: 0;
.iframe {
width: 100%;
height: 500rpx;
}
}
.other-safe {
background-color: #fff;
// margin-top: 50rpx;
padding: 15rpx 15rpx;
line-height: 40rpx;
.other-head {
display: flex;
.other-icon {
width: 10rpx;
height: 40rpx;
background-color: #2b8df3;
border-radius: 100rpx;
}
.other-text {
margin-left: 20rpx;
}
}
.other-content {
font-size: 22rpx;
width: auto;
min-height: 50rpx;
// background-color: darkred;
// border: 1rpx solid black;
margin: 0 30rpx;
margin-top: 15rpx;
display: flex;
.content-1 {
width: 22%;
}
.content-2 {
width: 24%;
}
.content-3 {
width: 23%;
// margin-left: 10%;
}
.content-4 {
width: 26%;
}
}
}
.safe-mesure {
width: 100%;
height: 100rpx;
display: flex;
justify-content: center;
align-items: center;
background-color: #fff;
.safe-btn {
text-align: center;
width: 80%;
line-height: 70rpx;
// background-color: darkred;
border: 4rpx solid #2b8df3;
color: #2b8df3;
border-radius: 20rpx;
font-weight: bold;
}
}
.table-info {
display: flex;
justify-content: center;
align-items: center;
background-color: #fff;
.teble-list {
display: flex;
font-size: 18rpx;
background-color: #fff;
white-space: nowrap;
.teble-item {
display: inline-block;
white-space: normal;
width: 220rpx;
.item-col {
padding: 3rpx;
margin-top: 5rpx;
margin-left: 5rpx;
line-height: 50rpx;
text-align: center;
background-color: #F6F6F6;
}
}
}
}
.dangerbig-details {
min-height: 100%;
background: #F6F6F6;
.fixedheader {
position: fixed;
top: 0;
left: 0;
width: 100%;
z-index: 2;
}
.detail-content {
padding-top: 20rpx;
}
.list {
margin-bottom: 20rpx;
}
.list-info {
background: #fff;
border-bottom: 1px solid #F6F6F6;
font-size: 26rpx;
padding: 20rpx;
// display: flex;
// align-items: center;
}
.list-info {
.source-box {
display: flex;
flex-direction: column;
text {
color: #8F8FF7;
text-decoration: underline;
margin-top: 20rpx;
}
}
}
.list-info ul {
list-style: none;
padding: 0;
display: flex;
flex-wrap: wrap;
align-items: center;
margin-top: 20rpx;
}
.list-info ul li {
width: 30%;
height: 100px;
margin: 0 10rpx;
margin-bottom: 20rpx;
}
.list-info ul li image {
width: 100%;
height: 100%;
}
.more-btn {
text-align: center;
font-size: 14px;
height: 50rpx;
background: #F1F7FE;
line-height: 50rpx;
}
.nav-list {
display: flex;
height: 80rpx;
align-items: center;
padding: 0 20rpx;
.nav-item {
width: 25%;
text-align: center;
white-space: nowrap;
padding: 0 20rpx;
height: 80rpx;
box-sizing: border-box;
line-height: 80rpx;
font-size: 14px;
}
.active-nav {
border-bottom: 2px solid #4396E7;
}
}
.detail-nav {
width: 100%;
}
.scrollx-wrap {
width: 100%;
background: #fff;
}
.add-btn {
background: #4181FE;
width: 96rpx;
height: 96rpx;
border-radius: 50%;
text-align: center;
line-height: 96rpx;
position: fixed;
bottom: 40rpx;
right: 40rpx;
span {
font-size: 30px;
line-height: 45px;
color: #fff;
}
}
}
</style>