heyang преди 6 месеца
родител
ревизия
96153b1079
променени са 2 файла, в които са добавени 198 реда и са изтрити 73 реда
  1. 27 8
      pages_safetyCheck/views/inspectManage/inspectAdd.vue
  2. 171 65
      pages_safetyCheck/views/itemsManage/hiddenDangerItemsDetail.vue

+ 27 - 8
pages_safetyCheck/views/inspectManage/inspectAdd.vue

@@ -9,7 +9,7 @@
 				</view>
 				<view class="items-b">< {{newData.hazardCheckCode2}} {{newData.hazardCheckName2}} <</view>
 			</view>
-			<view class="items-number">此检查项在当前实验室累计出现<text>{{newData.hazardCheckNum}}</text>次隐患</view>
+			<view class="items-number">此检查项在当前实验室累计出现<text>{{hazardCheckNum}}</text>次隐患</view>
 			<view class="list">
 				<view class="list-li">
 					<view>检查要点</view>
@@ -26,15 +26,15 @@
 						<text>{{item.name}}</text>
 					</view>
 				</view>
-				<view class="list-li">
+				<view class="list-li" v-if="!form.checkFlag">
 					<view>检查隐患</view>
 					<view>
 						<img src="@/pages_safetyCheck/images/icon_06.png">
 					</view>
 				</view>
-				<textarea class="describe" type="text" v-model="form.hazardDescribe" maxlength="200"
+				<textarea v-if="!form.checkFlag" class="describe" type="text" v-model="form.hazardDescribe" maxlength="200"
 					placeholder="请填写隐患描述" placeholder-style="font-size:24rpx;color:#999;"></textarea>
-				<view class="check-for-img-max-box">
+				<view v-if="!form.checkFlag" class="check-for-img-max-box">
 					<view class="left-title-p"></view>
 					<view class="right-img-box">
 						<view class="img-box" v-for="(imgUrl,imgIndex) in form.photoList" :key="imgIndex">
@@ -94,7 +94,7 @@
 			return {
 				baseUrl: config.base_url,
 				form: {
-					checkFlag: 0,
+					checkFlag: false,
 					photoList: [],
 				},
 				newData: {},
@@ -114,6 +114,7 @@
 				manageId: '', //检查管理id
 				subId: '',
 				hazardCheckPro: '',
+				hazardCheckNum:0,
 				sendLock: true, //发送锁,当为true时上锁,false时解锁发送
 				recorderManager: wx.getRecorderManager(),
 			}
@@ -157,12 +158,32 @@
 					data
 				} = await securityAppCheckPhotoGetCheckNumBySub(obj);
 				if (data.code == 200) {
-					this.$set(this.newData, 'hazardCheckNum', data.data);
+					this.$set(this, 'hazardCheckNum', data.data);
 
 				}
 			},
 			//提交
 			async submitForm(status) {
+				if(!this.form.checkFlag){
+					if(!this.form.hazardDescribe){
+						uni.showToast({
+							title: '请填写隐患描述!',
+							icon: "none",
+							mask: true,
+							duration: 2000
+						});
+						return
+					}
+					if(!this.form.photoList[0]){
+						uni.showToast({
+							title: '请选择现场照片!',
+							icon: "none",
+							mask: true,
+							duration: 2000
+						});
+						return
+					}
+				}
 				let obj = {
 					checkFlag: this.form.checkFlag,
 					checkStatus: status == 1 ? 2 : 1,
@@ -190,8 +211,6 @@
 							duration: 2000
 						});
 					}
-					
-
 				}
 			},
 			//滚动事件

+ 171 - 65
pages_safetyCheck/views/itemsManage/hiddenDangerItemsDetail.vue

@@ -2,21 +2,18 @@
 <template>
 	<view class="snapshotDetail">
 		<scroll-view scroll-y @scrolltolower="scrollGet" class="info-max-box">
-			<view class="items" v-if="inspectionItems==0">
-				<view class="items-li">
-					<view>实验室</view>
-					<view>{{newData.subName}}({{newData.subRoom}})</view>
-				</view>
-				<view class="items-li">
-					<view>学院单位</view>
-					<view>{{newData.deptName}}</view>
-				</view>
+			<view class="tip" v-if="pageType==0">{{newData.checkName}}</view>
+			<view class="tip-tow" v-if="pageType==1 || pageType==2">{{newData.checkName}}</view>
+			<view class="items">
 				<view class="items-t" v-if="newData.hazardCheckName!=''">
 					<view class="items-t-r">{{newData.hazardCheckCode}} {{newData.hazardCheckName}}</view>
 				</view>
