<template>
	<el-form
		class="content-main"
		label-width="200px"
		:data="formQuery"
		ref="detailForm"
	>
		<el-row>
			<el-col :span="8">
				<el-form-item label="企业名称:">
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.qymc"
					></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="8">
				<el-form-item label="统一社会信用代码:">
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.tyshxydm"
					></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="8">
				<el-form-item label="单位代码:">
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.dwdm"
					></el-input>
				</el-form-item>
			</el-col>
		</el-row>
		<el-row>
			<el-col :span="8">
				<el-form-item label="单位类型:">
					<el-select
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.dwlx"
						placeholder="请选择"
						multiple
					>
						<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="8">
				<el-form-item label="单位性质:">
					<el-select
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.qyxz"
						placeholder="请选择"
					>
						<el-option
							v-for="item in options1"
							:key="item.value"
							:label="item.label"
							:value="item.label"
						></el-option>
					</el-select>
				</el-form-item>
			</el-col>
			<el-col :span="8">
				<el-form-item label="注册日期:">
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="zcrq"
						value-format="yyyy-MM-dd HH:mm:ss"
						format="yyyy-MM-dd"
					></el-input>
				</el-form-item>
			</el-col>
		</el-row>
		<el-row>
			<el-col :span="16">
				<el-form-item label="所在地:">
					<el-input
						:disabled="showLock"
						v-model="formQuery.qytxdz"
						style="width: 154%"
					></el-input>
				</el-form-item>
			</el-col>
		</el-row>
		<el-row>
			<el-col :span="8">
				<el-form-item label="法定代表人:">
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.fddbr"
					></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="8">
				<el-form-item label="是否独立法人资格:">
					<el-radio-group
						:disabled="showLock"
						v-model="formQuery.sfdlfrzg"
					>
						<el-radio :label="1">是</el-radio>
						<el-radio :label="0">否</el-radio>
					</el-radio-group>
				</el-form-item>
			</el-col>
			<el-col :span="8">
				<el-form-item label="联系人:">
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.qylxr"
					></el-input>
				</el-form-item>
			</el-col>
		</el-row>
		<el-row>
			<el-col :span="8">
				<el-form-item label="手机:">
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.frsjh"
					></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="8">
				<el-form-item label="电话:">
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.bgdh"
					></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="8">
				<el-form-item label="传真:">
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.qyczhm"
					></el-input>
				</el-form-item>
			</el-col>
		</el-row>
		<el-row>
			<el-col :span="8">
				<el-form-item label="邮政编码:">
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.qyyb"
					></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="8">
				<el-form-item label="电子邮箱:">
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.qydzyx"
					></el-input>
				</el-form-item>
			</el-col>
		</el-row>
		<el-row>
			<el-col :span="8">
				<el-form-item label="经度:">
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.qyjd"
					></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="8">
				<el-form-item label="纬度:">
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.qywd"
					></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="8">
				<el-form-item label="占地面积(㎡):">
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.zdmj"
					></el-input>
				</el-form-item>
			</el-col>
		</el-row>
		<el-row>
			<el-col :span="8">
				<el-form-item label="总仓容(以三等小麦计/吨):" prop="zcr">
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.zcr"
					></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="8">
				<el-form-item label="总罐容(吨):" prop="gr">
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.gr"
					></el-input>
				</el-form-item>
			</el-col>
		</el-row>
		<el-row>
			<el-col :span="24">
				<el-form-item label="单位主要业务:" class="chb_box">
					<el-checkbox-group
						style="width: 90%"
						v-model="dwzyywArr"
						:disabled="showLock"
					>
						<el-checkbox
							v-for="(d, i) in dwzyywOpts"
							:key="i"
							:label="d.dictName"
							:value="d.dictCode"
						></el-checkbox>
						<!-- <el-checkbox :label="'粮油质检'">粮油质检</el-checkbox>
                                    <el-checkbox :label="'粮油科研'">粮油科研</el-checkbox>
                                    <el-checkbox :label="'中央储备粮承储'">中央储备粮承储</el-checkbox>
                                    <el-checkbox :label="'地方储备粮承储'">地方储备粮承储</el-checkbox>
                                    <el-checkbox :label="'粮油机械制造'">粮油机械制造</el-checkbox>
                                    <el-checkbox :label="'其他'">其他</el-checkbox>
                                    <el-checkbox :label="'行政管理'">行政管理</el-checkbox>
                        <el-checkbox :label="'粮油转化'">粮油转化</el-checkbox>-->
					</el-checkbox-group>
				</el-form-item>
			</el-col>
		</el-row>
		<el-row>
			<el-col :span="24">
				<el-form-item label="企业类型:">
					<el-checkbox-group
						style="width: 90%"
						v-model="formQuery.qylx"
						:disabled="showLock"
						class="chb_box"
					>
						<el-checkbox
							v-for="(d, i) in qylxOpts"
							:key="i"
							:label="d.dictName"
							:value="d.dictCode"
						></el-checkbox>
						<!-- <el-checkbox :label="'粮食收储企业'">粮食收储企业</el-checkbox>
                                    <el-checkbox :label="'粮油批发市场'">粮油批发市场</el-checkbox>
                                    <el-checkbox :label="'超市'">超市</el-checkbox>
                                    <el-checkbox :label="'小麦粉加工企业'">小麦粉加工企业</el-checkbox>
                                    <el-checkbox :label="'大米加工企业'">大米加工企业</el-checkbox>
                                    <el-checkbox :label="'其他成品粮加工企业'">其他成品粮加工企业</el-checkbox>
                                    <el-checkbox :label="'食用植物油加工企业'">食用植物油加工企业</el-checkbox>
                                    <el-checkbox :label="'食品及副食酿造企业'">食品及副食酿造企业</el-checkbox>
                                    <el-checkbox :label="'制酒企业'">制酒企业</el-checkbox>
                                    <el-checkbox :label="'饲料企业'">饲料企业</el-checkbox>
                                    <el-checkbox :label="'养殖企业'">养殖企业</el-checkbox>
                                    <el-checkbox :label="'淀粉企业'">淀粉企业</el-checkbox>
                                    <el-checkbox :label="'酒精企业'">酒精企业</el-checkbox>
                                    <el-checkbox :label="'其他粮油深加工企业'">其他粮油深加工企业</el-checkbox>
                                    <el-checkbox :label="'粮油机械制造企业'">粮油机械制造企业</el-checkbox>
                        <el-checkbox :label="'玉米加工企业'">玉米加工企业</el-checkbox>-->
					</el-checkbox-group>
				</el-form-item>
			</el-col>
		</el-row>
		<el-row>
			<el-col :span="8">
				<el-form-item label="企业层级:">
					<el-select
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.qycj"
						placeholder="请选择"
					>
						<el-option
							v-for="item in options2"
							:key="item.value"
							:label="item.label"
							:value="item.label"
						></el-option>
					</el-select>
				</el-form-item>
			</el-col>
			<el-col :span="8">
				<el-form-item label="在岗职工:">
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.qycyrys"
					></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="8">
				<el-form-item label="下属企业个数:">
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.xsqygs"
					></el-input>
				</el-form-item>
			</el-col>
		</el-row>
		<el-row>
			<el-col :span="8">
				<el-form-item label="企业工商登记机关:">
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.qygsdjjg"
					></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="16">
				<el-form-item label="注册地:">
					<el-input
						class="inputWidth"
						:disabled="showLock"
						style="width: 92%"
						v-model="formQuery.qygszcd"
					></el-input>
				</el-form-item>
			</el-col>
		</el-row>
		<el-row>
			<el-col :span="8">
				<el-form-item label="企业状态:">
					<el-select
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.qyzt"
						placeholder="请选择"
					>
						<el-option
							v-for="item in options3"
							:key="item.value"
							:label="item.label"
							:value="item.value"
						></el-option>
					</el-select>
				</el-form-item>
			</el-col>
			<el-col :span="8">
				<el-form-item label="入统状态:">
					<el-select
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.rtzt"
						placeholder="请选择"
					>
						<el-option
							v-for="item in options3"
							:key="item.value"
							:label="item.label"
							:value="item.value"
						></el-option>
					</el-select>
				</el-form-item>
			</el-col>
			<el-col :span="8">
				<el-form-item label="所属粮食行政管理部门:">
					<!-- <el-input class="inputWidth" :disabled="showLock" v-model="formQuery.sslsxzglbm"></el-input> -->
					<el-cascader
						:disabled="showLock"
						v-model="formQuery.sslsxzglbm"
						:options="tree"
						@change="handleTreeChange"
						:props="defaultParams"
						:change-on-select="true"
						:show-all-levels="false"
						class="inputWidth"
					></el-cascader>
				</el-form-item>
			</el-col>
		</el-row>
		<el-row>
			<el-col :span="8">
				<el-form-item label="是否具有粮食收购资格许可:">
					<!-- <el-input class="inputWidth" :disabled="showLock" v-model="formQuery.sfjysgzg"></el-input> -->
					<el-select
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.sfjysgzg"
						placeholder="请选择"
					>
						<el-option
							v-for="item in options4"
							:key="item.value"
							:label="item.label"
							:value="item.value"
						></el-option>
					</el-select>
				</el-form-item>
			</el-col>
			<el-col :span="8">
				<el-form-item label="粮食收购许可证发证机关:">
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.lssgxkzfzjg"
					></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="8">
				<el-form-item label="收购资格证编号:">
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.sgzgzbh"
					></el-input>
				</el-form-item>
			</el-col>
		</el-row>
		<el-row>
			<el-col :span="8">
				<el-form-item label="市级承储企业:">
					<el-select
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.sjccqy"
						placeholder="请选择"
					>
						<el-option
							v-for="item in options4"
							:key="item.value"
							:label="item.label"
							:value="item.value"
						></el-option>
					</el-select>
				</el-form-item>
			</el-col>
			<el-col :span="8">
				<el-form-item label="区级承储企业:">
					<el-select
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.qjccqy"
						placeholder="请选择"
					>
						<el-option
							v-for="item in options4"
							:key="item.value"
							:label="item.label"
							:value="item.value"
						></el-option>
					</el-select>
				</el-form-item>
			</el-col>
		</el-row>
		<el-row>
			<el-col :span="24">
				<h3 class="h3">企业应急信息</h3>
			</el-col>
		</el-row>
		<el-row>
			<el-col :span="8">
				<el-form-item label="应急级别:">
					<!-- <el-input class="inputWidth" :disabled="showLock" v-model="formQuery.qyyjjb"></el-input> -->
					<el-select
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.qyyjjb"
						placeholder="请选择"
					>
						<el-option
							v-for="item in options5"
							:key="item.value"
							:label="item.label"
							:value="item.value"
						></el-option>
					</el-select>
				</el-form-item>
			</el-col>
			<el-col :span="8">
				<el-form-item label="企业应急类型:">
					<!-- <el-input class="inputWidth" :disabled="showLock" v-model="formQuery.qyyjlxmc"></el-input> -->
					<el-select
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.qyyjlxmc"
						placeholder="请选择"
					>
						<el-option
							v-for="item in options6"
							:key="item.value"
							:label="item.label"
							:value="item.value"
						></el-option>
					</el-select>
				</el-form-item>
			</el-col>
		</el-row>
		<el-row>
			<el-col :span="24">
				<h3 class="h3">上级集团信息</h3>
			</el-col>
		</el-row>
		<el-row>
			<el-col :span="8">
				<el-form-item label="上级集团:">
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.sjjtmc"
					></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="8">
				<el-form-item label="上级集团统一社会信用代码:">
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.sjjttyshxydm"
					></el-input>
				</el-form-item>
			</el-col>
		</el-row>
		<el-row>
			<el-col :span="24">
				<h3 class="h3">加工企业信息</h3>
			</el-col>
		</el-row>
		<el-row>
			<el-col :span="8">
				<el-form-item label="产业化龙头企业:">
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.cyhltqy"
					></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="8">
				<el-form-item label="放心粮油示范工程:">
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.fxlysfgc"
					></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="8">
				<el-form-item label="全国工业产品生产许可证品种:">
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.qggycpscxkzpz"
					></el-input>
				</el-form-item>
			</el-col>
		</el-row>
		<el-row>
			<el-col :span="8">
				<el-form-item label="是否主食加工中央厨房:">
					<el-radio-group
						:disabled="showLock"
						v-model="formQuery.sfzsjgzycf"
					>
						<el-radio :label="1">是</el-radio>
						<el-radio :label="0">否</el-radio>
					</el-radio-group>
				</el-form-item>
			</el-col>
			<el-col :span="8">
				<el-form-item label="研发中心级别:">
					<!-- <el-input class="inputWidth" :disabled="showLock" v-model="formQuery.yfzxjb"></el-input> -->
					<el-select
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.yfzxjb"
						placeholder="请选择"
					>
						<el-option
							v-for="item in options7"
							:key="item.value"
							:label="item.label"
							:value="item.value"
						></el-option>
					</el-select>
				</el-form-item>
			</el-col>
		</el-row>
		<el-row>
			<el-col :span="24">
				<h3 class="h3">企业经济数据</h3>
			</el-col>
		</el-row>
		<el-row>
			<el-col :span="8">
				<el-form-item label="营业收入(万元):">
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.yysr"
					></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="8">
				<el-form-item label="工业总产值(万元):">
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.gyzcz"
					></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="8">
				<el-form-item label="产品销售收入(万元):">
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.cpxssr"
					></el-input>
				</el-form-item>
			</el-col>
		</el-row>
		<el-row>
			<el-col :span="8">
				<el-form-item label="利税总额(万元):">
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.lsze"
					></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="8">
				<el-form-item label="利润总额(万元):">
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.lrze"
					></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="8">
				<el-form-item label="资产总额(万元):">
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.zcze"
					></el-input>
				</el-form-item>
			</el-col>
		</el-row>
		<el-row>
			<el-col :span="8">
				<el-form-item label="当年研究开发投入(万元):">
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.dnyjkftr"
					></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="8">
				<el-form-item label="政府支持投入(万元):">
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.zfzctr"
					></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="8">
				<el-form-item label="当年专利获得数(件):">
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.dnzlhds"
					></el-input>
				</el-form-item>
			</el-col>
		</el-row>
		<el-row>
			<el-col :span="8">
				<el-form-item label="发明专利(件):">
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.fmzl"
					></el-input>
				</el-form-item>
			</el-col>
		</el-row>
		<el-row>
			<el-col :span="24">
				<h3 class="h3">企业设备及能耗</h3>
			</el-col>
		</el-row>
		<el-row>
			<el-col :span="8">
				<el-form-item label="年产粮油机械制造:">
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.nclyjxzz"
					></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="8">
				<el-form-item label="大米加工主机:">
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.dmjgzj"
					></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="8">
				<el-form-item label="小麦粉加工主机:">
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.xmfjgzj"
					></el-input>
				</el-form-item>
			</el-col>
		</el-row>
		<el-row>
			<el-col :span="8">
				<el-form-item label="油脂加工主机:">
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.yzjgzj"
					></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="8">
				<el-form-item label="饲料加工主机:">
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.sljgzj"
					></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="8">
				<el-form-item label="仓储设备:">
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.ccsb"
					></el-input>
				</el-form-item>
			</el-col>
		</el-row>
		<el-row>
			<el-col :span="8">
				<el-form-item label="通用设备:">
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.tysb"
					></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="8">
				<el-form-item label="能源耗电:">
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.nyhd"
					></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="8">
				<el-form-item label="能源消耗水:">
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.nyxhs"
					></el-input>
				</el-form-item>
			</el-col>
		</el-row>
		<el-row>
			<el-col :span="8">
				<el-form-item label="能源消耗标准煤:">
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.nhxhbzm"
					></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="8">
				<el-form-item label="能源消耗溶剂:">
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.nyxhrj"
					></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="8">
				<el-form-item label="总仓容(以三等小麦计):">
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.zcr"
					></el-input>
				</el-form-item>
			</el-col>
		</el-row>
		<el-row>
			<el-col :span="8">
				<el-form-item label="罐容:">
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.gr"
					></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="16">
				<el-form-item label="仓房:">
					<el-input
						style="width: 80px"
						:disabled="showLock"
						v-model="formQuery.cfd"
					></el-input>
					<span>&nbsp;&nbsp;栋&nbsp;&nbsp;</span>
					<el-input
						style="width: 80px"
						:disabled="showLock"
						v-model="formQuery.cfj"
					></el-input>
					<span>&nbsp;&nbsp;间</span>
				</el-form-item>
			</el-col>
		</el-row>
		<el-row>
			<el-form-item label="备注:">
				<el-input
					type="textarea"
					rows="3"
					style="width: 95%"
					:disabled="showLock"
					v-model="formQuery.remark"
				></el-input>
			</el-form-item>
		</el-row>
		<el-row v-if="reviewType">
			<el-col :span="24">
				<h3 class="h3">审批信息</h3>
			</el-col>
		</el-row>
		<el-row v-if="reviewType">
			<el-col :span="24">
				<el-form-item label="审批:">
					<el-radio-group
						v-model="auditQuery.sfba"
						:disabled="auditShow"
					>
						<el-radio label="5">通过</el-radio>
						<el-radio label="3">驳回</el-radio>
					</el-radio-group>
				</el-form-item>
			</el-col>
			<el-col :span="24">
				<el-form-item label="审核意见:">
					<el-input
						class="inputWidth"
						:disabled="auditShow"
						type="textarea"
						:autosize="{ minRows: 3 }"
						v-model="auditQuery.shyj"
					></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="8">
				<el-form-item label="审核人:">
					<el-input
						class="inputWidth"
						disabled
						v-model="auditQuery.shrmc"
					></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="8">
				<el-form-item label="审核时间:">
					<!-- <el-input class="inputWidth" :disabled="showLock" v-model="auditQuery.shsj"></el-input> -->
					<el-date-picker
						v-model="auditQuery.shsj"
						disabled
						type="date"
						value-format="yyyy-MM-dd"
					></el-date-picker>
				</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"
					v-if="!showLock"
					@click="saveSubmit('save')"
					>保存</el-button
				>
				<el-button
					type="primary"
					icon="iconfont icontijiao"
					v-if="!auditShow"
					@click="saveSubmit('send')"
					>提交</el-button
				>
				<el-button
					type="primary"
					icon="iconfont iconfanhui"
					@click="cancel"
					>返回</el-button
				>
			</div>
		</el-col>
	</el-form>
