瀏覽代碼

update

master
CANCERYS\kw093 2 月之前
父節點
當前提交
e084964be0
共有 3 個檔案被更改,包括 43 行新增49 行删除
  1. +2
    -1
      src/components/Jodetail/JobPickExecutionsecondscan.tsx
  2. +1
    -1
      src/components/PickOrderSearch/CreatedItemsTable.tsx
  3. +40
    -47
      src/components/PickOrderSearch/LotTable.tsx

+ 2
- 1
src/components/Jodetail/JobPickExecutionsecondscan.tsx 查看文件

@@ -1233,7 +1233,8 @@ const paginatedData = useMemo(() => {
</TableCell>
<TableCell align="center">
{lot.secondQrScanStatus?.toLowerCase() !== 'pending' ? (
{lot.secondQrScanStatus?.toLowerCase() === 'scanned' ||
lot.secondQrScanStatus?.toLowerCase() === 'completed' ? (
<Box sx={{
display: 'flex',
justifyContent: 'center',


+ 1
- 1
src/components/PickOrderSearch/CreatedItemsTable.tsx 查看文件

@@ -166,7 +166,7 @@ const CreatedItemsTable: React.FC<CreatedItemsTableProps> = ({
inputProps={{
min: 1,
step: 1,
style: { textAlign: 'center' }
style: { textAlign: 'right' }
}}
sx={{
width: '80px',


+ 40
- 47
src/components/PickOrderSearch/LotTable.tsx 查看文件

@@ -714,10 +714,18 @@ const LotTable: React.FC<LotTableProps> = ({
{t("Scan")}
</Button>
) : (
// ✅ 当有 stockOutLineId 时,显示 TextField + Pick Form 按钮
<Stack direction="row" spacing={1} alignItems="center">
{/* ✅ 恢复 TextField 用于正常数量输入 */}
<TextField
<Stack
direction="row"
spacing={1}
alignItems="center"
justifyContent="center" // ✅ 添加水平居中
sx={{
width: '100%', // ✅ 确保占满整个单元格宽度
minHeight: '40px' // ✅ 设置最小高度确保垂直居中
}}
>
{/* ✅ 恢复 TextField 用于正常数量输入 */}
<TextField
type="number"
size="small"
value={pickQtyData[selectedRowId!]?.[lot.lotId] || ''}
@@ -725,21 +733,6 @@ const LotTable: React.FC<LotTableProps> = ({
if (selectedRowId) {
const inputValue = parseFloat(e.target.value) || 0;
const maxAllowed = Math.min(calculateRemainingAvailableQty(lot), calculateRemainingRequiredQty(lot));
{/*
// ✅ Validate input
if (inputValue > maxAllowed) {
// Set validation error for this lot
setValidationErrors(prev => ({ ...prev, [`lot_${lot.lotId}`]: `${t('Input quantity cannot exceed')} ${maxAllowed}` }));
return;
} else {
// Clear validation error if valid
setValidationErrors(prev => {
const newErrors = { ...prev };
delete newErrors[`lot_${lot.lotId}`];
return newErrors;
});
*/}
onPickQtyChange(selectedRowId, lot.lotId, inputValue);
}
@@ -751,8 +744,8 @@ const LotTable: React.FC<LotTableProps> = ({
selectedLotRowId !== `row_${index}` ||
lot.stockOutLineStatus === 'completed'
}
error={!!validationErrors[`lot_${lot.lotId}`]} // ✅ Show red border when error
helperText={validationErrors[`lot_${lot.lotId}`]} // ✅ Show red error text below
error={!!validationErrors[`lot_${lot.lotId}`]}
helperText={validationErrors[`lot_${lot.lotId}`]}
inputProps={{
min: 0,
max: calculateRemainingRequiredQty(lot),
@@ -768,32 +761,32 @@ const LotTable: React.FC<LotTableProps> = ({
}
}}
placeholder="0"
/>
{/* ✅ 添加 Pick Form 按钮用于问题情况 */}
<Button
variant="outlined"
size="small"
onClick={() => handlePickExecutionForm(lot)}
disabled={
(lot.lotAvailability === 'expired' ||
lot.lotAvailability === 'status_unavailable' ||
lot.lotAvailability === 'rejected') ||
selectedLotRowId !== `row_${index}`
}
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>
/>
{/* ✅ 添加 Pick Form 按钮用于问题情况 */}
<Button
variant="outlined"
size="small"
onClick={() => handlePickExecutionForm(lot)}
disabled={
(lot.lotAvailability === 'expired' ||
lot.lotAvailability === 'status_unavailable' ||
lot.lotAvailability === 'rejected') ||
selectedLotRowId !== `row_${index}`
}
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>
)}
</TableCell>
{/*<TableCell align="right">{lot.availableQty.toLocaleString()}</TableCell>*/}


Loading…
取消
儲存