|
|
|
@@ -1984,23 +1984,15 @@ paginatedData.map((lot, index) => { |
|
|
|
</TableCell> |
|
|
|
|
|
|
|
<TableCell align="center"> |
|
|
|
{/* Issue lot 不显示扫描状态 */} |
|
|
|
{!isIssueLot && lot.stockOutLineStatus?.toLowerCase() !== 'pending' ? ( |
|
|
|
<Box sx={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}> |
|
|
|
<Checkbox |
|
|
|
checked={true} |
|
|
|
disabled={true} |
|
|
|
readOnly={true} |
|
|
|
size="large" |
|
|
|
sx={{ |
|
|
|
color: 'success.main', |
|
|
|
'&.Mui-checked': { color: 'success.main' }, |
|
|
|
transform: 'scale(1.3)', |
|
|
|
}} |
|
|
|
/> |
|
|
|
</Box> |
|
|
|
) : isIssueLot&&lot.stockOutLineStatus?.toLowerCase() == 'partially_completed'||lot.stockOutLineStatus?.toLowerCase() == 'completed' ? ( |
|
|
|
<Box sx={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}> |
|
|
|
{(() => { |
|
|
|
const status = lot.stockOutLineStatus?.toLowerCase(); |
|
|
|
const isRejected = status === 'rejected' || lot.lotAvailability === 'rejected'; |
|
|
|
const isNoLot = !lot.lotNo; |
|
|
|
|
|
|
|
// rejected lot:显示红色勾选(已扫描但被拒绝) |
|
|
|
if (isRejected && !isNoLot) { |
|
|
|
return ( |
|
|
|
<Box sx={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}> |
|
|
|
<Checkbox |
|
|
|
checked={true} |
|
|
|
disabled={true} |
|
|
|
@@ -2013,82 +2005,135 @@ paginatedData.map((lot, index) => { |
|
|
|
}} |
|
|
|
/> |
|
|
|
</Box> |
|
|
|
) : null} |
|
|
|
</TableCell> |
|
|
|
|
|
|
|
<TableCell align="center"> |
|
|
|
<Box sx={{ display: 'flex', justifyContent: 'center' }}> |
|
|
|
{isIssueLot ? ( |
|
|
|
// Issue lot 只显示 Issue 按钮 |
|
|
|
<Button |
|
|
|
variant="outlined" |
|
|
|
size="small" |
|
|
|
onClick={() => handlelotnull(lot)} |
|
|
|
disabled={ |
|
|
|
lot.stockOutLineStatus === 'completed' |
|
|
|
} |
|
|
|
sx={{ |
|
|
|
fontSize: '0.7rem', |
|
|
|
py: 0.5, |
|
|
|
minHeight: '28px', |
|
|
|
minWidth: '60px', |
|
|
|
borderColor: 'warning.main', |
|
|
|
color: 'warning.main' |
|
|
|
}} |
|
|
|
|
|
|
|
> |
|
|
|
{t("Issue")} |
|
|
|
</Button> |
|
|
|
) : ( |
|
|
|
// Normal lot 显示两个按钮 |
|
|
|
<Stack direction="row" spacing={1} alignItems="center"> |
|
|
|
<Button |
|
|
|
variant="contained" |
|
|
|
onClick={() => { |
|
|
|
const lotKey = `${lot.pickOrderLineId}-${lot.lotId}`; |
|
|
|
const submitQty = lot.requiredQty || lot.pickOrderLineRequiredQty; |
|
|
|
handlePickQtyChange(lotKey, submitQty); |
|
|
|
handleSubmitPickQtyWithQty(lot, submitQty); |
|
|
|
}} |
|
|
|
disabled={ |
|
|
|
lot.lotAvailability === 'expired' || |
|
|
|
lot.lotAvailability === 'status_unavailable' || |
|
|
|
lot.lotAvailability === 'rejected' || |
|
|
|
lot.stockOutLineStatus === 'completed' || |
|
|
|
lot.stockOutLineStatus === 'pending' |
|
|
|
} |
|
|
|
sx={{ fontSize: '0.75rem', py: 0.5, minHeight: '28px', minWidth: '70px' }} |
|
|
|
> |
|
|
|
{t("Submit")} |
|
|
|
</Button> |
|
|
|
|
|
|
|
<Button |
|
|
|
variant="outlined" |
|
|
|
size="small" |
|
|
|
onClick={() => handlePickExecutionForm(lot)} |
|
|
|
disabled={ |
|
|
|
lot.lotAvailability === 'expired' || |
|
|
|
lot.lotAvailability === 'status_unavailable' || |
|
|
|
lot.lotAvailability === 'rejected' || |
|
|
|
lot.stockOutLineStatus === 'completed' || |
|
|
|
lot.stockOutLineStatus === 'pending' |
|
|
|
} |
|
|
|
sx={{ |
|
|
|
fontSize: '0.7rem', |
|
|
|
py: 0.5, |
|
|
|
minHeight: '28px', |
|
|
|
minWidth: '60px', |
|
|
|
borderColor: 'warning.main', |
|
|
|
color: 'warning.main' |
|
|
|
}} |
|
|
|
title="Report missing or bad items" |
|
|
|
> |
|
|
|
{t("Issue")} |
|
|
|
</Button> |
|
|
|
</Stack> |
|
|
|
)} |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
// 正常 lot:已扫描(checked/partially_completed/completed) |
|
|
|
if (!isNoLot && status !== 'pending' && status !== 'rejected') { |
|
|
|
return ( |
|
|
|
<Box sx={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}> |
|
|
|
<Checkbox |
|
|
|
checked={true} |
|
|
|
disabled={true} |
|
|
|
readOnly={true} |
|
|
|
size="large" |
|
|
|
sx={{ |
|
|
|
color: 'success.main', |
|
|
|
'&.Mui-checked': { color: 'success.main' }, |
|
|
|
transform: 'scale(1.3)', |
|
|
|
}} |
|
|
|
/> |
|
|
|
</Box> |
|
|
|
</TableCell> |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
// noLot 且已完成/部分完成:显示红色勾选 |
|
|
|
if (isNoLot && (status === 'partially_completed' || status === 'completed')) { |
|
|
|
return ( |
|
|
|
<Box sx={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}> |
|
|
|
<Checkbox |
|
|
|
checked={true} |
|
|
|
disabled={true} |
|
|
|
readOnly={true} |
|
|
|
size="large" |
|
|
|
sx={{ |
|
|
|
color: 'error.main', |
|
|
|
'&.Mui-checked': { color: 'error.main' }, |
|
|
|
transform: 'scale(1.3)', |
|
|
|
}} |
|
|
|
/> |
|
|
|
</Box> |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
return null; |
|
|
|
})()} |
|
|
|
</TableCell> |
|
|
|
<TableCell align="center"> |
|
|
|
<Box sx={{ display: 'flex', justifyContent: 'center' }}> |
|
|
|
{(() => { |
|
|
|
const status = lot.stockOutLineStatus?.toLowerCase(); |
|
|
|
const isRejected = status === 'rejected' || lot.lotAvailability === 'rejected'; |
|
|
|
const isNoLot = !lot.lotNo; |
|
|
|
|
|
|
|
// rejected lot:不显示任何按钮 |
|
|
|
if (isRejected && !isNoLot) { |
|
|
|
return null; |
|
|
|
} |
|
|
|
|
|
|
|
// noLot 情况:只显示 Issue 按钮 |
|
|
|
if (isNoLot) { |
|
|
|
return ( |
|
|
|
<Button |
|
|
|
variant="outlined" |
|
|
|
size="small" |
|
|
|
onClick={() => handlelotnull(lot)} |
|
|
|
disabled={status === 'completed'} |
|
|
|
sx={{ |
|
|
|
fontSize: '0.7rem', |
|
|
|
py: 0.5, |
|
|
|
minHeight: '28px', |
|
|
|
minWidth: '60px', |
|
|
|
borderColor: 'warning.main', |
|
|
|
color: 'warning.main' |
|
|
|
}} |
|
|
|
> |
|
|
|
{t("Issue")} |
|
|
|
</Button> |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
// 正常 lot:显示 Submit 和 Issue 按钮 |
|
|
|
return ( |
|
|
|
<Stack direction="row" spacing={1} alignItems="center"> |
|
|
|
<Button |
|
|
|
variant="contained" |
|
|
|
onClick={() => { |
|
|
|
const lotKey = `${lot.pickOrderLineId}-${lot.lotId}`; |
|
|
|
const submitQty = lot.requiredQty || lot.pickOrderLineRequiredQty; |
|
|
|
handlePickQtyChange(lotKey, submitQty); |
|
|
|
handleSubmitPickQtyWithQty(lot, submitQty); |
|
|
|
}} |
|
|
|
disabled={ |
|
|
|
lot.lotAvailability === 'expired' || |
|
|
|
lot.lotAvailability === 'status_unavailable' || |
|
|
|
lot.lotAvailability === 'rejected' || |
|
|
|
lot.stockOutLineStatus === 'completed' || |
|
|
|
lot.stockOutLineStatus === 'pending' |
|
|
|
} |
|
|
|
sx={{ fontSize: '0.75rem', py: 0.5, minHeight: '28px', minWidth: '70px' }} |
|
|
|
> |
|
|
|
{t("Submit")} |
|
|
|
</Button> |
|
|
|
|
|
|
|
<Button |
|
|
|
variant="outlined" |
|
|
|
size="small" |
|
|
|
onClick={() => handlePickExecutionForm(lot)} |
|
|
|
disabled={ |
|
|
|
lot.lotAvailability === 'expired' || |
|
|
|
lot.lotAvailability === 'status_unavailable' || |
|
|
|
lot.lotAvailability === 'rejected' || |
|
|
|
lot.stockOutLineStatus === 'completed' || |
|
|
|
lot.stockOutLineStatus === 'pending' |
|
|
|
} |
|
|
|
sx={{ |
|
|
|
fontSize: '0.7rem', |
|
|
|
py: 0.5, |
|
|
|
minHeight: '28px', |
|
|
|
minWidth: '60px', |
|
|
|
borderColor: 'warning.main', |
|
|
|
color: 'warning.main' |
|
|
|
}} |
|
|
|
title="Report missing or bad items" |
|
|
|
> |
|
|
|
{t("Issue")} |
|
|
|
</Button> |
|
|
|
</Stack> |
|
|
|
); |
|
|
|
})()} |
|
|
|
</Box> |
|
|
|
</TableCell> |
|
|
|
</TableRow> |
|
|
|
); |
|
|
|
}) |
|
|
|
|