优化
This commit is contained in:
@@ -20,16 +20,42 @@ const inbounds = Array.from({ length: 15 }, (_, index) => ({
|
||||
|
||||
test('one container candidate aggregates fifteen independent one-inbound plans', () => {
|
||||
const candidate = normalizeReceivingCandidate({
|
||||
containerNo: 'C10000000', status: 'WAIT_SIGN', planCount: 15, inboundCodeCount: 15,
|
||||
sourceContainerBookingId: '2093166483653849089', containerNo: 'C10000000', status: 'WAIT_SIGN',
|
||||
plannedArrivalAt: '2026-08-29T09:30:00', totalOrderCount: 15, planCount: 15, inboundCodeCount: 15,
|
||||
missingInboundCodeCount: 0, plannedInboundCodeCount: 15, pendingPlanCount: 0, allPlansReady: true, operable: true, blockReason: '',
|
||||
destinationCodes: ['ABE3', 'US-LAX-01'], plannedPalletCount: 15,
|
||||
totalPackages: 60, receivedPackages: 0, currentAccount: false
|
||||
})
|
||||
assert.deepEqual(candidate, {
|
||||
containerNo: 'C10000000', status: 'WAIT_SIGN', planCount: 15, inboundCodeCount: 15,
|
||||
sourceContainerBookingId: '2093166483653849089', containerNo: 'C10000000', status: 'WAIT_SIGN',
|
||||
plannedArrivalAt: '2026-08-29T09:30:00', totalOrderCount: 15, planCount: 15, inboundCodeCount: 15,
|
||||
missingInboundCodeCount: 0, plannedInboundCodeCount: 15, pendingPlanCount: 0, allPlansReady: true, operable: true, blockReason: '',
|
||||
destinationCodes: ['ABE3', 'US-LAX-01'], plannedPalletCount: 15,
|
||||
totalPackages: 60, receivedPackages: 0, currentAccount: false
|
||||
})
|
||||
assert.equal(candidate.planCount, candidate.inboundCodeCount)
|
||||
assert.equal(candidate.sourceContainerBookingId, '2093166483653849089')
|
||||
})
|
||||
|
||||
test('incomplete containers remain visible but fail closed from server readiness facts', () => {
|
||||
const candidate = normalizeReceivingCandidate({
|
||||
sourceContainerBookingId: '2093166483653849099', containerNo: 'C10000001',
|
||||
plannedArrivalAt: null, totalOrderCount: 15, inboundCodeCount: 12, planCount: 10,
|
||||
missingInboundCodeCount: 3, plannedInboundCodeCount: 10, pendingPlanCount: 5, allPlansReady: false, operable: false,
|
||||
blockReason: '存在3票缺少入仓码'
|
||||
})
|
||||
assert.equal(candidate.totalOrderCount, 15)
|
||||
assert.equal(candidate.planCount, 10)
|
||||
assert.equal(candidate.plannedInboundCodeCount, 10)
|
||||
assert.equal(candidate.pendingPlanCount, 5)
|
||||
assert.equal(candidate.missingInboundCodeCount, 3)
|
||||
assert.equal(candidate.allPlansReady, false)
|
||||
assert.equal(candidate.operable, false)
|
||||
assert.equal(candidate.blockReason, '存在3票缺少入仓码')
|
||||
|
||||
const absentGate = normalizeReceivingCandidate({ containerNo: 'OLD-CONTRACT' })
|
||||
assert.equal(absentGate.allPlansReady, false)
|
||||
assert.equal(absentGate.operable, false)
|
||||
})
|
||||
|
||||
test('current recovery retains all independent-plan inbound facts while progress remains container-level', () => {
|
||||
@@ -53,7 +79,7 @@ test('container UI locks and signs once across independent plans, then renders o
|
||||
read('../src/api/inbound.js')
|
||||
])
|
||||
|
||||
assert.match(operation, /item\.inboundCodeCount[\s\S]*item\.totalPackages[\s\S]*item\.plannedPalletCount[\s\S]*item\.destinationCodes/)
|
||||
assert.match(operation, /item\.totalOrderCount[\s\S]*item\.inboundCodeCount[\s\S]*item\.planCount[\s\S]*item\.pendingPlanCount/)
|
||||
assert.match(summary, /inboundCodeCount[\s\S]*plannedPalletCount[\s\S]*totalPackages/)
|
||||
assert.doesNotMatch(operation, /v-for="[^"]*inbound[^"]*"/)
|
||||
assert.match(operation, /v-if="activeInbound"[\s\S]*activeInbound\.inboundCode[\s\S]*activeInbound\.pendingPackages/)
|
||||
@@ -70,10 +96,19 @@ test('container UI locks and signs once across independent plans, then renders o
|
||||
})
|
||||
|
||||
test('PDA does not infer container eligibility from partial plan workflow states', async () => {
|
||||
const operation = await read('../src/pages/operation/operation.vue')
|
||||
const [operation, adapter, inbound] = await Promise.all([
|
||||
read('../src/pages/operation/operation.vue'), read('../src/api/receiving-adapter.js'), read('../src/api/inbound.js')
|
||||
])
|
||||
for (const internalStatus of ['PENDING_ASSIGNMENT', 'INBOUND_PLANNED', 'PDA_PENDING', 'ASSIGNED', 'PICKING']) {
|
||||
assert.doesNotMatch(operation, new RegExp(internalStatus))
|
||||
}
|
||||
assert.match(operation, /listReceivingCandidates\(\)/)
|
||||
assert.match(operation, /statusLabel\(status\)[\s\S]*WAIT_SIGN[\s\S]*SIGNED[\s\S]*RECEIVING[\s\S]*COMPLETED/)
|
||||
assert.match(adapter, /allPlansReady: value\.allPlansReady === true/)
|
||||
assert.match(adapter, /operable: value\.operable === true/)
|
||||
assert.match(operation, /if \(!candidate\.operable\) \{ receiving\.selected = candidate; this\.detailOpen = true; return \}/)
|
||||
assert.match(operation, /if \(!this\.selected\?\.containerNo \|\| !this\.selected\?\.allPlansReady \|\| !this\.selected\?\.operable/)
|
||||
assert.match(operation, /catch \(error\) \{ await this\.recoverCurrentAfterConflict\(error, true\) \}/)
|
||||
assert.match(operation, /preserveEvidence \? error : null[\s\S]*this\.candidateError = preserveEvidence \? error : null/)
|
||||
assert.doesNotMatch(inbound, /sort\(/)
|
||||
})
|
||||
|
||||
@@ -66,7 +66,7 @@ test('login has no committed demo credentials and inbound operation implements t
|
||||
for (const role of ['LICENSE_PLATE', 'CONTAINER_SEAL', 'DOOR_OPEN']) assert.match(adapter, new RegExp(role))
|
||||
for (const forbidden of ['customerId', 'planNo', 'allocationId', 'warehouseId', 'locationId']) assert.doesNotMatch(inbound, new RegExp(forbidden))
|
||||
assert.match(operation, /isReceivingConflict|recoverCurrentAfterConflict/)
|
||||
assert.match(operation, /isNoCurrentReceiving\(recoveryError\)[\s\S]*该柜已被其他账号选择,列表已刷新/)
|
||||
assert.match(operation, /isNoCurrentReceiving\(recoveryError\)[\s\S]*柜状态已变化,列表已刷新/)
|
||||
assert.match(operation, /onShow\(\)[\s\S]*this\.phase === 'candidates'[\s\S]*this\.bootstrap\(\)/)
|
||||
assert.match(operation, /candidateLoading[\s\S]*candidateError/)
|
||||
assert.match(operation, /candidateError\.requestId[\s\S]*candidateError\.traceId/)
|
||||
@@ -112,13 +112,16 @@ test('receiving phases use a compiled container summary with cabinet and aggrega
|
||||
|
||||
test('candidate containers use compact card navigation and a small refresh action', async () => {
|
||||
const operation = await read('../src/pages/operation/operation.vue')
|
||||
assert.match(operation, /class="container-card container-card-compact"[\s\S]*@tap="openContainer\(item\.containerNo\)"/)
|
||||
assert.match(operation, /class="container-card container-card-compact"[\s\S]*container-card-disabled[\s\S]*@tap="openContainer\(item\)"/)
|
||||
assert.match(operation, /class="container-detail-link"/)
|
||||
assert.doesNotMatch(operation, /<button class="primary-button"[^>]*openContainer\(item\.containerNo\)/)
|
||||
assert.match(operation, /class="list-toolbar"><text>共 \{\{ candidates\.length \}\} 柜<\/text>/)
|
||||
assert.match(operation, /\.list-toolbar button\{[^}]*height:28px[^}]*min-height:28px/)
|
||||
assert.match(operation, /class="candidate-facts"[\s\S]*入仓码[\s\S]*计划托盘[\s\S]*目的仓/)
|
||||
assert.match(operation, /class="candidate-facts"[\s\S]*总订单[\s\S]*入仓码[\s\S]*已生成计划[\s\S]*未操作/)
|
||||
assert.match(operation, /class="candidate-destinations"/)
|
||||
assert.match(operation, /计划到仓:\{\{ formatPlannedArrival\(item\.plannedArrivalAt\) \}\}/)
|
||||
assert.match(operation, /item\.blockReason \|\| '当前柜入库计划尚未齐全'/)
|
||||
assert.doesNotMatch(operation, /预计到港/)
|
||||
assert.doesNotMatch(operation, /item\.receivedPackages[\s\S]*item\.totalPackages[\s\S]*progress-fill/)
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user