<template>
	<div>
		<el-breadcrumb separator-class="el-icon-arrow-right">
			<el-breadcrumb-item :to="{ path: '/jc/workbench' }">首页</el-breadcrumb-item>
			<!-- <el-breadcrumb-item :to="{ path: '/jc/setTaskcd'}">例行检测</el-breadcrumb-item> -->
			<!-- <el-breadcrumb-item>承担单位</el-breadcrumb-item>
			<el-breadcrumb-item :to="{ path: '/jc/routineMonitor' }">例行检测</el-breadcrumb-item>
			<el-breadcrumb-item>执行任务</el-breadcrumb-item>
			 :to="{ path: '/jc/setTaskcd' }"
			<el-breadcrumb-item>抽样</el-breadcrumb-item> -->
			<el-breadcrumb-item>填报抽样单</el-breadcrumb-item>
		</el-breadcrumb>
		<div id="sjinformation">
			<el-steps :active="active" finish-status="finish" style="width:70%; margin:auto;">
			<!-- <el-step title="步骤 1" description="填报抽样单编号"></el-step> -->
			<el-step title="步骤 1" description="填报受检单位信息"></el-step>
			<el-step title="步骤 2" description="填报样品信息"></el-step>
			<el-step title="步骤 3" description="填报抽样单信息"></el-step>
			</el-steps>
		</div>
		<!-- 受检单位信息 -->
		<div id="sjinformation" style="margin:40px auto; width:50%" v-show="active == 1">
			<el-form :rules="rules" :model="inspected_Unit">
				<el-form-item label="单位名称:" prop="inspected_name" class="labelItem">
					<el-input v-model="inspected_Unit.inspected_name" style="width:60%"></el-input>
				</el-form-item>
				<el-form-item label="单位地址:" prop="inspected_address" class="labelItem">	
						<el-cascader placeholder="请选择地区" :options="options" v-model="selectedOptions" @change="handleChange" style="width:25%">
						</el-cascader>
						<el-input v-model="inspected_Unit.inspected_address2" placeholder="请输入详细地址" style="width:34.5%;margin-left:5px;"></el-input>
				</el-form-item>
				
				<!-- <el-form-item label="" prop="inspected_address2" class="labelItem">	
						<el-input v-model="inspected_Unit.inspected_address" placeholder="请输入详细地址" style="width:42%"></el-input>
				</el-form-item> -->
				<el-form-item label="联系人:" prop="contact_name" class="labelItem">
					<el-input v-model="inspected_Unit.contact_name" style="width:60%"></el-input>
				</el-form-item>
				<el-form-item label="联系电话:" prop="contact_phone" class="labelItem">
					<el-input v-model="inspected_Unit.contact_phone" style="width:60%"></el-input>
				</el-form-item>
				<el-form-item label="Email:" prop="contact_email" class="labelItem">
					<el-input v-model="inspected_Unit.contact_email" style="width:60%"></el-input>
				</el-form-item>
			</el-form>

			<div class="footer">
				<el-button type="primary" style="margin-bottom:30px;" size="small" @click="next1()">下一步</el-button>
			</div>
		</div>
		<!-- 样品信息 -->
		<div style="width: 90%; margin:40px auto;" v-show="active == 2">
			<!-- 新增 -->
			<!-- <el-row :gutter="90" style="margin-right: 0px;"> -->
				<div style="display: flex;flex-direction: row;float: right; margin-bottom:20px;">
					<el-button type="primary" size="small" plain icon="el-icon-plus" @click="addSampleInforDialog = true;">新增</el-button>
				</div>
			<!-- </el-row> -->
				<!--  表格数据区域-->
			<el-table ref="multipleTable" :data="tableData" border stripe highlight-current-row style="width: 100%; margin:auto;"
				:row-style="rowStyle" :cell-style="cellStyle">
				<el-table-column type="selection" width="50"></el-table-column>
				<el-table-column label="序号" width="50px">
					<template slot-scope="scope">
						{{ scope.$index+1 }}
					</template>
				</el-table-column>

				<el-table-column :key="table.label" v-for="table in tableHeader" :label="table.label" :prop="table.prop"
					align="center" :width="table.width" :fixed="table.fixed" />
				<el-table-column label="操作" align="center">
						<template slot-scope="scope">
						<el-col style="margin-bottom: 5px;">
							<el-button type="primary" size="mini" @click="deleteSample(scope.row.id)">删除</el-button>
						</el-col>
					</template>
				</el-table-column>
			</el-table>
			<el-pagination style="margin-top:20px;" @size-change="handleSizeChange" @current-change="handleCurrentChange"
				:current-page="queryInfo.currentPage" :page-sizes="[10, 20, 30, 40]" :page-size="queryInfo.pageSize"
				layout="total, sizes, prev, pager, next, jumper" :total="total">
			</el-pagination>

			<div class="footer">
				<el-button type="primary" style="margin-bottom:30px;" size="small" @click="next2()">下一步</el-button>
			</div>

		</div>
		<div id="sjinformation" style="margin:40px auto; width:40%" v-show="active == 3">
			<el-form :rules="rules2" :model="sample_unit">
				<el-form-item label="抽样单编号:" prop="cyd_code" class="labelItem">
					<el-input v-model="sample_unit.cyd_code" style="width:65%"></el-input>
				</el-form-item>

					<el-form-item label="抽样地点:" prop="sample_address" class="labelItem">	
						<el-cascader placeholder="请选择地区" :options="options" v-model="selectedOptions1" @change="handleChange1" style="width:28%">
						</el-cascader>
						<el-input v-model="sample_unit.sample_address2" placeholder="请输入详细地址" style="width:36%;margin-left:5px;"></el-input>
				</el-form-item>

				<el-form-item label="抽样人员1:" prop="sample_person_one" class="labelItem">
					<el-input v-model="sample_unit.sample_person_one" style="width:65%"></el-input>
				</el-form-item>
				<el-form-item label="抽样人员2:" prop="sample_person_two" class="labelItem">
					<el-input v-model="sample_unit.sample_person_two" style="width:65%"></el-input>
				</el-form-item>
				<el-form-item label="抽样单日期:" prop="cyd_date" class="labelItem">
					<el-date-picker v-model="sample_unit.cyd_date" style="width:65%;" align="right" type="date" clearable />
				</el-form-item>
				<el-form-item label="备注:" prop="cyd_log" class="labelItem">
					<el-input v-model="sample_unit.cyd_log" style="width:65%"></el-input>
				</el-form-item>
			</el-form>
			<el-form>
				<el-form-item label="抽样单报告上传:" prop="sample_unit" class="labelItem">
					<el-upload
						class="upload-demo"
						:headers="myHeaders"
						action='http://syjcapi.aielab.net/api/v1/ossUpload'
						:on-preview="handlePreview"
						:on-remove="handleRemove"
						:before-remove="beforeRemove"
						:on-success="uploadSuccess"
						multiple
						:file-list="fileList">
						<el-button size="small" type="primary">点击上传</el-button>
						<div slot="tip" class="el-upload__tip">只能上传pdf文件，且不超过500kb</div>
					</el-upload>
				</el-form-item>
			</el-form>
						<div class="footer">
				<el-button type="primary" style="margin-bottom:30px;" size="small" @click="next3()">完成</el-button>
			</div>
		</div>
			<!-- <div class="footer">
				<el-button v-if="active > 1" type="success" style="margin:auto;" @click="pre">上一步</el-button>
				<el-button v-if="active < 3" type="success" style="margin-right:20px;" @click="next">下一步</el-button>
			</div> -->

		<!-- 新增样品信息弹框 -->
		<el-dialog title="新增样品信息" :visible.sync="addSampleInforDialog" width="40%" :close-on-click-modal="false" class="dialogItem" append-to-body>
		<el-form id="addSample" ref="form" :rules="rules1" :model="product_Unit">
				<el-form-item label="样品名称:" prop="sample_name" class="labelItem">
					<el-input v-model="product_Unit.sample_name" style="width:42%;"></el-input>
				</el-form-item>
				<!-- <el-form-item label="样品编号:" prop="releaser" class="labelItem" required>
					<el-input v-model="" style="width:42%"></el-input>
				</el-form-item> -->
				<!-- <el-form-item label="抽样地点:" prop="sample_name" class="labelItem">
					<el-input v-model="product_Unit.sample_name" style="width:42%"></el-input>
				</el-form-item> -->
				<el-form-item label="样品商标:" prop="sample_brand" class="labelItem">
					<el-input v-model="product_Unit.sample_brand" style="width:42%"></el-input>
				</el-form-item>
				<el-form-item label="规格型号:" prop="sample_type" class="labelItem">
					<el-input v-model="product_Unit.sample_type" style="width:42%"></el-input>
				</el-form-item>
				<el-form-item label="生产日期:" prop="sample_md_date" class="labelItem">
					<el-date-picker v-model="product_Unit.sample_md_date" style="width: 42%;" align="right" type="date"
						:picker-options="pickerOptions" clearable />
				</el-form-item>
				<el-form-item label="质量等级:" prop="sample_quality_grade" class="labelItem">
					<el-input v-model="product_Unit.sample_quality_grade" style="width:42%"></el-input>
				</el-form-item>
				<el-form-item label="标称生产者名称:" prop="sample_product_name" class="labelItem">
					<el-input v-model="product_Unit.sample_product_name" style="width:42%"></el-input>
				</el-form-item>
				<el-form-item label="标称生产者联系电话:" prop="sample_product_phone" class="labelItem">
					<el-input v-model="product_Unit.sample_product_phone" style="width:42%"></el-input>
				</el-form-item>
				<el-form-item label="样品来源:" prop="sample_source" class="labelItem">
					<el-input v-model="product_Unit.sample_source" style="width:42%"></el-input>
				</el-form-item>
				<el-form-item label="抽样数量:" prop="sample_count" class="labelItem">
					<el-input v-model="product_Unit.sample_count" style="width:42%"></el-input>
				</el-form-item>
				<el-form-item label="抽样基数:" prop="sample_base" class="labelItem">
					<el-input v-model="product_Unit.sample_base" style="width:42%"></el-input>
				</el-form-item>
				<el-form-item label="抽样时间:" prop="sample_ing_date" class="labelItem">
					<el-date-picker v-model="product_Unit.sample_ing_date" style="width: 42%;" align="right" type="date" clearable />
				</el-form-item>
				<el-form-item label="备注:" prop="sample_log" class="labelItem">
					<el-input v-model="product_Unit.sample_log" style="width:42%"></el-input>
				</el-form-item>
			</el-form>
			<div class="footer">
				<el-button type="primary" style="margin-bottom:30px;" size="small" @click="postSample('form')">确定</el-button>
			</div>
		</el-dialog>
