This commit is contained in:
wujinliang
2026-09-17 14:26:41 +08:00
parent 9a8a72b1bd
commit 6c17df2a9b
2 changed files with 3 additions and 0 deletions
@@ -306,6 +306,7 @@ test('selects platform destinations and uses customer-scoped server address book
test('lets the create-page instance own destination loading and exposes a recoverable error state', () => {
assert.match(source, /await router\.push\(\{ name: 'first-leg-order-create' \}\)\s*\n\}/)
assert.doesNotMatch(source, /await router\.push\(\{ name: 'first-leg-order-create' \}\)[\s\S]*?await loadDestinationWarehouses\(form\.destinationType\)/)
assert.match(source, /watch\(isCreatePage, \(isCreate, wasCreate\) => \{[\s\S]*?if \(wasCreate === false\) void loadPageData\(\)/)
assert.match(source, /if \(destinationResult\.status === 'rejected'\) supportingDataErrors\.value\.push\(`目的仓加载失败:\$\{errorMessage\(destinationResult\.reason\)\}`\)/)
assert.match(source, /下单配套数据加载失败/)
})
@@ -654,6 +654,8 @@ watch(isCreatePage, (isCreate, wasCreate) => {
editingId.value = undefined
replaceForm(quickOrderDraft())
resetEditorValidation()
// The list and create routes reuse this component, so onMounted does not run again.
if (wasCreate === false) void loadPageData()
}, { immediate: true })
watch(detailOpen, (open) => {