fix(client): request complete server-paged order workbench

This commit is contained in:
2026-10-03 14:57:54 +08:00
parent 78315873d7
commit 40f6753cca
10 changed files with 329 additions and 284 deletions
@@ -32,7 +32,6 @@ function harness(t) {
'@/modules/first-leg/api/firstLeg': api,
'@/modules/first-leg/api/unifiedOrders': {
getMerchantUnifiedOrder: async () => ({ summary: { orderId: 'one', mainStatus: null }, order: { order: { id: 'one', status: behavior.status, version: behavior.version, receivingWarehouseId: 'warehouse', receivingWarehouseAddress: behavior.receivingWarehouseAddress } }, timeline: [] }),
isUnifiedOrderQueryUnavailable: () => false,
},
'@/modules/first-leg/utils/firstLegOrder': { canClientEditFirstLegOrder: status => status === 'DRAFT', getFirstLegStatusLabel: value => value },
'@/modules/first-leg/utils/warehousePagination': {},
@@ -131,7 +130,7 @@ test('edit freezes detail version rather than cached list version and replays sa
const h = harness(t)
const original = await h.store.loadDraftDetail('one')
const session = h.store.beginDraftEdit(original)
h.store.orders[0].version = 0
h.store.orders = [{ ...original, version: 0 }]
h.behavior.failWrite = true
await assert.rejects(h.store.saveDraft(h.draft, '测试企业', 'one', session), /响应丢失/)
const first = h.calls.find(call => call.method === 'PUT')
@@ -233,6 +232,7 @@ function cancellationViewHarness() {
}
const ElMessage = { error: message => messages.push(message), warning: message => messages.push(message), success: message => messages.push(message) }
const globals = { canCancelOrder, cancellingOrderId, pendingCancellation, store, ElMessageBox, ElMessage, ApiError,
loadOrderPage: async () => calls.push(['load']),
isDetailPage: vue.ref(true), router: { push: async route => calls.push(['route', route]) } }
const handler = new Function(...Object.keys(globals), code + '\nreturn cancelOrder')(...Object.values(globals))
return { handler, calls, messages, prompts, canCancelOrder, pendingCancellation, behavior, ApiError }