<template>
    <div class="search-result-box">
        <!-- <div class="search-input">
            <van-search type="text" v-model="searchValue" show-action placeholder="请输入搜索关键词" @search="onSearch" @cancel="onCancel" />
        </div> -->
        <van-popup position="bottom" :style="{ height: '50%' }" v-model="businessInformation.dateSelectShow">
            <van-datetime-picker :min-date="minDate" @confirm="startDateOk" @cancel="startDateCancel"
                v-if="businessInformation.startDateShow"></van-datetime-picker>
            <van-datetime-picker :min-date="minDate" @confirm="endDateOk" @cancel="endDateCancel"
                v-if="businessInformation.endDateShow"></van-datetime-picker>
        </van-popup>
        <van-dropdown-menu :closeOnClickOutside=false active-color="#2372eb">
            <van-dropdown-item ref="areaDrop" title="区域筛选">
                <van-picker show-toolbar :columns="areaList" @confirm="areaOk" @cancel="areaCancel" />
            </van-dropdown-item>
            <van-dropdown-item ref="industryDrop" title="行业筛选">
                <div class="popup-box">
                    <ul class="select-item-box">
                        <li v-for=" (industryItem, industryIndex) in industryList " @click="industrySelect(industryIndex)"
                            :class="[industryItem.isSelect ? 'select-item-active' : '']" :key="industryItem.text"
                            class="select-item">{{ industryItem.text }}</li>
                    </ul>
                    <van-row class="more-screen-bottom-botton" gutter="16">
                        <van-col span="12"><van-button type="primary" size="small" plain block
                                @click="onIndustryCancel()">重置</van-button></van-col>
                        <van-col span="12"><van-button type="primary" size="small" block
                                @click="onIndustryConfirm()">确定</van-button></van-col>
                    </van-row>
                </div>
            </van-dropdown-item>
            <van-dropdown-item ref="moreScreenDrop" title="更多筛选">
                <div class="more-screen-box">
                    <div class="more-screen-content">

                        <div class="more-screen-content-left">
                            <van-sidebar v-model="sidebarActive">
                                <van-sidebar-item title="工商信息" />
                                <van-sidebar-item title="风险信息" />
                            </van-sidebar>
                        </div>

                        <div class="more-screen-content-right">
                            <div v-if="sidebarActive == 0">
                                <div class="more-screen-content-cell">
                                    <div class="more-title-box">
                                        <div class="more-title-h2">经营范围</div>
                                        <div class="select-slider-show"></div>
                                    </div>
                                    <div>
                                        <van-search type="text" v-model="businessInformation.businessScope"
                                            placeholder="请输入搜索关键词" />
                                    </div>
                                </div>
                                <div class="more-screen-content-cell">
                                    <div class="more-title-box">
                                        <div class="more-title-h2">成立年限</div>
                                        <div class="select-slider-show"></div>
                                    </div>
                                    <div class="chengli-input-box">
                                        <van-row>
                                            <van-col span="11">
                                                <div class="chengli-input" @click="establishmentPeriodNumChange('min')">{{
                                                    businessInformation.establishmentPeriodMinDate }}</div>
                                            </van-col>
                                            <van-col class="chengli-input-line" span="2">—</van-col>
                                            <van-col span="11">
                                                <div class="chengli-input" @click="establishmentPeriodNumChange('max')">{{
                                                    businessInformation.establishmentPeriodMaxDate }}</div>
                                            </van-col>
                                        </van-row>
                                    </div>
                                    <ul class="select-item-box">
                                        <li v-for=" (establishmentPeriodItem, establishmentPeriodIndex) in businessInformation.establishmentPeriodList "
                                            @click="establishmentPeriodSelect(establishmentPeriodItem.title, establishmentPeriodItem.min, establishmentPeriodItem.max)"
                                            :class="[businessInformation.establishmentPeriodValue == establishmentPeriodItem.title ? 'select-item-active' : '']"
                                            :key="establishmentPeriodItem.title" class="select-item">{{
                                                establishmentPeriodItem.title }}</li>
                                    </ul>
                                </div>

                                <div class="more-screen-content-cell">
                                    <div class="more-title-box">
                                        <div class="more-title-h2">注册资本</div>
                                        <div class="select-slider-show"></div>
                                    </div>
                                    <div class="chengli-input-box">
                                        <van-row>
                                            <van-col span="10">
                                                <input class="chengli-input"
                                                    v-model="businessInformation.registeredCapitalMin" placeholder="最低金额"
                                                    @change="registeredCapitalNumChange('min')" type="text">
                                            </van-col>
                                            <van-col class="chengli-input-line" span="1"
                                                style="font-size:13px;padding-top: 5px;">万</van-col>
                                            <van-col class="chengli-input-line" span="2"
                                                style="font-size:12px;padding-top: 5px;">—</van-col>
                                            <van-col span="10">
                                                <input class="chengli-input"
                                                    v-model="businessInformation.registeredCapitalMax" placeholder="最高金额"
                                                    @change="registeredCapitalNumChange('max')" type="text">
                                            </van-col>
                                            <van-col class="chengli-input-line" span="1"
                                                style="font-size:13px;padding-top: 5px;">万</van-col>
                                        </van-row>
                                    </div>
                                    <ul class="select-item-box">
                                        <li v-for=" (registeredCapitalItem, registeredCapitalIndex) in businessInformation.registeredCapitalList "
                                            @click="registeredCapitalSelect(registeredCapitalItem.title, registeredCapitalItem.min, registeredCapitalItem.max)"
                                            :class="[businessInformation.registeredCapitalValue == registeredCapitalItem.title ? 'select-item-active' : '']"
                                            :key="registeredCapitalItem.title" class="select-item">{{
                                                registeredCapitalItem.title }}
                                        </li>
                                    </ul>
                                </div>



                                <div class="more-screen-content-cell">
                                    <div class="more-title-box">
                                        <div class="more-title-h2">企业状态</div>
                                        <div class="select-slider-show"></div>
                                    </div>

                                    <ul class="select-item-box">
                                        <li v-for=" (enterpriseStatusItem, enterpriseStatusIndex) in businessInformation.enterpriseStatusList "
                                            @click="enterpriseStatusSelect(enterpriseStatusIndex)"
                                            :class="[enterpriseStatusItem.isSelect ? 'select-item-active' : '']"
                                            :key="enterpriseStatusItem.title" class="select-item">{{
                                                enterpriseStatusItem.title }}</li>
                                    </ul>
                                </div>


                                <div class="more-screen-content-cell">
                                    <div class="more-title-box">
                                        <div class="more-title-h2">企业类型</div>
                                        <div class="select-slider-show"></div>
                                    </div>

                                    <ul class="select-item-box">
                                        <li v-for=" (organizationTypeItem, organizationTypeIndex) in businessInformation.organizationTypeList "
                                            @click="organizationTypeSelect(organizationTypeIndex)"
                                            :class="[organizationTypeItem.isSelect ? 'select-item-active' : '']"
                                            :key="organizationTypeItem.title" class="select-item">{{
                                                organizationTypeItem.title }}
                                        </li>
                                    </ul>
                                </div>


                                <!--                                <div class="more-screen-content-cell">-->
                                <!--                                    <div class="more-title-box">-->
                                <!--                                        <div class="more-title-h2">是否上市</div>-->
                                <!--                                        <div class="select-slider-show"></div>-->
                                <!--                                    </div>-->

                                <!--                                    <ul class="select-item-box">-->
                                <!--                                        <li v-for=" (listedIsOrNotItem, listedIsOrNotIndex) in businessInformation.universalUnlimitedList "-->
                                <!--                                            @click="listedIsOrNotSelect(listedIsOrNotItem)"-->
                                <!--                                            :class="[businessInformation.listedIsOrNotValue == listedIsOrNotItem ? 'select-item-active' : '']"-->
                                <!--                                            :key="listedIsOrNotItem" class="select-item">{{ listedIsOrNotItem }}-->
                                <!--                                        </li>-->
                                <!--                                    </ul>-->
                                <!--                                </div>-->

                                <!--                                <div class="more-screen-content-cell">-->
                                <!--                                    <div class="more-title-box">-->
                                <!--                                        <div class="more-title-h2">联系方式</div>-->
                                <!--                                        <div class="select-slider-show"></div>-->
                                <!--                                    </div>-->
                                <!--                                    <ul class="select-item-box">-->
                                <!--                                        <li v-for=" (contactInformationItem, contactInformationIndex) in businessInformation.universalUnlimitedList "-->
                                <!--                                            @click="contactInformationSelect(contactInformationItem)"-->
                                <!--                                            :class="[businessInformation.contactInformationValue == contactInformationItem ? 'select-item-active' : '']"-->
                                <!--                                            :key="contactInformationItem" class="select-item">{{ contactInformationItem-->
                                <!--                                            }}-->
                                <!--                                        </li>-->
                                <!--                                    </ul>-->
                                <!--                                </div>-->



                                <!--                                <div class="more-screen-content-cell">-->
                                <!--                                    <div class="more-title-box">-->
                                <!--                                        <div class="more-title-h2">优质名录</div>-->
                                <!--                                        <div class="select-slider-show"></div>-->
                                <!--                                    </div>-->
                                <!--                                    <ul class="select-item-box">-->
                                <!--                                        <li v-for=" (highQualityDirectoryItem, highQualityDirectoryIndex) in businessInformation.highQualityDirectoryList "-->
                                <!--                                            @click="highQualityDirectorySelect(highQualityDirectoryIndex)"-->
                                <!--                                            :class="[highQualityDirectoryItem.isSelect ? 'select-item-active' : '']"-->
                                <!--                                            :key="highQualityDirectoryItem.title" class="select-item">{{-->
                                <!--                                                highQualityDirectoryItem.title }}-->
                                <!--                                        </li>-->
                                <!--                                    </ul>-->
                                <!--                                </div>-->


                            </div>
                            <div v-if="sidebarActive == 1">

                                <div class="more-screen-content-cell">
                                    <div class="more-title-box">
                                        <div class="more-title-h2">经营异常</div>
                                        <div class="select-slider-show"></div>
                                    </div>

                                    <ul class="select-item-box">
                                        <li v-for=" (businessAbnormalitiesItem, businessAbnormalitiesIndex) in businessInformation.universalUnlimitedList "
                                            @click="businessAbnormalitiesSelect(businessAbnormalitiesItem)"
                                            :class="[businessInformation.businessAbnormalitiesValue == businessAbnormalitiesItem ? 'select-item-active' : '']"
                                            :key="businessAbnormalitiesItem" class="select-item">{{
                                                businessAbnormalitiesItem }}
                                        </li>
                                    </ul>
                                </div>
                                <!--                                <div class="more-screen-content-cell">-->
                                <!--                                    <div class="more-title-box">-->
                                <!--                                        <div class="more-title-h2">股权冻结</div>-->
                                <!--                                        <div class="select-slider-show"></div>-->
                                <!--                                    </div>-->

                                <!--                                    <ul class="select-item-box">-->
                                <!--                                        <li v-for=" (equityFreezeItem, equityFreezeIndex) in businessInformation.universalUnlimitedList "-->
                                <!--                                            @click="equityFreezeSelect(equityFreezeItem)"-->
                                <!--                                            :class="[businessInformation.equityFreezeValue == equityFreezeItem ? 'select-item-active' : '']"-->
                                <!--                                            :key="equityFreezeItem" class="select-item">{{ equityFreezeItem }}-->
                                <!--                                        </li>-->
                                <!--                                    </ul>-->
                                <!--                                </div>-->
                                <div class="more-screen-content-cell">
                                    <div class="more-title-box">
                                        <div class="more-title-h2">工商行政处罚</div>
                                        <div class="select-slider-show"></div>
                                    </div>

                                    <ul class="select-item-box">
                                        <li v-for=" (industrialCommercialPenaltiesItem, industrialCommercialPenaltiesIndex) in businessInformation.universalUnlimitedList "
                                            @click="industrialCommercialPenaltiesSelect(industrialCommercialPenaltiesItem)"
                                            :class="[businessInformation.industrialCommercialPenaltiesValue == industrialCommercialPenaltiesItem ? 'select-item-active' : '']"
                                            :key="industrialCommercialPenaltiesItem" class="select-item">{{
                                                industrialCommercialPenaltiesItem }}
                                        </li>
                                    </ul>
                                </div>

                                <div class="more-screen-content-cell">
                                    <div class="more-title-box">
                                        <div class="more-title-h2">环保行政处罚</div>
                                        <div class="select-slider-show"></div>
                                    </div>

                                    <ul class="select-item-box">
                                        <li v-for=" (environmentalPenaltiesItem, environmentalPenaltiesIndex) in businessInformation.universalUnlimitedList "
                                            @click="environmentalPenaltiesSelect(environmentalPenaltiesItem)"
                                            :class="[businessInformation.environmentalPenaltiesValue == environmentalPenaltiesItem ? 'select-item-active' : '']"
                                            :key="environmentalPenaltiesItem" class="select-item">{{
                                                environmentalPenaltiesItem }}
                                        </li>
                                    </ul>
                                </div>
                                <!--                                <div class="more-screen-content-cell">-->
                                <!--                                    <div class="more-title-box">-->
                                <!--                                        <div class="more-title-h2">环保评级</div>-->
                                <!--                                        <div class="select-slider-show"></div>-->
                                <!--                                    </div>-->
                                <!--                                    <ul class="select-item-box">-->
                                <!--                                        <li v-for=" (environmentalRatingItem, environmentalRatingIndex) in businessInformation.environmentalRatingList "-->
                                <!--                                            @click="environmentalRatingSelect(environmentalRatingItem)"-->
                                <!--                                            :class="[businessInformation.environmentalRatingValue == environmentalRatingItem ? 'select-item-active' : '']"-->
                                <!--                                            :key="environmentalRatingItem" class="select-item">{{-->
                                <!--                                                environmentalRatingItem }}-->
                                <!--                                        </li>-->
                                <!--                                    </ul>-->
                                <!--                                </div>-->

                                <!--                                <div class="more-screen-content-cell">-->
                                <!--                                    <div class="more-title-box">-->
                                <!--                                        <div class="more-title-h2">纳税评级</div>-->
                                <!--                                        <div class="select-slider-show"></div>-->
                                <!--                                    </div>-->
                                <!--                                    <ul class="select-item-box">-->
                                <!--                                        <li v-for=" (taxRatingItem, taxRatingIndex) in businessInformation.taxRatingList "-->
                                <!--                                            @click="taxRatingSelect(taxRatingItem)"-->
                                <!--                                            :class="[businessInformation.taxRatingValue == taxRatingItem ? 'select-item-active' : '']"-->
                                <!--                                            :key="taxRatingItem" class="select-item">{{ taxRatingItem }}-->
                                <!--                                        </li>-->
                                <!--                                    </ul>-->
                                <!--                                </div>-->
                                <div class="more-screen-content-cell">
                                    <div class="more-title-box">
                                        <div class="more-title-h2">涉税违法</div>
                                        <div class="select-slider-show"></div>
                                    </div>

                                    <ul class="select-item-box">
                                        <li v-for=" (taxRelatedViolationsItem, taxRelatedViolationsIndex) in businessInformation.universalUnlimitedList "
                                            @click="taxRelatedViolationsSelect(taxRelatedViolationsItem)"
                                            :class="[businessInformation.taxRelatedViolationsValue == taxRelatedViolationsItem ? 'select-item-active' : '']"
                                            :key="taxRelatedViolationsItem" class="select-item">{{
                                                taxRelatedViolationsItem }}
                                        </li>
                                    </ul>
                                </div>
                                <div class="more-screen-content-cell">
                                    <div class="more-title-box">
                                        <div class="more-title-h2">被执行人</div>
                                        <div class="select-slider-show"></div>
                                    </div>

                                    <ul class="select-item-box">
                                        <li v-for=" (ifThePersonItem, ifThePersonIndex) in businessInformation.universalUnlimitedList "
                                            @click="ifThePersonSelect(ifThePersonItem)"
                                            :class="[businessInformation.ifThePersonValue == ifThePersonItem ? 'select-item-active' : '']"
                                            :key="ifThePersonItem" class="select-item">{{ ifThePersonItem }}
                                        </li>
                                    </ul>
                                </div>
                                <div class="more-screen-content-cell">
                                    <div class="more-title-box">
                                        <div class="more-title-h2">失信被执行人</div>
                                        <div class="select-slider-show"></div>
                                    </div>

                                    <ul class="select-item-box">
                                        <li v-for=" (dishonestDebtorItem, dishonestDebtorIndex) in businessInformation.universalUnlimitedList "
                                            @click="dishonestDebtorSelect(dishonestDebtorItem)"
                                            :class="[businessInformation.dishonestDebtorValue == dishonestDebtorItem ? 'select-item-active' : '']"
                                            :key="dishonestDebtorItem" class="select-item">{{ dishonestDebtorItem }}
                                        </li>
                                    </ul>
                                </div>
                                <div class="more-screen-content-cell">
                                    <div class="more-title-box">
                                        <div class="more-title-h2">限制高消费</div>
                                        <div class="select-slider-show"></div>
                                    </div>
                                    <ul class="select-item-box">
                                        <li v-for=" (restrictHighConsumptionItem, restrictHighConsumptionIndex) in businessInformation.universalUnlimitedList "
                                            @click="restrictHighConsumptionSelect(restrictHighConsumptionItem)"
                                            :class="[businessInformation.restrictHighConsumptionValue == restrictHighConsumptionItem ? 'select-item-active' : '']"
                                            :key="restrictHighConsumptionItem" class="select-item">{{
                                                restrictHighConsumptionItem }}
                                        </li>
                                    </ul>
                                </div>
                                <div class="more-screen-content-cell">
                                    <div class="more-title-box">
                                        <div class="more-title-h2">上市</div>
                                        <div class="select-slider-show"></div>
                                    </div>
                                    <ul class="select-item-box">
                                        <li v-for=" (ipoFlagItem, ipoFlagIndex) in businessInformation.universalUnlimitedList "
                                            @click="ipoFlagSelect(ipoFlagItem)"
                                            :class="[businessInformation.ipoFlag == ipoFlagItem ? 'select-item-active' : '']"
                                            :key="ipoFlagItem" class="select-item">{{
                                                ipoFlagItem }}
                                        </li>
                                    </ul>
                                </div>
                                <div class="more-screen-content-cell">
                                    <div class="more-title-box">
                                        <div class="more-title-h2">联系电话</div>
                                        <div class="select-slider-show"></div>
                                    </div>
                                    <ul class="select-item-box">
                                        <li v-for=" (phoneFlagItem, phoneFlagIndex) in businessInformation.universalUnlimitedList "
                                            @click="phoneFlagSelect(phoneFlagItem)"
                                            :class="[businessInformation.phoneFlag == phoneFlagItem ? 'select-item-active' : '']"
                                            :key="phoneFlagItem" class="select-item">{{
                                                phoneFlagItem }}
                                        </li>
                                    </ul>
                                </div>
                                <div class="more-screen-content-cell">
                                    <div class="more-title-box">
                                        <div class="more-title-h2">股权冻结</div>
                                        <div class="select-slider-show"></div>
                                    </div>
                                    <ul class="select-item-box">
                                        <li v-for=" (equityFreezeFlagItem, equityFreezeFlagIndex) in businessInformation.universalUnlimitedList "
                                            @click="equityFreezeFlagSelect(equityFreezeFlagItem)"
                                            :class="[businessInformation.equityFreezeFlag == equityFreezeFlagItem ? 'select-item-active' : '']"
                                            :key="equityFreezeFlagItem" class="select-item">{{
                                                equityFreezeFlagItem }}
                                        </li>
                                    </ul>
                                </div>
                            </div>
                        </div>

                    </div>
                    <van-row class="more-screen-bottom-botton" gutter="16">
                        <van-col span="12"><van-button type="primary" size="small" plain block
                                @click="moreScreenCancel()">重置</van-button></van-col>
                        <van-col span="12"><van-button type="primary" size="small" block
                                @click="moreScreenOk()">确定</van-button></van-col>
                    </van-row>
                </div>

            </van-dropdown-item>
        </van-dropdown-menu>


        <div>
            <div v-if="pageLoading == true">
                <ul class="company-box" v-if="searchResultList.length > 0">
                    <li @click="goUrlDetails(resultItem.companyId)" class="company-item"
                        v-for="(resultItem, resultIndex) in searchResultList" :key="resultItem.companyName">
                        <div class="company-item-left bg-2372eb" v-if="resultItem.colorNum == 1">
                            <img name="wap-home" src="../../../../images/part_one/icon_company.png" alt="">
                        </div>
                        <div class="company-item-left bg-ee8c15" v-else-if="resultItem.colorNum == 2">
                            <img name="wap-home" src="../../../../images/part_one/icon_company.png" alt="">
                        </div>
                        <div class="company-item-left bg-11c95f" v-else-if="resultItem.colorNum == 3">
                            <img name="wap-home" src="../../../../images/part_one/icon_company.png" alt="">
                        </div>
                        <div class="company-item-left bg-e21183" v-else-if="resultItem.colorNum == 4">
                            <img name="wap-home" src="../../../../images/part_one/icon_company.png" alt="">
                        </div>
                        <div class="company-item-left bg-fde809" v-else-if="resultItem.colorNum == 5">
                            <img name="wap-home" src="../../../../images/part_one/icon_company.png" alt="">
                        </div>
                        <div class="company-item-left bg-17b9d7" v-else-if="resultItem.colorNum == 6">
                            <img name="wap-home" src="../../../../images/part_one/icon_company.png" alt="">
                        </div>
                        <div class="company-item-left bg-db2c2c" v-else-if="resultItem.colorNum == 7">
                            <img name="wap-home" src="../../../../images/part_one/icon_company.png" alt="">
                        </div>
                        <div class="company-item-left bg-9232db" v-else-if="resultItem.colorNum == 8">
                            <img name="wap-home" src="../../../../images/part_one/icon_company.png" alt="">
                        </div>
                        <div class="company-item-left bg-8c8c8c" v-else>
                            <img name="wap-home" src="../../../../images/part_one/icon_company.png" alt="">
                        </div>
                        <div class="company-item-right">
                            <div class="company-item-right-title mb-10" v-html="resultItem.companyName"></div>
                            <div class="mb-10" v-if="resultItem.econKindLabel">
                                <van-tag class="mr-6" type="primary">{{ resultItem.econKindLabel }}</van-tag>
                            </div>
                            <div class="mb-10">法定代表人：<span v-html="resultItem.operName"></span></div>
                            <div class="mb-10">注册资本：{{ resultItem.registCapiValue !==
                                null ? `${resultItem.registCapiValue}${resultItem.registCapiUnit}` : '未披露' }}</div>
                            <div class="">成立时间：{{ resultItem.startDate }}</div>
                        </div>
                    </li>
                </ul>
                <div v-else>
                    <van-empty />
                </div>
            </div>
            <van-loading style="text-align: center;margin-top: 50%" v-if="pageLoading == false" />
        </div>
    </div>
