优化
This commit is contained in:
@@ -102,15 +102,25 @@ const fields: QueryField[] = [{ key: 'documentNo', type: 'input', label: '出库
|
||||
|
||||
async function load(model: QueryModel = filters.value) { Object.assign(filters.value, model); loading.value = true; error.value = null; try { const result = await listOutbounds({ page: page.value, size: pageSize.value, documentNo: String(filters.value.documentNo || '').trim() || undefined, lxCode: String(filters.value.lxCode || '').trim() || undefined, warehouseId: String(filters.value.warehouseId || '').trim() || undefined, status: String(filters.value.status || '').trim() || undefined, outboundType: String(filters.value.outboundType || '').trim() || undefined }); rows.value = result.records.map((row) => ({ ...row, createdAt: formatOverseasDateTime(row.createdAt) })); total.value = result.total } catch (cause) { error.value = getApiErrorDetails(cause, '出库单列表加载失败') } finally { loading.value = false } }
|
||||
function outboundTypeLabel(value?: string | null) { return value === 'WAREHOUSE_TRANSFER_OUTBOUND' ? '仓储转运出库' : value === 'ONE_CLICK_DROPSHIP' ? '一件代发出库' : value === 'RETURN_OUTBOUND' ? '退货出库' : value === 'DISPATCH_DELIVERY' ? '派送出库' : value || '—' }
|
||||
async function loadCustomerOptions() {
|
||||
const records: PlatformTenantResource[] = []
|
||||
let page = 1
|
||||
while (true) {
|
||||
const result = await listPlatformTenants({ page, size: 200, status: 'ACTIVE' })
|
||||
records.push(...result.records)
|
||||
if (page >= result.pages || !result.records.length) return records
|
||||
page += 1
|
||||
}
|
||||
}
|
||||
async function loadInventoryOptions() {
|
||||
inventoryLoading.value = true
|
||||
try {
|
||||
const [tenants, warehouses, fbaWarehouses] = await Promise.allSettled([
|
||||
listPlatformTenants({ page: 1, size: 200, status: 'ACTIVE' }),
|
||||
loadCustomerOptions(),
|
||||
listPlatformWarehouses({ page: 1, size: 200, warehouseType: 'OVERSEAS', status: 'ACTIVE' }),
|
||||
listPlatformWarehouses({ page: 1, size: 200, warehouseType: 'FBA', status: 'ACTIVE' }),
|
||||
])
|
||||
if (tenants.status === 'fulfilled') tenantOptions.value = tenants.value.records
|
||||
if (tenants.status === 'fulfilled') tenantOptions.value = tenants.value
|
||||
else ElMessage.error(getApiErrorDetails(tenants.reason, '客户列表加载失败').message)
|
||||
if (warehouses.status === 'fulfilled') {
|
||||
warehouseOptionsSource.value = warehouses.value.records
|
||||
|
||||
Reference in New Issue
Block a user