fix(client): retain customs access after order completion

This commit is contained in:
2026-10-02 11:33:51 +08:00
parent c115f1c504
commit 605388e666
5 changed files with 108 additions and 6 deletions
@@ -15,6 +15,7 @@ import OrderProgressPanel from '@/modules/first-leg/components/OrderProgressPane
import CustomsDocumentsDialog from '@/modules/first-leg/components/CustomsDocumentsDialog.vue'
import { getMerchantInboundBilling } from '@/modules/first-leg/api/inboundBilling'
import { getMerchantCustomsForOrder, isMerchantCustomsUnavailable, type MerchantCustomsContainer } from '@/modules/first-leg/api/customs'
import { isCustomsOrderCandidate } from '../utils/customsEligibility'
import {
estimateMerchantFirstLegPrice,
createIdempotencyKey,
@@ -499,12 +500,12 @@ function selectOrderQueue(queue: OrderQueue) {
function eligibleCustomsDetail(order: FirstLegOrder) {
const value = customsByOrder[order.id]
if (order.status !== 'LOADED' || !value?.merchantStatus) return null
if (!isCustomsOrderCandidate(order) || !value?.merchantStatus) return null
return value.inbounds.some((item) => item.orderId === order.id && item.taxMode === 'TAX_REFUND') ? value : null
}
async function loadCustomsEligibility(order: FirstLegOrder) {
if (order.status !== 'LOADED' || customsByOrder[order.id] !== undefined || customsEligibilityPending.has(order.id)) return
if (!isCustomsOrderCandidate(order) || customsByOrder[order.id] !== undefined || customsEligibilityPending.has(order.id)) return
customsEligibilityPending.add(order.id)
try {
customsByOrder[order.id] = await getMerchantCustomsForOrder(order.id)