<template>
	<el-form class="content-main" label-width="240px" :model="formQuery" :rules="rules" ref="formQuery">
		<el-row>
			<el-col :span="12">
				<el-form-item label="单位名称:">
					<el-input class="inputWidth" :disabled="showLock" v-model="formQuery.qymc"></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="12">
				<el-form-item label="单位代码:">
					<el-input class="inputWidth" :disabled="showLock" v-model="formQuery.dwdm"></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="12">
				<el-form-item label="单位类型:">
					<el-select class="inputWidth" v-model="formQuery.dwlx" placeholder="请选择" multiple
						:disabled="showLock">
						<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
					</el-select>
				</el-form-item>
			</el-col>
			<el-col :span="12">
				<el-form-item label="隶属于:">
					<el-input class="inputWidth" :disabled="showLock" v-model="formQuery.sslsxzglbm"></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="12">
				<el-form-item label="单位性质:" prop="qyxz">
					<el-radio-group v-model="formQuery.qyxz" :disabled="showLock">
						<el-radio :label="0">国有</el-radio>
						<el-radio :label="1">外资</el-radio>
						<el-radio :label="2">民营</el-radio>
					</el-radio-group>
				</el-form-item>
			</el-col>

			<el-col :span="12">
				<el-form-item label="注册地:">
					<el-input class="inputWidth" :disabled="showLock" v-model="formQuery.qygszcd"></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="12">
				<el-form-item label="统一社会信用代码/组织机构代码:" prop="tyshxydm">
					<el-input class="inputWidth" :disabled="showLock" v-model="formQuery.tyshxydm"></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="12">
				<el-form-item label="法定代表人:">
					<el-input class="inputWidth" :disabled="showLock" v-model="formQuery.fddbr"></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="12">
				<el-form-item label="联系人姓名:" prop="qylxr">
					<el-input class="inputWidth" :disabled="showLock" v-model="formQuery.qylxr"></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="12">
				<el-form-item label="联系电话:" prop="bgdh">
					<el-input class="inputWidth" v-model="formQuery.bgdh" :disabled="showLock"></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="12">
				<el-form-item label="电子邮箱:">
					<el-input class="inputWidth" v-model="formQuery.qydzyx" :disabled="showLock"></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="12">
				<el-form-item label="传真:">
					<el-input class="inputWidth" v-model="formQuery.qyczhm" :disabled="showLock"></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="12">
				<el-form-item label="邮政编码:" prop="qyyb">
					<el-input class="inputWidth" :disabled="showLock" v-model="formQuery.qyyb"></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="24">
				<el-form-item label="单位主要业务:">
					<el-checkbox-group style="width: 90%" v-model="dwzyyw1" :disabled="showLock">
						<el-checkbox :label="'粮油质检'" :disabled="showLock">粮油质检</el-checkbox>
						<el-checkbox :label="'粮油科研'" :disabled="showLock">粮油科研</el-checkbox>
						<el-checkbox :label="'中央储备粮承储'" :disabled="showLock">中央储备粮承储</el-checkbox>
						<el-checkbox :label="'地方储备粮承储'" :disabled="showLock">地方储备粮承储</el-checkbox>
						<el-checkbox :label="'粮油机械制造'" :disabled="showLock">粮油机械制造</el-checkbox>
						<el-checkbox :label="'其他'" :disabled="showLock">其他</el-checkbox>
						<el-checkbox :label="'行政管理'" :disabled="showLock">行政管理</el-checkbox>
						<el-checkbox :label="'粮油转化'" :disabled="showLock">粮油转化</el-checkbox>
					</el-checkbox-group>
				</el-form-item>
			</el-col>
			<el-col :span="24">

				<el-form-item label="企业经营类型:" prop="jyfw">
					<el-input class="inputWidth" :disabled="showLock" v-model="formQuery.jyfw"></el-input>
				</el-form-item>
				
			</el-col>
			
			<el-col :span="12">
				<el-form-item label="企业经营品种:">
					<el-input class="inputWidth" v-model="formQuery.qysclszypz" :disabled="showLock"></el-input>
				</el-form-item>
			</el-col>
			
			<el-col :span="12">
				<el-form-item label="是否有粮食收购许可证:">
					<el-radio-group v-model="formQuery.sfjysgzg" :disabled="showLock">
						<el-radio :label="0">是</el-radio>
						<el-radio :label="1">否</el-radio>
					</el-radio-group>
				</el-form-item>
			</el-col>
		</el-row>
		<el-row>
			<el-col :span="12">
				<el-form-item label="粮食收购许可证发证机关:">
					<el-input class="inputWidth" :disabled="showLock" v-model="formQuery.lssgxkzfzjg"></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="12">
				<el-form-item label="粮食收购许可证发证时间:">
					<el-date-picker v-model="formQuery.lssgxkzfzsj" :disabled="showLock" type="date" value-format="yyyy-MM-dd"
						placeholder="选择日期时间" class="inputWidth">
					</el-date-picker>
					<!-- <el-input class="inputWidth" :disabled="showLock" v-model="formQuery.lssgxkzfzsj"></el-input> -->
				</el-form-item>
			</el-col>

			<el-col :span="12">
				<el-form-item label="企业工商登记机关:">
					<el-input class="inputWidth" v-model="formQuery.qygsdjjg" :disabled="showLock"></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="12">
				<el-form-item label="粮食收购许可证编号:">
					<el-input class="inputWidth" :disabled="showLock" v-model="formQuery.sgzgzbh"></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="12">
				<el-form-item label="上级集团（公司）:">
					<el-input class="inputWidth" v-model="formQuery.sjjtmc" :disabled="showLock"></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="12">
				<el-form-item label="下属企业个数:">
					<el-input class="inputWidth" v-model="formQuery.xsqygs" :disabled="showLock"></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="12">
				<el-form-item label="操作人:">
					<el-input class="inputWidth" v-model="formQuery.creator" :disabled="showLock"></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="12">
				<el-form-item label="创建时间:">
					<el-date-picker v-model="formQuery.createDate" type="date" value-format="yyyy-MM-dd" placeholder="选择日期时间"
						class="inputWidth" :disabled="showLock">
					</el-date-picker>
				</el-form-item>
			</el-col>
			<el-col :span="24">
				<el-form-item label="审核意见:">
					<el-input style="width:90%;" :disabled="showLock" v-model="formQuery.remark" type="textarea" :rows="3">
					</el-input>
				</el-form-item>
			</el-col>
		</el-row>

		<el-col :span="24">
			<div style="text-align:center;margin-top:20px">
				<!-- <el-button type="primary" icon="iconfont icontijiao" @click="saveSubmit">保存</el-button> -->
				<!-- <el-button type="primary" icon="iconfont icontijiao" @click="saveSubmit('formQuery')">提交</el-button> -->
				<el-button type="primary" icon="iconfont iconfanhui" @click="cancel">返回</el-button>
			</div>
		</el-col>

	</el-form>

