This commit is contained in:
wujinliang
2026-08-27 21:48:15 +08:00
parent 550d8add97
commit b47323edf3
53 changed files with 624 additions and 82 deletions
@@ -24,6 +24,11 @@ describe('OceanBookingDetailView draft and release contract', () => {
expect(source).not.toContain('cancelOceanBooking')
})
it('invalidates the cached booking list after deleting a draft', () => {
expect(source).toContain("workspace.bumpCacheEpoch('ocean-bookings')")
expect(source).toContain("await router.replace('/ocean-bookings')")
})
it('saves incomplete DRAFT data and sends null for blank nullable fields', () => {
expect(source).toContain('保存草稿')
expect(source).toContain('channelCode: form.data.channelCode?.trim() || null')
@@ -316,6 +316,7 @@ async function removeDraft() {
actionSaving.value = true
await deleteOceanBookingDraft(id.value, detail.value.version)
ElMessage.success('订舱草稿已删除')
workspace.bumpCacheEpoch('ocean-bookings')
await router.replace('/ocean-bookings')
} catch (cause) {
if (cause !== 'cancel' && !(cause instanceof Error && cause.message === 'cancel')) actionError.value = getApiErrorDetails(cause)