<!--
 * @Title: 
 * @Description: 巡检填报信息
 * @Author: swp
 * @Date: 2022-08-24 10:49:21
 * @LastEditors: 
 * @LastEditTime: 2022-08-24 10:49:21
-->
<template>
	<view class="wrap">
		<uni-nav-bar dark :fixed="true" backgroundColor="#3F9EFF" statusBar="false" left-icon="left" left-text="返回"
			@clickLeft="toBack">
			<view class="nav-title">
				<text>{{title}}</text>
			</view>
		</uni-nav-bar>
		<view class="container">
			<inspectionreportdetail v-if="isShow"  ref="inspectionreportdetail" :inspectionId="id">
			</inspectionreportdetail>
		</view>
	</view>
</template>

<script>
	import http from '@/http/api.js';
	import inspectionreportdetail from '@/pages/equipment-inspection/inspectionreportdetail.vue'
	export default {
		components: {
		
			inspectionreportdetail
		},
		onLoad(options) {
			this.id = options.id;
			console.log("vvvvvvvv " + this.id);
			this.inspectionreportRainType = options.type;
			if (this.inspectionreportRainType == 1) {
				this.title = '汛前巡检填报详情';
			} else if (this.inspectionreportRainType == 2) {
				this.title = '汛中（一）巡检填报详情';
			} else if (this.inspectionreportRainType == 3) {
				this.title = '汛中（二）巡检填报详情';
			}
		    
		},
		data() {
			return {
				isShow:false,
				id: '',
				inspectionreportRainType: 0,
				// items: ['汛前巡检', '汛中（一）巡检', '汛中（二）巡检'],
				// current: 0,
				// inspectionReportStatus: {
				// 	beforeRainSeasonReportId: '',
				// 	rainSeasonFirstReportId: '',
				// 	rainSeasonSecondReportId: '',
				// 	beforeRainSeasonStatus: 0,
				// 	rainSeasonFirstStatus: 0,
				// 	rainSeasonSecondStatus: 0,
				// },
				query: {},
				title: '巡检填报详情',
			}
		},
		computed: {},
		onShow() {
			console.log("vvvvvvvvvv onShow")
			this.isShow=true;
		},
		created() {
			console.log("vvvvvvvvvvvvvvvv created")

		},
		methods: {
			toBack() {
				uni.navigateBack({
					delta: 1
				})
			},
			getInspectionReportStatus(params = {}) {
				let that = this;
				let postData = Object.assign(params, this.query);
				//console.log(JSON.stringify(postData))
				http.request({
					url: '/galaxy-business/equipment/inspection/reportStatus',
					method: 'GET',
					data: postData
				}).then(res => {
					//console.log(JSON.stringify(res))
					if (res != null && res.success) {
						if (res.data != null) {
							that.inspectionReportStatus = res.data;
							if (that.inspectionReportStatus.rainSeasonSecondStatus == 1) {
								that.current = 2;
							} else if (that.inspectionReportStatus.rainSeasonFirstStatus == 1) {
								that.current = 1;
							} else if (that.inspectionReportStatus.beforeRainSeasonStatus == 1) {
								that.current = 0;
							}
						}
					}
				}).catch(err => {
					console.log(err)
				})
			},
			onClickItem(e) {
				if (this.current != e.currentIndex) {
					this.current = e.currentIndex;
				}
			},
		}
	}
</script>

<style>

</style>

<style lang="scss" scoped>
	.nav-title {
		width: 100%;
		display: flex;
		flex-direction: row;
		justify-content: center;
		align-items: center;

		text {
			color: white;
			font-size: 1rem;
		}
	}

	.container {
		padding: 0 0 50rpx;
		width: 100%;
	}

	.content {
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		justify-content: flex-start;
		flex-direction: column;
		width: 100%;

	}
</style>
