This commit is contained in:
2026-08-14 14:27:03 +08:00
parent 724848feb6
commit a81af4a664
64 changed files with 961 additions and 176 deletions
@@ -17,7 +17,7 @@ import type { InboundOrderSummary } from '../core/types'
import InboundMeasurementPanel from '../measurement/InboundMeasurementPanel.vue'
import MeasurementReviewPanel from '../review/MeasurementReviewPanel.vue'
import { inboundProcessStatusLabels, inboundReviewStatusLabels, inboundStatusLabel } from '../status'
import { buildInboundTaskQuery, type InboundTaskMode } from '../task-list'
import { buildInboundTaskQuery, loadAllActiveCustomers, type InboundTaskMode } from '../task-list'
type FilterModel = QueryModel & {
customerId: string
@@ -43,6 +43,7 @@ const warehouseOptions = ref<Array<{ label: string; value: string }>>([])
const selectedInbound = ref<InboundOrderSummary | null>(null)
const taskDialogOpen = ref(false)
let requestSerial = 0
let optionsRequestSerial = 0
let disposed = false
let activatedOnce = false
@@ -109,14 +110,15 @@ function dateParam(value: string | undefined, end = false) {
}
async function loadOptions() {
const serial = ++optionsRequestSerial
customerLoadError.value = null
try {
const [customerPage, warehousePage] = await Promise.all([
listPlatformTenants({ page: 1, size: 200, status: 'ACTIVE' }),
const [customerRecords, warehousePage] = await Promise.all([
loadAllActiveCustomers((query) => listPlatformTenants(query)),
listPlatformWarehouses(1, 200),
])
if (disposed) return
customers.value = customerPage.records
if (disposed || serial !== optionsRequestSerial) return
customers.value = customerRecords
warehouseOptions.value = warehousePage.records.map((warehouse) => ({
label: `${warehouse.warehouseName} · ${warehouse.warehouseCode}`,
value: String(warehouse.id),
@@ -190,7 +192,7 @@ onActivated(() => {
}
void loadTasks()
})
onBeforeUnmount(() => { disposed = true; requestSerial += 1 })
onBeforeUnmount(() => { disposed = true; requestSerial += 1; optionsRequestSerial += 1 })
</script>
<template>