-				<view class="items-b" v-if="newData.hazardCheckName!=''">< {{newData.hazardCheckCode2}} {{newData.hazardCheckName2}} < {{newData.hazardCheckCode1}} {{newData.hazardCheckName1}}</view>
+				<view class="items-b" v-if="newData.hazardCheckName!=''">< {{newData.hazardCheckCode2}}
+					{{newData.hazardCheckName2}} < {{newData.hazardCheckCode1}} {{newData.hazardCheckName1}}
+				</view>
 			</view>
-			<view class="items-number" v-if="newData.hazardCheckName!=''">此检查项在当前实验室累计出现<text>{{newData.hazardCheckNum}}</text>次隐患</view>
+			<view class="items-number" v-if="newData.hazardCheckName!=''">
+				此检查项在当前实验室累计出现<text>{{hazardCheckNum}}</text>次隐患</view>
 			<view class="list">
 				<view class="list-li" v-if="newData.hazardCheckName!=''">
 					<view>检查要点</view>
@@ -27,45 +24,33 @@
 				<view v-if="newData.hazardCheckName!=''" class="hidden-content">{{newData.hazardCheckPoint}}
 				</view>
 				<view class="list-li">
-					<view>检查隐患</view>
-				</view>
-				<view class="hidden-content">{{newData.hazardDescribe}}
-				</view>
-				<view class="photo">
-					<img v-for="(item,index) in newData.yhDtoList" :src="baseUrl+item.fileUrl">
-				</view>
-				<view class="list-li">
-					<view>隐患整改</view>
-					<view :id="newData.rectifyStatus==0?'fontColor-A':(newData.rectifyStatus==1?'fontColor-B':'fontColor-C')">
-						{{newData.rectifyStatus==0?'待整改':(newData.rectifyStatus==1?'已整改':'暂无法整改')}}
+					<view>{{newData.checkFlag?'检查结果':'检查隐患'}}</view>
+					<view :id="newData.checkFlag?'fontColor-B':'fontColor-C'">
+						{{newData.checkFlag?'符合':'不符合'}}
 						<img src="@/pages_safetyCheck/images/icon_06.png">
 					</view>
 				</view>
-				<view class="hidden-content" v-if="newData.rectifyStatus==1 || newData.rectifyStatus==2">{{newData.rectifyDescribe}}
-				</view>
-				<view class="photo" v-if="newData.rectifyStatus==1 || newData.rectifyStatus==2">
-					<img v-for="(item,index) in newData.zgDtoList" :src="baseUrl+item.fileUrl">
+				<view class="hidden-content" v-if="!newData.checkFlag">{{newData.hazardDescribe}}
 				</view>
-				<view class="list-li" v-if="newData.rectifyStatus==1 || newData.rectifyStatus==2">
-					<view>整改方案</view>
-					<view></view>
+				<view class="photo" v-if="!newData.checkFlag">
+					<img v-for="(item,index) in newData.photoList" :src="baseUrl+item.fileUrl">
 				</view>
-				<view class="file-li" v-if="newData.rectifyStatus==1 || newData.rectifyStatus==2">
-					<img src="@/pages_safetyCheck/images/icon_djc_wj.png">
-					<view>{{newData.rectifyProjectName}}</view>
-				</view>
-				<view class="list-li" v-if="newData.rectifyStatus==1 || newData.rectifyStatus==2">
+				<view class="list-li">
 					<view>姓名:</view>
-					<view>{{newData.rectifyUserName}}</view>
+					<view>{{newData.checkUserName}}</view>
 				</view>
-				<view class="list-li" v-if="newData.rectifyStatus==1 || newData.rectifyStatus==2">
-					<view>时间:</view>
-					<view>{{newData.rectifyTime}}</view>
+				<view class="list-li">
+					<view>检查时间:</view>
+					<view>{{newData.checkTime}}</view>
 				</view>
-				
+
 			</view>
 		</scroll-view>
-		<view class="sub-btn" @click="rectificationBtn">{{newData.rectifyStatus==0?'整改':'继续整改'}}</view>
+		<view class="sub-btn" v-if="pageType==0 && !newData.checkFlag">
+			<view @click="submitBtn(1)">编辑</view>
+			<view @click="submitBtn(2)">继续检查</view>
+		</view>
+		<view v-if="pageType==0 && newData.checkFlag" @click="submitBtn(2)" class="sub-btn-tow">继续检查</view>
 	</view>
 
 </template>
