<template>
	<view class=" uni-container">
		<view class="example container" :style="'height: ' + (screenHeight - wheight - 75) + 'px'">
			<!-- 自定义表单校验 1-->
			<u--form :model="formData" labelPosition="top" labelWidth="300" labelAlign="left">
				<view class=" flex  flex-direction width100">
					<u-form-item label="检查单位场所名称" prop="jcdwscmc" :required="true">
						<u-input v-model="formData.jcdwscmc" disabled placeholder="必填。检查单位场所名称" />
					</u-form-item>
					<!-- <u-form-item label="所属乡镇街道"  prop="streetName" :required="true">
				<u-input
					v-model="formData.streetName"
					placeholder="请选择所属乡镇街道"
				></u-input>
			</u-form-item> -->
					<u-form-item label="检查记录编号(示例:编号:［2022］第00xx号)	"><u-input disabled v-model="formData.jcjlbh"
							placeholder="检查记录编号" /></u-form-item>
					<u-form-item label="检查人员 (示例:王xx、李xx)	">
						<u-input disabled v-model="formData.jcry" placeholder="检查人员" />
					</u-form-item>
					<u-form-item label="检查时间">
						<uni-datetime-picker disabled v-model="formData.jcsj" mode="date" closeOnClickOverlay
							></uni-datetime-picker>
					</u-form-item>
					<u-form-item label="检查形式(示例:安全检查)">
						<u-input disabled v-model="formData.jcxs" placeholder="检查形式" />
					</u-form-item>

					<u-form-item>
						<template #label>
							<span class="my-label">是/否责令限期整改及整改时限<view class="">
									(示例:是 2022年x月x日)
								</view></span></template>
						<u-input v-model="formData.sfxqzg" disabled placeholder="是/否责令限期整改及整改时限" />
					</u-form-item>
					<u-form-item label="是/否移交消防机构或公安派出所处理	" prop="xfaqzrr">
						<u-input v-model="formData.sfyjxfjg" disabled placeholder="是/否移交消防机构或公安派出所处理" />
					</u-form-item>

					<u-form-item label="是/否存在严重威胁公共安全的火灾隐患并报告">
						<u-input v-model="formData.sfyzwx" disabled placeholder="是/否存在严重威胁公共安全的火灾隐患并报告" />
					</u-form-item>
					<u-form-item label="备注">
						<u-input v-model="formData.remark" disabled placeholder="备注" />
					</u-form-item>
				</view>
			</u--form>
		</view>
		<uni-row class="heigthButton">
		<u-button
			@click="gotoEditArchive(formData)"
			shape="circle"
			size="large"
			color="#4cb2b6"
			text="修改信息"
			style="width: 60%;"
		></u-button>
		</uni-row>
	</view>
</template>
<script>
	
var that = null;
export default {
	data() {
		return {
			formData: {
				orgName: ''
			},
			screenHeight: this.$screenHeight,
			wheight: '',
		};
	},
	mounted() {
		uni.createSelectorQuery().in(this).select('.heigthButton').boundingClientRect(data => {
			this.wheight = data.height
		}).exec()
	},
	onLoad: function(option) {
		that = this;
		var data = option.id;
		// 接收来自上个页面传递的参数
		const eventChannel = this.getOpenerEventChannel();
		eventChannel.on('acceptDataFromOpenerPage', function(val) {
			that.formData = val;
		});
		this.formData.orgName = option.orgName;
	},

	methods: {
		// 传递当前页面数据到 ‘修改信息’
		gotoEditArchive(val) {
			uni.navigateTo({
				url: '/pagesA/fire/archive/edit_archive/edit_archive5',
				events: {
					// 为指定事件添加一个监听器，获取被打开页面传送到当前页面的数据
					acceptDataFromOpenedPage: function(val) {
						this.formData = val;
					}
				},
				success: function(res) {
					// 通过eventChannel向被打开页面传送数据
					res.eventChannel.emit('acceptDataFromOpenerPage', val);
				}
			});
		}
	}
};
</script>
	
<style lang="scss" scoped>
	page{
		background-color: #F5F7F9;
	}
.container {
	position: relative;
	// height: 220vh;
	background-color: rgb(245, 247, 249);
	overflow: auto;
	.buju {
		margin: 40rpx 0;
	}
}

.cont {
}

.weiwan {
	color: #d51a52;
	background: rgba(213, 26, 82, 0.2);
	padding: 5rpx 20rpx;
	border-radius: 2px;
	border: 1px solid #d51a52;
}

.yiwan {
	color: #4cb2b6;
	background: rgba(76, 178, 182, 0.2);
	padding: 5rpx 20rpx;
	border-radius: 2px;
	border: 1px solid #4cb2b6;
}

.miaoshu {
	margin-right: 20rpx;
	color: #274647;
	font-weight: 600;
}
</style>
