<template>
	<view>
		<gw-pay-flowable-detail v-if="gwPayFlowableDetailShow" :parentPaymentData="paymentData" :processInstanceId="processInstanceId" ref="gwRef"></gw-pay-flowable-detail>	
		<gn-pay-flowable-detail v-if="gnPayFlowableDetailShow" :parentPaymentData="paymentData" :processInstanceId="processInstanceId" ref="gnRef"></gn-pay-flowable-detail>
		<sk-pay-flowable  v-if="skPayFlowableShow" :parentPaymentData="paymentData"></sk-pay-flowable>
		<qt-pay-flowable-detail v-if="qtPayFlowableDetail" :parentPaymentData="paymentData" :processInstanceId="processInstanceId" ref="qtRef"></qt-pay-flowable-detail>
		<sk-detail v-if="skDetailShow" :parentPaymentData="paymentData"></sk-detail>
	</view>
</template>

<script>
	import gwPayFlowableDetail from '@/components/pages/beijing/payment/gwPayFlowableDetail.vue';
	import gnPayFlowableDetail from '@/components/pages/beijing/payment/gnPayFlowableDetail.vue';
	import skPayFlowable from '@/components/pages/beijing/payment/skPayFlowable.vue';
	import qtPayFlowableDetail from '@/components/pages/beijing/payment/qtPayFlowableDetail.vue';
	import skDetail from '@/components/pages/beijing/payment/skDetail.vue';
	export default {
		props:['businessKey', 'menuId', 'processInstanceId'],
		components: {gwPayFlowableDetail, gnPayFlowableDetail, skPayFlowable, qtPayFlowableDetail, skDetail},
		data() {
			return {
				paymentData : {},
				gwPayFlowableDetailShow : false,
				gnPayFlowableDetailShow : false,
				skPayFlowableShow : false,
				qtPayFlowableDetail : false,
				skDetailShow : false
			}
		},
		beforeMount() {
			let self = this;
			this.admRequest({
				action : 'CollectPayManageAction/queryContractCollect',
				data : {
					paymentId : self.businessKey
				},
				success(res){
					self.paymentData = res.data.data[0];
					// 货款审批
					if (self.menuId == '4400001_FK_HK') {
						// 国外
						if (self.paymentData.abroad == '01') {
							self.gwPayFlowableDetailShow = true;
						// 国内
						} else {
							self.gnPayFlowableDetailShow = true;
						}
					// 税款
					} else if (self.menuId == '4400001_FK_SK') {
						self.skPayFlowableShow = true;
					} else if (self.menuId == '4400001_FK_QT') {
						self.qtPayFlowableDetail = true;
					} else if (self.menuId == '4400001_SK') {
						self.skDetailShow = true;
					}
				}
			})
		},
		methods:{
			getCallBackData(){
				if (this.menuId == '4400001_FK_HK') {
					if (this.paymentData.abroad == '01') {
						return this.$refs.gwRef.getCallBackData();
					} else  {
						return this.$refs.gnRef.getCallBackData();
					}
				} else if (this.menuId == '4400001_FK_QT') {
					return this.$refs.qtRef.getCallBackData();
				}
			}
		}
	}
</script>

<style>
</style>
