<template>
	<div>
		<!-- 		<el-card class="box-card" style="height: 100%;">
 -->
		<!-- <div slot="header" class="clearfix"> -->
		<el-breadcrumb separator-class="el-icon-arrow-right">
			<el-breadcrumb-item>首页</el-breadcrumb-item>
			<el-breadcrumb-item :to="{ path: '/jc/routineMonitorqt' }">例行检测</el-breadcrumb-item>
			<el-breadcrumb-item :to="{ path: '/jc/setTask' }">执行任务</el-breadcrumb-item>
			<el-breadcrumb-item>抽样</el-breadcrumb-item>
			<el-breadcrumb-item>填报抽样单</el-breadcrumb-item>
		</el-breadcrumb>
		<div class="form">
			<el-form ref="form" :model="form" label-width="100px"
				style="margin-top: 20px;width: 48%;background-color: aliceblue;padding: 5px;">
				<el-row style="text-align: center; font-size: 23px; margin: 40px 0;">
					安徽省农业农村厅 农产品质量安全 例行检测 抽样单
				</el-row>
				<el-row>
					<el-col :span="12">
						<el-form-item label="样品名称" prop="sample_name" class="labelItem" size="mini" >
							<el-input disabled v-model="form.sample_name"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="11">
						<el-form-item label="样品编码" prop="sample_id" class="labelItem" style="" size="mini">
							<el-input disabled v-model="form.sample_id"></el-input>
						</el-form-item>
					</el-col>
				</el-row>
				<el-row>
					<el-col :span="12">
						<el-form-item label="商标" prop="brand" class="labelItem" size="mini">
							<el-input disabled v-model="form.brand"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="11">
						<el-form-item label="包装" prop="ispack" class="labelItem" style="" size="mini">
							<el-input disabled v-model="form.ispack"></el-input>
						</el-form-item>
					</el-col>
				</el-row>
				<el-row>
					<el-col :span="12">
						<el-form-item label="型号规格" prop="type" class="labelItem" size="mini">
							<el-input disabled v-model="form.type"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="11">
						<el-form-item label="执行标准" prop="standard" class="labelItem" style="" size="mini">
							<el-input disabled v-model="form.standard"></el-input>
						</el-form-item>
					</el-col>
				</el-row>
				<el-row>
					<el-col :span="12">
						<el-form-item label="生产日期或批号" prop="production_date" class="labelItem" size="mini" >
							<el-input disabled v-model="form.production_date"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="11">
						<el-form-item label="产地" prop="place" class="labelItem" style="" size="mini">
							<el-input disabled v-model="form.place"></el-input>
						</el-form-item>
					</el-col>
				</el-row>
				<el-row>
					<el-col :span="12">
						<el-form-item label="产品认证情况" prop="certicfie" class="labelItem" size="mini" >
						<el-input disabled v-model="form.certicfie"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="11">
						<el-form-item label="证书编号" prop="certifie_num" class="labelItem" style="" size="mini">
							<el-input disabled v-model="form.certifie_num"></el-input>
						</el-form-item>
					</el-col>
				</el-row>
				<el-row>
					<el-col :span="12">
						<el-row>
							<el-col :span="13">
								<el-form-item label="抽样数量" prop="sample_renum" class="labelItem" size="mini" >
									<el-input disabled v-model="form.sample_renum"></el-input>
								</el-form-item>
							</el-col>
							<el-col :span="10">
								<el-form-item label="单位" prop="sample_num_unit" class="labelItem" size="mini" 
									label-width="60px">
									<el-input disabled v-model="form.sample_num_unit"></el-input>
								</el-form-item>
							</el-col>
						</el-row>
					</el-col>
					<el-col :span="11">
						<el-row>
							<el-col :span="13">
								<el-form-item label="抽样基数" prop="sample_base" class="labelItem" size="mini" >
									<el-input disabled v-model="form.sample_base"></el-input>
								</el-form-item>
							</el-col>
							<el-col :span="10">
								<el-form-item label="单位" prop="sample_base_unit" class="labelItem" size="mini" 
									label-width="60px" clearable>
									<el-input disabled v-model="form.sample_base_unit"></el-input>
								</el-form-item>
							</el-col>
						</el-row>
					</el-col>
				</el-row>
				<el-row>
					<el-col>
						<el-form-item label="抽样场所" prop="sample_ground" class="labelItem" size="mini" >
							<el-input disabled v-model="form.sample_ground"></el-input>
						</el-form-item>
					</el-col>
				</el-row>
				<el-row>
					<el-col :span="7"
						style="text-align: center;vertical-align: middle;line-height: 250px;font-size: 14px;">
						<div class="">
							受检单位情况
						</div>
					</el-col>
					<el-col :span="15">
						<el-form-item label="单位名称" prop="units_name" class="labelItem" style="" size="mini" >
							<el-input disabled v-model="form.units_name"></el-input>
						</el-form-item>
						<el-form-item label="通讯地址" prop="address" class="labelItem" style="" size="mini" >
							<el-input disabled v-model="form.address"></el-input>
						</el-form-item>
						<el-form-item label="法定代表人" prop="corporation" class="labelItem" style="" size="mini" >
							<el-input disabled v-model="form.corporation"></el-input>
						</el-form-item>
						<el-form-item label="受检人" prop="user_name" class="labelItem" style="" size="mini" >
							<el-input disabled v-model="form.user_name"></el-input>
						</el-form-item>
						<el-form-item label="电话" prop="phone" class="labelItem" style="" size="mini">
							<el-input disabled v-model="form.phone"></el-input>
						</el-form-item>
						<el-form-item label="传真" prop="fax" class="labelItem" style="" size="mini">
							<el-input disabled v-model="form.fax"></el-input>
						</el-form-item>
					</el-col>
				</el-row>
			</el-form>
			<el-form ref="form" :model="form" label-width="110px"
				style="margin-top: 20px;width: 48%;background-color: aliceblue;padding:10px 1px 1px 10px;">
				<el-row>
					<el-col :span="7"
						style="text-align: center;vertical-align: middle;line-height: 250px;font-size: 14px;">
						<div class="">
							生产单位情况
						</div>
					</el-col>
					<el-col :span="15">
						<el-form-item label="生产类型" prop="production_class" class="labelItem" style="" size="mini" >
							<el-input disabled v-model="form.production_class"></el-input>
						</el-form-item>
						<el-form-item label="单位名称" prop="production_name" class="labelItem" style="" size="mini"
							>
							<el-input disabled v-model="form.production_name"></el-input>
						</el-form-item>
						<el-form-item label="通讯地址" prop="p_address" class="labelItem" style="" size="mini" >
							<el-input disabled v-model="form.p_address"></el-input>
						</el-form-item>
						<el-form-item label="邮编" prop="postcode" class="labelItem" style="" size="mini">
							<el-input disabled v-model="form.postcode"></el-input>
						</el-form-item>
						<el-form-item label="联系人" prop="user_name" class="labelItem" style="" size="mini" >
							<el-input disabled v-model="form.user_name"></el-input>
						</el-form-item>
						<el-form-item label="电话" prop="phone" class="labelItem" style="" size="mini">
							<el-input disabled v-model="form.phone"></el-input>
						</el-form-item>
						<el-form-item label="传真" prop="fax" class="labelItem" style="" size="mini">
							<el-input disabled v-model="form.fax"></el-input>
						</el-form-item>
					</el-col>
				</el-row>
				<el-row>
					<el-col :span="7"
						style="text-align: center;vertical-align: middle;line-height: 250px;font-size: 14px;">
						<div class="">
							抽样单位情况
						</div>
					</el-col>
					<el-col :span="15">
						<el-form-item label="单位名称" prop="sample_unit_name" class="labelItem" style="" size="mini"
							>
							<el-input disabled v-model="form.sample_unit_name"></el-input>
						</el-form-item>
						<el-form-item label="联系人" prop="sample_unit_user" class="labelItem" style="" size="mini"
							>
							<el-input disabled v-model="form.sample_unit_user"></el-input>
						</el-form-item>
						<el-form-item label="通讯地址" prop="sample_unit_address" class="labelItem" style="" size="mini"
							>
							<el-input disabled v-model="form.sample_unit_address"></el-input>
						</el-form-item>
						<el-form-item label="邮编" prop="sample_unit_postcode" class="labelItem" style="" size="mini">
							<el-input disabled v-model="form.sample_unit_postcode"></el-input>
						</el-form-item>
						<el-form-item label="联系电话" prop="sample_unit_phone" class="labelItem" style="" size="mini">
							<el-input disabled v-model="form.sample_unit_phone"></el-input>
						</el-form-item>
						<el-form-item label="传真" prop="sample_unit_fax" class="labelItem" style="" size="mini">
							<el-input disabled v-model="form.sample_unit_fax"></el-input>
						</el-form-item>
						<el-form-item label="Email" prop="sample_unit_email" class="labelItem" style="" size="mini">
							<el-input disabled v-model="form.sample_unit_email"></el-input>
						</el-form-item>
					</el-col>
				</el-row>
				<el-row>
					<el-form-item label="检测任务依据" prop="base" class="labelItem" style="" size="mini" >
						<el-input disabled v-model="form.base"></el-input>
					</el-form-item>
				</el-row>
				<el-row>
					<el-form-item label="抽样时间" prop="sample_date" class="labelItem" style="" size="mini" >
					<el-input disabled v-model="form.sample_date"></el-input>
					</el-form-item>
				</el-row>
				<el-row>
					<el-form-item label="被抽检单位签字盖章附件" prop="filr_url" class="labelItem" style="" size="mini">
					<el-link type="primary" :href="form.file_url">{{form.file_name}}</el-link>	
					</el-form-item>
				</el-row>
				<el-form-item>
					<el-button type="primary" @click="back">返回抽样列表</el-button>
				</el-form-item>
			</el-form>
		</div>
		<!-- </el-card> -->
	</div>
</template>

<script>
	const token = window.sessionStorage.getItem('token')

	export default {
		name: 'sampleDetail',
		data() {
			return {
				form: {},
			}
		},
		created() {
			this.id = this.$route.params.id
			this.getSampleDetail()
		},
		methods: {
			// 获取样本详情
			async getSampleDetail() {
				const result = await this.$http.post('getSampleDetail', {
					sample_id: this.id
				})
				if (result.data.code == 0) {
					this.form = result.data.data
				}
			},
			// 返回
			back() {
				var that = this
				this.$router.push({
					name: 'setTask',
					params: {
						id: that.id
					}
				})
			}
		},
	}
</script>

<style lang="less" scoped>
	.form {
		display: flex;
		flex-direction: row;
		justify-content: space-between;
	}

	/* 	.el-form {
	
		
	} */
</style>
