<template>
	<el-form
		class="content-main"
		label-width="200px"
		:model="formQuery"
		ref="detailForm"
	>
		<el-row>
			<el-col :span="8">
				<el-form-item
					label="企业名称:"
					prop="qymc"
					:rules="rules('企业名称')"
				>
					<el-input
						class="inputWidth"
						disabled
						v-model="formQuery.qymc"
					></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="8">
				<el-form-item
					label="统一社会信用代码:"
					prop="tyshxydm"
					:rules="rules('统一社会信用代码')"
				>
					<el-input
						class="inputWidth"
						disabled
						v-model="formQuery.tyshxydm"
					></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="8">
				<el-form-item
					label="单位代码:"
					prop="dwdm"
					:rules="[rules('单位代码'), { validator: checkUnitCode }]"
				>
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.dwdm"
						maxlength="20"
					></el-input>
				</el-form-item>
			</el-col>
		</el-row>
		<el-row>
			<el-col :span="8">
				<el-form-item
					label="单位类型:"
					prop="dwlxArr"
					:rules="rules('单位类型')"
				>
					<el-select
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.dwlxArr"
						multiple
						placeholder="请选择"
						@change="handeleDWLXChange"
					>
						<el-option
							v-for="(item, index) in options"
							:key="index"
							:label="item.label"
							:value="item.value"
						></el-option>
					</el-select>
				</el-form-item>
			</el-col>
			<el-col :span="8">
				<el-form-item
					label="单位性质:"
					prop="qyxz"
					:rules="rules('单位性质')"
				>
					<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="formQuery.zcrq"></el-input> -->
					<el-date-picker
						type="date"
						:disabled="showLock"
						v-model="formQuery.zcrq"
						class="inputWidth"
						value-format="yyyy-MM-dd HH:mm:ss"
						format="yyyy-MM-dd"
					></el-date-picker>
				</el-form-item>
			</el-col>
		</el-row>
		<el-row>
			<el-col :span="7">
				<!--        <el-form-item label="所在地:" prop="qytxdz" :rules="rules('所在地')">-->
				<el-form-item
					label="所在地:"
					prop="txprovince"
					:rules="[rules('省市')]"
				>
					<el-select
						clearable
						:disabled="showLock"
						v-model="formQuery.txprovince"
						placeholder="省市"
						style="width: 100%"
						@change="initszdCity"
					>
						<el-option
							v-for="item in szdProvince"
							:key="item.countyCode"
							:label="item.countyName"
							:value="item.countyCode"
						></el-option>
					</el-select>
				</el-form-item>
			</el-col>
			<el-col :span="3">
				<el-form-item
					label-width="20px"
					prop="txcity"
					:rules="[rules('地区')]"
				>
					<el-select
						clearable
						:disabled="showLock"
						v-model="formQuery.txcity"
						placeholder="地区"
						style="width: 100%"
					>
						<el-option
							v-for="item in szdCity"
							:key="item.countyCode"
							:label="item.countyName"
							:value="item.countyCode"
						></el-option>
					</el-select>
				</el-form-item>
			</el-col>
			<el-col :span="14">
				<el-form-item
					label-width="20px"
					prop="qytxdz"
					:rules="[rules('所在地')]"
				>
					<el-input
						:disabled="showLock"
						style="width: 95%"
						maxlength="50"
						v-model="formQuery.qytxdz"
					></el-input>
				</el-form-item>
			</el-col>
		</el-row>
		<el-row>
			<el-col :span="8">
				<el-form-item
					label="法定代表人:"
					prop="fddbr"
					:rules="rules('法定代表人')"
				>
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.fddbr"
						maxlength="20"
					></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
						v-model="formQuery.qylxr"
						maxlength="20"
					></el-input>
				</el-form-item>
			</el-col>
		</el-row>
		<el-row>
			<el-col :span="8">
				<el-form-item
					label="手机:"
					prop="frsjh"
					:rules="[rules('手机号码'), { validator: checkPhone }]"
				>
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.frsjh"
						clearable
						maxlength="11"
					></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="8">
				<el-form-item
					label="电话:"
					prop="bgdh"
					:rules="[rules('电话'), { validator: checkCall }]"
				>
					<el-input
						class="inputWidth"
						disabled
						v-model="formQuery.bgdh"
					></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="8">
				<el-form-item
					label="传真:"
					prop="qyczhm"
					:rules="[rules('传真'), { validator: checkFax }]"
				>
					<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="邮政编码:"
					prop="qyyb"
					:rules="{
						validator: checkPostal,
						trigger: ['change', 'blur'],
					}"
				>
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.qyyb"
						maxlength="6"
					></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="8">
				<el-form-item
					label="电子邮箱:"
					prop="qydzyx"
					:rules="{
						validator: checkEmail,
						trigger: ['change', 'blur'],
					}"
				>
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.qydzyx"
					></el-input>
				</el-form-item>
			</el-col>
			<!--      <el-col :span="8">-->
			<!--        <el-form-item label="地区:" prop="qyszqybh">-->
			<!--          <el-select-->
			<!--            clearable-->
			<!--            :disabled="showLock"-->
			<!--            v-model="formQuery.qyszqybh"-->
			<!--            placeholder="请选择"-->
			<!--          >-->
			<!--            <el-option-->
			<!--              v-for="item in oooops"-->
			<!--              :key="item.dictCode"-->
			<!--              :label="item.dictName"-->
			<!--              :value="item.dictCode"-->
			<!--            ></el-option>-->
			<!--          </el-select>-->
			<!--        </el-form-item>-->
			<!--      </el-col>-->
		</el-row>
		<el-row>
			<el-col :span="8">
				<el-form-item label="经度:" prop="qyjd" :rules="rules('经度')">
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.qyjd"
						@blur="formatFloat($event, formQuery.qyjd, 'qyjd')"
						maxlength="20"
					></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="8">
				<el-form-item label="纬度:" prop="qywd" :rules="rules('纬度')">
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.qywd"
						@blur="formatFloat($event, formQuery.qywd, 'qywd')"
						maxlength="20"
					></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="8">
				<el-form-item
					label="占地面积(亩):"
					prop="zdmj"
					:rules="rules('占地面积')"
				>
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.zdmj"
						@blur="formatFloat($event, formQuery.zdmj, 'zdmj')"
						maxlength="20"
					></el-input>
				</el-form-item>
			</el-col>
		</el-row>
		<el-row>
			<el-col :span="8">
				<el-form-item
					label="总仓容(以三等小麦计/吨):"
					prop="zcr"
					:rules="[rules('总仓容'), { validator: checkThreeDP }]"
				>
					<el-input
						class="inputWidth"
						:disabled="showLock"
						@change="limitZcr"
						v-model="formQuery.zcr"
					></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="8">
				<el-form-item
					label="总罐容(吨):"
					prop="gr"
					:rules="[rules('总罐容'), { validator: checkThreeDP }]"
				>
					<el-input
						class="inputWidth"
						:disabled="showLock"
						@change="limitGr"
						v-model="formQuery.gr"
					></el-input>
				</el-form-item>
			</el-col>
		</el-row>
		<el-row>
			<el-col :span="24">
				<el-form-item
					label="单位主营业务:"
					prop="qyzyyw"
					class="chb_box"
					:rules="{
						required: true,
						validator: checkBox1,
						trigger: 'change',
					}"
				>
					<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="企业经营类型:"
                        prop="qylx"
                        :rules="{
            required: true,
            validator: checkBox2,
            trigger: 'change',
          }"
                >
                    <el-checkbox-group
                            style="width: 90%"
                            v-model="qylxArr"
                            :disabled="showLock"
                            class="chb_box"
                            @change="handleQYLXChange"
                    >
                        <el-checkbox
                                v-for="(d, i) in qylxOpts"
                                :key="i"
                                :label="d.dictName"
                                :value="d.dictCode"
                        ></el-checkbox>
                        <!-- <el-checkbox min-width="150px" :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="企业层级:"
                        prop="qycj"
                        :rules="[rules('企业层级')]"
                >
                    <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="在岗职工:" prop="qycyrys" :rules="[{ validator: rulesNumZ,trigger: 'change', }]">
                    <el-input
                            class="inputWidth"
                            :disabled="showLock"
                            v-model="formQuery.qycyrys"
                            maxlength="9"

                    ></el-input>
                </el-form-item>
            </el-col>
            <el-col :span="8">
                <el-form-item
                        label="下属企业个数:"
                        prop="xsqygs"
                        :rules="[rules('下属企业个数'),{ validator: rulesNumZ,trigger: 'change', }]"
                >
                    <el-input
                            class="inputWidth"
                            :disabled="showLock"
                            v-model="formQuery.xsqygs"
                            maxlength="9"

                    ></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"
                            maxlength="20"
                    ></el-input>
                </el-form-item>
            </el-col>
            <!--      <el-col :span="16">-->
            <!--        <el-form-item label="注册地:" prop="qygszcd" :rules="[rules('注册地'), { validator: checkZcd }]">-->
            <!--          <el-select-->
            <!--            clearable-->
            <!--            :disabled="showLock"-->
            <!--            v-model="formQuery.zcprovince"-->
            <!--            placeholder="省市"-->
            <!--            style="width: 20%"-->
            <!--            @change="initzcdCity"-->
            <!--          >-->
            <!--            <el-option-->
            <!--              v-for="item in zcdProvince"-->
            <!--              :key="item.countyCode"-->
            <!--              :label="item.countyName"-->
            <!--              :value="item.countyCode"-->
            <!--            ></el-option>-->
            <!--          </el-select>-->
            <!--          <el-select-->
            <!--            clearable-->
            <!--            :disabled="showLock"-->
            <!--            v-model="formQuery.zccity"-->
            <!--            placeholder="地区"-->
            <!--            style="width: 20%;"-->
            <!--          >-->
            <!--            <el-option-->
            <!--              v-for="item in zcdCity"-->
            <!--              :key="item.countyCode"-->
            <!--              :label="item.countyName"-->
            <!--              :value="item.countyCode"-->
            <!--            ></el-option>-->
            <!--          </el-select>-->
            <!--          <el-input-->
            <!--            :disabled="showLock"-->
            <!--            style="width: 52%;"-->
            <!--            v-model="formQuery.qygszcd"-->
            <!--            maxlength="50"-->
            <!--          ></el-input>-->
            <!--        </el-form-item>-->
            <!--      </el-col>-->
            <el-col :span="6">
                <el-form-item label="注册地:" prop="zcprovince" :rules="[rules('省市')]">
                    <el-select
                            clearable
                            :disabled="showLock"
                            v-model="formQuery.zcprovince"
                            placeholder="省市"
                            style="width: 100%"
                            @change="initzcdCity"
                    >
                        <el-option
                                v-for="item in zcdProvince"
                                :key="item.countyCode"
                                :label="item.countyName"
                                :value="item.countyCode"
                        ></el-option>
                    </el-select>
                </el-form-item>
            </el-col>
            <el-col :span="2">
                <el-form-item label-width="10px" prop="zccity" :rules="[rules('地区')]">
                    <el-select
                            clearable
                            :disabled="showLock"
                            v-model="formQuery.zccity"
                            placeholder="地区"
                            style="width: 100%;"
                    >
                        <el-option
                                v-for="item in zcdCity"
                                :key="item.countyCode"
                                :label="item.countyName"
                                :value="item.countyCode"
                        ></el-option>
                    </el-select>
                </el-form-item>
            </el-col>
            <el-col :span="8">
                <el-form-item label-width="10px" prop="qygszcd" :rules="[rules('注册地')]">
                    <el-input
                            :disabled="showLock"
                            style="width: 90%;"
                            v-model="formQuery.qygszcd"
                            maxlength="50"
                            clearable
                    ></el-input>
                </el-form-item>
            </el-col>
        </el-row>
        <el-row>
            <el-col :span="8">
                <el-form-item label="企业状态:" prop="qyzt" :rules="rules('企业状态')">
                    <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="入统状态:"
                        prop="rtzt"
                        :rules="[rules('入统状态')]"
                >
                    <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="所属粮食行政管理部门:"
                        prop="sslsxzglbm"
                        :rules="[rules('所属粮食行政管理部门')]"
                >
                    <!-- <el-input class="inputWidth" :disabled="showLock" v-model="formQuery.sslsxzglbm"></el-input> -->
                    <el-cascader
                            disabled
                            v-model="formQuery.sslsxzglbm"
                            :options="tree"
                            :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-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-col :span="8">
                <el-form-item
                        label="是否最低最高企业:"
                        prop="sfzdzgqy"
                        :rules="[rules('是否最低最高企业')]"
                >
                    <el-select
                            class="inputWidth"
                            :disabled="showLock"
                            v-model="formQuery.sfzdzgqy"
                            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="8">
                <el-form-item label="是否为备案企业:" prop="sfbaqy">
                    <el-select
                            class="inputWidth"
                            :disabled="showLock"
                            v-model="formQuery.sfbaqy"
                            placeholder="请选择">
                        <el-option
                                v-for="item in options4"
                                :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="是否为流通统计企业:" prop="sflttjqy">
                    <el-select
                            class="inputWidth"
                            :disabled="showLock"
                            v-model="formQuery.sflttjqy"
                            placeholder="请选择">
                        <el-option
                                v-for="item in options4"
                                :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="企业类型:" prop="qiyeleix">
                    <el-select class="inputWidth" :disabled="showLock" v-model="formQuery.qiyeleix" placeholder="请选择">
                        <el-option v-for="item in options8" :key="item.value" :label="item.label" :value="item.value"></el-option>
                    </el-select>
                </el-form-item>
            </el-col>
        </el-row>
        <div
                class="sub_title"
                @click="subTitle.lssgzg = !subTitle.lssgzg"
                :class="{ sub_title__icon_arrow_down: subTitle.lssgzg }"
        >
            粮食收购资格
            <i class="el-icon-arrow-up"></i>
        </div>
        <el-row v-show="subTitle.lssgzg">
            <el-col :span="8">
                <el-form-item label="是否具有粮食收购资格许可:">
                    <el-select
                            class="inputWidth"
                            disabled
                            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
                            v-model="formQuery.lssgxkzfzjg"
                            maxlength="20"
                    ></el-input>
                </el-form-item>
            </el-col>
            <el-col :span="8">
                <el-form-item label="收购资格证编号:">
                    <el-input
                            class="inputWidth"
                            disabled
                            v-model="formQuery.sgzgzbh"
                            maxlength="20"
                    ></el-input>
                </el-form-item>
            </el-col>
            <el-col :span="8">
                <el-form-item label="发证日期:">
                    <el-date-picker
                            v-model="formQuery.fzrq"
                            value-format="yyyy-MM-dd"
                            format="yyyy-MM-dd"
                            clearable
                            disabled
                            class="inputWidth"
                    ></el-date-picker>
                </el-form-item>
            </el-col>
            <el-col :span="8">
                <el-form-item label="有效日期:">
                    <el-date-picker
                            v-model="formQuery.yxqz"
                            value-format="yyyy-MM-dd"
                            format="yyyy-MM-dd"
                            clearable
                            disabled
                            class="inputWidth"
                    ></el-date-picker>
                </el-form-item>
            </el-col>
            <el-col :span="8">
                <el-form-item label="状态:">
                    <el-select
                            class="inputWidth"
                            disabled
                            v-model="formQuery.sgzt"
                            placeholder="请选择"
                    >
                        <el-option
                                v-for="(item, index) in ['无效', '有效']"
                                :key="index"
                                :label="item"
                                :value="`${index}`"
                        ></el-option>
                    </el-select>
                </el-form-item>
            </el-col>
        </el-row>
        <div
                class="sub_title"
                @click="subTitle.qyyjxx = !subTitle.qyyjxx"
                :class="{ sub_title__icon_arrow_down: subTitle.qyyjxx }"
        >
            企业应急信息
            <i class="el-icon-arrow-up"></i>
        </div>

		<el-row v-show="subTitle.qyyjxx">
			<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>
		<div
			class="sub_title"
			@click="subTitle.sjjtxx = !subTitle.sjjtxx"
			:class="{ sub_title__icon_arrow_down: subTitle.sjjtxx }"
		>
			上级集团信息
			<i class="el-icon-arrow-up"></i>
		</div>
		<el-row v-show="subTitle.sjjtxx">
			<el-col :span="8">
				<el-form-item label="上级集团:">
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.sjjtmc"
						maxlength="20"
					></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="8">
				<el-form-item
					label="上级集团统一社会信用代码:"
					prop="sjjttyshxydm"
					:rules="{
						validator: checkTYSHXYDM,
						trigger: ['change', 'blur'],
					}"
				>
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.sjjttyshxydm"
						maxlength="20"
					></el-input>
				</el-form-item>
			</el-col>
		</el-row>
		<div
			class="sub_title"
			@click="subTitle.jgqyxx = !subTitle.jgqyxx"
			:class="{ sub_title__icon_arrow_down: subTitle.jgqyxx }"
		>
			加工企业信息
			<i class="el-icon-arrow-up"></i>
		</div>
		<el-row v-show="subTitle.jgqyxx">
			<el-col :span="8">
				<el-form-item label="产业化龙头企业:">
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="tzYjqyVO.cyhltqy"
						maxlength="20"
					></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="8">
				<el-form-item label="放心粮油示范工程:">
					<!-- 1、省，2、市。3、县 -->
					<el-select
						class="inputWidth"
						:disabled="showLock"
						v-model="tzYjqyVO.fxlysfgc"
					>
						<el-option
							v-for="(item, i) in [
								[3, '县级'],
								[0, '否'],
							]"
							:key="i"
							:label="item[1]"
							:value="item[0]"
						></el-option>
					</el-select>
					<!-- <el-input class="inputWidth" :disabled="showLock" v-model="tzYjqyVO.fxlysfgc"></el-input> -->
				</el-form-item>
			</el-col>
			<el-col :span="8">
				<el-form-item label="全国工业产品生产许可证品种:">
					<el-select
						class="inputWidth"
						:disabled="showLock"
						v-model="tzYjqyVO.qggycpscxkzpz"
					>
						<el-option
							v-for="(item, i) in [
								[1, '小麦粉'],
								[2, '豆制品'],
								[0, '其他'],
							]"
							:key="i"
							:label="item[1]"
							:value="item[0]"
						></el-option>
					</el-select>
					<!-- <el-input class="inputWidth" :disabled="showLock" v-model="tzYjqyVO.qggycpscxkzpz"></el-input> -->
				</el-form-item>
			</el-col>
			<el-col :span="8">
				<el-form-item label="是否主食加工中央厨房:">
					<el-radio-group
						:disabled="showLock"
						v-model="tzYjqyVO.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="tzYjqyVO.yfzxjb"></el-input> -->
					<el-select
						class="inputWidth"
						:disabled="showLock"
						v-model="tzYjqyVO.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>

		<div
			class="sub_title"
			@click="subTitle.qyjjsj = !subTitle.qyjjsj"
			:class="{ sub_title__icon_arrow_down: subTitle.qyjjsj }"
		>
			企业经济数据
			<i class="el-icon-arrow-up"></i>
		</div>
		<el-row v-show="subTitle.qyjjsj">
			<el-col :span="8">
				<el-form-item
					label="营业收入(万元):"
					prop="yysr"
					:rules="[{ validator: rulesNum, trigger: 'blur' }]"
				>
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.yysr"
						maxlength="9"
					></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="8">
				<el-form-item
					label="工业总产值(万元):"
					prop="gyzcz"
					:rules="[{ validator: rulesNum, trigger: 'blur' }]"
				>
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.gyzcz"
						maxlength="9"
					></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="8">
				<el-form-item
					label="产品销售收入(万元):"
					prop="cpxssr"
					:rules="[{ validator: rulesNum, trigger: 'blur' }]"
				>
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.cpxssr"
						maxlength="15"
					></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="8">
				<el-form-item
					label="利税总额(万元):"
					prop="lsze"
					:rules="[{ validator: rulesNum, trigger: 'blur' }]"
				>
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.lsze"
						maxlength="9"
					></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="8">
				<el-form-item
					label="利润总额(万元):"
					prop="lrze"
					:rules="[{ validator: rulesNum, trigger: 'blur' }]"
				>
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.lrze"
						maxlength="9"
					></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="8">
				<el-form-item
					label="资产总额(万元):"
					prop="zcze"
					:rules="[
						rules('资产总额'),
						{ validator: rulesNum, trigger: 'blur' },
					]"
				>
					<el-tooltip
						class="item"
						effect="light"
						placement="top-start"
					>
						<div slot="content" class="el-tooltip__popper__ts">
							填写上一年度财务报表数
						</div>
						<el-input
							class="inputWidth"
							:disabled="showLock"
							v-model="formQuery.zcze"
							maxlength="15"
						></el-input>
					</el-tooltip>
				</el-form-item>
			</el-col>
			<el-col :span="8">
				<el-form-item
					label="当年研究开发投入(万元):"
					prop="dnyjkftr"
					:rules="[{ validator: rulesNum, trigger: 'blur' }]"
				>
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.dnyjkftr"
						maxlength="9"
					></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="8">
				<el-form-item
					label="政府支持投入(万元):"
					prop="zfzctr"
					:rules="[{ validator: rulesNum, trigger: 'blur' }]"
				>
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.zfzctr"
						maxlength="15"
					></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="8">
				<el-form-item
					label="当年专利获得数(件):"
					prop="dnzlhds"
					:rules="[{ validator: rulesNum, trigger: 'blur' }]"
				>
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.dnzlhds"
						maxlength="9"
					></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="8">
				<el-form-item
					label="发明专利(件):"
					prop="fmzl"
					:rules="[{ validator: rulesNum, trigger: 'blur' }]"
				>
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.fmzl"
						maxlength="20"
					></el-input>
				</el-form-item>
			</el-col>
		</el-row>

		<div
			class="sub_title"
			@click="subTitle.qysbjnh = !subTitle.qysbjnh"
			:class="{ sub_title__icon_arrow_down: subTitle.qysbjnh }"
		>
			企业设备及能耗
			<i class="el-icon-arrow-up"></i>
		</div>
		<el-row v-show="subTitle.qysbjnh">
			<el-col :span="8">
				<el-form-item label="年产粮油机械制造:">
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.nclyjxzz"
						maxlength="9"
					></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"
						maxlength="20"
					></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"
						maxlength="20"
					></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="8">
				<el-form-item label="油脂加工主机:">
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.yzjgzj"
						maxlength="20"
					></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"
						maxlength="20"
					></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"
						maxlength="20"
					></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="8">
				<el-form-item label="通用设备:">
					<el-input
						class="inputWidth"
						:disabled="showLock"
						v-model="formQuery.tysb"
						maxlength="20"
					></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"
						maxlength="9"
					></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="8">
				<el-form-item label="能源消耗水:">
					<el-input
						class="inputWidth"
						:disabled="showLock"
						@change="limitNyxhs"
						v-model="formQuery.nyxhs"
						maxlength="20"
					></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="8">
				<el-form-item label="能源消耗标准煤:">
					<el-input
						class="inputWidth"
						:disabled="showLock"
						@change="limitNhxhbzm"
						v-model="formQuery.nhxhbzm"
						maxlength="9"
					></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="8">
				<el-form-item label="能源消耗溶剂:">
					<el-input
						class="inputWidth"
						:disabled="showLock"
						@change="limitNyxhrj"
						v-model="formQuery.nyxhrj"
						maxlength="20"
					></el-input>
				</el-form-item>
			</el-col>

			<el-col :span="16">
				<el-form-item label="仓房:">
					<el-input
						style="width: 80px"
						:disabled="showLock"
						@change="limitCfd"
						v-model="formQuery.cfd"
						maxlength="9"
						onkeyup="this.value=(this.value.replace(/\D/g,'')==''?'':parseInt(this.value))"
					></el-input>
					<span>&nbsp;&nbsp;栋&nbsp;&nbsp;</span>
					<el-input
						style="width: 80px"
						:disabled="showLock"
						@change="limitCfj"
						v-model="formQuery.cfj"
						maxlength="9"
						onkeyup="this.value=(this.value.replace(/\D/g,'')==''?'':parseInt(this.value))"
					></el-input>
					<span>&nbsp;&nbsp;间</span>
				</el-form-item>
			</el-col>
			<el-col :span="24">
				<el-form-item label="备注:">
					<el-input
						type="textarea"
						rows="3"
						style="width: 95%"
						:disabled="showLock"
						v-model="formQuery.remark"
						maxlength="2000"
					></el-input>
				</el-form-item>
			</el-col>
		</el-row>

		<div
			v-if="formQuery.sfba == 3 || formQuery.sfba == 5"
			class="sub_title"
			@click="subTitle.spxx = !subTitle.spxx"
			:class="{ sub_title__icon_arrow_down: subTitle.spxx }"
		>
			审批信息
			<i class="el-icon-arrow-up"></i>
		</div>
		<el-row
			v-if="formQuery.sfba == 3 || formQuery.sfba == 5"
			v-show="subTitle.spxx"
		>
			<el-col :span="24">
				<el-form-item label="审批:">
					<el-radio-group v-model="formQuery.sfba" disabled>
						<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
						type="textarea"
						:autosize="{ minRows: 3 }"
						v-model="formQuery.shyj"
					></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="8">
				<el-form-item label="审核人:">
					<el-input
						class="inputWidth"
						disabled
						v-model="formQuery.shrmc"
					></el-input>
				</el-form-item>
			</el-col>
			<el-col :span="8">
				<el-form-item label="审核时间:">
					<el-date-picker
						v-model="formQuery.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 iconbaocun"
					v-if="!showLock"
					@click="handleSubmit('save')"
					>保存</el-button
				>
				<el-button
					type="primary"
					icon="iconfont icontijiao"
					v-if="!showLock"
					@click="handleSubmit('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,
	findProvince,
	findCity,
	findCountyQ,
	dwzyywOpts,
} from '@/api/jcxxwh/qyjcxx'
import { getNowDate } from '@/utils/index'
import { cityDetain } from '@/api/login/login'
function formatData(list) {
	return list.map((item) => {
		let newItem = {}
		newItem.label = item.orgName
		newItem.value = item.orgName
		newItem.code = item.orgCode
		if (item.orgCode.length == 8) {
			return newItem
		}
		if (item.hasOwnProperty('children') && item.children.length > 0) {
			newItem.children = formatData(item.children)
			newItem.children.length = 18
		}

            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 {
                oooops: [],
                subTitle: {
                    lssgzg: true,
                    qyyjxx: true,
                    sjjtxx: true,
                    jgqyxx: true,
                    qyjjsj: true,
                    qysbjnh: true,
                    spxx: true,
                },
                dwzyywOpts: [],
                qylxArr: [],
                defaultParams: {
                    label: "label",
                    value: "code",
                    children: "children",
                    name: "label",
                    emitPath: false,
                },
                tree: [],
                qylxOpts: [], // 企业类型options
                showLock: false,
                formQuery: {
                    sfdlfrzg: "",
                    zcrq: "",
                },
                tzYjqyVO: {}, // 加工企业信息
                dwzyywArr: [],
                qylx1: [],
                dwlx: [],
                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: "利达粮油",
                    },
                    {
                        value: "4",
                        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: "高级",
                    },
                ],
                options8: [
                    {
                        value: "国有及国有控股企业",
                        label: "国有及国有控股企业",
                    },
                    {
                        value: "港澳台商及外商企业",
                        label: "港澳台商及外商企业",
                    },
                    {
                        value: "内资非国有企业",
                        label: "内资非国有企业",
                    }
                ],
                // tzQylxVOList: []
                szdProvince: [], //所在地省
                szdCity: [],//注册地市
                zcdProvince: [], //所在地省
                zcdCity: [], //注册地市
            };
        },
        methods: {
            //获取省
            initProvince(){
                findProvince().then(res=>{
                    this.szdProvince = res.data
                    this.zcdProvince = res.data
                }).catch()
            },
            initCity(val,name){
                //310000--上海,500000--重庆,110000--北京,120000--天津
                if(val == 310000 || val == 500000 || val == 110000 || val == 120000){
                    //获取直辖市下的区
                    findCountyQ(val).then(res=>{
                        this[name] = res.data
                    }).catch()
                }else{
                    //获取省下的市
                    findCity(val).then(res=>{
                        this[name] = res.data
                    }).catch()
                }
            },
            initzcdCity(val){
                this.$set(this.formQuery,'zccity','')
                this.initCity(val,'zcdCity')
            },
            initszdCity(val){
                this.$set(this.formQuery,'txcity','')
                this.initCity(val,'szdCity')
            },
            limitGr(val) {
                if (!Number(val) && Number(val) != 0) {
                    this.$message.info("输入格式不正确");
                    this.formQuery.gr = null;
                }
            },
            limitZcr(val) {
                if (!Number(val) && Number(val) != 0) {
                    this.$message.info("输入格式不正确");
                    this.formQuery.zcr = null;
                }
            },
            limitNyxhrj(val) {
                if (!Number(val)) {
                    this.$message.info("输入格式不正确");
                    this.formQuery.nyxhrj = "";
                }
            },
            limitNhxhbzm(val) {
                if (!Number(val)) {
                    this.$message.info("输入格式不正确");
                    this.formQuery.nhxhbzm = "";
                }
            },
            limitNyxhs(val) {
                if (!Number(val)) {
                    this.$message.info("输入格式不正确");
                    this.formQuery.nyxhs = "";
                }
            },
            limitCfj(val) {
                if (!Number(val)) {
                    this.$message.info("输入格式不正确");
                    this.formQuery.cfj = "";
                }
            },
            limitCfd(val) {
                if (!Number(val)) {
                    this.$message.info("输入格式不正确");
                    this.formQuery.cfd = "";
                }
            },
            formatFloat(val, d, type) {
                if (/\d\.$/.test(d)) {
                    this.formQuery[type] = Number(d);
                }

			if (/\d\.\d{5,}$/.test(d)) {
				this.formQuery[type] = parseFloat(d).toFixed(5)
			}
		},
		checkTYSHXYDM(rule, value, callback) {
			if (/^[^_IOZSVa-z\W]{2}\d{6}[^_IOZSVa-z\W]{10}$/.test(value)) {
				callback()
			} else if (!value) {
				callback()
			} else {
				callback(new Error('请输入正确的统一社会信用代码'))
			}
		},
		checkEmail(rule, value, callback) {
			let val = value && value.trim()
			if (!val) callback()
			else if (
				/^([a-zA-Z0-9._-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/.test(
					val
				)
			)
				callback()
			else callback(new Error('请按照正确邮箱格式填写'))
		},
		checkPostal(rule, value, callback) {
			let val = value && value.trim()
			if (!val) {
				callback()
			} else if (/^[0-9]{6}$/.test(val)) {
				callback()
			} else {
				callback(new Error('请按照正确的邮编格式填写'))
			}
		},
		checkBox1(rule, value, callback) {
			if (this.dwzyywArr.length) {
				callback()
			} else {
				callback(new Error('请勾选单位主要业务'))
			}
		},
		checkBox2(rule, value, callback) {
			if (this.qylxArr.length) {
				callback()
			} else {
				callback(new Error('请勾选企业类型'))
			}
		},
		checkPhone(rule, value, callback) {
			var val = value && value.trim()
			if (/^1\d{10}$/.test(val)) {
				callback()
			} else {
				callback(new Error('请按正确手机号码格式填写'))
			}
		},
		checkCall(rule, value, callback) {
			var val = value && value.trim()
			if (/^(\(\d{3,4}\)|\d{3,4}-|\s)?\d{7,14}$/.test(val)) {
				callback()
			} else {
				callback(new Error('请按正确电话号码格式填写'))
			}
		},
		checkFax(rule, value, callback) {
			var val = value && value.trim()
			if (/^(\d{3,4}-)?\d{7,8}$/.test(val)) {
				callback()
			} else {
				callback(new Error('请按照正确的传真号码填写'))
			}
		},
		checkUnitCode(rule, value, callback) {
			var val = value && value.trim()
			if (/^\d{8}$/.test(val)) {
				callback()
			} else {
				callback(new Error('请输入8位数单位代码'))
			}
		},
		checkThreeDP(rule, value, callback) {
			var val = value
			if (/^0{1}([.]\d{1,3})?$|^[1-9]\d*([.]{1}[0-9]{1,3})?$/.test(val)) {
				callback()
			} else {
				callback(new Error('只能保留3位小数'))
			}
		},
		rulesNum(rule, value, callback) {
			const reg =
				/(^[1-9](\d+)?(\.\d{1,2})?$)|(^[1-9]$)|(^\d\.[1-9]{1,2}$)|(^\d\.[0]{1}[1-9]{1}$|(^\d\.[1-9]{1}[0]{1}$)$)/
			if (value == '' || value == undefined || value == null) {
				callback()
			} else {
				if (!reg.test(value)) {
					callback(new Error('请输入数字格式'))
				} else {
					if (value.length > 20) {
						callback(new Error('输入字符个数最大20个'))
					} else {
						callback()
					}
				}
			}
		},
		rulesNumZ(rule, value, callback) {
			const reg = /^\+?[0-9][0-9]*$/
			if (value == '' || value == undefined || value == null) {
				callback()
			} else {
				if (!reg.test(value)) {
					callback(new Error('请输入整数'))
				} else {
					if (value.length > 20) {
						callback(new Error('输入字符个数最大20个'))
					} else {
						callback()
					}
				}
			}
		},
		rules(label) {
			return {
				required: true,
				message: '请输入' + label,
				trigger: ['change', 'blur'],
			}
		},
		checkDz(rule, value, callback) {
			if (!this.formQuery.txprovince) {
				callback(new Error('请选择所在省市'))
			} else if (!this.formQuery.txcity) {
				callback(new Error('请选择所在市区'))
			} else if (!this.formQuery.qytxdz) {
				callback(new Error('请输入所在地'))
			} else {
				callback()
			}
		},
		checkZcd(rule, value, callback) {
			if (!this.formQuery.zcprovince) {
				callback(new Error('请选择所在省市'))
			} else if (!this.formQuery.zccity) {
				callback(new Error('请选择所在市区'))
			} else if (!this.formQuery.qygszcd) {
				callback(new Error('请输入注册地'))
			} else {
				callback()
			}
		},
		zgzRules(label) {
			return {
				required: this.formQuery.sfjysgzg == '1',
				message: '请输入' + label,
				trigger: ['change', 'blur'],
			}
		},
		handleQYLXChange(val) {
			// var cur = this.options.filter((d) => val.includes(d.value))
			var cur = this.qylxOpts.filter((d) => val.includes(d.dictName))
			cur = cur.map((d) => ({
				qylxbh: d.dictCode,
				qylxmc: d.dictName,
				qyid: this.formQuery.id,
			}))
			// this.formQuery.qylx = this.qylxArr.join(",");
			this.formQuery.tzQylxVOList = cur
		},
		handeleDWLXChange(val) {
			this.formQuery.dwlx = this.formQuery.dwlxArr.join(',')
		},
		getInfo() {
			var code = this.$route.query.code
			getCompanyInfo(code).then((res) => {
				if (!res) return
				var detailQuery = res.data

                    // for (var x in detailQuery) {
                    // 	if (!detailQuery[x]) detailQuery[x] = 3
                    // }
                    this.tzYjqyVO = detailQuery.tzYjqyVO || {};
                    this.tzYjqyVO.qyid = detailQuery.id;
                    if (detailQuery.sfjysgzg)
                        detailQuery.sfjysgzg = detailQuery.sfjysgzg + "";
                    this.tzYjqyVO.id = this.tzYjqyVO ? this.tzYjqyVO.id : null;
                    console.log(detailQuery.qyzyyw, "qyzyyw");
                    let arr = [];
                    if(detailQuery.qyzyyw && detailQuery.qyzyyw.length){
                        if (detailQuery.qyzyyw.indexOf(",") == -1) {
                            this.dwzyywOpts.map((item) => {
                                if (detailQuery.qyzyyw == item.dictCode) {
                                    arr.push(item.dictName);
                                }
                            });
                        } else {
                            detailQuery.qyzyyw.split(",").map((item) => {
                                this.dwzyywOpts.map((iitem) => {
                                    if (item == iitem.dictCode) {
                                        arr.push(iitem.dictName);
                                    }
                                });
                            });
                        }
                    }
                    this.dwzyywArr = arr ? arr : [];

                    this.qylxArr = detailQuery.tzQylxVOList ? detailQuery.tzQylxVOList.map((d) => d.qylxmc): [];
                    this.formQuery = detailQuery;
                    this.$set(this.formQuery,'dwlxArr',[])
                    this.formQuery.dwlxArr = detailQuery.dwlx ? detailQuery.dwlx.split(",") : [];
                    //默认天津
                    if(!detailQuery.zcprovince){
                        detailQuery.zcprovince = '120000'
                    }
                    if(!detailQuery.txprovince){
                        detailQuery.txprovince = '120000'
                    }
                    this.initCity(detailQuery.zcprovince,'zcdCity')
                    this.initCity(detailQuery.txprovince,'szdCity')
                    // console.log(this.formQuery.sfzdzgqy, 'sfzdzgqy')
                    // console.log(this.formQuery.fzrq, 'this.formQuery.fzrq')
                    // console.log(this.formQuery.yxqz, 'this.formQuery.yxqz')
                    // console.log(this.formQuery.sgzt, 'this.formQuery.sgzt')
                    this.$nextTick(() => {
                        this.$refs.detailForm.clearValidate();
                    });


                });
            },
            handleSubmit(status) {
                if (status == "save") {
                    this.saveSubmit(status);
                    return;
                }
                this.$refs.detailForm.validate((valid) => {
                    if (valid) {
                        this.saveSubmit(status);
                        return;
                    }
                    this.$message.warning("必填项未填写或有格式填写错误,请先完善修改");
                });
            },
            saveSubmit(status) {
                this.formQuery.dwlx = this.formQuery.dwlxArr.join(",");
                this.formQuery = {
                    ...this.formQuery,
                    tzYjqyVO: this.tzYjqyVO,
                };
                let arr = [];
                this.dwzyywArr.map((item) => {
                    this.dwzyywOpts.map((iitem) => {
                        if (item == iitem.dictName) {
                            arr.push(iitem.dictCode);
                        }
                    });
                });
                this.formQuery.qyzyyw = arr.join(",");
                console.log("this.formQuery.qyzyyw", this.formQuery.qyzyyw);
                this.formQuery.qylx = this.formQuery.tzQylxVOList.map((d) => d.qylxbh);
                this.formQuery.dsbxxsjyVOList = [];
                // this.formQuery.qylx = this.formQuery.qylx.join(",");
                /*console.log(this.formQuery.sfzdzgqy, "sfzdzgqy");
                console.log(this.formQuery.fzrq, "this.formQuery.fzrq");
                console.log(this.formQuery.yxqz, "this.formQuery.yxqz");
                console.log(this.formQuery.sgzt, "this.formQuery.sgzt");*/
                if (status == "save") {
                    this.formQuery.sfba = "1";
                    console.log("this.formQuery==>", this.formQuery);
                    editCompanyInfo(this.formQuery).then((res) => {
                        console.log("-----------", res);
                        if (res.infoCode == 200) {
                            this.$message({
                                message: "保存成功",
                                type: "success",
                                duration: 2000,
                            });
                            this.$router.push({ path: "/grainCoManage/enterpriseInformationBase/index" });
                        } else {
                            this.$message({
                                message: "保存失败",
                                type: "success",
                                duration: 2000,
                            });
                        }
                    });
                } else if (status == "send") {
                    this.formQuery.sfba = "2";
                    editCompanyInfo(this.formQuery).then((res) => {
                        if (res.infoCode == 200) {
                            this.$message({
                                message: "提交成功",
                                type: "success",
                                duration: 2000,
                            });
                            this.$router.push({ path: "/grainCoManage/enterpriseInformationBase/index" });
                        } else {
                            this.$message({
                                message: "提交失败",
                                type: "success",
                                duration: 2000,
                            });
                        }
                    });
                }
            },
            cancel() {
                this.$router.push({ path: "/grainCoManage/enterpriseInformationBase/index" });
            },
            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;
                    if(this.formQuery.qyzyyw){
                        let arr = [];
                        if (this.formQuery.qyzyyw.indexOf(",") == -1) {
                            this.dwzyywOpts.map((item) => {
                                if (this.formQuery.qyzyyw == item.dictCode) {
                                    arr.push(item.dictName);
                                }
                            });
                        } else {
                            this.formQuery.qyzyyw.split(",").map((item) => {
                                this.dwzyywOpts.map((iitem) => {
                                    if (item == iitem.dictCode) {
                                        arr.push(iitem.dictName);
                                    }
                                });
                            });
                        }
                        this.dwzyywArr = arr ? arr : [];
                    }
                });
                tree().then((res) => {
                    if (!res) {
                        this.tree = [];
                        return;
                    }
                    var arr = [];
                    arr.push(res.data);
                    this.tree = formatData(arr);
                    arr[0].children.forEach((item) => {
                        if (item.orgCode == "LS001060") {
                            console.log(item);
                            this.tree[0].children.push({
                                label: item.orgName,
                                value: item.orgName,
                                code: item.orgCode,
                            });
                        }
                    });
                    console.info(this.tree);
                });
            },
        },
        created() {
            this.initProvince()
            this.initOpts();

		cityDetain().then((res) => {
			this.oooops = res ? res.data : []
		})
		if (this.$route.query.status) {
			this.showLock = true
		} else {
			this.showLock = false
		}
		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% !important;
}

.sub_title {
	width: 98%;
	text-align: center;
	font-size: 1em;
	line-height: 2.5em;
	color: #fff;
	background-color: #49a2fa;
	box-sizing: border-box;
	margin-bottom: 20px;
	position: relative;
	cursor: pointer;
	&.sub_title__icon_arrow_down {
		.el-icon-arrow-up {
			transform: rotate(180deg);
		}
	}
	.el-icon-arrow-up {
		transition: transform 0.3s;
		position: absolute;
		right: 0.5em;
		font-size: 1.6em;
		line-height: 1.6em;
	}
}

.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;
	}
}
/*/deep/ .el-form-item__content{*/
/*  display: flex;*/
/*}*/
/deep/ .el-select {
	display: inline-block !important;
}
</style>
