<template>
	<view class="page">
		<view class="top">
			<view class="img" v-if="!age.imgShow">
				<img src="@/static/091212.jpg" @click="chooseImage" alt="" >
			</view>
			<img v-else :src="age.imgShow" alt="" @click="chooseImage">
		</view>
		<view class="form">
			<view class="itembox">
				<view class="item">
					<view class="left">
						位置
					</view>
					<view class="right">
						<input type="text" v-model="form.position" placeholder="请输入位置">
					</view>
				</view>
			</view>
			<view class="itembox">
				
				<view class="item">
					<view class="left">
						姓名
					</view>
					<view class="right">
						<input type="text" v-model="form.name" placeholder="请输入姓名">
					</view>
				</view>
				<view class="item">
					<view class="left">
						职务
					</view>
					<view class="right">
						<input type="text" v-model="form.post" placeholder="请输入职务">
					</view>
				</view>
				<view class="item">
					<view class="left">
						备注
					</view>
					<view class="right">
						<input type="text" v-model="form.remarks" placeholder="若非指导员请说明原因">
					</view>
				</view>
				
			</view>
			<view class="itembox">
				
				<view class="item" v-for="(item,k) in form.form" :key="k">
					<view class="left">
						{{item.name}}
					</view>
					<view class="right">
						<view v-if="item.index" class="">
							已完成
						</view>
						<view v-else class="">
							未完成
						</view>
						<img src="@/static/arrow.png" alt="">
					</view>
				</view>
				
				
			</view>
		</view>
		<view class="button">
			<button @tap="bbb()">确定</button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				id:"",
				form:{
					position:"",
					name:"",
					post:"",
					remarks:"",
					form:[
						{
							name:"消防控制室",
							index:false,
							data:{}
						},
						{
							name:"消防电梯",
							index:false,
							data:{}
						},
						{
							name:"实战演练",
							index:false,
							data:{}
						},
						{
							name:"安全出口",
							index:false,
							data:{}
						},
						{
							name:"应急照明",
							index:false,
							data:{}
						},
						{
							name:"消防疏散指示标志",
							index:false,
							data:{}
						},
						{
							name:"火灾自动报警系统",
							index:false,
							data:{}
						},
						{
							name:"消防水池",
							index:false,
							data:{}
						},
						{
							name:"消防水箱",
							index:false,
							data:{}
						},
						{
							name:"消防水泵房",
							index:false,
							data:{}
						},
						{
							name:"室内消火栓",
							index:false,
							data:{}
						},
						{
							name:"室外消火栓",
							index:false,
							data:{}
						},
						{
							name:"末端试水装置",
							index:false,
							data:{}
						},
						{
							name:"防火门",
							index:false,
							data:{}
						},
						{
							name:"防火卷帘",
							index:false,
							data:{}
						},
						{
							name:"防排烟设施",
							index:false,
							data:{}
						},
						{
							name:"灭火器",
							index:false,
							data:{}
						},
						{
							name:"通信测试情况",
							index:false,
							data:{}
						},
						{
							name:"消防车辆作业面",
							index:false,
							data:{}
						},
						{
							name:"微型消防站",
							index:false,
							data:{}
						},
						{
							name:"水泵接合器",
							index:false,
							data:{}
						},
						{
							name:"高层建筑管道井",
							index:false,
							data:{}
						},
						{
							name:"数字化预案",
							index:false,
							data:{}
						},
						{
							name:"消防安全管理",
							index:false,
							data:{}
						},
						{
							name:"其他项",
							index:false,
							data:{}
						},
					]
				},
				age: {
					imgShow: '',
					text: '',
				},
				  
			}
		},
		onLoad(e) {
			console.log(e);
			this.id=e.id
			this.uid=e.uid
			console.log(uni.getStorageSync("user"));
			// this.getCompanies()
		},
		onReady() {


		},
		methods: {
			getCompanies(){
				this.$request.get("/api/Companies/"+this.id,{},(data,res)=>{
					console.log(res);
					this.list=res
					if(this.list.data){
						this.datas=JSON.parse(this.list.data)
						if(this.datas.basicInfo.nature=="重点单位"){
							this.datasIndex=1
						}
					}
				})
			},
			chooseImage() {
				var _this = this
				uni.chooseImage({
					count: 1, //默认9
					sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图，默认二者都有
					sourceType: ['album', 'camera'], //从相册选择、摄像头
					success: function(res) {
						_this.age.imgShow = res.tempFilePaths[0]
					}
				});
				// ass()
			},
			bbb(){
				uni.navigateTo({
					url:"/pages/demo/demo"
				})
				// let params={
				// 	approvalStatus:'已检查',
				// 	inspectionResult:'未发现违法违规情况'
				// }
				// this.$request.patch('/api/PlanTasks/' + this.uid, params, (data, res) => {
				// 	console.log(res);
				// })
			},
			danweif(e){
				console.log(e);
				this.datas.basicInfo.nature=this.danwei[e.detail.value]
			}
		}

	}
</script>

<style lang="scss">
	
	.button{
		margin-top: 40rpx;
		button {
			width: 200rpx;
			// height: 140rpx;
			// background: linear-gradient(180deg, #317AFF 0%, #0052E6 100%);
			color: #fff;
			background: #317AFF;
			border-radius: 20rpx;
		}
	}
	.top{
		display: flex;
		justify-content: center;
		align-items: center;
		.img{
			margin-top: 20rpx;
			width: 320rpx;
			height: 320rpx;
			
			img{
				width: 100%;
				height: 100%;
				border-radius: 40rpx;
			}
		}
	}
	.form{
		
		.itembox{
			margin-top: 20rpx;
			background: #fff;
			.item{
				display: flex;
				height: 100rpx;
				border-top: 2rpx solid #E4E7EC;
				box-sizing: border-box;
				margin: 0 20rpx;
				font-size: 32rpx;
				.left{
					color: #8D8C8F;
					line-height: 100rpx;
				}
				.right{
					flex: 1;
					color: #100F19;
					text-align: right;
					line-height: 100rpx;
					display: flex;
					img{
						width: 20rpx;
						height: 20rpx;
					}
				}
				.right_inp{
					flex: 1;
					color: #100F19;
					text-align: right;
					margin-top: 26rpx;
				}
				
			}
			.item:nth-child(1){
				display: flex;
				height: 100rpx;
				
				box-sizing: border-box;
				margin: 0 20rpx;
				font-size: 32rpx;
			}
		}
		
		
	}
</style>
