<!-- 资质审核-->
<template>
    <view id="register">
		<viwe v-if="status==0" class="tip">信息正在审核中，请耐心等待...</viwe>
		<viwe v-if="status==2" class="reject">{{form.centerAuditStatus==2?'您提交的审核被驳回，驳回原因为：'+form.centerAuditCause:'您提交的审核被驳回，驳回原因为：'+form.leadAuditCause}}</viwe>

		<view class="register_li">
			<view class="register_li_min">
				<img class="icon_img" src="@/pages_student/images/Version3.0/icon_zgsq_sqr.png">
				<view>申请人：</view>
				<input v-model="form.applyUser" disabled  type="text" >
			</view>
			<view class="register_li_min" style="border: none;">
				<img class="icon_img" src="@/pages_student/images/Version3.0/icon_zgsq_dhh.png">
				<view>联系方式：</view>
				<input v-model="form.phone" disabled  type="text" >
			</view>
		</view>
		<!-- <view class="register_li">
			<view class="register_li_min" v-for="(item,index) in form.airBottlelist" style="border-bottom:0;" >
				<view></view>
				<view>{{item.airConstituents}}-{{item.parent}}({{item.specValue}})：</view>
				<input v-model="item.bottleNumber" disabled  type="text" >
			</view>
		</view> -->
		<view class="register_li">
			<view class="register_li_min">
				<view></view>
				<view>实验地点：</view>
				<input v-model="form.location" disabled type="text" >
			</view>
			<view class="register_li_min">
				<view></view>
				<view>使用气体：</view>
				<input v-model="form.useGasName" disabled type="text" >
			</view>
			<!-- 使用期限 -->
			<view class="register_li_min2">
				<view><text  style="color: #f00;margin-right: 10rpx;"></text>使用期限:</view>
				<picker mode="date" disabled @change="startChange($event)">
					<input class="picker-text" v-model="form.startTime" disabled  type="text"  placeholder="开始时间">
				</picker>
				<view>-</view>
				<picker mode="date" disabled @change="endChange($event)">
					<input class="picker-text2" v-model="form.endTime" disabled  type="text"  placeholder="结束时间">
				</picker>
			</view>
			<view class="register_li_min">
			    <view></view>
				<view>气体用途：</view>
				<input v-model="form.gasUse" disabled  type="text" >
			</view>
			<view class="register_li_min">
			    <view></view>
				<view>安全措施：</view>
				<input v-model="form.safetyPrecautions" disabled  type="text" >
			</view>
			<view  class="issue_li" style="border-bottom:0;"  @click="lookItem(form.applyCertificate)">
				<view></view>
				<view>用气申请表：</view>
				<img class="issue_img" :src="baseUrl+form.applyCertificate">
			</view>
		</view>

		<view  class="sub_btn" v-if="status=='2'" @click="submitForm()">重新申请</view>
	</view>
</template>

<script>
    import {useAgsApplyDetail} from '@/api/index.js'
	import { config } from '@/api/request/config.js'
    export default {
        data() {
            return {
				baseUrl:config.base_url,
				form:{},
				id:'',
				status:null,
            }
        },
        onLoad(option) {
			if(decodeURIComponent(option.item)){
				this.id=JSON.parse(decodeURIComponent(option.item)).id;
				this.status=JSON.parse(decodeURIComponent(option.item)).remark;
			}

        },
        onShow(){



        },

        methods: {
			//获取详情
			async getInfo(){
			    let _this = this;
			    const {data} = await useAgsApplyDetail({id:this.id})
			    if(data.code==200){
					let res=data.data
					_this.form=res.apply;
					_this.form.airBottlelist=res.airBottlelist
			    }
			},
			lookItem(item){
				//查看图片
				wx.previewImage({
					urls: [config.base_url+item], //需要预览的图片http链接列表，多张的时候，url直接写在后面就行了
					current: '', // 当前显示图片的http链接，默认是第一个
					success: function(res) {},
					fail: function(res) {},
					complete: function(res) {},
				})
			},
			//重新提交
			async submitForm(){
				uni.navigateTo({
				    url:'/pages_manage/useGasApply/useGasApplyAdd?status=1&id='+this.id
				});
			},
        },
		mounted() {
			this.getInfo();
		}
    }
