Browse Source

巡检详情

zhengkaixin 2 weeks ago
parent
commit
18ec2e67e7

+ 1 - 1
pages/index/index.vue

@@ -186,7 +186,7 @@
 							
 							
 							</view>
 							</view>
 							<view class="value">
 							<view class="value">
-								{{item.createTime}}<span style="color: red;" v-if="isToday(item.createTime)">(今日)</span>
+								{{item.errorReportTime}}<span style="color: red;" v-if="isToday(item.errorReportTime)">(今日)</span>
 
 
 							</view>
 							</view>
 							
 							

+ 1 - 1
pages/inspection/add.vue

@@ -479,7 +479,7 @@
 					if(bl==true){
 					if(bl==true){
 						return
 						return
 					}
 					}
-					if(item.imageRequired&&0){
+					if(item.imageRequired){
 						let files = [];
 						let files = [];
 						console.log(this.$refs)
 						console.log(this.$refs)
 						console.log(item.imageRequired,i,this.$refs['uUpload'+i])
 						console.log(item.imageRequired,i,this.$refs['uUpload'+i])

+ 283 - 18
pages/inspection/info.vue

@@ -1,21 +1,286 @@
-<template>
-	<view>
-		
-	</view>
-</template>
-
-<script>
-	import * as API from '@/apis/pagejs/pagesInspection.js'
-	
-	export default {
-		data() {
-			return {
+<template>
+	<view>
+		<u-navbar title="巡检记录详情" title-color="#101010"></u-navbar>
+		<view class="list">
+			<view class="item">
+				{{record.stationName}}
+
+
+			</view>
+			<view class="item ">
+				<view class="name">
+					站点地址
+
+				</view>
+				<view class="value">
+					 {{record.stationAddress}}
+				</view>
+				
+			</view>
+			<view class="item ">
+				<view class="name">
+					巡检人
+			
+				</view>
+				<view class="value">
+					 {{record.lastInspectionTime}}
+			
+				</view>
 				
 				
-			};
-		}
-	}
-</script>
+			</view>
+			<view class="item ">
+				<view class="name">
+					巡检时间
+			
+				</view>
+				<view class="value">
+					 {{record.inspectionTime}}
+				</view>
+				
+			</view>
+
+
+
+		</view>
+		<view class=" listtime">
+			<view class="item">
+				巡检结果
 
 
-<style lang="scss">
+			</view>
+			<u-time-line >
+				<u-time-line-item  v-for="(item,index) in submitcontent" :key="index">
+				<template v-slot:content >
+					<view >
+						<view class="u-order-title">{{index+1}}.{{item.name}}</view>
+						<view class="u-order-desc" v-if="contentList[index].btn&&contentList[index].btn.length" >
+							
+						 
+							<span :class="'result'+item.result"  v-for="(b,i) in contentList[index].btn" v-show="item.result==b.value">
+								{{b.name}}
+							</span>
+							<span v-if="item.result==0" style="margin: 0 8rpx;">, </span>
+							{{item.content}}
+						</view>
+						<view class="u-order-time"></view>
+					</view>
+				</template>
+				</u-time-line-item>
+			</u-time-line>
+		</view>
+	</view>
+</template>
+
+<script>
+	import * as API from '@/apis/pagejs/pagesInspection.js'
+
+	export default {
+		data() {
+			return {
+				record: {},
+				content: [
+
+				],
+				submitcontent:[]
+			};
+		},
+		onLoad(op) {
+
+			if (op.id) {
+				this.id = op.id
+			}
+
+			this.errDetails()
+
+
+
+		},
+		methods: {
+			errDetails() {
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+
+				API.recordDetails({
+					id: this.id,
+
+				}).then((res) => {
+					this.record = res.data.record
+
+					this.content = res.data.content
+					
+					this.contentList=this.content.map(item=>{
+						
+						var obj={
+							dataId:item.dataId,
+							name:item.name,
+							btn:[{
+								name:"正常",
+								value:"1"
+							},{
+								name:"异常",
+								value:"0"
+							}],
+							desc:"问题描述",
+							descP:"请简单描述发现的问题",
+						}
+						
+						if(item.extended1){
+							var extended1=JSON.parse(item.extended1)
+							
+							Object.keys(extended1).forEach(key1 => {
+								
+								obj[key1]=extended1[key1]
+							})
+						}
+						
+						return obj
+					})
+					
+					
+					if(this.record.contentJson){
+						var contentJson=JSON.parse(this.record.contentJson)
+						console.log(contentJson)
+						this.submitcontent=contentJson.content
 
 
-</style>
+					}
+					uni.hideLoading();
+				}).catch(error => {
+
+					uni.hideLoading();
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			},
+		}
+
+	}
+</script>
+
+<style lang="scss">
+	.jpmain {
+		padding-bottom: 120rpx;
+	}
+
+	.list {
+		background-color: rgba(255, 255, 255, 1);
+		border-radius: 16rpx;
+
+		margin: 20rpx;
+		 padding-bottom: 20rpx ;
+		.item:first-child {
+			border-bottom: 2rpx solid rgba(232, 232, 232, 1);
+			font-size: 32rpx;
+			padding: 20rpx 24rpx;
+			font-weight: bold;margin-bottom: 10rpx;
+		}
+
+
+		.item {
+			padding: 10rpx 24rpx;
+			display: flex;
+		    align-items: center;
+			.name {
+				 width: 30%;
+				//padding-bottom: 32rpx;
+				font-size: 32rpx;
+				color: #777777;
+
+				span {
+					color: red
+				}
+
+
+			}
+
+			.valueplus {
+				display: flex;
+				justify-content: space-between;
+
+			}
+
+			.valueclock {
+				width: 100%;
+				border-radius: 8rpx;
+				padding: 0 16rpx;
+				height: 64rpx;
+				line-height: 64rpx;
+				background-color: rgba(241, 242, 245, 1);
+			}
+
+			.value {
+				font-size: 32rpx;
+
+				display: flex;
+				align-items: center;
+
+				input::placeholder {
+					color: #AAAAAA;
+				}
+
+				.img {
+					width: 40rpx;
+					height: 40rpx;
+
+				}
+
+				.textarea {
+					background-color: rgba(241, 242, 245, 1);
+					width: 100%;
+					border-radius: 8rpx;
+				}
+
+				.typeN {
+					font-size: 24rpx;
+					margin-right: 8rpx;
+					display: flex;
+					align-items: center;
+					border-radius: 8rpx;
+					padding: 4rpx 8rpx;
+					color: #fff;
+				}
+
+				.typeN1 {
+					background-color: #1677ff;
+					//border: 2rpx solid #1677ff;
+				}
+
+				.typeN2 {
+					background-color: #19be6b;
+					//border: 2rpx solid #19be6b;
+
+				}
+			}
+		}
+
+
+	}
+	.listtime{
+		background-color: rgba(255, 255, 255, 1);
+		border-radius: 16rpx;
+		
+		margin: 20rpx;
+		padding: 32rpx 24rpx;
+		.item{
+			color: rgba(51,51,51,1);
+			font-size: 32rpx;
+			font-weight: bold;
+			margin-bottom: 18rpx;
+		}
+		.result0{
+			color: #FF3D00;
+		}
+		.result1{
+			color: #00B962;
+		}
+		.u-order-time{
+			margin-bottom: 30rpx;
+		}
+		.u-order-desc{
+			margin: 10rpx 0;
+		}
+	}
+	
+</style>

+ 21 - 21
pages/inspection/list.vue

@@ -67,15 +67,6 @@
 		<u-divider :isnone="list.length==0" nonetext="没有找到相关内容" border-color="#CFD2D5">已经到底了</u-divider>
 		<u-divider :isnone="list.length==0" nonetext="没有找到相关内容" border-color="#CFD2D5">已经到底了</u-divider>
 		
 		
 		
 		
-		<view class="floating-button">
-			<view class="button"  @click="submit" >
-				
-				巡检
-
-			</view>
-			
-		</view>
-		
 	</view>
 	</view>
 </template>
 </template>
 
 
@@ -194,18 +185,27 @@
 				}
 				}
 			},
 			},
 			gotoTask(k){
 			gotoTask(k){
-				uni.navigateTo({
-				  url: '/pages/inspection/add?stationId='+k.stationId,
-				  events: {
-				    // 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据
-				    acceptDataFromOpenerPage: (data)=>{
-						console.log(data)
-						this.getList(1)
-				    },
-				 
-				  }
-				 
-				})
+				if(k.status==0){
+					uni.navigateTo({
+					  url: '/pages/inspection/add?stationId='+k.stationId,
+					  events: {
+					    // 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据
+					    acceptDataFromOpenerPage: (data)=>{
+							console.log(data)
+							this.getList(1)
+					    },
+					 
+					  }
+					 
+					})
+				}else{
+					uni.navigateTo({
+					  url: '/pages/inspection/info?id='+k.id,
+					 
+					 
+					})
+				}
+				
 			},
 			},
 			change(e){
 			change(e){
 				this.current=e
 				this.current=e

+ 4 - 3
pages/station/stationInfo.vue

@@ -74,14 +74,14 @@
 				<view class="text">
 				<view class="text">
 					<view>故障提醒</view>
 					<view>故障提醒</view>
 			
 			
-					<view class="check-all"  @click="gotoUrl('/pages/inspection/list')"  >查看全部<u-icon name="arrow-right"></u-icon></view>
+					<view class="check-all"  @click="gotoUrl('/pages/task/listTask')"  >查看全部<u-icon name="arrow-right"></u-icon></view>
 			
 			
 				</view>
 				</view>
 			
 			
 			</view>
 			</view>
 			<view class="body">
 			<view class="body">
 				<view class="line" v-for="(item,index) in errList"
 				<view class="line" v-for="(item,index) in errList"
-				 @click="gotoUrl('/pages/task/listTask')"
+				 @click="gotoUrl('/pages/task/maintenanceTaks?id='+item.id)"
 				 :key="i">
 				 :key="i">
 					<view class="p1">
 					<view class="p1">
 						<view class="name">
 						<view class="name">
@@ -236,7 +236,8 @@
 				API.recordList({
 				API.recordList({
 					pageIndex:1,
 					pageIndex:1,
 					pageSize:5,
 					pageSize:5,
-					stationId:this.id
+					stationId:this.id,
+					status:1
 				}).then((response) => {
 				}).then((response) => {
 					this.recordList=response.data.data
 					this.recordList=response.data.data
 					this.recordListTotal=response.data.recordsTotal
 					this.recordListTotal=response.data.recordsTotal