</div>
<!-- 底部按钮 -->
		<!-- <el-form>
				<el-form-item class="btn">
					<el-button type="primary" @click="back()">返回任务详情</el-button>
					<el-button @click="resetForm()">重置</el-button>
					<el-button @click="onSubmit">保存，继续添加</el-button>
				</el-form-item>
			</el-form> -->
			<!-- <el-form ref="form1" :model="form" label-width="110px"
				style="margin-top: 20px;width: 48%;background-color: aliceblue;padding:10px 1px 1px 10px;">
			</el-form> -->
		<!-- </el-card> -->
</template>

<script>
	const token = window.sessionStorage.getItem('token')
	import {
		provinceAndCityData,
		regionData,
		provinceAndCityDataPlus,
		regionDataPlus,
		CodeToText,
		TextToCode
	} from 'element-china-area-data'
	export default {
		name: 'inputSample',
		data() {
			// 电话号码验证
			var checkNumber = (rule, value, callback) => {
			// const phoneReg = /^1[3|4|5|7|8][0-9]{9}$/
			// if (!value) {
			// return callback(new Error('电话号码不能为空'))
			// }
			setTimeout(() => {
			// Number.isInteger是es6验证数字是否为整数的方法,实际输入的数字总是识别成字符串
			// 所以在前面加了一个+实现隐式转换
		
			if (!Number.isInteger(+value)) {
				callback(new Error('请输入数字值'))
			}
			//  else {
			// 	if (phoneReg.test(value)) {
			// 	callback()
			// 	} else {
			// 	callback(new Error('电话号码格式不正确'))
			// 	}
			// }
			}, 100)
			}

			// 邮箱验证
			 var checkEmail = (rule, value, callback) => {
				const regEmail = /^\w+@\w+(\.\w+)+$/
				if (regEmail.test(value)) {
					// 合法邮箱
					return callback()
				}
				callback(new Error('请输入合法邮箱'))
				}

			return {
				active: 1,
				addSampleInforDialog: false,
				total: 0,
				cellStyle: {
					padding: 2 + 'px'
				},
				rowStyle: {
					height: 35 + 'px'
				},

				rules: {
                	inspected_name: [{required: true, message: '请输入单位名称', trigger: 'blur'},],
					// inspected_address: [{required: true, message: '请输入单位地址', trigger: 'blur'},],
					contact_name: [{required: true, message: '请输入联系人', trigger: 'blur'},],
					contact_phone: [{required: true, message: '请输入联系电话', trigger: 'blur'},
									{validator: checkNumber, trigger: 'blur' }],
					contact_email:[{required: true, message: '请输入联系电话', trigger: 'blur'},
									{validator: checkEmail, trigger: 'blur' }]
						},
				rules1: {
                	sample_name: [{required: true, message: '请输入样品名称', trigger: 'blur'},],
					sample_brand: [{required: true, message: '请输入样品商标', trigger: 'blur'},],
					sample_type: [{required: true, message: '请输入规格型号', trigger: 'blur'},],
					sample_md_date: [{required: true, message: '请输入生产日期', trigger: 'blur'},],
					sample_quality_grade: [{required: true, message: '请输入质量等级', trigger: 'blur'},],
					sample_product_name: [{required: true, message: '请输入标称生产者名称', trigger: 'blur'},],
					sample_product_phone: [{required: true, message: '请输入标称生产者联系电话', trigger: 'blur'},],
					sample_source: [{required: true, message: '请输入样品来源', trigger: 'blur'},],
					sample_count: [{required: true, message: '请输入抽样数量', trigger: 'blur'},
									{validator: checkNumber, trigger: 'blur' }],
					sample_base: [{required: true, message: '请输入抽样基数', trigger: 'blur'},
									{validator: checkNumber, trigger: 'blur' }],
					sample_ing_date: [{required: true, message: '请输入抽样时间', trigger: 'blur'},],
						},
				rules2: {
                	cyd_code: [{required: true, message: '请输入抽样单编号', trigger: 'blur'},],
					sample_person_one: [{required: true, message: '请输入抽样人员姓名', trigger: 'blur'},],
					sample_person_two: [{required: true, message: '请输入抽样人员姓名', trigger: 'blur'},],
					cyd_date: [{required: true, message: '请输入抽样单日期', trigger: 'blur'},],
						},
				tableHeader: [{
						label: '样品名称',
						prop: 'sample_name'
						// fixed: 'left'
					},
					// {
					// 	label: '样品编号',
					// 	prop: 'year'
					// 	// fixed: 'left'
					// }, 
					{
						label: '样品来源',
						prop: 'sample_source',
						// fixed: 'left'
					},
					{
						label: '抽样数量',
						prop: 'sample_count'
					},
					{
						label: '抽样基数',
						prop: 'sample_base'
					},
					{
						label: '生产日期',
						prop: 'sample_md_date'
					},
					{
						label: '备注',
						prop: 'sample_log'
					}

				],
				// 产地
				options: regionData,
				selectedOptions: [],
				//抽样地点
				selectedOptions1: [],
				// 数据表格数据
				tableData: [],
				// 批量删除选中数据
				multipleSelection: [],
				myHeaders: {
					Authorization: 'bearer' + token
				},
				queryInfo:{
					pageSize:10,
					pageNum:1,
				},
				fileList: [],
				form: {},
				// 抽样单id
				cyd_id: '',
				cyd_code: '',//抽验单编号
				cyd_data: {},//抽样单信息上部分
				inspected_Unit: {
					inspected_name: '',
					inspected_address: '',
					contact_name: '',
					contact_phone: '',
					contact_email: ''
				},//受检单位信息
				product_Unit: {
					sample_name: '',
					sample_brand: '',
					sample_type: '',
					sample_md_date: '',
					sample_quality_grade: '',
					sample_product_name: '',
					sample_product_phone: '',
					sample_source: '',
					sample_count: '',
					sample_base: '',
					sample_ing_date: '',
					sample_log: ''
				},//样品信息
				sample_unit: {
					cyd_code: '',
					sample_person_one: '',
					sample_person_two: '',
					cyd_date: '',
					cyd_log: '',
					file_url: '',
					file_name: ''
				},//填报抽样单最后一步
				units: [],
				production: [],
				// 样品下拉框
				sampleList: [],
				task_id: '',
				undertake_id: '',
				// 产地
				options: regionData[11].children,
				selectedOptions: [],
				// 日期选择器快捷选项
				pickerOptions: {
					disabledDate(time) {
						return time.getTime() > Date.now();
					},
					shortcuts: [{
						text: '今天',
						onClick(picker) {
							picker.$emit('pick', new Date());
						}
					}, {
						text: '昨天',
						onClick(picker) {
							const date = new Date();
							date.setTime(date.getTime() - 3600 * 1000 * 24);
							picker.$emit('pick', date);
						}
					}, {
						text: '一周前',
						onClick(picker) {
							const date = new Date();
							date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
							picker.$emit('pick', date);
						}
					}]
				},
			}
		},
		created() {
			this.task_id = this.$route.params.task_id
			this.task_profile_id = this.$route.params.under_id
			console.log(this.task_id)
			console.log(this.task_profile_id)
			this.getCydObj()
			console.log(regionData)
			console.log(regionData[11])

		},
		methods: {
			// // 步骤条下一步
			// next() {
			// 	if(this.active == 1){
			// 		this.getSamples()
			// 	}
			// 	if(this.active++ >2) this.active = 1

			// 	},
			// // 步骤条上一步
			// pre() {
			// 		if(this.active == 3){
			// 		this.getSamples()
			// 	}
			// 	if(this.active-- <2) this.active = 1
			// 	},
			//填报抽样单第一步页面中的下一步
			async next1(){
				 this.$confirm('保存后不可修改, 是否继续?', '提示', {
					confirmButtonText: '确定',
					cancelButtonText: '取消',
					type: 'warning'
					}).then(() => {
					this.postInspectedUnit()
					this.$message({
						type: 'success',
						message: '受检单位信息保存成功!'
					});
					this.active = 2	
					}).catch(() => {
					this.$message({
						type: 'info',
						message: '已取消保存'
					});       
					});
				
			},
			async next2(){
				this.$confirm('保存后不可继续添加样品信息, 是否继续?', '提示', {
					confirmButtonText: '确定',
					cancelButtonText: '取消',
					type: 'warning'
					}).then(() => {
					this.$message({
						type: 'success',
						message: '样品信息保存成功!'
					});
					this.active = 3	
					}).catch(() => {
					this.$message({
						type: 'info',
						message: '已取消保存'
					});  
					});
			},
				async next3(){
				this.$confirm('是否确认完成抽样单填报?', '提示', {
					confirmButtonText: '确定',
					cancelButtonText: '取消',
					type: 'warning'
					}).then(() => {
						this.$message({
							type: 'success',
							message: '抽样单保存成功!'
						});
						this.postCydProfile()
					}).catch(() => {
					this.$message({
						type: 'info',
						message: '已取消保存'
					});  
					});
			},
			// //新增样品信息弹框
			// async addData() {
			// 	this.addSampleInforDialog = true;
			// },
			//获取抽样单id
			async getCydObj() {
				const res = await this.$http.post('getCydObj',{
					task_id:this.task_id,
					task_profile_id:this.task_profile_id
					})
				console.log(res)
				this.cyd_id = res.data.data.cyd_id
				console.log(this.cyd_id)
			},
			//保存受检单位信息
			async postInspectedUnit() {
				var that = this
				that.inspected_Unit['cyd_id'] = that.cyd_id
				console.log()
				that.inspected_Unit.inspected_address = that.inspected_Unit.inspected_address1 + that.inspected_Unit.inspected_address2
				console.log(that.inspected_Unit.inspected_address)
				const res = await this.$http.post('postInspectedUnit',that.inspected_Unit)
				console.log(res)
				// 判断业务逻辑
				// if (result.data.code == 0) {
				// 		this.$message({
				// 			type: 'success',
				// 			message: '提交成功!'
				// 		});
				// 	this.$router.push('jcobj')
				// }
			},
			//保存样品信息
			async postSample(formName){
				var that = this
				that.product_Unit['cyd_id'] = that.cyd_id
				const res = await this.$http.post('postSample',that.product_Unit)
				console.log(res.data.message)
				console.log(res.data.code)
				if (res.data.code !== 0) {
					this.$message({
						type: 'error',
						message: res.data.message
					});
				} else {
					this.addSampleInforDialog = false
					this.$refs[formName].resetFields();
					console.log(that.product_Unit)
					this.getSamples()
				}
			
			},
			//保存最后一步上传报告备注
			async postCydProfile(){
				var that = this
				that.sample_unit['cyd_id'] = that.cyd_id
				that.sample_unit.sample_address = that.sample_unit.sample_address1 + that.sample_unit.sample_address2
				const res = await this.$http.post('postCydProfile',that.sample_unit)
				const result = await this.$http.post('postCyd',{
					cyd_id: that.cyd_id,
					cyd_code: that.sample_unit.cyd_code})
				console.log(result)
				console.log(res)
				this.$router.push({
					name: 'setTaskcd',
					params: {
						id: that.task_id,
					}
					});
			},
			//填报抽样单样品删除
			async deleteSample(id) {
				const res = await this.$http.post('deleteSample',{sample_id: id})
				this.getSamples()
			},
			//上传文件
			 handleRemove(file, fileList) {
				console.log(file, fileList);
			},
			handlePreview(file) {
				console.log(file);
			},
			beforeRemove(file, fileList) {
				return this.$confirm(`确定移除 ${ file.name }？`);
			},

			// 上传成功
			uploadSuccess(res) {
				console.log(res.data)
				this.sample_unit.file_url = res.data.fileUrl
				this.sample_unit.file_name = res.data.fileName
				console.log(this.sample_unit.file_url)
				console.log(this.sample_unit.file_name)
			},
			//填报抽样单样品信息分页
			handleSizeChange(val) {
				this.queryInfo.pageSize = val;
				console.log(`每页 ${val} 条`);
			},
			//填报抽样单样品信息分页
			handleCurrentChange(val) {
				this.queryInfo.pageNum = val;
				console.log(`当前页: ${val}`);
				this.gettaskList()
			},
			//获取抽样单样品信息列表
			async getSamples(){
				var that = this
				that.queryInfo['cyd_id'] = that.cyd_id
				const res = await this.$http.post('getSamples',that.queryInfo)
				console.log(res.data.data.rows)
				that.tableData = res.data.data.rows
				that.total = res.data.data.total
			},
			// 获取样本列表
			// 生成样品编码
			// 获取受检单位地址
			handleChange() {
				var that = this
				var loc = "";
				console.log(this.selectedOptions)
				for (let i = 0; i < this.selectedOptions.length; i++) {
					loc += CodeToText[this.selectedOptions[i]];
				}
				console.log(loc)
				that.inspected_Unit.inspected_address1 = loc
				console.log(that.inspected_Unit.inspected_address1)
			},
			// 获取抽样地址
			handleChange1() {
				var that = this
				var loc = "";
				console.log(this.selectedOptions1)
				for (let i = 0; i < this.selectedOptions1.length; i++) {
					loc += CodeToText[this.selectedOptions1[i]];
				}
				console.log(loc)
				that.sample_unit.sample_address1 = loc
				console.log(that.sample_unit.sample_address1)
			},
			// 上传成功(要确认数据)
			// uploadSuccess(res) {
			// 	console.log(res.data)
			// 	this.cyd_data.file_url = res.data.fileUrl
			// 	this.cyd_data.file_name = res.data.fileName
			// },
			// async onSubmit() {
			// 	console.log(this.cyd_data.sample_name)
			// 	var that = this
			// 	console.log(that.cyd_data)
			// 	that.cyd_data.task_id = that.task_id
			// 	that.cyd_data.undertake_id = that.undertake_id
			// 	that.form.cyd_data = that.cyd_data
			// 	that.form.unit_test = that.unit_test
			// 	that.form.unit_production = that.unit_production
			// 	that.form.unit_sample = that.unit_sample
			// 	console.log(that.form)
			// 	const result = await this.$http.post('saveSample', this.form)
			// 	if (result.data.code == 0) {
			// 		// that.form.sample_id = result.data.data.id
			// 		this.$message({
			// 			type: 'success',
			// 			message: '提交抽样单成功!'
						
			// 		});
			// 	}
			// },
			// 重置表单
			// resetForm() {
			// 	console.log(this.form)
			// 		this.cyd_data = '';
			// 		this.unit_test = '';
			// 		this.unit_production = '';
			// 		this.unit_sample = '';
			// 		this.selectedOptions = '';
			// },
			// 返回
			// back() {
			// 	var that = this
			// 	console.log(that.task_id)
			// 	this.$router.push({
			// 		name: 'setTaskcd',
			// 		params: {
			// 			id: that.task_id
			// 		}
			// 	})
			// }
		},
	}
