<!-- 资质审核-->
<template>
    <view id="register">
		<viwe v-if="auditStatus==1" class="tip">已通过审核...</viwe>
		<viwe v-if="auditStatus==2 || auditStatus==0" 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_manage/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_manage/images/Version3.0/icon_zgsq_dhh.png">
				<view>联系方式：</view>
				<input v-model="form.phone" disabled  type="text" >
			</view>
		</view>
		<view class="register_li" v-if="status=='zg'">
			<view class="register_li_min" v-for="(item,index) in form.airBottlelist" style="border-bottom:0;" >
				<view></view>
				<view>{{item.airName}}-{{item.configName}}：</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.startTime" disabled  type="text" >
			</view>
			<view class="register_li_min">
			    <view></view>
				<view>使用期限-结束：</view>
				<input v-model="form.endTime" disabled  type="text" >
			</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 {auditDetail,qualificationDetail} from '@/api/index.js'
	import { config } from '@/api/request/config.js'
    export default {
        data() {
            return {
				baseUrl:config.base_url,
				form:{},
				id:'',
				status:null,
				auditStatus:null,// 0 未审核 1.通过 2.驳回）
            }
        },
        onLoad(option) {
			if(decodeURIComponent(option.item)){
				this.id=JSON.parse(decodeURIComponent(option.item)).id;
				this.status=JSON.parse(decodeURIComponent(option.item)).remark;
				this.auditStatus=JSON.parse(decodeURIComponent(option.item)).auditStatus;
			}
			if(this.status=='yq'){
				wx.setNavigationBarTitle({
				  title: '用气申请',
				})
			}else if(this.status=='zg'){
				wx.setNavigationBarTitle({
				  title: '资格申请',
				})
			}

        },
        onShow(){
        },

        methods: {
			//获取详情
			async getInfo(){
			    let _this = this;
				if(this.status=='yq'){
					const {data} = await auditDetail({id:this.id})
					if(data.code==200){
						let res=data.data
						_this.form=res.apply;
						_this.form.airBottlelist=res.airBottlelist
					}
				}else if(this.status=='zg'){
					const {data} = await qualificationDetail({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.redirectTo({
				    url:'/pages_manage/examination/examinationAdd?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(1,204,39,0.2);
			font-size: 28rpx;
			font-family: PingFang SC;
			font-weight: 500;
			color: #01CC27;
			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;
				}


			}
			.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>
