This commit is contained in:
2026-10-28 13:59:39 +08:00
parent 0c3f4ece2a
commit 6464935014
5 changed files with 26 additions and 34 deletions
@@ -22,7 +22,7 @@ import { overseasBusinessPermissions } from '../permissions'
import { statusLabel, money, dateTime, text } from '../procurementPresentation'
import type { PlatformProcurement } from '../procurementTypes'
import { directionLabel } from '../procurementDirection'
import { requireReviewedProcurementFees } from '../procurementOutboundFees'
import { hasProcurementFeeDetails } from '../procurementOutboundFees'
const route = useRoute(); const router = useRouter(); const auth = useAuthStore(); const access = useAccessPreviewStore()
const purchaseId = computed(() => typeof route.params.purchaseId === 'string' ? route.params.purchaseId : '')
const customerId = computed(() => typeof route.query.customerId === 'string' ? route.query.customerId : '')
@@ -30,9 +30,10 @@ const detail = ref<PlatformProcurement | null>(null), workflow = ref<Procurement
const loadError = ref<ApiErrorDetails | null>(null), operationError = ref<ApiErrorDetails | null>(null), downloading = ref('')
const order = computed(() => detail.value?.customerView.order)
const feePanel = ref<InstanceType<typeof BusinessDocumentFees>>()
async function beforeOutbound() {
if (!feePanel.value) throw new Error('费用明细尚未加载完成,请稍后重试')
requireReviewedProcurementFees(await feePanel.value.getFees())
async function beforeOutbound(): Promise<boolean | null> {
if (!feePanel.value) return null
try { return !hasProcurementFeeDetails(await feePanel.value.getFees()) }
catch { return null }
}
const fields = computed(() => [
['客户', order.value?.customerName], ['采购方向', directionLabel(order.value?.procurementDirection)], ['收货仓', order.value?.actualWarehouseName || order.value?.plannedWarehouseName],