装柜优化

This commit is contained in:
2026-08-11 14:23:46 +08:00
parent 8a8c5a3faa
commit ef35a1be2e
7 changed files with 38 additions and 16 deletions
@@ -142,14 +142,14 @@ function syncDrafts(next: SmartLoadingPlan, preserved: Record<string, number> =
for (const key of Object.keys(quantityDrafts)) delete quantityDrafts[key]
for (const item of next.items || []) quantityDrafts[item.id] = preserved[item.id] ?? item.packageCount
}
function acceptPlan(next: SmartLoadingPlan, preserved: Record<string, number> = {}) {
function acceptPlan(next: SmartLoadingPlan, preserved: Record<string, number> = {}, syncContainerStatus = true) {
plan.value = next
noDraft.value = false
syncDrafts(next, preserved)
const container = selectedContainer.value
if (container) {
container.planId = next.id
container.planStatus = next.status
if (syncContainerStatus) container.planStatus = next.status
}
}
function clearSelectionData() {
@@ -178,7 +178,7 @@ async function loadSelectedData(preserved: Record<string, number> = {}) {
])
if (request !== selectionRequest) return
candidates.value = candidateResult
if (planResult.value) acceptPlan(planResult.value, preserved)
if (planResult.value) acceptPlan(planResult.value, preserved, false)
else noDraft.value = planResult.missing
} catch (error) {
if (request === selectionRequest) selectionError.value = getApiErrorDetails(error, '柜次装柜数据加载失败')