</script>

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

	.el-descriptions {
		width: 80%;
		margin: auto;
	}

	/deep/ .el-descriptions__title {
		margin: auto;
		font-size: 1.25rem;
		// font-weight: 31.25rem !important;
	}
	.btn{
		margin-top:20px ;
		// float: right;
		text-align: center;
	}
	.dialogItem /deep/ .el-dialog__body {
		padding: 15px 12px 0;
		color: #606266;
		font-size: 14px;
		word-break: break-all;
	}
	/deep/ #sampleReport{
		.el-descriptions-item__label.is-bordered-label{
		width: 15rem;}
	}
	/deep/ #sjinformation{
		.el-form-item__label{
			width: 14%;
		}
		.el-form-item__error{
		left:9.0625rem;
	}
		.el-upload__tip{
			margin-left: 7.5rem;
		}
		.el-upload-list__item-name{
			margin-left: 7.8125rem
		}
		.labelItem{
			width: 130%;
		}
	
	}
	.footer {
		margin-left: 45%;
		margin-top: 20px;
	}
	/deep/ #addSample{
		width: 80%;
		margin: auto;
		.el-form-item__label{
			width: 17%;
		}
		.el-form-item__error{
		left:155px;
	}
	.labelItem{
		width: 160%;
	}
	}
</style>