</script>

<style lang="stylus" scoped>
    #register{
        height:auto;
        width:100%;
        display flex;
        flex-direction column;
		padding-bottom: 220rpx;
		/* 审核中 */
		.tip{
			width: 750rpx;
			background: rgba(255,144,0,0.2);
			font-size: 28rpx;
			font-family: PingFang SC;
			font-weight: 500;
			color: #FF9000;
			line-height: 28rpx;
			padding: 36rpx 20rpx;
			box-sizing: border-box;
		}
		/* 驳回 */
		.reject{
			width: 750rpx;
			background: #F3DCDC;
			font-size: 28rpx;
			font-family: PingFang SC;
			font-weight: 500;
			color: #DC0000;
			line-height: 36rpx;
			padding: 36rpx 20rpx;
			box-sizing: border-box;
		}
		.register_li{
			background #fff;
			border-radius:20rpx;
			margin:20rpx 20rpx 0;
			padding:20rpx 0;
			box-sizing: border-box;
			.register_li_min{
				margin:0 26rpx;
				display flex;
				align-items center;
				border-bottom: 1px solid #F5F5F5;
				.icon_img{
					width: 30rpx;
					height: 30rpx;
					margin-right: 12rpx;
				}
				view{
					line-height:100rpx;
					font-size:28rpx;
				}
				view:nth-child(1){
					color:red;
					line-height:28rpx;
					margin-right: 12rpx;
				}
				view:nth-child(2){
					//width:140rpx;
					font-size: 28rpx;
					font-family: PingFang SC;
					font-weight: 500;
					color: #999999;
				}

				>input{
					flex:1;
					text-align: right;
					font-size: 24rpx;
					font-family: PingFang SC;
					font-weight: 500;
					color: #333333;
				}


			}
			/* 时间 */
			.register_li_min2{
				margin:0 26rpx;
				border-bottom: 1px solid #f5f5f5;
				height: 100rpx;
				display: flex;
				justify-content: flex-start;
				align-items: center;
				>view:nth-child(1){
					font-size: 28rpx;
					font-family: PingFang SC;
					font-weight: 500;
					color: #999999;
					line-height: 100rpx;
					margin-right: 140rpx;
				}
				.picker-text{
					font-size: 24rpx;
					font-family: PingFang SC;
					font-weight: 500;
					color: #333333;
					line-height: 100rpx;
					width: 188rpx;

				}
				>view:nth-child(2){
					font-size: 24rpx;
					font-family: PingFang SC;
					font-weight: 500;
					color: #333333;
					line-height: 100rpx;
				}
				.picker-text2{
					font-size: 24rpx;
					font-family: PingFang SC;
					font-weight: 500;
					color: #333333;
					line-height: 100rpx;
					width: 188rpx;
					text-align: right;
				}
			}

			.issue_li{
				margin:34rpx 26rpx 0;
				display flex;
				border-bottom: 1px solid #F5F5F5;
				view:nth-child(1){
					color:red;
					line-height:28rpx;
					margin-right: 12rpx;
				}
				view:nth-child(2){
					//width:140rpx;
					font-size: 28rpx;
					font-family: PingFang SC;
					font-weight: 500;
					color: #999999;
				}
				.issue_img{
					width: 210rpx;
					height: 210rpx;
					border-radius: 10rpx;
					margin-left:250rpx;
				}
			}
		}
		/* 按钮 */
		.sub_btn{
			width: 650rpx;
			height: 100rpx;
			background: #0183FA;
			border-radius: 20rpx;
			font-size: 28rpx;
			font-family: PingFang SC;
			font-weight: 500;
			color: #FFFFFF;
			line-height: 100rpx;
			text-align: center;
			margin-left: 50rpx;
			position: fixed;
			bottom:30rpx;
			z-index: 1000;
		}
	}
	/deep/.input-value-border{
		display :none !important;
	}
</style>
