| @@ -479,7 +479,7 @@ const JobPickExecution: React.FC<Props> = ({ 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<Props> = ({ 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<Props> = ({ 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(() => { | |||
| </TableCell> | |||
| <TableCell align="center"> | |||
| {lot.secondQrScanStatus?.toLowerCase() === 'scanned' || | |||
| lot.secondQrScanStatus?.toLowerCase() === 'completed' ? ( | |||
| <Box sx={{ | |||
| display: 'flex', | |||
| justifyContent: 'center', | |||
| alignItems: 'center', | |||
| width: '100%', | |||
| height: '100%' | |||
| }}> | |||
| <Checkbox | |||
| checked={lot.secondQrScanStatus?.toLowerCase() !== 'pending'} | |||
| disabled={true} | |||
| readOnly={true} | |||
| size="large" | |||
| sx={{ | |||
| color: lot.secondQrScanStatus?.toLowerCase() !== 'pending' ? 'success.main' : 'grey.400', | |||
| '&.Mui-checked': { | |||
| color: 'success.main', | |||
| }, | |||
| transform: 'scale(1.3)', | |||
| '& .MuiSvgIcon-root': { | |||
| fontSize: '1.5rem', | |||
| } | |||
| }} | |||
| /> | |||
| </Box> | |||
| ) : null} | |||
| </TableCell> | |||
| {lot.matchStatus?.toLowerCase() === 'scanned' || | |||
| lot.matchStatus?.toLowerCase() === 'completed' ? ( | |||
| <Box sx={{ | |||
| display: 'flex', | |||
| justifyContent: 'center', | |||
| alignItems: 'center', | |||
| width: '100%', | |||
| height: '100%' | |||
| }}> | |||
| <Checkbox | |||
| checked={true} // ✅ 改为 true | |||
| disabled={true} | |||
| readOnly={true} | |||
| size="large" | |||
| sx={{ | |||
| color: 'success.main', // ✅ 固定为绿色 | |||
| '&.Mui-checked': { | |||
| color: 'success.main', | |||
| }, | |||
| transform: 'scale(1.3)', | |||
| '& .MuiSvgIcon-root': { | |||
| fontSize: '1.5rem', | |||
| } | |||
| }} | |||
| /> | |||
| </Box> | |||
| ) : ( | |||
| <Typography variant="body2" color="text.secondary"> | |||
| {t("Pending")} | |||
| </Typography> | |||
| )} | |||
| </TableCell> | |||
| <TableCell align="center"> | |||
| <Box sx={{ display: 'flex', justifyContent: 'center' }}> | |||
| @@ -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', | |||