feat: gate PDA loading evidence by ready task

This commit is contained in:
2026-08-15 17:04:00 +08:00
parent 207c872dff
commit 3bb5da8ae7
6 changed files with 147 additions and 79 deletions
+7 -18
View File
@@ -87,23 +87,12 @@ export function isRemoteReady(inboundId) {
export function getContainerPickingTask(identity, warehouseId) {
const selector = typeof identity === 'object' && identity !== null ? identity : {}
const taskId = selector.taskId ?? selector.id
if (taskId) {
if (!warehouseId) throw new Error('缺少作业仓库标识,无法请求现场任务')
return request({
url: `/first-leg/pda-loading/tasks/${encodeURIComponent(taskId)}?warehouseId=${encodeURIComponent(warehouseId)}`,
method: 'GET'
}).then(normalizePickingTask)
}
const query = []
if (selector.cabinetNo) query.push(`cabinetNo=${encodeURIComponent(selector.cabinetNo)}`)
else if (selector.loadingPlanId) query.push(`loadingPlanId=${encodeURIComponent(selector.loadingPlanId)}`)
else throw new Error('缺少稳定柜次标识,无法请求现场任务')
if (warehouseId) query.push(`warehouseId=${encodeURIComponent(warehouseId)}`)
if (session.tenantId) query.push(`tenantId=${encodeURIComponent(session.tenantId)}`)
return request({ url: `/first-leg/pda-loading/tasks?${query.join('&')}`, method: 'GET' }).then((data) => {
const task = Array.isArray(data) ? data[0] : (data?.records ? data.records[0] : data)
return task ? normalizePickingTask(task) : null
})
if (!taskId) throw new Error('当前没有可进入的拣货任务,请返回任务列表刷新')
if (!warehouseId) throw new Error('缺少作业仓库标识,无法请求现场任务')
return request({
url: `/first-leg/pda-loading/tasks/${encodeURIComponent(taskId)}?warehouseId=${encodeURIComponent(warehouseId)}`,
method: 'GET'
}).then(normalizePickingTask)
}
export function claimContainerPickingTask(taskId, expectedAssignmentVersion, operationId) {
@@ -197,7 +186,7 @@ export function normalizePdaOrder(row = {}) {
cabinetNo: row.cabinetNo ?? row.loading?.cabinetNo ?? row.container?.cabinetNo ?? row.containerNo ?? '',
currentContainerNo: row.currentContainerNo ?? row.containerNo ?? row.container?.containerNo ?? row.loadingPlan?.containerNo ?? row.loading?.containerNo ?? null,
warehouseId: row.warehouseId ?? row.warehouse?.id ?? row.loadingPlan?.warehouseId ?? null,
displayNo: row.orderNo ?? row.inboundCode ?? row.order?.orderNo ?? `任务 ${row.taskId ?? row.id}`
displayNo: row.orderNo ?? row.inboundCode ?? row.order?.orderNo ?? '业务单号待同步'
}
}