diff --git a/src/components/Jodetail/JobPickExecutionsecondscan.tsx b/src/components/Jodetail/JobPickExecutionsecondscan.tsx index 622de57..2c46ad8 100644 --- a/src/components/Jodetail/JobPickExecutionsecondscan.tsx +++ b/src/components/Jodetail/JobPickExecutionsecondscan.tsx @@ -479,7 +479,7 @@ const JobPickExecution: React.FC = ({ filterArgs }) => { // Router info routerIndex: lot.routerIndex, - secondQrScanStatus: lot.secondQrScanStatus, + matchStatus: lot.matchStatus, routerArea: lot.routerArea, routerRoute: lot.routerRoute, uomShortDesc: lot.uomShortDesc @@ -536,7 +536,7 @@ const JobPickExecution: React.FC = ({ filterArgs }) => { }, [currentUserId]); const handleSubmitAllScanned = useCallback(async () => { const scannedLots = combinedLotData.filter(lot => - lot.secondQrScanStatus === 'scanned' // Only submit items that are scanned but not yet submitted + lot.matchStatus === 'scanned' // Only submit items that are scanned but not yet submitted ); if (scannedLots.length === 0) { @@ -592,7 +592,7 @@ const JobPickExecution: React.FC = ({ filterArgs }) => { // ✅ Calculate scanned items count const scannedItemsCount = useMemo(() => { - return combinedLotData.filter(lot => lot.secondQrScanStatus === 'scanned').length; + return combinedLotData.filter(lot => lot.matchStatus === 'scanned').length; }, [combinedLotData]); // ✅ 修改:初始化时加载数据 @@ -1233,34 +1233,38 @@ const paginatedData = useMemo(() => { - {lot.secondQrScanStatus?.toLowerCase() === 'scanned' || - lot.secondQrScanStatus?.toLowerCase() === 'completed' ? ( - - - - ) : null} - + {lot.matchStatus?.toLowerCase() === 'scanned' || + lot.matchStatus?.toLowerCase() === 'completed' ? ( + + + + ) : ( + + {t("Pending")} + + )} + @@ -1276,11 +1280,12 @@ const paginatedData = useMemo(() => { handleSubmitPickQtyWithQty(lot, submitQty); }} disabled={ - (lot.secondQrScanStatus === 'expired' || - lot.secondQrScanStatus === 'status_unavailable' || - lot.secondQrScanStatus === 'rejected') || - lot.secondQrScanStatus === 'completed' || - lot.secondQrScanStatus === 'pending' // ✅ Disable when QR scan not passed + // ✅ 修复:使用 matchStatus 而不是 secondQrScanStatus + lot.matchStatus === 'pending' || // 未扫描 + lot.matchStatus === 'completed' || // 已完成 + lot.lotAvailability === 'expired' || + lot.lotAvailability === 'status_unavailable' || + lot.lotAvailability === 'rejected' } sx={{ fontSize: '0.75rem', @@ -1297,11 +1302,12 @@ const paginatedData = useMemo(() => { size="small" onClick={() => handlePickExecutionForm(lot)} disabled={ - (lot.lotAvailability === 'expired' || - lot.lotAvailability === 'status_unavailable' || - lot.lotAvailability === 'rejected') || - lot.secondQrScanStatus === 'completed' || // ✅ Disable when finished - lot.secondQrScanStatus === 'pending' // ✅ Disable when QR scan not passed + // ✅ 修复:使用 matchStatus 而不是 secondQrScanStatus + lot.matchStatus === 'pending' || // 未扫描 + lot.matchStatus === 'completed' || // 已完成 + lot.lotAvailability === 'expired' || + lot.lotAvailability === 'status_unavailable' || + lot.lotAvailability === 'rejected' } sx={{ fontSize: '0.7rem',