<template>
  <el-dialog title="企业信息详情" :visible.sync="detailOpen" @closed="dialogClose" @open="dialogOpen" width="1000px" append-to-body>
    <el-form label-width="160px">
      <el-row class="el-row-table">
        <el-col :span="12">
            <el-form-item label="企业名称">
                <span v-if="detailInfo.enterpriseName">{{ detailInfo.enterpriseName }}</span>
                <span v-else>-</span>
            </el-form-item>
        </el-col>
        <el-col :span="12">
            <el-form-item label="企业类型">
                <span v-if="detailInfo.enterpriseType">{{ $parent.enterpriseTypeFormat(detailInfo) }}</span>
                <span v-else>-</span>
            </el-form-item>
        </el-col>
        <el-col :span="24">
            <el-form-item label="注册地址">
                <span v-if="detailInfo.registerAddress">{{ detailInfo.registerAddress }}</span>
                <span v-else>-</span>
            </el-form-item>
        </el-col>
        <el-col :span="12">
            <el-form-item label="法定代表人">
                <span v-if="detailInfo.legalRepresentative">{{ detailInfo.legalRepresentative }}</span>
                <span v-else>-</span>
            </el-form-item>
        </el-col>
        <el-col :span="12">
            <el-form-item label="许可证有效期">
                <span v-if="detailInfo.licenseValidityTime">{{ detailInfo.licenseValidityTime }}</span>
                <span v-else>-</span>
            </el-form-item>
        </el-col>

        <el-col :span="12">
          <el-form-item label="许可证编号">
            <span v-if="detailInfo.licenseKey">{{ detailInfo.licenseKey }}</span>
            <span v-else>-</span>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="经营区域">
            <span v-if="detailInfo.businessArea">{{ detailInfo.businessArea }}</span>
            <span v-else>-</span>
          </el-form-item>
        </el-col>

        <el-col :span="12">
          <el-form-item label="联系方式">
            <span v-if="detailInfo.contact">{{ detailInfo.contact }}</span>
            <span v-else>-</span>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="手机号">
            <span v-if="detailInfo.phone">{{ detailInfo.phone }}</span>
            <span v-else>-</span>
          </el-form-item>
        </el-col>



        <el-col :span="24">
          <el-form-item label="营业执照">
            <MyImage v-if="detailInfo.doDusiness"
              class="view-img"
              :src="detailInfo.doDusiness.split(',')[0]"
              :previewSrcList="detailInfo.doDusiness.split(',')"
            >
            </MyImage>
            <span v-else>-</span>

          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label="年度监督检查情况">
            <span v-if="detailInfo.annualSupervisionInspection">{{ detailInfo.annualSupervisionInspection }}</span>
            <span v-else>-</span>
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label="备注">
            <span v-if="detailInfo.remarks">{{ detailInfo.remarks }}</span>
            <span v-else>-</span>
          </el-form-item>
        </el-col>


      </el-row>

      </el-form>
    </el-dialog>
</template>

<script>
 import Editor from '@/components/Editor/index.vue';
 import MyImage from "@/components/MyImage/index.vue";
 import { getInfo} from "@/api/regulation/info";
 let uploadfile = require("@/assets/uploadfile.png");

  export default {
    name: "detail-info",
    components: {
        Editor,MyImage
    },
    data(){
        return{
          detailInfo: {},
          detailOpen: false,
          isOpen:false,
          fileList:[],
          fileurl:'',
        }
    },
    methods:{
    dialogClose(){
      this.detailOpen=false;
    },
    dialogOpen(){
      this.detailOpen=true;
    },
    checkFile(url) {
      window.open(url,'_blank');
    },
      getDetailInfo(id){
        getInfo(id).then(res =>{
          if(res.code == 200 && res.data){
            this.detailInfo = res.data;
            this.fileList = [{name: '附件', url:uploadfile}];
            this.fileurl = this.detailInfo.iconUrl;
            this.detailOpen = true;
          }
        })
      }
    }
  }
</script>

<style scoped lang="scss">

.division{
    display:flex;
    flex-direction:row;
    justify-content:flex-start;
  }
</style>
