<template>
	<a-result status="success" title="操作成功!" sub-title="操作已完成，请仔细核对实物与清单，确保无误。">
		<template #extra>
			<a-button type="primary" @click="select">查询申请</a-button>
			<a-button @click="again">继续提交申请</a-button>
		</template>
	</a-result>
</template>

<script lang="ts" setup>
	import router from '@/router'

	// 和外层界面的数据交互
	const props = defineProps(
		{
			applyType: {
				type: String,
				default: '',
			},
		}, // 申请类型 applyType页面传值的使用PURCHASE_RECEIPT和LOAN_OUT，PURCHASE_RECEIPT: 采购入库 和 归还入库 LOAN_OUT: 出库外借
	)

	const select = () => {
		if (props.applyType === 'PURCHASE_RECEIPT') {
			router.push({ path: '/statistic/inbound' })
		} else {
			router.push({ path: '/statistic/outbound' })
		}
	}

	const again = () => {
		router.go(0)
	}
</script>
