优化
This commit is contained in:
@@ -7,7 +7,7 @@ const body = source.split('<script>')[1].split('</script>')[0].replace(/^\s*impo
|
||||
function setup(confirm) {
|
||||
const calls = []
|
||||
const uni = { showModal(options) { calls.push(options); options.success({ confirm }) }, redirectTo(options) { calls.push(options) } }
|
||||
const component = new Function('PortalHeader', 'RelabelPalletWork', 'ScanTargetInput', 'uni', body)({}, {}, {}, uni)
|
||||
const component = new Function('PortalHeader', 'RelabelPalletWork', 'ScanTargetInput', 'ReturnRelabelPackWork', 'uni', body)({}, {}, {}, {}, uni)
|
||||
const context = { busy: false, stage: 'receive', taskCode: 'PREVIOUS', error: null, candidates: [{ relabelNo: 'RL-ACTIVE', taskStatus: 'PROCESSING', claimedByCurrentOperator: true }] }
|
||||
context.promptActiveTask = component.methods.promptActiveTask.bind(context)
|
||||
return { calls, context, open: () => component.methods.openExecution.call(context, { relabelNo: 'RL-OTHER', taskStatus: 'AVAILABLE' }) }
|
||||
@@ -34,7 +34,7 @@ test('cancel stays on list and preserves existing task selection', async () => {
|
||||
test('new relabel task asks whether to start before it can be claimed', async () => {
|
||||
const calls = []
|
||||
const uni = { showModal(options) { calls.push(options); options.success({ confirm: false }) } }
|
||||
const component = new Function('PortalHeader', 'RelabelPalletWork', 'ScanTargetInput', 'uni', body)({}, {}, {}, uni)
|
||||
const component = new Function('PortalHeader', 'RelabelPalletWork', 'ScanTargetInput', 'ReturnRelabelPackWork', 'uni', body)({}, {}, {}, {}, uni)
|
||||
const context = { busy: false }
|
||||
const confirmed = await component.methods.confirmStartTask.call(context, { relabelNo: 'RL-NEW' })
|
||||
|
||||
|
||||
Reference in New Issue
Block a user