<template>
	<div class="hui-detail">
		<div class="hui-detail-title">基础信息</div>
		<div class="hui-detail-content">
			<div class="hui-detail-item">
				<div class="hui-detail-label">企业名称</div>
				<div class="hui-detail-value">{{detail.name}}</div>
			</div>
			<div class="hui-detail-item">
				<div class="hui-detail-label">企业类型</div>
				<div class="hui-detail-value">{{$field.findTypeName('industryType',detail.industryType)}}</div>
			</div>
			<div class="hui-detail-item">
				<div class="hui-detail-label">企业法人</div>
				<div class="hui-detail-value">{{detail.legalPerson}}</div>
			</div>
			<div class="hui-detail-item">
				<div class="hui-detail-label">成立时间</div>
				<div class="hui-detail-value">{{detail.establishDate}}</div>
			</div>
			<div class="hui-detail-item">
				<div class="hui-detail-label">营业期限</div>
				<div class="hui-detail-value">{{detail.businessTerm}}</div>
			</div>
			<div class="hui-detail-item">
				<div class="hui-detail-label">注册资本</div>
				<div class="hui-detail-value">{{detail.registeredCapital}}</div>
			</div>
			<div class="hui-detail-item">
				<div class="hui-detail-label">企业地址</div>
				<div class="hui-detail-value">{{detail.address}}</div>
			</div>
			<div class="hui-detail-item">
				<div class="hui-detail-label">经营范围</div>
				<div class="hui-detail-value">{{detail.businessScope}}</div>
			</div>
			<div class="hui-detail-item">
				<div class="hui-detail-label">企业规模</div>
				<div class="hui-detail-value">{{detail.corporateScale}}</div>
			</div>
			<div class="hui-detail-item">
				<div class="hui-detail-label">企业理念</div>
				<div class="hui-detail-value">{{detail.corporatePhilosophy}}</div>
			</div>
			<div class="hui-detail-item">
				<div class="hui-detail-label">企业文化</div>
				<div class="hui-detail-value">{{detail.corporateCulture}}</div>
			</div>
			<div class="hui-detail-item">
				<div class="hui-detail-label">联系方式</div>
				<div class="hui-detail-value">{{detail.contactInformation}}</div>
			</div>
			<div class="hui-detail-item">
				<div class="hui-detail-label">传真</div>
				<div class="hui-detail-value">{{detail.fax}}</div>
			</div>
			<div class="hui-detail-item">
				<div class="hui-detail-label">电子邮箱</div>
				<div class="hui-detail-value">{{detail.email}}</div>
			</div>
		</div>
		<div v-if="detail.roomIds">
			<div class="hui-detail-title">入驻信息</div>
			<div class="hui-detail-content">
				<div class="hui-detail-item">
					<div class="hui-detail-label">入驻房源</div>
					<div class="hui-detail-value">
						<div class="hui-ellipsis" v-for="(item,index) in detail.roomMap" :key="index">
							{{item}}
						</div>
					</div>
				</div>
				<div class="hui-detail-item">
					<div class="hui-detail-label">入驻时间</div>
					<div class="hui-detail-value">{{detail.entryTime}}</div>
				</div>
			</div>
		</div>
		<div v-if="detail.intellectualPropertyRight && detail.intellectualPropertyRight != '[]'">
			<div class="hui-detail-title">知识产权</div>
			<div class="hui-detail-content">
				<div v-for="(item,index) in JSON.parse(detail.intellectualPropertyRight)">
					<div class="hui-detail-item">
						<div class="hui-detail-label">产权名称</div>
						<div class="hui-detail-value">{{item.keyName}}</div>
					</div>
					<div class="hui-detail-item">
						<div class="hui-detail-label">产权数量</div>
						<div class="hui-detail-value">{{item.value}}</div>
					</div>
				</div>
			</div>
		</div>
		<div v-if="detail.enterpriseMilestones && detail.enterpriseMilestones != '[]'">
			<div class="hui-detail-title">企业里程碑</div>
			<div class="hui-detail-content">
				<div v-for="(item,index) in JSON.parse(detail.enterpriseMilestones)">
					<div class="hui-detail-item">
						<div class="hui-detail-label">日期</div>
						<div class="hui-detail-value">{{item.keyName}}</div>
					</div>
					<div class="hui-detail-item">
						<div class="hui-detail-label">内容</div>
						<div class="hui-detail-value">{{item.value}}</div>
					</div>
				</div>
			</div>
		</div>
		<div v-if="detail.produce && detail.produce != '[]'">
			<div class="hui-detail-title">历年产值</div>
			<div class="hui-detail-content">
				<div v-for="(item,index) in JSON.parse(detail.produce)">
					<div class="hui-detail-item">
						<div class="hui-detail-label">年份</div>
						<div class="hui-detail-value">{{item.keyName}}</div>
					</div>
					<div class="hui-detail-item">
						<div class="hui-detail-label">产值</div>
						<div class="hui-detail-value">{{item.value}}万元</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</template>

<script>
	import {
		getOrganizationDetailById
	} from '@/httpApi/business'
	export default {
		props: ['detailId'],
		data() {
			return {
				detail: {
					name: '',
					legalPerson: '',
					establishDate: '',
					businessTerm: '',
					organizationId: '',
					registeredCapital: '',
					industryType: '',
					data: '',
					address: '',
					businessScope: '',
					corporateScale: '',
					corporatePhilosophy: '',
					corporateCulture: '',
					contactInformation: '',
					fax: '',
					email: ''
				}
			}
		},
		created() {
			if (this.detailId) this.init();
		},
		methods: {
			init() {
				getOrganizationDetailById(this.detailId).then(res => {
					if (res.state) {
						this.detail = res.data;
					}
				})
			}
		},
	}
</script>
<style lang="scss">

</style>