<template>
	<view>
		<foreign-contract-detail :parentForm="form" :businessKey="businessKey" v-if="foreignContractDetailShow"></foreign-contract-detail>
		<gNContractDetail :parentForm="form" :businessKey="businessKey" v-if="gNContractDetailShow"></gNContractDetail>
		<xs-contract-detail :parentForm="form" :businessKey="businessKey" v-if="xsContractDetailShow"></xs-contract-detail>
	</view>
</template>

<script>
	import foreignContractDetail from '@/components/pages/beijing/contract/foreignContractDetail.vue';
	import gNContractDetail from '@/components/pages/beijing/contract/gNContractDetail.vue';
	import xsContractDetail from '@/components/pages/beijing/contract/xsContractDetail.vue';
	export default {
		components:{foreignContractDetail, gNContractDetail, xsContractDetail},
		props:['businessKey'],
		data() {
			return {
				form : {},
				foreignContractDetailShow : false,
				gNContractDetailShow : false,
				xsContractDetailShow : false
			}
		},
		beforeMount() {
			let self = this;
			this.admRequest({
				action : 'ContractManageAction/selectContractInfo',
				data : {
					aciId : self.businessKey
				},
				success(res){
					self.form = res.data.data[0];
					// 国外合同
					if (self.form.abroad == '01') {
						self.foreignContractDetailShow = true;
					// 国内采购合同
					} else if (self.form.type == '00') {
						self.gNContractDetailShow = true;
					// 国内销售合同
					} else {
						self.xsContractDetailShow = true;
					}
				}
			})
		}
	}
</script>

<style>
</style>