</template>

<script>
import { ref } from 'vue';
import { getQueryCompanyPage } from "@/service/api/home";
import { Icon, Search, DropdownMenu, DropdownItem, Area, Picker, Button, Col, Row, Sidebar, SidebarItem, Field, Tag, Empty, DatetimePicker, Popup, Toast } from 'vant';//button组件

export default {
    name: "searchRefult",
    data() {
        return {
            pageLoading: true,
            searchValue: '',
            minDate: new Date(2000, 0, 1),
            historyList: [],
            areaList: [
                {
                    text: '浙江省',
                    value: 'Zhejiang',
                    children: [
                        {
                            text: '杭州市', value: '330100',
                            children: [
                                { text: '滨江区', value: '3301001' },
                                { text: '淳安县', value: '3301002' },
                                { text: '富阳区', value: '3301003' },
                                { text: '拱墅区', value: '3301004' },
                                { text: '建德市', value: '3301005' },
                                { text: '临安区', value: '3301006' },
                                { text: '临平区', value: '3301007' },
                                { text: '钱塘区', value: '3301008' },
                                { text: '上城区', value: '3301009' },
                                { text: '桐庐县', value: '33010010' },
                                { text: '萧山区', value: '33010011' },
                                { text: '西湖区', value: '33010012' },
                                { text: '余杭区', value: '33010013' },
                            ]
                        },
                        {
                            text: '宁波市', value: '330200',
                            children: [
                                { text: '北仑区', value: '3302001' },
                                { text: '慈溪市', value: '3302002' },
                                { text: '奉化区', value: '3302003' },
                                { text: '高新科技开发区', value: '3302004' },
                                { text: '海曙区', value: '3302005' },
                                { text: '江北区', value: '3302006' },
                                { text: '江东区', value: '3302007' },
                                { text: '宁海县', value: '3302008' },
                                { text: '象山县', value: '3302009' },
                                { text: '鄞州区', value: '33020010' },
                                { text: '余姚市', value: '33020011' },
                                { text: '镇海区', value: '33020012' },
                            ]
                        },
                        {
                            text: '温州市', value: '330300',
                            children: [
                                { text: '茶山高教园区', value: '3303001' },
                                { text: '苍南县', value: '3303002' },
                                { text: '洞头区', value: '3303003' },
                                { text: '龙湾区', value: '3303004' },
                                { text: '鹿城区', value: '3303005' },
                                { text: '龙港市', value: '3303006' },
                                { text: '瓯海区', value: '3303007' },
                                { text: '平阳县', value: '3303008' },
                                { text: '瑞安市', value: '3303009' },
                                { text: '泰顺县', value: '33030010' },
                                { text: '文成县', value: '33030011' },
                                { text: '乐清市', value: '33030012' },
                                { text: '永嘉市', value: '33030013' },
                            ]
                        },
                        {
                            text: '嘉兴市', value: '330400',
                            children: [
                                { text: '海宁市', value: '3304002' },
                                { text: '海盐县', value: '3304003' },
                                { text: '嘉善县', value: '3304004' },
                                { text: '南湖区', value: '3304005' },
                                { text: '平湖市', value: '3304006' },
                                { text: '桐乡市', value: '3304007' },
                                { text: '秀洲区', value: '3304008' },
                            ]
                        },
                        {
                            text: '湖州市', value: '330500',
                            children: [
                                { text: '安吉县', value: '3305002' },
                                { text: '德清县', value: '3305003' },
                                { text: '南浔区', value: '3305004' },
                                { text: '吴兴区', value: '3305005' },
                                { text: '长兴县', value: '3305006' },
                            ]
                        },
                        {
                            text: '绍兴市', value: '330600',
                            children: [
                                { text: '柯桥区', value: '3306002' },
                                { text: '嵊州市', value: '3306003' },
                                { text: '上虞区', value: '3306004' },
                                { text: '新昌县', value: '3306005' },
                                { text: '越城区', value: '3306006' },
                                { text: '诸暨市', value: '3306007' },
                            ]
                        },
                        {
                            text: '金华市', value: '330700',
                            children: [
                                { text: '东阳市', value: '3307001' },
                                { text: '金华区', value: '3307002' },
                                { text: '兰溪市', value: '3307003' },
                                { text: '磐安县', value: '3307004' },
                                { text: '浦江县', value: '3307005' },
                                { text: '婺城区', value: '3307006' },
                                { text: '武义县', value: '3307007' },
                                { text: '义乌市', value: '3307008' },
                                { text: '永康市', value: '3307009' },
                            ]
                        },
                        {
                            text: '衢州市', value: '330800',
                            children: [
                                { text: '常山县', value: '3308001' },
                                { text: '江山市', value: '3308002' },
                                { text: '开化县', value: '3308003' },
                                { text: '柯城区', value: '3308004' },
                                { text: '龙游县', value: '3308005' },
                                { text: '衢江区', value: '3308006' },
                            ]
                        },
                        {
                            text: '舟山市', value: '330900',
                            children: [
                                { text: '岱山县', value: '3309001' },
                                { text: '定海区', value: '3309002' },
                                { text: '普陀区', value: '3309003' },
                                { text: '嵊泗县', value: '3309004' },
                            ]
                        },
                        {
                            text: '台州市', value: '331e3',
                            children: [
                                { text: '黄岩区', value: '331e301' },
                                { text: '椒江区', value: '331e302' },
                                { text: '临海市', value: '331e303' },
                                { text: '路桥区', value: '331e304' },
                                { text: '三门县', value: '331e305' },
                                { text: '天台县', value: '331e306' },
                                { text: '温岭市', value: '331e307' },
                                { text: '仙居县', value: '331e308' },
                                { text: '玉环市', value: '331e309' },
                            ]
                        },
                        {
                            text: '丽水市', value: '331100',
                            children: [
                                { text: '缙云县', value: '3311001' },
                                { text: '景宁畲族自治县', value: '3311002' },
                                { text: '莲都区', value: '3311003' },
                                { text: '龙泉市', value: '3311004' },
                                { text: '庆元县', value: '3311005' },
                                { text: '青田县', value: '3311006' },
                                { text: '遂昌县', value: '3311007' },
                                { text: '松阳县', value: '3311008' },
                                { text: '云和县', value: '3311009' },
                            ]
                        },
                    ],
                },
            ],// 区域数据
            areaValue: '', // 选中的地区

            industry: '',// 行业
            industryValue: '',// 行业值

            industryList: [
                { text: '农、林、牧、渔业', value: 'A', isSelect: false },
                { text: '采矿业', value: 'B', isSelect: false },
                { text: '制造业', value: 'C', isSelect: false },
                { text: '电力、热力、燃气及水生产和供应业', value: 'D', isSelect: false },
                { text: '建筑业', value: 'E', isSelect: false },
                { text: '批发和零售业', value: 'F', isSelect: false },
                { text: '交通运输、仓储和邮政业', value: 'G', isSelect: false },
                { text: '住宿和餐饮业', value: 'H', isSelect: false },
                { text: '信息传输、软件和信息技术服务业', value: 'I', isSelect: false },
                { text: '金融业', value: 'J', isSelect: false },
                { text: '房地产业', value: 'K', isSelect: false },
                { text: '租赁和商务服务业', value: 'L', isSelect: false },
                { text: '科学研究和技术服务业', value: 'M', isSelect: false },
                { text: '水利、环境和公共设施管理业', value: 'N', isSelect: false },
                { text: '居民服务、修理和其他服务业', value: 'O', isSelect: false },
                { text: '教育', value: 'P', isSelect: false },
                { text: '卫生和社会工作', value: 'Q', isSelect: false },
                { text: '文化、体育和娱乐业', value: 'R', isSelect: false },
                { text: '公共管理、社会保障和社会组织', value: 'S', isSelect: false },
                { text: '国际组织', value: 'T', isSelect: false },
            ],


            sidebarActive: 0,// 侧边导航当前选中的

            // 更多筛选筛选值
            businessInformation: {
                businessScope: '',// 经营范围
                dateSelectShow: false,//
                startDateShow: false,// 开始日期弹出窗
                endDateShow: false,// 结束日期弹出窗
                establishmentPeriodValue: '',// 成立年限

                establishmentPeriodMin: '开始时间',// 成立最低年限
                establishmentPeriodMax: '结束时间',// 成立最高年限
                establishmentPeriodMinDate: '开始时间',// 成立最低年限
                establishmentPeriodMaxDate: '结束时间',// 成立最高年限
                establishmentPeriodList: [
                    { title: '不限', min: '', max: '' },
                    { title: '3个月内', min: '', max: '' },
                    { title: '半年内', min: '', max: '' },
                    { title: '一年内', min: '', max: '' },
                    { title: '1-3年', min: '', max: '' },
                    { title: '3-5年', min: '', max: '' },
                    { title: '5-10年', min: '', max: '' },
                    { title: '10年以上', min: '', max: '' },
                ],// 成立年限选择列表
                establishmentPeriodMinValue: '',// 成立最低年限最终值
                establishmentPeriodMaxValue: '',// 成立最高年限最终值


                registeredCapitalValue: '',// 注册资本
                registeredCapitalMin: '',// 注册资本最低金额
                registeredCapitalMax: '',// 注册资本最高金额
                registeredCapitalMinValue: '',// 注册资本最低金额最终值
                registeredCapitalMaxValue: '',// 注册资本最高金额最终值
                registeredCapitalList: [
                    {
                        title: '不限',
                        min: '',
                        max: '',
                    },
                    {
                        title: '100万以内',
                        min: '0',
                        max: '100',
                    },
                    {
                        title: '100-200万',
                        min: '100',
                        max: '200',
                    },
                    {
                        title: '200-500万',
                        min: '200',
                        max: '500',
                    },
                    {
                        title: '500-1000万',
                        min: '500',
                        max: '1000',
                    },
                    {
                        title: '1000-5000万',
                        min: '1000',
                        max: '5000',
                    },
                    {
                        title: '5000万以上',
                        min: '5000',
                        max: '1000000000',
                    }],// 注册资本选择列表


                enterpriseStatusValue: [],// 企业状态选中项
                enterpriseStatusList: [
                    { title: '存续', isSelect: false },
                    { title: '迁出', isSelect: false },
                    { title: '迁入', isSelect: false },
                    { title: '注销', isSelect: false },
                    { title: '吊销', isSelect: false },
                    { title: '撤销', isSelect: false },
                    { title: '清算', isSelect: false },
                    { title: '歇业', isSelect: false },
                    { title: '其他', isSelect: false },
                ],// 企业状态选择列表



                organizationTypeValue: [],// 企业类型选中项
                organizationTypeList: [
                    { title: '股份企业', isSelect: false },
                    { title: '港澳台企业', isSelect: false },
                    { title: '有限责任公司', isSelect: false },
                    { title: '外商投资企业', isSelect: false },
                    { title: '国有企业', isSelect: false },
                    { title: '合伙企业', isSelect: false },
                    { title: '企业常驻代表机构', isSelect: false },
                    { title: '个人独资', isSelect: false },
                    { title: '其他', isSelect: false },
                ],// 企业类型选择列表


                universalUnlimitedList: ['不限', '是', '否'],// 不限，是，否选择列表


                listedIsOrNotValue: '',// 是否上市选中项

                contactInformationValue: '',// 联系方式选中项


                highQualityDirectoryValue: [],// 优质名录选中项
                highQualityDirectoryList: [
                    { title: '纳税百强', isSelect: false },
                    { title: 'A级纳税人', isSelect: false },
                    { title: 'B级纳税人', isSelect: false },
                    { title: '高新技术企业', isSelect: false },
                    { title: '科技型中小企业', isSelect: false },
                    { title: '国家级科技企业孵化器名单', isSelect: false },
                    { title: '技术先进型服务企业', isSelect: false },
                    { title: '国家备案众创空间名单', isSelect: false },
                    { title: '国家企业技术中心', isSelect: false },
                    { title: '海外高级认证企业', isSelect: false },
                    { title: '财务中国500强', isSelect: false },
                    { title: '中国民营500强', isSelect: false },
                    { title: '中国制造企业500强', isSelect: false },
                    { title: '中国服务企业500强', isSelect: false },
                    { title: '房地产500强企业', isSelect: false },
                    { title: '专精特新中小企业', isSelect: false },
                    { title: '专精特新小巨人企业', isSelect: false },
                    { title: '独角兽企业', isSelect: false },
                    { title: '瞪羚企业', isSelect: false },
                    { title: '国家级技术创新示范企业', isSelect: false },
                    { title: '排污许可企业', isSelect: false },
                    { title: '矿业权许可企业', isSelect: false },
                    { title: '进出口许可企业', isSelect: false },
                ],// 优质名录选择列表



                businessAbnormalitiesValue: '',// 经营异常选中项
                equityFreezeValue: '',// 股权冻结选中项
                industrialCommercialPenaltiesValue: '',// 工商行政处罚选中项
                environmentalPenaltiesValue: '',// 环保行政处罚选中项
                environmentalRatingValue: '',// 环保评级选中项
                environmentalRatingList: ['不限', '环保绿牌（诚信）企业', '环保蓝牌（良好）企业', '环保黄牌（警示）企业', '环保红牌（不良）企业', '环保黑牌（失信）企业',],// 环保评级选择列表
                taxRatingValue: '',// 纳税评级选中项
                taxRatingList: ['不限', 'A级纳税人', 'B级纳税人', 'C级纳税人', 'D级纳税人', 'M级纳税人',],// 纳税评级选择列表

                taxRelatedViolationsValue: '',// 涉税违法选中项

                ifThePersonValue: '',// 被执行人选中项

                dishonestDebtorValue: '',// 失信被执行人选中项

                restrictHighConsumptionValue: '',// 限制高消费选中项
                ipoFlag: '',// 是否上市选中项
                phoneFlag: '',// 是否有联系电话选中项
                equityFreezeFlag: '',// 是否股权冻结选中项


            },

            searchResultList: [],
            currentPage: 1,
            loading: false,
            isEndLoading: false,
            startDate: '',
            endDate: '',


        }
    },
    computed: {
        swiper() {
            return this.$refs.mySwiper.$swiper;
        }
    },
    mounted() {
        sessionStorage.removeItem('dashboardType');
        if (sessionStorage.getItem('searchValue')) {
            this.searchValue = sessionStorage.getItem('searchValue')
        }
        if (sessionStorage.getItem('historyList')) {
            this.historyList = JSON.parse(sessionStorage.getItem('historyList'));
        }
        window.addEventListener('scroll', this.scrollBottom);
    },
    destroyed() {
        window.removeEventListener('scroll', this.scrollBottom)
    },
    methods: {
        // 去详情页
        goUrlDetails(companyId) {
            sessionStorage.setItem('companyId', companyId);
            sessionStorage.setItem('tabBarActiveIndex', '1');
            sessionStorage.setItem('dashboardType', 'result');
            this.$router.push('/dashboard/CustomerDashboard');
        },

        // 搜索关键字
        onSearch() {
            if (this.searchValue.length < 2) {
                Toast('搜索关键词必须大于两个字符！')
            } else {
                let historyListArray = [];
                if (this.historyList.length > 0) {
                    historyListArray = this.historyList;
                } else {
                    historyListArray = [];
                }
                historyListArray.unshift(this.searchValue)
                this.historyList = historyListArray
                sessionStorage.setItem('historyList', JSON.stringify(this.historyList))
                this.pageLoading = false;
                this.getQueryCompanyPageData();
            }
            sessionStorage.removeItem('searchValue');
        },

        // 搜索取消
        onCancel() {
            // history.back();
            sessionStorage.setItem('tabBarActiveIndex', '0');
            this.$router.push({ path: '/dashboard/home' });
        },

        // 省市区选择确认
        areaOk(selectedValues) {
            this.areaValue = selectedValues.join(',');
            this.$refs.areaDrop.toggle(false);
            this.pageLoading = false;
            this.getQueryCompanyPageData();
        },

        // 省市区取消
        areaCancel() {
            this.$refs.areaDrop.toggle(false);
            this.pageLoading = false;
            this.getQueryCompanyPageData();
        },

        // 行业重置
        onIndustryCancel() {
            this.industry = '';
            this.industryValue = [];
            for (let i = 0; i < this.industryList.length; i++) {
                this.industryList[i].isSelect = false;
            }
        },

        // 行业确定
        onIndustryConfirm() {
            this.showIndustryPicker = false;
            let industry = [];
            let industryValue = [];
            for (let i = 0; i < this.industryList.length; i++) {
                if (this.industryList[i].isSelect) {
                    industry.push(this.industryList[i].text);
                    industryValue.push(this.industryList[i].value);
                }
            }
            this.industry = industry.join(',');
            this.industryValue = industryValue;

            this.$refs.industryDrop.toggle(false);
            this.pageLoading = false;
            this.getQueryCompanyPageData();

            console.log(111, this.industry, this.industryValue)
        },

        // 行业选择
        industrySelect(index) {
            this.industryList[index].isSelect = !this.industryList[index].isSelect;
        },


        // 更多筛选确定
        moreScreenOk() {
            console.log(this.businessInformation.establishmentPeriodMinValue, '开始')
            console.log(this.businessInformation.establishmentPeriodMaxValue, '结束')
            //    this.businessInformation.establishmentPeriodMinValue,max:this.businessInformation.establishmentPeriodMaxValue
            this.processMultipleSelectionFiltering();
            console.log('更多筛选', this.businessInformation)
            this.$refs.moreScreenDrop.toggle(false);
            if (this.startDate > this.endDate) {
                Toast('开始时间要早于结束时间')
            } else if (Number(this.businessInformation.registeredCapitalMinValue) > Number(this.businessInformation.registeredCapitalMaxValue)) {
                Toast('最低金额要小于最高金额')
            } else {
                this.pageLoading = false;
                this.currentPage = 1;
                this.getQueryCompanyPageData();
            }
        },

        // 更多筛选重置
        moreScreenCancel() {
            // this.$refs.moreScreenDrop.toggle(false);


            this.businessInformation.businessScope = '';
            this.businessInformation.establishmentPeriodValue = '';
            this.businessInformation.establishmentPeriodMin = '';
            this.businessInformation.establishmentPeriodMax = '';
            this.businessInformation.establishmentPeriodMinDate = '';
            this.businessInformation.establishmentPeriodMaxDate = '';
            this.businessInformation.establishmentPeriodMinValue = '';
            this.businessInformation.establishmentPeriodMaxValue = '';
            this.businessInformation.registeredCapitalValue = '';// 注册资本
            this.businessInformation.registeredCapitalMin = '';// 注册资本最低金额
            this.businessInformation.registeredCapitalMax = '';// 注册资本最高金额
            this.businessInformation.registeredCapitalMinValue = '';// 注册资本最低金额
            this.businessInformation.registeredCapitalMaxValue = '';// 注册资本最高金额
            this.businessInformation.enterpriseStatusValue = [];//企业状态
            this.businessInformation.organizationTypeValue = [];//企业类型
            this.businessInformation.listedIsOrNotValue = '';// 是否上市选中项
            this.businessInformation.contactInformationValue = '';// 联系方式选中项
            this.businessInformation.businessAbnormalitiesValue = '';// 经营异常选中项
            this.businessInformation.equityFreezeValue = '';// 股权冻结选中项
            this.businessInformation.industrialCommercialPenaltiesValue = '';// 工商行政处罚选中项
            this.businessInformation.environmentalPenaltiesValue = '';// 环保行政处罚选中项
            this.businessInformation.environmentalRatingValue = '';// 环保评级选中项
            this.businessInformation.taxRatingValue = '';// 纳税评级选中项
            this.businessInformation.taxRelatedViolationsValue = '';// 涉税违法选中项
            this.businessInformation.ifThePersonValue = '';// 被执行人选中项
            this.businessInformation.dishonestDebtorValue = '';// 失信被执行人选中项
            this.businessInformation.restrictHighConsumptionValue = '';// 限制高消费选中项
            this.businessInformation.ipoFlag = '';// 是否上市选中项
            this.businessInformation.phoneFlag = '';// 是否有联系电话选中项
            this.businessInformation.equityFreezeFlag = '';// 是否股权冻结选中项
            this.startDate = '';
            this.endDate = '';
            this.currentPage = 1;


            for (let i = 0; i < this.businessInformation.enterpriseStatusList.length; i++) {
                this.businessInformation.enterpriseStatusList[i].isSelect = false;
            }
            for (let i = 0; i < this.businessInformation.organizationTypeList.length; i++) {
                this.businessInformation.organizationTypeList[i].isSelect = false;
            }
            for (let i = 0; i < this.businessInformation.highQualityDirectoryList.length; i++) {
                this.businessInformation.highQualityDirectoryList[i].isSelect = false;
            }
            this.pageLoading = false;
            this.getQueryCompanyPageData();
        },

        // 格式化需要传入的数据
        formatParams(value) {
            if (value == '是') {
                return value = 1;
            } else if (value == '否') {
                return value = 0;
            } else {
                return value = null;
            }
        },

        // 获取企业热搜榜
        async getQueryCompanyPageData() {
            if (sessionStorage.getItem('searchValue')) {
                this.searchValue = sessionStorage.getItem('searchValue')
            }
            let params = {
                "keyword": this.searchValue || null,// 企业名称或法人姓名
                "area": this.areaValue || null,// 区域筛选
                "industryCodeList": this.industryValue.length > 0 ? this.industryValue : null,// 行业筛选
                "econKindList": this.businessInformation.organizationTypeValue.length > 0 ? this.businessInformation.organizationTypeValue : null,// 企业类型
                "scope": this.businessInformation.businessScope || null,// 经营范围
                // {min:this.businessInformation.establishmentPeriodMinValue,max:this.businessInformation.establishmentPeriodMaxValue}
                "startDuration": this.businessInformation.establishmentPeriodMinValue == '' && this.businessInformation.establishmentPeriodMaxValue == '' ? [] :
                    [{ min: this.businessInformation.establishmentPeriodMinValue, max: this.businessInformation.establishmentPeriodMaxValue }],
                "registCapiStart": this.businessInformation.registeredCapitalMinValue || null,// 注册资本左区间
                "registCapiEnd": this.businessInformation.registeredCapitalMaxValue || null,// 注册资本右区间

                "operateExcFlag": this.formatParams(this.businessInformation.businessAbnormalitiesValue),// 是否经营异常
                "penaltyFlag": this.formatParams(this.businessInformation.industrialCommercialPenaltiesValue),// 是否有工商行政处罚
                "illegalFlag": this.formatParams(this.businessInformation.taxRelatedViolationsValue),// 是否有涉税违法
                "punishmentFlag": this.formatParams(this.businessInformation.environmentalPenaltiesValue),// 是否有环保处罚
                "statusList": this.businessInformation.enterpriseStatusValue.length > 0 ? this.businessInformation.enterpriseStatusValue : null, // 企业状态
                "shixinFlag": this.formatParams(this.businessInformation.dishonestDebtorValue),// 失信人标识
                "limitHighFlag": this.formatParams(this.businessInformation.restrictHighConsumptionValue),// 限制高消费标识
                "zhixingFlag": this.formatParams(this.businessInformation.ifThePersonValue),// 被执行人标识
                "ipoFlag": this.formatParams(this.businessInformation.ipoFlag),// 是否上市选中项
                "phoneFlag": this.formatParams(this.businessInformation.phoneFlag),// 是否有联系电话选中项
                "equityFreezeFlag": this.formatParams(this.businessInformation.equityFreezeFlag),// 是否股权冻结选中项
                "pageNum": this.currentPage,
                "pageSize": 10,
            }
            let result = await getQueryCompanyPage(params);
            if (result) {
                this.pageLoading = true;
                if (this.loading) {
                    this.searchResultList = this.searchResultList.concat(result.records);
                } else {
                    this.searchResultList = result.records;
                }
                if (this.searchResultList.length < result.total) {
                    this.isEndLoading = false;
                } else {
                    this.isEndLoading = true;
                }
                this.loading = false;
            }
        },

        // 滚动到页面底部时，请求内容
        scrollBottom() {
            let scrollTop = document.documentElement.scrollTop || document.body.scrollTop  //页面滚动的高度
            let clientHeight = document.documentElement.clientHeight  //可视区域高度
            let scrollHeight = document.documentElement.scrollHeight  //可滚动内容的高度
            let bottomOfWindow = scrollTop + clientHeight + 1000 >= scrollHeight    //是否滚动到底部
            //loading 和 this.tableData.length和this.total是自己的判断条件
            if (scrollTop !== 0 && bottomOfWindow && !this.loading && !this.isEndLoading) {
                this.loading = true;
                this.currentPage += 1;
                this.getQueryCompanyPageData();
            }
        },

        // 多选的筛选，需要进一步进行处理
        processMultipleSelectionFiltering() {
            this.businessInformation.enterpriseStatusValue = [];
            this.businessInformation.organizationTypeValue = [];
            this.businessInformation.highQualityDirectoryValue = [];
            for (let i = 0; i < this.businessInformation.enterpriseStatusList.length; i++) {
                if (this.businessInformation.enterpriseStatusList[i].isSelect) {
                    this.businessInformation.enterpriseStatusValue.push(this.businessInformation.enterpriseStatusList[i].title)
                }
            }
            for (let i = 0; i < this.businessInformation.organizationTypeList.length; i++) {
                if (this.businessInformation.organizationTypeList[i].isSelect) {
                    this.businessInformation.organizationTypeValue.push(this.businessInformation.organizationTypeList[i].title)
                }
            }
            for (let i = 0; i < this.businessInformation.highQualityDirectoryList.length; i++) {
                if (this.businessInformation.highQualityDirectoryList[i].isSelect) {
                    this.businessInformation.highQualityDirectoryValue.push(this.businessInformation.highQualityDirectoryList[i].title)
                }
            }
        },

        // 成立年限选择
        establishmentPeriodSelect(establishmentPeriodItem, min, max) {

            this.businessInformation.establishmentPeriodMaxValue = this.geshiTime(new Date());
            this.businessInformation.establishmentPeriodValue = establishmentPeriodItem;
            this.businessInformation.establishmentPeriodMin = '开始时间';
            this.businessInformation.establishmentPeriodMax = '结束时间';
            this.businessInformation.establishmentPeriodMinDate = '开始时间';
            this.businessInformation.establishmentPeriodMaxDate = '结束时间';
            const timestamp = Date.now();
            if (establishmentPeriodItem == '3个月内') {
                this.businessInformation.establishmentPeriodMinValue = this.geshiTime(timestamp - 24 * 60 * 60 * 91 * 1000);
            } else if (establishmentPeriodItem == '半年内') {
                this.businessInformation.establishmentPeriodMinValue = this.geshiTime(timestamp - 24 * 60 * 60 * 183 * 1000);
            } else if (establishmentPeriodItem == '一年内') {
                this.businessInformation.establishmentPeriodMinValue = this.geshiTime(timestamp - 24 * 60 * 60 * 365 * 1000);
            } else if (establishmentPeriodItem == '1-3年') {
                this.businessInformation.establishmentPeriodMinValue = this.geshiTime(timestamp - 24 * 60 * 60 * 3 * 365 * 1000);
                this.businessInformation.establishmentPeriodMaxValue = this.geshiTime(timestamp - 24 * 60 * 60 * 1 * 365 * 1000);
            } else if (establishmentPeriodItem == '3-5年') {
                this.businessInformation.establishmentPeriodMinValue = this.geshiTime(timestamp - 24 * 60 * 60 * 5 * 365 * 1000);
                this.businessInformation.establishmentPeriodMaxValue = this.geshiTime(timestamp - 24 * 60 * 60 * 3 * 365 * 1000);
            } else if (establishmentPeriodItem == '5-10年') {
                this.businessInformation.establishmentPeriodMinValue = this.geshiTime(timestamp - 24 * 60 * 60 * 10 * 365 * 1000);
                this.businessInformation.establishmentPeriodMaxValue = this.geshiTime(timestamp - 24 * 60 * 60 * 5 * 365 * 1000);
            } else if (establishmentPeriodItem == '10年以上') {
                this.businessInformation.establishmentPeriodMinValue = this.geshiTime(timestamp - 24 * 60 * 60 * 200 * 365 * 1000);
                this.businessInformation.establishmentPeriodMaxValue = this.geshiTime(timestamp - 24 * 60 * 60 * 10 * 365 * 1000);
            } else {
                this.businessInformation.establishmentPeriodMinValue = '';
                this.businessInformation.establishmentPeriodMaxValue = '';
            }
        },

        // 格式化时间
        geshiTime(time) {
            const date = new Date(time);
            const year = date.getFullYear();
            const month = date.getMonth() + 1;
            const day = date.getDate();
            if (month < 10) {
                if (day < 10) {
                    return time = `${year}0${month}0${day}`
                } else {
                    return time = `${year}0${month}${day}`
                }
            } else {
                if (day < 10) {
                    return time = `${year}${month}0${day}`
                } else {
                    return time = `${year}${month}${day}`
                }
            }
        },

        formatDate(date) {
            if (date.getMonth() + 1 < 10) {
                return `${date.getYear() + 1900}-0${date.getMonth() + 1}-${date.getDate()}`;
            } else {
                return `${date.getYear() + 1900}-${date.getMonth() + 1}-${date.getDate()}`;
            }
        },

        formatUpdateDate(date) {
            if (date.getMonth() + 1 < 10) {
                if (date.getDate() < 10) {
                    return `${date.getFullYear()}0${date.getMonth() + 1}0${date.getDate()}`;
                } else {
                    return `${date.getFullYear()}0${date.getMonth() + 1}${date.getDate()}`;
                }
            } else {
                if (date.getDate() < 10) {
                    return `${date.getFullYear()}${date.getMonth() + 1}0${date.getDate()}`;
                } else {
                    return `${date.getFullYear()}${date.getMonth() + 1}${date.getDate()}`;
                }
            }
        },

        // 成立年限输入变化
        establishmentPeriodNumChange(type) {
            this.businessInformation.dateSelectShow = true;
            if (type == 'min') {
                this.businessInformation.startDateShow = true;
            } else {
                this.businessInformation.endDateShow = true;
            }
        },

        // 开始时间确定
        startDateOk(value) {
            const formatDate = (date) => `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`;
            const formatStartDate = (date) => `${date.getFullYear()}${date.getMonth() + 1}${date.getDate()}`;
            this.businessInformation.establishmentPeriodMin = this.formatUpdateDate(value);
            this.businessInformation.establishmentPeriodMinDate = this.formatDate(value);
            this.startDate = formatStartDate(value);
            this.businessInformation.establishmentPeriodMinValue = this.businessInformation.establishmentPeriodMin;
            this.businessInformation.dateSelectShow = false;
            if (this.businessInformation.establishmentPeriodMax) {
                this.businessInformation.establishmentPeriodValue = '';
            }
            this.businessInformation.startDateShow = false;
            this.businessInformation.endDateShow = false;
        },

        // 开始时间取消
        startDateCancel() {
            this.businessInformation.dateSelectShow = false;
            this.businessInformation.establishmentPeriodMin = '开始时间';
            this.businessInformation.establishmentPeriodMinDate = '开始时间';
            this.businessInformation.startDateShow = false;
            this.businessInformation.endDateShow = false;
        },

        // 结束时间确定
        endDateOk(value) {
            const formatDate = (date) => `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`;
            const formatEndDate = (date) => `${date.getFullYear()}${date.getMonth() + 1}${date.getDate()}`;
            this.businessInformation.establishmentPeriodMax = this.formatUpdateDate(value);
            this.businessInformation.establishmentPeriodMaxDate = this.formatDate(value);
            this.endDate = formatEndDate(value);
            this.businessInformation.establishmentPeriodMaxValue = this.businessInformation.establishmentPeriodMax;
            this.businessInformation.dateSelectShow = false;
            if (this.businessInformation.establishmentPeriodMin) {
                this.businessInformation.establishmentPeriodValue = '';
            }
            this.businessInformation.startDateShow = false;
            this.businessInformation.endDateShow = false;
        },

        // 结束时间取消
        endDateCancel() {
            this.businessInformation.dateSelectShow = false;
            this.businessInformation.establishmentPeriodMax = '结束时间';
            this.businessInformation.establishmentPeriodMaxDate = '结束时间';
            this.businessInformation.startDateShow = false;
            this.businessInformation.endDateShow = false;
        },

        // 注册资本选择
        registeredCapitalSelect(registeredCapitalItem, min, max) {
            this.businessInformation.registeredCapitalValue = registeredCapitalItem;
            this.businessInformation.registeredCapitalMin = '';
            this.businessInformation.registeredCapitalMax = '';
            this.businessInformation.registeredCapitalMinValue = min;
            this.businessInformation.registeredCapitalMaxValue = max;
            console.log(1122, this.businessInformation.registeredCapitalMinValue, this.businessInformation.registeredCapitalMaxValue)
        },

        // 注册资本输入变化
        registeredCapitalNumChange(type) {
            if (type == 'min') {
                this.businessInformation.registeredCapitalMinValue = this.businessInformation.registeredCapitalMin;
                if (this.businessInformation.registeredCapitalMax) {
                    this.businessInformation.registeredCapitalValue = '';
                }
            } else {
                this.businessInformation.registeredCapitalMaxValue = this.businessInformation.registeredCapitalMax;
                if (this.businessInformation.registeredCapitalMin) {
                    this.businessInformation.registeredCapitalValue = '';
                }
            }
        },


        // 企业状态选择
        enterpriseStatusSelect(index) {
            this.businessInformation.enterpriseStatusList[index].isSelect = !this.businessInformation.enterpriseStatusList[index].isSelect;
        },


        // 企业类型选择
        organizationTypeSelect(index) {
            this.businessInformation.organizationTypeList[index].isSelect = !this.businessInformation.organizationTypeList[index].isSelect;
        },


        // 是否上市
        listedIsOrNotSelect(listedIsOrNotItem) {
            this.businessInformation.listedIsOrNotValue = listedIsOrNotItem;
        },


        // 联系方式
        contactInformationSelect(contactInformationItem) {
            this.businessInformation.contactInformationValue = contactInformationItem;
        },


        // 优质名录选择
        highQualityDirectorySelect(index) {
            this.businessInformation.highQualityDirectoryList[index].isSelect = !this.businessInformation.highQualityDirectoryList[index].isSelect;
        },


        // 经营异常
        businessAbnormalitiesSelect(businessAbnormalitiesItem) {
            this.businessInformation.businessAbnormalitiesValue = businessAbnormalitiesItem;
        },


        // 股权冻结
        equityFreezeSelect(equityFreezeItem) {
            this.businessInformation.equityFreezeValue = equityFreezeItem;
        },



        // 工商行政处罚
        industrialCommercialPenaltiesSelect(industrialCommercialPenaltiesItem) {
            this.businessInformation.industrialCommercialPenaltiesValue = industrialCommercialPenaltiesItem;
        },


        // 环保行政处罚
        environmentalPenaltiesSelect(environmentalPenaltiesItem) {
            this.businessInformation.environmentalPenaltiesValue = environmentalPenaltiesItem;
        },


        // 环保评级
        environmentalRatingSelect(environmentalRatingItem) {
            this.businessInformation.environmentalRatingValue = environmentalRatingItem;
        },


        // 纳税评级
        taxRatingSelect(taxRatingItem) {
            this.businessInformation.taxRatingValue = taxRatingItem;
        },


        // 纳税评级
        taxRelatedViolationsSelect(taxRelatedViolationsItem) {
            this.businessInformation.taxRelatedViolationsValue = taxRelatedViolationsItem;
        },


        // 被执行人
        ifThePersonSelect(ifThePersonItem) {
            this.businessInformation.ifThePersonValue = ifThePersonItem;
        },


        // 失信被执行人
        dishonestDebtorSelect(dishonestDebtorItem) {
            this.businessInformation.dishonestDebtorValue = dishonestDebtorItem;
        },



        // 限制高消费
        restrictHighConsumptionSelect(restrictHighConsumptionItem) {
            this.businessInformation.restrictHighConsumptionValue = restrictHighConsumptionItem;
        },

        // 是否上市
        ipoFlagSelect(ipoFlagItem) {
            this.businessInformation.ipoFlag = ipoFlagItem;
        },

        // 是有联系电话
        phoneFlagSelect(phoneFlagItem) {
            this.businessInformation.phoneFlag = phoneFlagItem;
        },

        // 是否股权冻结
        equityFreezeFlagSelect(equityFreezeFlagItem) {
            this.businessInformation.equityFreezeFlag = equityFreezeFlagItem;
        },


    },
    components: {
        VanIcon: Icon,
        VanSearch: Search,
        VanDropdownMenu: DropdownMenu,
        VanDropdownItem: DropdownItem,
        VanArea: Area,
        VanPicker: Picker,
        VanButton: Button,
        VanCol: Col,
        VanRow: Row,
        VanSidebar: Sidebar,
        VanSidebarItem: SidebarItem,
        VanField: Field,
        VanTag: Tag,
        VanEmpty: Empty,
        VanDatetimePicker: DatetimePicker,
        VanPopup: Popup
    },
}
</script>

