|  | @@ -1,29 +1,40 @@
 | 
	
		
			
				|  |  |  <template>
 | 
	
		
			
				|  |  | -	<view class="wrap">
 | 
	
		
			
				|  |  | -		<template v-if="itemList.length>0">
 | 
	
		
			
				|  |  | -			<view class="checklist" v-for="(hazard,idx) in itemList" :key="idx">
 | 
	
		
			
				|  |  | -				<view class="title">{{hazard.hazardTitle}}</view>
 | 
	
		
			
				|  |  | -				<view class="item-cont" v-if="hazard.riskList&&hazard.riskList.length>0">
 | 
	
		
			
				|  |  | -					<view class="checklistItem" v-for="(risk,itemIdx) in hazard.riskList" :key="itemIdx">
 | 
	
		
			
				|  |  | -						<view class="itemTitle">{{risk.riskTitle}}</view>
 | 
	
		
			
				|  |  | -						<view  class="point-cont" v-if="risk.recordList&&risk.recordList.length>0">
 | 
	
		
			
				|  |  | -							<view class="point" v-for="(measure,measureIdx) in risk.recordList" :key="measureIdx" @click="check(measure)">
 | 
	
		
			
				|  |  | -								<view class="pointContent">{{measure.measureContent}}</view>
 | 
	
		
			
				|  |  | -								<view class="status" v-if="measure.checkResult===1">通过</view>
 | 
	
		
			
				|  |  | -								<view class="status" v-if="measure.checkResult===-1">不通过</view>
 | 
	
		
			
				|  |  | +	<view class="page">
 | 
	
		
			
				|  |  | +		<view class="wrap">
 | 
	
		
			
				|  |  | +			<template v-if="itemList.length>0">
 | 
	
		
			
				|  |  | +				<view class="checklist" v-for="(hazardlist,idx) in itemList" :key="idx">
 | 
	
		
			
				|  |  | +					<view class="title more">{{hazardlist.hazardTitle}}</view>
 | 
	
		
			
				|  |  | +					<view class="item-cont" v-if="hazardlist.riskList&&hazardlist.riskList.length>0">
 | 
	
		
			
				|  |  | +						<view class="checklistItem" v-for="(riskItem,itemIdx) in hazardlist.riskList" :key="itemIdx">
 | 
	
		
			
				|  |  | +							<view class="itemTitle more"> {{riskItem.riskTitle}}</view>
 | 
	
		
			
				|  |  | +							<view  class="point-cont" v-if="riskItem.recordList&&riskItem.recordList.length>0">
 | 
	
		
			
				|  |  | +								<view class="point" v-for="(measure,measureIdx) in riskItem.recordList" :key="measureIdx" @click="check(measure)">
 | 
	
		
			
				|  |  | +									<view class="pointContent">
 | 
	
		
			
				|  |  | +											<text style="padding-right: 5px;">{{measureIdx+1}})</text>
 | 
	
		
			
				|  |  | +											<text>{{measure.measureContent}}</text>
 | 
	
		
			
				|  |  | +									</view>
 | 
	
		
			
				|  |  | +									<view class="status">【<span class="text">{{measure.checkResult|checkResultFilter}}</span>】</view>
 | 
	
		
			
				|  |  | +								</view>
 | 
	
		
			
				|  |  |  							</view>
 | 
	
		
			
				|  |  | -						</view>
 | 
	
		
			
				|  |  | +						</view>				
 | 
	
		
			
				|  |  |  					</view>				
 | 
	
		
			
				|  |  |  				</view>
 | 
	
		
			
				|  |  | -			</view>
 | 
	
		
			
				|  |  | -			<view class="handle-container" v-if="handleVisiable">
 | 
	
		
			
				|  |  | -				<view class="handle" @click="handleSubmit(3)">全部通过</view>
 | 
	
		
			
				|  |  | -				<view class="handle" @click="handleSubmit(4)">全不通过</view>				
 | 
	
		
			
				|  |  | -				<view class="handle" @click="handleSubmit(1)">提交</view>
 | 
	
		
			
				|  |  | -				<view class="handle" @click="handleSubmit(2)">撤销</view>				
 | 
	
		
			
				|  |  | -			</view>
 | 
	
		
			
				|  |  | -		</template>
 | 
	
		
			
				|  |  | -		<template v-else>没有可处理的清单^-_-^</template>
 | 
	
		
			
				|  |  | +				<view class="handle-container" v-if="handleVisiable">	
 | 
	
		
			
				|  |  | +					<view class="handle" @click="handleSubmit(3)">全部通过</view>
 | 
	
		
			
				|  |  | +					<view class="handle" @click="handleSubmit(4)">全不通过</view>
 | 
	
		
			
				|  |  | +					<view class="handle submit" @click="handleSubmit(1)">提交</view>
 | 
	
		
			
				|  |  | +<!-- 					<view class="more" @mouseenter="hover(1)" @mouseleave="hover">
 | 
	
		
			
				|  |  | +						<text class="text">更多</text>
 | 
	
		
			
				|  |  | +						<view class="list" v-if="showMore">
 | 
	
		
			
				|  |  | +							<view class="hand-item-box">
 | 
	
		
			
				|  |  | +								<view class="handle-item" @click="handleSubmit(2)">撤销</view>															
 | 
	
		
			
				|  |  | +							</view>						
 | 
	
		
			
				|  |  | +						</view>						
 | 
	
		
			
				|  |  | +					</view> -->
 | 
	
		
			
				|  |  | +				</view>
 | 
	
		
			
				|  |  | +			</template>
 | 
	
		
			
				|  |  | +			<template v-else>没有可处理的清单^-_-^</template>
 | 
	
		
			
				|  |  | +		</view>		
 | 
	
		
			
				|  |  |  	</view>
 | 
	
		
			
				|  |  |  </template>
 | 
	
		
			
				|  |  |  <script>
 | 
	
	
		
			
				|  | @@ -47,9 +58,28 @@
 | 
	
		
			
				|  |  |  				itemList:[],
 | 
	
		
			
				|  |  |  				recordId:undefined,
 | 
	
		
			
				|  |  |  				checklistId:undefined,
 | 
	
		
			
				|  |  | -				handleVisiable:false
 | 
	
		
			
				|  |  | +				handleVisiable:false,
 | 
	
		
			
				|  |  | +				showMore:false,
 | 
	
		
			
				|  |  | +				submit_bt_state:false
 | 
	
		
			
				|  |  |  			}
 | 
	
		
			
				|  |  |  		},
 | 
	
		
			
				|  |  | +		filters: {
 | 
	
		
			
				|  |  | +		  checkResultFilter(i) {
 | 
	
		
			
				|  |  | +					  if (i >= 0) {
 | 
	
		
			
				|  |  | +					    const strs = [
 | 
	
		
			
				|  |  | +					      '未检查',
 | 
	
		
			
				|  |  | +					      '通过'
 | 
	
		
			
				|  |  | +					    ]
 | 
	
		
			
				|  |  | +					    return strs[i]
 | 
	
		
			
				|  |  | +					  } else {
 | 
	
		
			
				|  |  | +					    if (i === -1) {
 | 
	
		
			
				|  |  | +					      return '未通过'
 | 
	
		
			
				|  |  | +					    } else if (i === -2) {
 | 
	
		
			
				|  |  | +					      return '发现隐患'
 | 
	
		
			
				|  |  | +					    }
 | 
	
		
			
				|  |  | +					  }
 | 
	
		
			
				|  |  | +		  }
 | 
	
		
			
				|  |  | +		},
 | 
	
		
			
				|  |  |  		onLoad({id,recordId,type}) {
 | 
	
		
			
				|  |  |  			this.checklistId=id	
 | 
	
		
			
				|  |  |  			this.recordId=recordId	
 | 
	
	
		
			
				|  | @@ -74,7 +104,7 @@
 | 
	
		
			
				|  |  |  				})
 | 
	
		
			
				|  |  |  				this.itemList=data.hazardList
 | 
	
		
			
				|  |  |  				this.recordId=data.recordId
 | 
	
		
			
				|  |  | -			},
 | 
	
		
			
				|  |  | +			},		
 | 
	
		
			
				|  |  |  			getChecklistHazardRecordViewById(checklistId,recordId){
 | 
	
		
			
				|  |  |  				/* status 0-未初始化;1-初始化完成 2-完成 -1-巡检完成【异常】*/
 | 
	
		
			
				|  |  |  				getChecklistHazardRecordViewById(recordId,checklistId).then((res)=>{
 | 
	
	
		
			
				|  | @@ -98,11 +128,30 @@
 | 
	
		
			
				|  |  |  				let recordId=this.recordId;
 | 
	
		
			
				|  |  |  				let checklistId=this.checklistId;
 | 
	
		
			
				|  |  |  				if(type===1){//完成
 | 
	
		
			
				|  |  | -					completeChecklistDoing(recordId,checklistId).then(()=>{
 | 
	
		
			
				|  |  | -						uni.$emit('type',4)						
 | 
	
		
			
				|  |  | -						uni.switchTab({
 | 
	
		
			
				|  |  | -							url:'/pages/history/history'
 | 
	
		
			
				|  |  | -						})
 | 
	
		
			
				|  |  | +					completeChecklistDoing(recordId,checklistId).then(()=>{					
 | 
	
		
			
				|  |  | +						if(this.isAllPass()){
 | 
	
		
			
				|  |  | +							uni.$emit('type',4)
 | 
	
		
			
				|  |  | +							uni.switchTab({
 | 
	
		
			
				|  |  | +								url:'/pages/history/history'
 | 
	
		
			
				|  |  | +							})
 | 
	
		
			
				|  |  | +							return
 | 
	
		
			
				|  |  | +						}						
 | 
	
		
			
				|  |  | +						uni.showModal({
 | 
	
		
			
				|  |  | +							title: '提示',
 | 
	
		
			
				|  |  | +							content: '本次检查有未通过项,是否需要登记隐患?',
 | 
	
		
			
				|  |  | +							success: function (res) {
 | 
	
		
			
				|  |  | +								if (res.confirm) {
 | 
	
		
			
				|  |  | +									uni.reLaunch({
 | 
	
		
			
				|  |  | +										url:`/pages/app_views/danger/submit/submit?tid=${recordId}`
 | 
	
		
			
				|  |  | +									})	
 | 
	
		
			
				|  |  | +								} else if (res.cancel) {
 | 
	
		
			
				|  |  | +									uni.$emit('type',4)
 | 
	
		
			
				|  |  | +									uni.switchTab({
 | 
	
		
			
				|  |  | +										url:'/pages/history/history'
 | 
	
		
			
				|  |  | +									})
 | 
	
		
			
				|  |  | +								}
 | 
	
		
			
				|  |  | +							}
 | 
	
		
			
				|  |  | +						});										
 | 
	
		
			
				|  |  |  					}).catch(()=>{
 | 
	
		
			
				|  |  |  						uni.showToast({
 | 
	
		
			
				|  |  |  							icon:"none",
 | 
	
	
		
			
				|  | @@ -132,30 +181,82 @@
 | 
	
		
			
				|  |  |  						this.getChecklistHazardRecordViewById(checklistId,recordId)
 | 
	
		
			
				|  |  |  					})
 | 
	
		
			
				|  |  |  				}			
 | 
	
		
			
				|  |  | +			},
 | 
	
		
			
				|  |  | +			isAllPass(){
 | 
	
		
			
				|  |  | +				let items=[]
 | 
	
		
			
				|  |  | +				for(let i=0;i<this.itemList.length;i++){
 | 
	
		
			
				|  |  | +					if(this.itemList[i].riskList){
 | 
	
		
			
				|  |  | +						this.itemList[i].riskList.map(child=>{
 | 
	
		
			
				|  |  | +							child.recordList.map(measure=>{
 | 
	
		
			
				|  |  | +								items.push(measure)
 | 
	
		
			
				|  |  | +							})
 | 
	
		
			
				|  |  | +						})
 | 
	
		
			
				|  |  | +					}						
 | 
	
		
			
				|  |  | +				}
 | 
	
		
			
				|  |  | +				let index=items.findIndex(item=>item.checkResult===-1)
 | 
	
		
			
				|  |  | +				return index<0
 | 
	
		
			
				|  |  | +			},	
 | 
	
		
			
				|  |  | +			hover(state){
 | 
	
		
			
				|  |  | +				this.showMore=state===1
 | 
	
		
			
				|  |  |  			}
 | 
	
		
			
				|  |  |  		}
 | 
	
		
			
				|  |  |  	}
 | 
	
		
			
				|  |  |  </script>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  <style lang="scss" scoped>
 | 
	
		
			
				|  |  | +	.page{
 | 
	
		
			
				|  |  | +		background-color: #F5F6F8;
 | 
	
		
			
				|  |  | +		padding: 20rpx;
 | 
	
		
			
				|  |  | +		min-height: 100vh;
 | 
	
		
			
				|  |  | +		box-sizing: border-box;
 | 
	
		
			
				|  |  | +		padding-bottom: 120rpx;
 | 
	
		
			
				|  |  | +		.page-head{
 | 
	
		
			
				|  |  | +			text-align: right;
 | 
	
		
			
				|  |  | +			padding-bottom: 10rpx;
 | 
	
		
			
				|  |  | +			.handle{
 | 
	
		
			
				|  |  | +				display: inline-block;
 | 
	
		
			
				|  |  | +				background-color: #3384FF;
 | 
	
		
			
				|  |  | +				color: #fff;
 | 
	
		
			
				|  |  | +				padding: 10rpx 15rpx;
 | 
	
		
			
				|  |  | +				box-sizing: border-box;
 | 
	
		
			
				|  |  | +				border-right: 1rpx solid #eaeaea;
 | 
	
		
			
				|  |  | +				font-size: 30rpx;
 | 
	
		
			
				|  |  | +				text-align: center;
 | 
	
		
			
				|  |  | +				&:nth-child(4){
 | 
	
		
			
				|  |  | +					border: 0;
 | 
	
		
			
				|  |  | +				}
 | 
	
		
			
				|  |  | +			}
 | 
	
		
			
				|  |  | +		}
 | 
	
		
			
				|  |  | +	}	
 | 
	
		
			
				|  |  |  	.wrap{
 | 
	
		
			
				|  |  |  		padding: 20rpx;
 | 
	
		
			
				|  |  | -		margin-bottom: 100rpx;
 | 
	
		
			
				|  |  | +		background-color: #fff;
 | 
	
		
			
				|  |  |  		.checklist{
 | 
	
		
			
				|  |  |  			.title{
 | 
	
		
			
				|  |  | -				color: #333;
 | 
	
		
			
				|  |  | -				font-size: 36rpx;
 | 
	
		
			
				|  |  | -				height: 60rpx;
 | 
	
		
			
				|  |  | -				line-height: 60rpx;
 | 
	
		
			
				|  |  | +				color: #222222;
 | 
	
		
			
				|  |  | +				font-size: 32rpx;
 | 
	
		
			
				|  |  | +				height: 98rpx;
 | 
	
		
			
				|  |  | +				line-height: 98rpx;
 | 
	
		
			
				|  |  | +				overflow: hidden;
 | 
	
		
			
				|  |  | +				text-overflow: ellipsis;
 | 
	
		
			
				|  |  | +				border-bottom: 1px dashed #E8E8E8;				
 | 
	
		
			
				|  |  | +			}
 | 
	
		
			
				|  |  | +			.more{
 | 
	
		
			
				|  |  | +				background-image: url('/static/tree_more.png');
 | 
	
		
			
				|  |  | +				background-size: 30rpx 30rpx;
 | 
	
		
			
				|  |  | +				padding-left: 40rpx;
 | 
	
		
			
				|  |  | +				background-position: center left;
 | 
	
		
			
				|  |  | +				background-repeat: no-repeat;
 | 
	
		
			
				|  |  |  			}
 | 
	
		
			
				|  |  |  			.item-cont{
 | 
	
		
			
				|  |  |  				padding-left: 20rpx;
 | 
	
		
			
				|  |  | +				border-bottom: 1px dashed #E8E8E8;	
 | 
	
		
			
				|  |  |  				.checklistItem{
 | 
	
		
			
				|  |  |  					.itemTitle{
 | 
	
		
			
				|  |  | -						color: #424242;
 | 
	
		
			
				|  |  | +						color: #222222;
 | 
	
		
			
				|  |  |  						font-size: 32rpx;	
 | 
	
		
			
				|  |  | -						line-height: 1;	
 | 
	
		
			
				|  |  | -						padding: 10rpx 0;
 | 
	
		
			
				|  |  | +						height: 98rpx;
 | 
	
		
			
				|  |  | +						line-height: 98rpx;
 | 
	
		
			
				|  |  |  					}
 | 
	
		
			
				|  |  |  				}
 | 
	
		
			
				|  |  |  				.point-cont{
 | 
	
	
		
			
				|  | @@ -164,15 +265,22 @@
 | 
	
		
			
				|  |  |  						display: flex;						
 | 
	
		
			
				|  |  |  						color: #666;
 | 
	
		
			
				|  |  |  						font-size: 28rpx;	
 | 
	
		
			
				|  |  | -						line-height: 1;	
 | 
	
		
			
				|  |  | -						padding: 10rpx 0;	
 | 
	
		
			
				|  |  | +						// height: 98rpx;
 | 
	
		
			
				|  |  | +						// line-height: 98rpx;
 | 
	
		
			
				|  |  |  						.pointContent{
 | 
	
		
			
				|  |  |  							flex: 1;
 | 
	
		
			
				|  |  |  						}
 | 
	
		
			
				|  |  | +						.status{
 | 
	
		
			
				|  |  | +							.text{
 | 
	
		
			
				|  |  | +								color: #3384FF;
 | 
	
		
			
				|  |  | +								font-weight: 800;
 | 
	
		
			
				|  |  | +							}
 | 
	
		
			
				|  |  | +						}
 | 
	
		
			
				|  |  |  					}
 | 
	
		
			
				|  |  |  				}
 | 
	
		
			
				|  |  |  			}
 | 
	
		
			
				|  |  |  		}
 | 
	
		
			
				|  |  | +			
 | 
	
		
			
				|  |  |  		.handle-container{
 | 
	
		
			
				|  |  |  			position: fixed;
 | 
	
		
			
				|  |  |  			width: 100%;
 | 
	
	
		
			
				|  | @@ -183,18 +291,75 @@
 | 
	
		
			
				|  |  |  			justify-content: center;
 | 
	
		
			
				|  |  |  			align-items: center;
 | 
	
		
			
				|  |  |  			border-top: 1rpx solid #eaeaea;
 | 
	
		
			
				|  |  | +			padding: 15rpx 0;
 | 
	
		
			
				|  |  |  			.handle{
 | 
	
		
			
				|  |  | -				display: inline-block;
 | 
	
		
			
				|  |  | -				background-color: #3384FF;
 | 
	
		
			
				|  |  | -				color: #fff;
 | 
	
		
			
				|  |  | +				display:inline-block;
 | 
	
		
			
				|  |  | +				color: #222;
 | 
	
		
			
				|  |  |  				padding: 15rpx 20rpx;
 | 
	
		
			
				|  |  | -				width: 25%;
 | 
	
		
			
				|  |  |  				box-sizing: border-box;
 | 
	
		
			
				|  |  | -				border-right: 1rpx solid #eaeaea;
 | 
	
		
			
				|  |  | -				font-size: 30rpx;
 | 
	
		
			
				|  |  | -				text-align: center;				
 | 
	
		
			
				|  |  | -				&:nth-child(4){
 | 
	
		
			
				|  |  | -					border: 0;
 | 
	
		
			
				|  |  | +				border: 1rpx solid #eaeaea;
 | 
	
		
			
				|  |  | +				font-size: 26rpx;
 | 
	
		
			
				|  |  | +				text-align: center;
 | 
	
		
			
				|  |  | +				border-radius: 50rpx;
 | 
	
		
			
				|  |  | +				margin: 0 10rpx;
 | 
	
		
			
				|  |  | +				&.danger{
 | 
	
		
			
				|  |  | +					background-color: #FA5B41;	
 | 
	
		
			
				|  |  | +					color: #fff;						
 | 
	
		
			
				|  |  | +				}
 | 
	
		
			
				|  |  | +				&.submit{
 | 
	
		
			
				|  |  | +					background-color: #3384FF;	
 | 
	
		
			
				|  |  | +					color: #fff;
 | 
	
		
			
				|  |  | +				   padding: 18rpx 38rpx;
 | 
	
		
			
				|  |  | +				}
 | 
	
		
			
				|  |  | +			}
 | 
	
		
			
				|  |  | +			.more{
 | 
	
		
			
				|  |  | +				position: relative;
 | 
	
		
			
				|  |  | +				padding: 15rpx 20rpx;
 | 
	
		
			
				|  |  | +				// .text:hover{
 | 
	
		
			
				|  |  | +				// 	&+.list>.hand-item-box{
 | 
	
		
			
				|  |  | +				// 		display: block;
 | 
	
		
			
				|  |  | +				// 	}
 | 
	
		
			
				|  |  | +				// }
 | 
	
		
			
				|  |  | +				.list{
 | 
	
		
			
				|  |  | +					position: absolute;
 | 
	
		
			
				|  |  | +					bottom: 100rpx;
 | 
	
		
			
				|  |  | +					right: 0;
 | 
	
		
			
				|  |  | +					box-shadow: 0px 2px 12px 0px #0000001F;
 | 
	
		
			
				|  |  | +					padding:0 20rpx;
 | 
	
		
			
				|  |  | +					background-color: #fff;
 | 
	
		
			
				|  |  | +					.hand-item-box{
 | 
	
		
			
				|  |  | +						position: relative;
 | 
	
		
			
				|  |  | +						// display: none;
 | 
	
		
			
				|  |  | +						&.show{
 | 
	
		
			
				|  |  | +							display: block;
 | 
	
		
			
				|  |  | +						}
 | 
	
		
			
				|  |  | +						&::after{
 | 
	
		
			
				|  |  | +							width: 0;
 | 
	
		
			
				|  |  | +							height: 0;
 | 
	
		
			
				|  |  | +							content: "";
 | 
	
		
			
				|  |  | +							display: block;
 | 
	
		
			
				|  |  | +							border-width: 26rpx 26rpx 0 0;
 | 
	
		
			
				|  |  | +							border-color: #fff transparent;
 | 
	
		
			
				|  |  | +							border-style: solid;
 | 
	
		
			
				|  |  | +							position: absolute;
 | 
	
		
			
				|  |  | +							bottom: -20rpx;
 | 
	
		
			
				|  |  | +							right: -20rpx;
 | 
	
		
			
				|  |  | +						}
 | 
	
		
			
				|  |  | +						.handle-item{
 | 
	
		
			
				|  |  | +							width: 180rpx;
 | 
	
		
			
				|  |  | +							height: 50rpx;
 | 
	
		
			
				|  |  | +							font-size: 26rpx;
 | 
	
		
			
				|  |  | +							line-height: 50rpx;
 | 
	
		
			
				|  |  | +							background-color: #fff;
 | 
	
		
			
				|  |  | +							text-align: center;
 | 
	
		
			
				|  |  | +							border-bottom: 1px solid #ccc;
 | 
	
		
			
				|  |  | +							padding:10rpx 0;
 | 
	
		
			
				|  |  | +							&:last-child{
 | 
	
		
			
				|  |  | +								border: 0;
 | 
	
		
			
				|  |  | +							}
 | 
	
		
			
				|  |  | +						}						
 | 
	
		
			
				|  |  | +					}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  				}
 | 
	
		
			
				|  |  |  			}
 | 
	
		
			
				|  |  |  		}
 |