<template>
  <div>
    <el-descriptions class="margin-top" :column="2" border>
    <el-descriptions-item label="企业名称">{{ formatName(info.name) }}</el-descriptions-item>
    <el-descriptions-item label="统一社会信用代码">{{ info.code }}</el-descriptions-item>
    <el-descriptions-item label="法定代表人">{{ info.representative }}</el-descriptions-item>
    <el-descriptions-item label="成立时间">{{ formatDate(info.establishmentTime, 'YYYY-MM-DD') }}</el-descriptions-item>
    <el-descriptions-item label="注册资金">{{ info.registeredCapital }}</el-descriptions-item>
    <el-descriptions-item label="企业类型">{{ info.type }}</el-descriptions-item>
    <el-descriptions-item label="所属地区">{{ info.area }}</el-descriptions-item>
    <el-descriptions-item label="核准日期">{{ info.approvalTime }}</el-descriptions-item>
    <el-descriptions-item label="曾用名">{{ info.formerName }}</el-descriptions-item>
    <el-descriptions-item label="注册机关">{{ info.registrationAuthority }}</el-descriptions-item>
    <el-descriptions-item label="注册地址">{{ info.address }}</el-descriptions-item>
    <el-descriptions-item label="经营状态">{{ info.businessStatus }}</el-descriptions-item>
    <el-descriptions-item label="营业期限">{{ info.businessTerm }}</el-descriptions-item>
  </el-descriptions>
  </div>
</template>

<script setup>
defineOptions({ name: 'EnterpriseDetailsBusinessInfo'})
import { EnterpriseApi } from '@/api/menduner/system/enterprise/message'
import { formatDate } from '@/utils/formatTime'
import { DICT_TYPE } from '@/utils/dict'
import { formatName } from '@/utils'

const props = defineProps({
  id: String
})

const info = ref({})
const getInfo = async () => {
  const data = await EnterpriseApi.getEnterpriseBusinessInfo(props.id)
  info.value = data
}
getInfo()
</script>