</template>

<script>
import {
	getCompanyInfo,
} from '@/api/grainCirculationPrice/coInfo/index.js'
export default {
	name: "slqyxxsb",
	data() {
		return {
			showLock: true,
			formQuery: {},
			dwzyyw1: [],
			qylx1: [],
			options: [{
				value: '储备',
				label: '1'
			}, {
				value: '收购',
				label: '2'
			}, {
				value: '加工',
				label: '3'
			}, {
				value: '销售',
				label: '4'
			}, {
				value: '运输',
				label: '5'
			}, {
				value: '进出口',
				label: '6'
			}, {
				value: '其他',
				label: '7'
			}],
			options1: [{
				value: '储备',
				label: '1'
			}, {
				value: '收购',
				label: '2'
			}, {
				value: '加工',
				label: '3'
			}, {
				value: '销售',
				label: '4'
			}, {
				value: '运输',
				label: '5'
			}, {
				value: '进出口',
				label: '6'
			}, {
				value: '其他',
				label: '7'
			}],
			value1: '',
			rules: {
				// qyxz: [
				// 	{ required: true, message: '请输入单位性质', trigger: 'change' },
				// ],
				dwzyyw: [
					{ required: true, message: '请输入单位主要业务', trigger: 'blur' },
				],
				// zj: [
				// 	{ required: true, message: '请输入追加单位主要业务', trigger: 'blur' },
				// ],
				tyshxydm: [
					{ required: true, message: '请输入统一社会信用代码/组织机构代码', trigger: 'blur' },
				],
				qylxr: [
					{ required: true, message: '请输入联系人姓名', trigger: 'blur' },
				],
				bgdh: [
					{ required: true, message: '请输入联系电话', trigger: 'blur' },
				],
				qyyb: [
					{ required: true, message: '请输入邮政编码', trigger: 'blur' },
				],
				jyfw: [
					{ required: true, message: '请输入企业经营类型', trigger: 'blur' },
				],
			}
		};
	},
	methods: {
		getInfo() {
			var code = this.$route.query.tyshxydm;
			// var code = '91120118712878201'
			getCompanyInfo(code).then(res => {
				this.formQuery = res.data
				this.jyfw = res.data.jyfw
				if (this.formQuery.qyzyyw) {
					this.dwzyyw1 = this.formQuery.qyzyyw.split(',');
				}
				// if (this.formQuery.qylx) {
				// 	this.qylx1 = this.formQuery.qylx.split(',');
				// }
				if (this.formQuery.dwlx) {
					this.formQuery.dwlx = this.formQuery.dwlx.split(',');
				}
			})
		},
		cancel() {
			this.$router.push('index');
		},
	},
	created() {
		this.getInfo();
	}
};
</script>

<style scoped lang="scss">
.content-main {
	margin: 10px 10px 0;
	padding-top: 20px;
}

.span-inline-block {
	float: left;
	margin-right: 5px;
	width: 80px;
	text-align: right;
	line-height: 30px;
}

.inputWidth {
	width: 80%;
}

.h3 {
	width: 98%;
	text-align: center;
	font-size: 1em;
	line-height: 2.5;
	color: #fff;
	background-color: #49a2fa;
	margin-bottom: 20px
}

.el-form {
	overflow: hidden;
	overflow-y: auto;
}

.el-row {
	.el-tooltip {
		float: left;
		padding: 0 12px 0 0;
		width: 118px;
		white-space: nowrap;
		text-align: right;
		vertical-align: middle;
		color: #525357;
		font-size: 14px;
		line-height: 40px;
		box-sizing: border-box;
	}
}
</style>