优化
This commit is contained in:
@@ -219,19 +219,19 @@ const candidateColumns: DataTableColumn[] = [
|
||||
{ key: 'customerName', prop: 'customerName', label: '客户', minWidth: 70 },
|
||||
{ key: 'availablePackageCount', prop: 'availablePackageCount', label: '可用箱数', width: 80 },
|
||||
// { key: 'cartonIdentityStatus', label: '箱号归属', width: 105, slotName: 'cartonIdentityStatus' },
|
||||
{ key: 'unitGrossWeightKg', label: '平均单箱毛重', width: 100, slotName: 'unitGrossWeight' },
|
||||
{ key: 'totalGrossWeightKg', label: '总重量', width: 90, slotName: 'candidateTotalWeight' },
|
||||
{ key: 'averageUnitVolumeCbm', label: '平均单箱体积', width: 100, slotName: 'averageUnitVolume' },
|
||||
{ key: 'totalVolumeCbm', label: '总体积', width: 90, slotName: 'candidateTotalVolume' },
|
||||
{ key: 'unitGrossWeightKg', label: '单箱毛重', width: 80, slotName: 'unitGrossWeight' },
|
||||
{ key: 'totalGrossWeightKg', label: '重量', width: 90, slotName: 'candidateTotalWeight' },
|
||||
{ key: 'averageUnitVolumeCbm', label: '单箱体积', width: 80, slotName: 'averageUnitVolume' },
|
||||
{ key: 'totalVolumeCbm', label: '体积', width: 90, slotName: 'candidateTotalVolume' },
|
||||
]
|
||||
const itemColumns: DataTableColumn[] = [
|
||||
{ key: 'actions', label: '操作', width: 90, fixed: 'left', slotName: 'actions' },
|
||||
{ key: 'inboundCode', prop: 'inboundCode', label: '入仓码', minWidth: 190, fixed: 'left', showOverflowTooltip: true },
|
||||
{ key: 'coLoadGroup', label: '同柜不可拆', minWidth: 210, slotName: 'coLoadGroup' },
|
||||
{ key: 'customerName', prop: 'customerName', label: '客户', minWidth: 140 },
|
||||
{ key: 'packageCount', label: '分配箱数', width: 140, slotName: 'packageCount' },
|
||||
{ key: 'grossWeightKg', label: '毛重', width: 110, slotName: 'weight' },
|
||||
{ key: 'volumeCbm', label: '体积', width: 105, slotName: 'volume' },
|
||||
{ key: 'actions', label: '操作', width: 80, fixed: 'left', slotName: 'actions' },
|
||||
{ key: 'inboundCode', prop: 'inboundCode', label: '入仓码', minWidth: 140, fixed: 'left', showOverflowTooltip: true },
|
||||
{ key: 'coLoadGroup', label: '同柜', minWidth: 80, slotName: 'coLoadGroup' },
|
||||
{ key: 'customerName', prop: 'customerName', label: '客户', minWidth: 70 },
|
||||
{ key: 'packageCount', label: '分配箱数', width: 100, slotName: 'packageCount' },
|
||||
{ key: 'grossWeightKg', label: '毛重', width: 80, slotName: 'weight' },
|
||||
{ key: 'volumeCbm', label: '体积', width: 80, slotName: 'volume' },
|
||||
]
|
||||
|
||||
function formatNumber(value: number, digits = 3) {
|
||||
@@ -306,6 +306,14 @@ function candidateQueryParams(): Parameters<typeof listSmartLoadingCandidates>[0
|
||||
return params
|
||||
}
|
||||
|
||||
function containerQueryParams(page = 1): Parameters<typeof listSmartLoadingWorkbenchContainers>[0] {
|
||||
return {
|
||||
channelGroupCodes: [...selectedChannelCodes.value],
|
||||
page,
|
||||
size: 200,
|
||||
}
|
||||
}
|
||||
|
||||
async function loadCandidateData() {
|
||||
if (!selectedChannelCodes.value.length) return
|
||||
const request = ++candidateRequest
|
||||
@@ -357,9 +365,9 @@ async function loadContainerData(preserved: Record<string, number> = {}) {
|
||||
if (!selectedChannelCodes.value.length) return
|
||||
const request = ++containerRequest
|
||||
try {
|
||||
const firstPage = await listSmartLoadingWorkbenchContainers({ ...candidateQueryParams(), page: 1, size: 200 })
|
||||
const firstPage = await listSmartLoadingWorkbenchContainers(containerQueryParams())
|
||||
const remainingPages = firstPage.pages > 1
|
||||
? await Promise.all(Array.from({ length: firstPage.pages - 1 }, (_, index) => listSmartLoadingWorkbenchContainers({ ...candidateQueryParams(), page: index + 2, size: 200 })))
|
||||
? await Promise.all(Array.from({ length: firstPage.pages - 1 }, (_, index) => listSmartLoadingWorkbenchContainers(containerQueryParams(index + 2))))
|
||||
: []
|
||||
if (request !== containerRequest) return
|
||||
containers.value = [firstPage, ...remainingPages].flatMap((page) => page.records)
|
||||
@@ -431,7 +439,7 @@ async function selectChannels(codes: string[]) {
|
||||
async function applyFilters(model: QueryModel) {
|
||||
appliedQuery.value = { ...model }
|
||||
candidatePage.value = 1
|
||||
await loadWorkbenchData()
|
||||
await loadCandidateData()
|
||||
}
|
||||
|
||||
async function changeCandidatePage(page: number) {
|
||||
|
||||
Reference in New Issue
Block a user