<style scoped>
.search-input {
    margin-bottom: 10px;
}

.van-dropdown-menu /deep/ .van-dropdown-menu__bar {
    box-shadow: none;
}

.more-screen-box {
    height: 35vh;
    position: relative;
}

.more-screen-content {
    height: calc(35vh - 52px);
    overflow-y: scroll;
    display: flex;
    justify-content: space-between;
    align-items: start;
}

.more-screen-bottom-botton {
    border-top: solid 1px #f2f2f2;
    height: 52px;
    width: 100%;
    padding: 10px 1rem;
    position: absolute;
    bottom: 0;
    left: 0;
}

.van-sidebar-item--select::before {
    background: #2372eb !important;
}

.more-screen-content-right {
    width: calc(100vw - 80px);
    padding: 0.8rem 1rem 1rem 0.6rem;
}

.more-screen-content-cell {
    margin-bottom: 20px;
}

.more-title-box {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.more-title-h2 {
    font-size: 1rem;
}

.select-slider-show {
    font-size: 1rem;
    color: #2372eb;
    font-weight: bold;
}

.van-search {
    padding: 0;
}

.chengli-input {
    width: 100%;
    background: #f2f2f2;
    border-radius: 6px;
    padding: 0 10px;
    font-size: 14px;
    height: 30px;
    line-height: 30px;
}

.chengli-input-line {
    text-align: center;
}

.chengli-input-box {
    margin-bottom: 10px;
}

.select-item-box {
    display: flex;
    justify-content: start;
    align-items: self-start;
    flex-wrap: wrap;
    width: 100%;
}

.select-item {
    padding: 2px 10px;
    background: #f2f2f2;
    font-size: 0.8rem;
    color: #333333;
    margin: 0 10px 10px 0;
    border-radius: 4px;
}

.select-item-active {
    color: #ffffff;
    background: #2372eb;
}

.company-box {
    width: 100%;
}

.company-item {
    display: flex;
    justify-content: space-between;
    align-items: start;
    border: solid 1px #f2f2f2;
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 16px;
}

.company-item-left {
    width: 32px;
    height: 32px;
    background: #2372eb;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 4px;
}

.company-item-left img {
    width: 20px;
}

.mb-10 {
    margin-bottom: 10px;
}

.mr-6 {
    margin-right: 6px;
}

.company-item-right {
    width: calc(100% - 42px);
    font-size: 0.8rem;
}

.company-item-right-title {
    font-size: 1rem;
    font-weight: bold;
}

.popup-box {
    height: 25rem;
    padding: 1rem 1rem 3rem 1rem;
}

.bg-2372eb {
    background: #2372EB;
}

.bg-ee8c15 {
    background: #ee8c15;
}

.bg-11c95f {
    background: #11c95f;
}

.bg-e21183 {
    background: #e21183;
}

.bg-fde809 {
    background: #fde809;
}

.bg-17b9d7 {
    background: #17b9d7;
}

.bg-db2c2c {
    background: #db2c2c;
}

.bg-9232db {
    background: #9232db;
}

.bg-8c8c8c {
    background: #8c8c8c;
}</style>