@@ -75,7 +60,11 @@
 		config
 	} from '@/api/request/config.js'
 	import {
-		securityAppCheckPhotoDetail,
+		parseTime
+	} from '@/component/public.js'
+	import {
+		securityAppCheckPlanCheckInfo,
+		securityAppCheckPhotoGetCheckNumBySub,
 	} from '@/pages_safetyCheck/api/index.js'
 	export default {
 		name: "snapshotDetail",
@@ -85,40 +74,95 @@
 		data() {
 			return {
 				baseUrl: config.base_url,
-				inspectionItems:0,//0有检查项 1无检查项
+				inspectionItems: 0, //0有检查项 1无检查项
 				newData: {},
-				photoId:'',
-				
+				setOptionId: '',
+				manageId: '',
+				subId: '',
+				hazardCheckPro: '',
+				hazardCheckNum: 0,
+				pageType: 0, //0检查 1复查 2整改
+
 			}
 		},
 		onLoad(option) {
-			this.$set(this, 'photoId', JSON.parse(decodeURIComponent(option.infoData)).photoId);
+			let optionData = JSON.parse(decodeURIComponent(option.infoData));
+
+			this.$set(this, 'pageType', optionData.pageType);
+			this.$set(this, 'setOptionId', optionData.setOptionId);
+			this.$set(this, 'manageId', optionData.manageId);
+			this.$set(this, 'subId', optionData.subId);
+			this.$set(this, 'hazardCheckPro', optionData.hazardCheckPro);
 		},
 		onShow() {
 
 		},
 		mounted() {
-			this.securityAppCheckPhotoDetail();
+			this.securityAppCheckPlanCheckInfo();
+			this.securityAppCheckPhotoGetCheckNumBySub();
 		},
 		methods: {
 			//滚动事件
 			scrollGet() {},
-			async securityAppCheckPhotoDetail() {
-				let self = this;
+			//获取详情
+			async securityAppCheckPlanCheckInfo() {
+				let obj = {
+					setOptionId: this.setOptionId,
+					manageId: this.manageId,
+				}
 				const {
 					data
-				} = await securityAppCheckPhotoDetail({photoId:this.photoId});
+				} = await securityAppCheckPlanCheckInfo(obj);
 				if (data.code == 200) {
+					uni.setNavigationBarTitle({
+						title: data.data.subName + '(' + (this.pageType == 0 ? data.data.roomNum : data.data
+							.subRoom) + ')'
+					})
 					this.$set(this, 'newData', data.data);
+					this.$set(this.newData, 'checkTime', parseTime(data.data.checkTime, "{y}-{m}-{d}"));
+				}
+			},
+			//获取检查项在当前实验室出现的次数
+			async securityAppCheckPhotoGetCheckNumBySub() {
+				let obj = {
+					subId: this.subId,
+					hazardCheckPro: this.hazardCheckPro,
+				}
+				const {
+					data
+				} = await securityAppCheckPhotoGetCheckNumBySub(obj);
+				if (data.code == 200) {
+					this.$set(this, 'hazardCheckNum', data.data);
+
+				}
+			},
+			//检查-按钮
+			submitBtn(status){
+				if(status==1){
+					//编辑
+					let infoData = {
+						setOptionId:this.setOptionId,
+						manageId:this.manageId,
+						subId:this.subId,
+						hazardCheckPro:this.hazardCheckPro,
+						pageType:this.pageType,
+					};
+					uni.redirectTo({
+						url: '/pages_safetyCheck/views/inspectManage/inspectAdd?infoData=' + encodeURIComponent(JSON
+							.stringify(infoData))
+					});
+				}else if(status==2){
+					//继续检查
 				}
 			},
 			//整改页面
-			rectificationBtn(){
-				let self=this;
-				let infoData=self.newData;
+			rectificationBtn() {
+				let self = this;
+				let infoData = self.newData;
 				console.log(self.newData)
 				uni.navigateTo({
-					url: '/pages_safetyCheck/views/itemsManage/snapshotRectification?infoData=' + encodeURIComponent(JSON.stringify(infoData))
+					url: '/pages_safetyCheck/views/itemsManage/snapshotRectification?infoData=' +
+						encodeURIComponent(JSON.stringify(infoData))
 				});
 			},
 		}
@@ -132,6 +176,7 @@
 		box-sizing: border-box;
 		padding-bottom: 160rpx;
 		box-sizing: border-box;
+
 		#bgColor-A {
 			color: #FFD400;
 		}
@@ -143,39 +188,64 @@
 		#bgColor-C {
 			color: #E11608;
 		}
