<template>
<div>
    <header class="mui-bar mui-bar-nav">
			<h1 class="mui-title">携出申请详情</h1>
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
		</header>
		<div class="mui-content">
			 <div class="vongi-hy-tit mui-text-center bg-green" v-if="!info.releaseTime">
				<h1 class="flew-al"><i class="iconfont icon-chayanfanghang"></i>允许放行</h1>
			</div> 
			<div class="vongi-hy-tit mui-text-center bg-blue" v-if="info.releaseTime">
				<h1 class="flew-al"><i class="iconfont icon-tongguo"></i>已放行</h1>
			</div>
			<div class="vongi-hy-top">
				<div class="mui-content-padded vongi-qingjiadt mt-10">
					<form class="mui-input-group vongi-wybx">
						<div class="mui-input-row">
							<label>申请人</label>
							<span>{{info.name}}</span>
						</div>
						<div class="mui-input-row">
							<label>出厂日期</label>
							<span>{{info.date}}</span>
						</div>
						<div class="mui-input-row">
							<label style="width:100%">申请理由及物品清单</label> 
							<textarea id="textarea" rows="8" readonly="readonly"
							style="
							    width: 100%;
							    padding: 0 20px;
							"
							
							v-model="info.content"></textarea>
						</div>
						<div class="mui-input-row padd10">
							<label>图片附件</label>
							<span class="vongi-span vongi-wordcard vongi-meform-pho">
							<div class="fyy-upphoto flew"  v-if="info.images" >
								<div class="mui-col-xs-3"  v-for="(item,index) in info.images.split(',')">
									<img :src="item" v-viewer />
								</div>
								 
							</div>
						</span>
						</div>
					</form>
				</div>
				<div class="mui-content-padded vongi-qingjiadt mt-10">
					<form class="mui-input-group">
						<div class="mui-input-row">
							<label>申请时间</label>
							<span>{{info.createTime}}</span>
						</div>
					</form>
				</div>
				<examineDetail  :id="id" v-if="info.sp" class="mui-content-padded"></examineDetail>
			
				<div class="mui-content-padded vongi-qingjiadt mt-10" v-if="info.releaseTime">
					<form class="mui-input-group">
						<div class="mui-input-row">
							<label>放行时间</label>
							<span>{{info.releaseTime}}</span>
						</div>
						<div class="mui-input-row">
							<label>核验人</label>
							<span>{{info.releasePerson}}  {{info.releaseCompany}}</span>
						</div>
					</form>
				</div>
				<div class="vongi-btn vongi-login-btn"  v-if="!info.releaseTime&&$route.query.scan">
					<button class="mui-btn mui-btn-primary" @click="submit()">确认放行</button>
				</div>	
			</div>

		</div>
</div>
</template>


<script>
	import * as API from '@/apis-xsy/scan'
	import  Common from '$project/components/Common.vue'
	import Loading from '$project/components/Loading.vue'
	import TopHeader from '$project/components/TopHeader.vue'
	 import ExamineDetail from '$project/components/ExamineDetail.vue'
	 
	
	export default {
		name: '',
		components: {
			Common,
			Loading,ExamineDetail,
			TopHeader 
		},
		data() {
			return {
				id:this.$route.query.id,
				pageTitle: '申请调班',
				info:{},
				isLoading: false,
				 
			}
		},
		created() {
	 
		},
		methods: {
			
			 submit(){
				 this.isLoading = true;
				 
				 API.submit(this.id).then(response => {
				 	//this.info=response;
					this.getInfo();
					mui.toast("操作成功");
				 	this.isLoading = false;
				 }).catch(error => {
				 	this.isLoading = false;
				 	mui.toast(error);
				 })
			 },
			 
			getInfo(){
				this.isLoading = true;
					 
				API.carryThingsDetail(this.id).then(response => {
					this.info=response;
					this.info.sp=true
					this.isLoading = false;
				}).catch(error => {
					this.isLoading = false;
					mui.toast(error);
				})
			},
			asynCallBack() {
	
			},
		
		},
		mounted() {
			this.getInfo();
			
		},
		destroyed() {},
	
	}
</script>

<style src="$project/assets/css/iconfont.css"></style>
<style scoped src="$project/assets/css/xpwyfyy.css"></style>
<style src="$project/assets/css/xsy.css"></style>
<style>
</style>