优化
This commit is contained in:
@@ -11,14 +11,14 @@ import ListPageLayout from '@/shared/components/ListPageLayout.vue'
|
||||
import LoadErrorState from '@/shared/components/LoadErrorState.vue'
|
||||
import QueryToolbar, { type QueryField, type QueryModel } from '@/shared/components/QueryToolbar.vue'
|
||||
import { getInventorySummary, listInventoryBalances, type InventoryDashboardDto } from '../api/inventory'
|
||||
import { listCustomerWarehouses, type CustomerWarehouseDto } from '../api/pallets'
|
||||
import { listReceivingOverseasWarehouses, type ReceivingOverseasWarehouseDto } from '../api/pallets'
|
||||
import { toInventoryListItem } from '../inventoryPresentation'
|
||||
import { overseasWarehousePermissions } from '../permissions'
|
||||
import type { InventoryListItem } from '../types'
|
||||
|
||||
const router = useRouter()
|
||||
const access = useAccessPreviewStore()
|
||||
const warehouses = ref<CustomerWarehouseDto[]>([])
|
||||
const warehouses = ref<ReceivingOverseasWarehouseDto[]>([])
|
||||
const rows = ref<InventoryListItem[]>([])
|
||||
const summary = ref<InventoryDashboardDto | null>(null)
|
||||
const loading = ref(false)
|
||||
@@ -59,7 +59,7 @@ const columns: DataTableColumn[] = [
|
||||
async function loadWarehouses() {
|
||||
if (!access.can(overseasWarehousePermissions.warehouseList)) return
|
||||
contextLoading.value = true; loadError.value = null
|
||||
try { warehouses.value = (await listCustomerWarehouses()).records }
|
||||
try { warehouses.value = (await listReceivingOverseasWarehouses()).records }
|
||||
catch (error) { loadError.value = getApiErrorDetails(error, '海外仓列表加载失败,请重试') }
|
||||
finally { contextLoading.value = false }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user