|
|
@@ -73,7 +73,8 @@ const QrCodeModal: React.FC<{ |
|
|
|
|
|
|
|
|
const [processedQrCodes, setProcessedQrCodes] = useState<Set<string>>(new Set()); |
|
|
const [processedQrCodes, setProcessedQrCodes] = useState<Set<string>>(new Set()); |
|
|
const [scannedQrResult, setScannedQrResult] = useState<string>(''); |
|
|
const [scannedQrResult, setScannedQrResult] = useState<string>(''); |
|
|
|
|
|
|
|
|
|
|
|
const { data: session } = useSession() as { data: SessionWithTokens | null }; |
|
|
|
|
|
const currentUserId = session?.id ? parseInt(session.id) : |
|
|
// Process scanned QR codes |
|
|
// Process scanned QR codes |
|
|
useEffect(() => { |
|
|
useEffect(() => { |
|
|
if (qrValues.length > 0 && lot && !isProcessingQr && !qrScanSuccess) { |
|
|
if (qrValues.length > 0 && lot && !isProcessingQr && !qrScanSuccess) { |
|
|
@@ -660,7 +661,9 @@ const JobPickExecution: React.FC<Props> = ({ filterArgs }) => { |
|
|
// ✅ Use the new second scan API |
|
|
// ✅ Use the new second scan API |
|
|
const result = await updateSecondQrScanStatus( |
|
|
const result = await updateSecondQrScanStatus( |
|
|
matchingLot.pickOrderId, |
|
|
matchingLot.pickOrderId, |
|
|
matchingLot.itemId |
|
|
|
|
|
|
|
|
matchingLot.itemId, |
|
|
|
|
|
currentUserId || 0, |
|
|
|
|
|
matchingLot.requiredQty || 1 // ✅ 传递实际的 required quantity |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
if (result.code === "SUCCESS") { |
|
|
if (result.code === "SUCCESS") { |
|
|
@@ -1261,7 +1264,7 @@ const paginatedData = useMemo(() => { |
|
|
</Box> |
|
|
</Box> |
|
|
) : ( |
|
|
) : ( |
|
|
<Typography variant="body2" color="text.secondary"> |
|
|
<Typography variant="body2" color="text.secondary"> |
|
|
{t("Pending")} |
|
|
|
|
|
|
|
|
{t(" ")} |
|
|
</Typography> |
|
|
</Typography> |
|
|
)} |
|
|
)} |
|
|
</TableCell> |
|
|
</TableCell> |
|
|
@@ -1280,9 +1283,8 @@ const paginatedData = useMemo(() => { |
|
|
handleSubmitPickQtyWithQty(lot, submitQty); |
|
|
handleSubmitPickQtyWithQty(lot, submitQty); |
|
|
}} |
|
|
}} |
|
|
disabled={ |
|
|
disabled={ |
|
|
// ✅ 修复:使用 matchStatus 而不是 secondQrScanStatus |
|
|
|
|
|
lot.matchStatus === 'pending' || // 未扫描 |
|
|
|
|
|
lot.matchStatus === 'completed' || // 已完成 |
|
|
|
|
|
|
|
|
// ✅ 修复:只有扫描过但未完成的才能提交 |
|
|
|
|
|
lot.matchStatus !== 'scanned' || // 只有 scanned 状态才能提交 |
|
|
lot.lotAvailability === 'expired' || |
|
|
lot.lotAvailability === 'expired' || |
|
|
lot.lotAvailability === 'status_unavailable' || |
|
|
lot.lotAvailability === 'status_unavailable' || |
|
|
lot.lotAvailability === 'rejected' |
|
|
lot.lotAvailability === 'rejected' |
|
|
@@ -1302,9 +1304,8 @@ const paginatedData = useMemo(() => { |
|
|
size="small" |
|
|
size="small" |
|
|
onClick={() => handlePickExecutionForm(lot)} |
|
|
onClick={() => handlePickExecutionForm(lot)} |
|
|
disabled={ |
|
|
disabled={ |
|
|
// ✅ 修复:使用 matchStatus 而不是 secondQrScanStatus |
|
|
|
|
|
lot.matchStatus === 'pending' || // 未扫描 |
|
|
|
|
|
lot.matchStatus === 'completed' || // 已完成 |
|
|
|
|
|
|
|
|
// ✅ 修复:只有扫描过但未完成的才能报告问题 |
|
|
|
|
|
lot.matchStatus !== 'scanned' || // 只有 scanned 状态才能报告问题 |
|
|
lot.lotAvailability === 'expired' || |
|
|
lot.lotAvailability === 'expired' || |
|
|
lot.lotAvailability === 'status_unavailable' || |
|
|
lot.lotAvailability === 'status_unavailable' || |
|
|
lot.lotAvailability === 'rejected' |
|
|
lot.lotAvailability === 'rejected' |
|
|
|