</template>

<script>
import {
	getCompanyInfo,
	editCompanyInfo,
	qylxOpts,
	tree,
	dwzyywOpts,
} from '@/api/jcxxwh/qyjcxx'
import { getNowDate } from '@/utils/index'
function formatData(list) {
	return list.map((item) => {
		let newItem = {}
		newItem.label = item.orgName
		newItem.value = item.orgName
		newItem.code = item.orgCode
		if (item.hasOwnProperty('children') && item.children.length > 0) {
			newItem.children = formatData(item.children)
		}
		return newItem
	})
}
function getCascaderObj(val, opt) {
	return val.map(function (value, index, array) {
		for (var itm of opt) {
			if (itm.value == value) {
				opt = itm.children
				return itm
			}
		}
		return null
	})
}
export default {
	name: 'slqyxxsb',
	data() {
		return {
			tyshxydm: '',
			zcrq: '',
			dwzyywArr: [],
			dwzyywOpts: [],
			defaultParams: {
				label: 'label',
				value: 'code',
				children: 'children',
				name: 'label',
				emitPath: false,
			},
			tree: [],
			qylxOpts: [],
			showLock: true,
			auditShow: false,
			reviewType: false,
			formQuery: {},
			auditQuery: {
				shrmc: sessionStorage.userName || '',
				shsj: getNowDate(),
				sfba: '5',
				shyj: '',
			},
			dwzyyw1: [],
			qylx1: [],
			isChecked: false,
			options: [
				{
					value: '1',
					label: '应急',
				},
				{
					value: '2',
					label: '仓储',
				},
				{
					value: '3',
					label: '加工',
				},
				{
					value: '4',
					label: '物流',
				},
				{
					value: '5',
					label: '配送',
				},
			],
			options1: [
				{
					value: 1,
					label: '行政机关',
				},
				{
					value: 2,
					label: '参公管理事业单位',
				},
				{
					value: 3,
					label: '非参公管理事业单位',
				},
				{
					value: 4,
					label: '国有及国有控股企业',
				},
				{
					value: 5,
					label: '内资非国有企业',
				},
				{
					value: 6,
					label: '私营企业',
				},
				{
					value: 7,
					label: '港澳台商及外商企业',
				},
				{
					value: 8,
					label: '个体工商户',
				},
			],
			options2: [
				{
					value: '1',
					label: '市属',
				},
				{
					value: '2',
					label: '区属',
				},
				{
					value: '3',
					label: '利达粮油',
				},
			],
			options3: [
				{
					value: 1,
					label: '启用',
				},
				{
					value: 0,
					label: '停用',
				},
			],
			options4: [
				{
					value: '1',
					label: '是',
				},
				{
					value: '0',
					label: '否',
				},
			],
			options5: [
				{
					value: '1',
					label: '市级',
				},
				{
					value: '2',
					label: '区级',
				},
				{
					value: '3',
					label: '非应急',
				},
			],
			options6: [
				{
					value: '1',
					label: '应急储运企业',
				},
				{
					value: '2',
					label: '应急供应网点',
				},
				{
					value: '3',
					label: '应急加工企业',
				},
				{
					value: '4',
					label: '应急配送中心',
				},
			],
			options7: [
				{
					value: '1',
					label: '初级',
				},
				{
					value: '2',
					label: '中级',
				},
				{
					value: '3',
					label: '高级',
				},
			],
		}
	},
	methods: {
		handleTreeChange(val) {
			var item = getCascaderObj(val, this.tree)
			var value = item[item.length - 1]
			this.formQuery.qylsqxname = value.value
			this.formQuery.sslsxzglbm = value.code
		},
		initOpts() {
			qylxOpts().then((res) => {
				var codes = []
				if (res && Array.isArray(res.data))
					this.qylxOpts = res.data.filter((d) => {
						if (codes.includes(d.dictCode)) {
							return false
						} else {
							codes.push(d.dictCode)
							return true
						}
					})
			})
			dwzyywOpts().then((res) => {
				if (!res) return
				this.dwzyywOpts = res.data
			})
			tree().then((res) => {
				if (!res) {
					this.tree = []
					return
				}
				var arr = []
				arr.push(res.data)
				this.tree = formatData(arr)
			})
		},
		getInfo() {
			// var code = sessionStorage.getItem('tyshxydm')
			var code = this.tyshxydm
			getCompanyInfo(code).then((res) => {
				if (!res) return
				let detailForm = res.data
				if (!this.$route.query.status) {
					this.reviewType = true
					this.auditQuery.sfba = res.data.sfba
						? res.data.sfba == '2'
							? this.auditQuery.sfba
							: res.data.sfba
						: this.auditQuery.sfba
					this.auditQuery.shrmc = res.data.shrmc
						? res.data.sfba == '2'
							? this.auditQuery.shrmc
							: res.data.shrmc
						: this.auditQuery.shrmc
					this.auditQuery.shsj = res.data.shsj
						? res.data.sfba == '2'
							? this.auditQuery.shsj
							: res.data.shsj
						: this.auditQuery.shsj
					this.auditQuery.shyj = res.data.shyj
						? res.data.sfba == '2'
							? this.auditQuery.shyj
							: res.data.shyj
						: this.auditQuery.shyj
				} else {
					this.reviewType = res.data.sfba > 2 ? true : false
					this.auditQuery.sfba = res.data.sfba
						? res.data.sfba == '2'
							? this.auditQuery.sfba
							: res.data.sfba
						: this.auditQuery.sfba
					this.auditQuery.shrmc = res.data.shrmc
						? res.data.sfba == '2'
							? this.auditQuery.shrmc
							: res.data.shrmc
						: this.auditQuery.shrmc
					this.auditQuery.shsj = res.data.shsj
						? res.data.sfba == '2'
							? this.auditQuery.shsj
							: res.data.shsj
						: this.auditQuery.shsj
					this.auditQuery.shyj = res.data.shyj
						? res.data.sfba == '2'
							? this.auditQuery.shyj
							: res.data.shyj
						: this.auditQuery.shyj
				}
				detailForm = {
					...detailForm,
					...detailForm.tzYjqyVO,
				}
				if (detailForm.dwlx)
					detailForm.dwlx = detailForm.dwlx.split(',')
				if (detailForm.zcrq) this.zcrq = detailForm.zcrq.slice(0, 10)
				if (detailForm.sfjysgzg)
					detailForm.sfjysgzg = detailForm.sfjysgzg + ''
				// this.dwzyyw1 = detailForm.qyzyyw.split(',')
				this.dwzyywArr = detailForm.qyzyyw.split(',')
				detailForm.qylx = detailForm.tzQylxVOList.map((d) => d.qylxmc)
				if (!this.$route.query.status) {
				}
				this.formQuery = detailForm

				this.$refs.detailForm.clearValidate()
				this.initOpts()
			})
		},
		saveSubmit(status) {
			if (this.formQuery.dwlx)
				this.formQuery.dwlx = this.formQuery.dwlx.join(',')
			// this.formQuery.qyzyyw = this.dwzyyw1.join(',')
			// this.formQuery.qylx = this.qylx1.join(',')
			// this.formQuery = { ...this.auditQuery, ...this.formQuery }
			this.formQuery.sfba = this.auditQuery.sfba
			this.formQuery.shrmc = this.auditQuery.shrmc
			this.formQuery.shsj = this.auditQuery.shsj
			this.formQuery.shyj = this.auditQuery.shyj
			this.formQuery.dsbxxsjyVOList = []

			if (status == 'save') {
				editCompanyInfo(this.formQuery).then((res) => {
					if (res.infoCode == 200) {
						this.$message({
							message: '保存成功',
							type: 'success',
							duration: 2000,
						})
						this.$router.push({ path: '/jcxxwh/qyjcxx' })
					} else {
						this.$message({
							message: '保存失败',
							type: 'success',
							duration: 2000,
						})
					}
				})
			} else if (status == 'send') {
				editCompanyInfo(this.formQuery).then((res) => {
					if (res.infoCode == 200) {
						this.$message({
							message: '提交成功',
							type: 'success',
							duration: 2000,
						})
						this.$router.push({ path: '/jcxxwh/qyjcxx' })
					} else {
						this.$message({
							message: '提交失败',
							type: 'success',
							duration: 2000,
						})
					}
				})
			}
		},
		cancel() {
			this.$router.push({ path: '/jcxxsh/qyxxsh' })
		},
	},
	created() {
		this.tyshxydm = this.$route.query.code
		if (this.$route.query.status) {
			this.auditShow = true
			this.reviewType = false
		} else {
			this.auditShow = false
			this.reviewType = true
		}
		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;
	}
}
.chb_box {
	/deep/ .el-checkbox {
		min-width: 150px;
	}
}
</style>
