优化
This commit is contained in:
@@ -170,6 +170,20 @@ test('pages expose loading empty error offline and permission diagnostics with g
|
||||
assert.doesNotMatch(dispatch + outbound, /DeliveryOrder|deliveryStatus|customerVisit|\/deliveries/)
|
||||
})
|
||||
|
||||
test('fulfillment workbench entries open task lists before details and keep explicit cross-workflow resume', async () => {
|
||||
const [dispatch, outbound] = await Promise.all([read('../src/pages/dispatch/dispatch.vue'), read('../src/pages/outbound/outbound.vue')])
|
||||
assert.match(dispatch, /resumeOnEntry: false/)
|
||||
assert.match(dispatch, /onLoad\(options\) \{ this\.resumeOnEntry = options\?\.resume === '1' \}/)
|
||||
assert.match(dispatch, /if \(this\.resumeOnEntry && fulfillment\.dispatch\.currentNo\) this\.openTask/)
|
||||
assert.match(outbound, /if \(!this\.bootstrapped\) \{ this\.bootstrapped = true; this\.scanCode = ''; this\.loadTasks\(\); return \}/)
|
||||
assert.match(outbound, /pages\/dispatch\/dispatch\?resume=1/)
|
||||
for (const page of [dispatch, outbound]) {
|
||||
assert.match(page, /detail-toolbar/)
|
||||
assert.match(page, /上次作业/)
|
||||
assert.match(page, /返回列表/)
|
||||
}
|
||||
})
|
||||
|
||||
test('dispatch vehicle-plate conflict uses actionable Chinese copy and preserves diagnostics', () => {
|
||||
const error = toDispatchError({
|
||||
code: 'A0409',
|
||||
|
||||
@@ -53,6 +53,8 @@ test('login has no committed demo credentials and inbound operation implements t
|
||||
assert.match(runtime, /#ifdef H5[\s\S]*?VITE_H5_AUTH_API_BASE_URL/)
|
||||
assert.match(runtime, /#ifdef H5[\s\S]*?VITE_H5_OVERSEAS_API_BASE_URL/)
|
||||
assert.match(operation, /startScanBroadcast/)
|
||||
assert.match(operation, /palletWorkflowActive = Boolean\(this\.activeInbound \|\| this\.resolvedPallet\)/)
|
||||
assert.match(operation, /queuedTarget: scan\.target/)
|
||||
for (const action of ['prepareReceivingContainer', 'getCurrentReceiving', 'resolveCurrentCarton', 'resolveCurrentPallet', 'receiveCurrentBulk', 'receiveCurrentCarton', 'receiveCurrentWholePallet', 'completeCurrentReceiving']) assert.match(operation, new RegExp(action))
|
||||
for (const path of ['/candidates', '/prepare', '/unload-photos/files', '/sign', '/cartons/resolve', '/pallets/resolve', '/receipts/bulk', '/receipts/carton', '/receipts/pallet', '/complete']) assert.match(inbound, new RegExp(path.replaceAll('/', '\\/')))
|
||||
assert.match(inbound, /current\('\/pallets\/resolve'\)/)
|
||||
|
||||
@@ -19,7 +19,7 @@ test('conflicting task opens modal and confirm resumes owned task without claimi
|
||||
assert.equal(calls[0].cancelText, '取消')
|
||||
assert.match(calls[0].content, /RL-ACTIVE/)
|
||||
assert.equal(context.taskCode, 'RL-ACTIVE')
|
||||
assert.equal(calls[1].url, '/pages/relabel/relabel?op=relabelExecute')
|
||||
assert.equal(calls[1].url, '/pages/relabel/relabel?op=relabelExecute&task=RL-ACTIVE')
|
||||
assert.equal(context.error, null)
|
||||
assert.equal(context.busy, false)
|
||||
})
|
||||
|
||||
@@ -107,9 +107,10 @@ test('relabel list opens a row directly in execution and completion returns to t
|
||||
assert.doesNotMatch(page, /name="relabelTask"/)
|
||||
assert.match(page, /@tap="openExecution\(item\)"/)
|
||||
assert.match(page, /async openExecution\(item\)/)
|
||||
assert.match(page, /uni\.redirectTo\(\{ url: '\/pages\/relabel\/relabel\?op=relabelExecute' \}\)/)
|
||||
assert.match(page, /relabelExecute&task=\$\{encodeURIComponent\(item\.relabelNo\)\}/)
|
||||
assert.match(page, /当前账号正在执行 \$\{active\.relabelNo\}/)
|
||||
assert.match(page, /v-if="stage === 'execute'" class="work-card"><button class="secondary"[^>]*@tap="goToClaimList">返回换标列表<\/button>/)
|
||||
assert.match(page, /v-if="stage === 'execute' && showCurrent" class="detail-toolbar"[\s\S]*@tap="closeCurrent">\u2039 返回列表<\/button>/)
|
||||
assert.match(page, /closeCurrent\(\) \{ this\.current = null;[\s\S]*this\.taskCode = '' \}/)
|
||||
assert.match(page, /updateWarehouseWork\('relabel', \{ currentNo: '', photoFileIds: \[\], photoNames: \[\], remark: '' \}\)/)
|
||||
assert.match(page, /if \(completed\) this\.goToClaimList\(\)/)
|
||||
assert.match(page, /goToClaimList\(\) \{ this\.taskCode = ''; uni\.redirectTo\(\{ url: '\/pages\/relabel\/relabel\?op=relabelReceive' \}\) \}/)
|
||||
@@ -119,7 +120,7 @@ test('relabel review is a read-only list and completed execution details stay hi
|
||||
const page = await read('../src/pages/relabel/relabel.vue')
|
||||
const body = page.match(/showCurrent\(\) \{([^\n]+)\},/)[1]
|
||||
const visible = new Function(body)
|
||||
const context = { stage: 'execute', current: { relabelNo: 'RL-1', taskStatus: 'PROCESSING' }, candidates: [{ relabelNo: 'RL-1', taskStatus: 'PROCESSING', claimedByCurrentOperator: true }] }
|
||||
const context = { stage: 'execute', entryTaskNo: '', current: { relabelNo: 'RL-1', taskStatus: 'PROCESSING' }, candidates: [{ relabelNo: 'RL-1', taskStatus: 'PROCESSING', claimedByCurrentOperator: true }] }
|
||||
assert.equal(visible.call(context), true, 'detail without ownership field must use server candidate ownership')
|
||||
assert.equal(visible.call({ ...context, candidates: [] }), false)
|
||||
assert.equal(visible.call({ ...context, stage: 'review' }), false)
|
||||
@@ -132,8 +133,10 @@ test('relabel review is a read-only list and completed execution details stay hi
|
||||
const bootstrapBody = page.match(/async bootstrap\(\) \{([^\n]+)\},/)[1]
|
||||
const bootstrap = new (Object.getPrototypeOf(async function () {}).constructor)(bootstrapBody)
|
||||
const opened = []
|
||||
await bootstrap.call({ ...context, taskCode: 'STALE', loadCandidates: async () => {}, openTask: async (no) => opened.push(no) })
|
||||
await bootstrap.call({ ...context, entryTaskNo: 'RL-1', loadCandidates: async () => {}, openTask: async (no) => opened.push(no) })
|
||||
assert.deepEqual(opened, ['RL-1'])
|
||||
await bootstrap.call({ ...context, entryTaskNo: '', loadCandidates: async () => {}, openTask: async (no) => opened.push(no) })
|
||||
assert.deepEqual(opened, ['RL-1'], 'workbench execution entry must stay on the processing-task list')
|
||||
})
|
||||
|
||||
test('warehouse drafts are isolated by operator and warehouse and retain retry keys until success', () => {
|
||||
|
||||
Reference in New Issue
Block a user