<template>
	<el-container>
		<el-header>
			<el-page-header :content="detail.name" @back="goBack" />
		</el-header>
		<el-main>
			<el-card shadow="never" header="公司信息">
				<el-descriptions border :column="2">
					<el-descriptions-item label="统一社会信用代码">{{detail.org_code}}</el-descriptions-item>
					<el-descriptions-item label="公司名称">{{detail.name}}</el-descriptions-item>
					<el-descriptions-item label="注册资金">{{detail.reg_capital}}</el-descriptions-item>
					<el-descriptions-item label="登记状态">{{detail.status}}</el-descriptions-item>
					<el-descriptions-item label="成立日期">{{detail.reg_date}}</el-descriptions-item>
					<el-descriptions-item label="人员规模">{{detail.staff_num}}</el-descriptions-item>
					<el-descriptions-item label="营收规模">{{detail.turnover}}</el-descriptions-item>
					<el-descriptions-item label="参保人数">{{detail.social_insurance}}</el-descriptions-item>
					<el-descriptions-item label="所属区域">{{detail.area_t}}</el-descriptions-item>
					<el-descriptions-item label="所属行业">{{detail.industry_t}}</el-descriptions-item>
					<el-descriptions-item label="是否上市">{{detail.is_ipo}}</el-descriptions-item>
					<el-descriptions-item label="融资信息">{{detail.finance_info}}</el-descriptions-item>
					<el-descriptions-item label="网址">{{detail.website}}</el-descriptions-item>
					<el-descriptions-item label="注册地址">{{detail.reg_address}}</el-descriptions-item>
					<el-descriptions-item label="经营范围">{{detail.business}}</el-descriptions-item>
				</el-descriptions>
			</el-card>

			<el-card shadow="never" header="成员信息" style="margin-top: 10px">
				<el-table :data="detail.contact" style="width: 100%">
					<el-table-column prop="name" label="姓名" width="180" />
					<el-table-column prop="sex" label="性别" width="180" />
					<el-table-column prop="job" label="职务" />
					<el-table-column prop="mobile" label="手机号码" />
					<el-table-column prop="phone" label="单位电话" />
					<el-table-column prop="phone" label="是否法人" />
				</el-table>
			</el-card>
		</el-main>
	</el-container>
</template>

<script>
import useTabs from '@/utils/useTabs'

export default {
	data() {
		return {
			detail: {}
		}
	},
	mounted(){
		this.getCompanyDetail();
	},
	methods:{
		async getCompanyDetail(){
			let id = this.$router.currentRoute.value.query.id;
			let res = await this.$API.customer.company.detail.get({id: id});
			if(res.code == 1){
				this.detail = res.data;
				useTabs.setTitle(this.detail.name)
			}
		},
		goBack(){
			this.$router.go(-1)
		}
	}
}
</script>