+
 		#fontColor-A {
 			color: #0183FA;
 		}
-		
+
 		#fontColor-B {
 			color: #16B531;
 		}
-		
+
 		#fontColor-C {
-			
+
+			color: #FF8C00;
+		}
+
+		.tip {
+			width: 750rpx;
+			height: 80rpx;
+			background: rgba(1, 131, 250, 0.2);
+			border-radius: 0rpx 0rpx 0rpx 0rpx;
+			font-size: 30rpx;
+			color: #0183FA;
+			line-height: 80rpx;
+			text-align: center;
+		}
+
+		.tip-tow {
+			width: 750rpx;
+			height: 80rpx;
+			background: rgba(255, 140, 0, 0.2);
+			border-radius: 0rpx 0rpx 0rpx 0rpx;
+			font-size: 30rpx;
 			color: #FF8C00;
+			line-height: 80rpx;
+			text-align: center;
 		}
+
 		.items {
 			width: 690rpx;
 			min-height: 165rpx;
 			background: #FFFFFF;
 			border-radius: 20rpx 20rpx 20rpx 20rpx;
 			margin: 20rpx 0 0 30rpx;
-			.items-li{
+
+			.items-li {
 				display: flex;
 				justify-content: space-between;
 				align-items: center;
 				padding: 0 30rpx;
 				box-sizing: border-box;
 				border-bottom: 1rpx solid #E0E0E0;
-				
+
 				>view:nth-of-type(1) {
 					font-size: 30rpx;
 					color: #333333;
 					line-height: 80rpx;
 					text-align: left;
 				}
-				
+
 				>view:nth-of-type(2) {
 					font-size: 28rpx;
 					color: #666666;
@@ -186,6 +256,7 @@
 					align-items: center;
 				}
 			}
+
 			.items-t {
 				border-bottom: 1rpx solid #E0E0E0;
 				height: 80rpx;
@@ -279,17 +350,20 @@
 				}
 
 			}
-			.file-li{
+
+			.file-li {
 				display: flex;
 				justify-content: space-between;
 				align-items: center;
 				padding: 0 30rpx;
 				box-sizing: border-box;
+
 				>img:nth-of-type(1) {
 					width: 30rpx;
 					height: 30rpx;
 				}
-				>view{
+
+				>view {
 					flex: 1;
 					font-size: 28rpx;
 					color: #333333;
@@ -298,8 +372,9 @@
 					margin: 0 92rpx 0 16rpx;
 					overflow: hidden;
 					text-overflow: ellipsis;
-					white-space: nowrap;   
+					white-space: nowrap;
 				}
+
 				>img:nth-of-type(2) {
 					width: 30rpx;
 					height: 30rpx;
@@ -335,13 +410,45 @@
 					margin: 0 10rpx 10rpx 0;
 				}
 			}
+
 			.list-li:last-of-type {
 				border: none;
 			}
 		}
-		
+
 	}
-	.sub-btn{
+
+	.sub-btn {
+		display: flex;
+		justify-content: center;
+		position: fixed;
+		left: 30rpx;
+		bottom: 30rpx;
+	
+		>view:nth-of-type(1) {
+			width: 345rpx;
+			height: 100rpx;
+			background: #FF8C00;
+			border-radius: 50rpx 0rpx 0rpx 50rpx;
+			font-size: 30rpx;
+			color: #FFFFFF;
+			line-height: 100rpx;
+			text-align: center;
+		}
+	
+		>view:nth-of-type(2) {
+			width: 345rpx;
+			height: 100rpx;
+			background: #0183FA;
+			border-radius: 0rpx 50rpx 50rpx 0rpx;
+			font-size: 30rpx;
+			color: #FFFFFF;
+			line-height: 100rpx;
+			text-align: center;
+		}
+	}
+
+	.sub-btn-tow {
 		width: 686rpx;
 		height: 100rpx;
 		background: #0183FA;
@@ -355,5 +462,4 @@
 		line-height: 100rpx;
 		text-align: center;
 	}
-	
 </style>