浏览代码

update

master
CANCERYS\kw093 2 个月前
父节点
当前提交
dfbc057a24
共有 1 个文件被更改,包括 47 次插入41 次删除
  1. +47
    -41
      src/components/Jodetail/JobPickExecutionsecondscan.tsx

+ 47
- 41
src/components/Jodetail/JobPickExecutionsecondscan.tsx 查看文件

@@ -479,7 +479,7 @@ const JobPickExecution: React.FC<Props> = ({ filterArgs }) => {
// Router info // Router info
routerIndex: lot.routerIndex, routerIndex: lot.routerIndex,
secondQrScanStatus: lot.secondQrScanStatus,
matchStatus: lot.matchStatus,
routerArea: lot.routerArea, routerArea: lot.routerArea,
routerRoute: lot.routerRoute, routerRoute: lot.routerRoute,
uomShortDesc: lot.uomShortDesc uomShortDesc: lot.uomShortDesc
@@ -536,7 +536,7 @@ const JobPickExecution: React.FC<Props> = ({ filterArgs }) => {
}, [currentUserId]); }, [currentUserId]);
const handleSubmitAllScanned = useCallback(async () => { const handleSubmitAllScanned = useCallback(async () => {
const scannedLots = combinedLotData.filter(lot => 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) { if (scannedLots.length === 0) {
@@ -592,7 +592,7 @@ const JobPickExecution: React.FC<Props> = ({ filterArgs }) => {


// ✅ Calculate scanned items count // ✅ Calculate scanned items count
const scannedItemsCount = useMemo(() => { const scannedItemsCount = useMemo(() => {
return combinedLotData.filter(lot => lot.secondQrScanStatus === 'scanned').length;
return combinedLotData.filter(lot => lot.matchStatus === 'scanned').length;
}, [combinedLotData]); }, [combinedLotData]);


// ✅ 修改:初始化时加载数据 // ✅ 修改:初始化时加载数据
@@ -1233,34 +1233,38 @@ const paginatedData = useMemo(() => {
</TableCell> </TableCell>
<TableCell align="center"> <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"> <TableCell align="center">
<Box sx={{ display: 'flex', justifyContent: 'center' }}> <Box sx={{ display: 'flex', justifyContent: 'center' }}>
@@ -1276,11 +1280,12 @@ const paginatedData = useMemo(() => {
handleSubmitPickQtyWithQty(lot, submitQty); handleSubmitPickQtyWithQty(lot, submitQty);
}} }}
disabled={ 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={{ sx={{
fontSize: '0.75rem', fontSize: '0.75rem',
@@ -1297,11 +1302,12 @@ const paginatedData = useMemo(() => {
size="small" size="small"
onClick={() => handlePickExecutionForm(lot)} onClick={() => handlePickExecutionForm(lot)}
disabled={ 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={{ sx={{
fontSize: '0.7rem', fontSize: '0.7rem',


正在加载...
取消
保存