浏览代码

update

master
CANCERYS\kw093 2 个月前
父节点
当前提交
8c9c4c3f8d
共有 2 个文件被更改,包括 29 次插入5 次删除
  1. +27
    -4
      src/components/FinishedGoodSearch/GoodPickExecutiondetail.tsx
  2. +2
    -1
      src/i18n/zh/do.json

+ 27
- 4
src/components/FinishedGoodSearch/GoodPickExecutiondetail.tsx 查看文件

@@ -798,8 +798,22 @@ const [isConfirmingLot, setIsConfirmingLot] = useState(false);
return;
}
// 2) Check if scanned lot is exactly in expected lots
const exactLotMatch = sameItemLotsInExpected.find(l =>
// ✅ FIXED: Find the ACTIVE suggested lot (not rejected lots)
const activeSuggestedLots = sameItemLotsInExpected.filter(lot =>
lot.lotAvailability !== 'rejected' &&
lot.stockOutLineStatus !== 'rejected' &&
lot.processingStatus !== 'rejected'
);
if (activeSuggestedLots.length === 0) {
console.error("No active suggested lots found for this item");
setQrScanError(true);
setQrScanSuccess(false);
return;
}
// 2) Check if scanned lot is exactly in active suggested lots
const exactLotMatch = activeSuggestedLots.find(l =>
(scanned?.inventoryLotLineId && l.lotId === scanned.inventoryLotLineId) ||
(scanned?.lotNo && l.lotNo === scanned.lotNo)
);
@@ -812,7 +826,8 @@ const [isConfirmingLot, setIsConfirmingLot] = useState(false);
}
// Case 2: Item matches but lot number differs -> open confirmation modal
const expectedLot = sameItemLotsInExpected[0];
// ✅ FIXED: Use the first ACTIVE suggested lot, not just any lot
const expectedLot = activeSuggestedLots[0];
if (!expectedLot) {
console.error("Could not determine expected lot for confirmation");
setQrScanError(true);
@@ -827,6 +842,7 @@ const [isConfirmingLot, setIsConfirmingLot] = useState(false);
return;
}
console.log(`🔍 Lot mismatch: Expected ${expectedLot.lotNo}, Scanned ${scanned?.lotNo}`);
setSelectedLotForQr(expectedLot);
handleLotMismatch(
{
@@ -1134,7 +1150,14 @@ useEffect(() => {
setPickExecutionFormOpen(false);
setSelectedLotForExecutionForm(null);
setQrScanError(false);
setQrScanSuccess(false);
setQrScanInput('');
setIsManualScanning(false);
stopScan();
resetScan();
setProcessedQrCodes(new Set());
setLastProcessedQr('');
await fetchAllCombinedLotData();
} catch (error) {
console.error("Error submitting pick execution form:", error);


+ 2
- 1
src/i18n/zh/do.json 查看文件

@@ -43,5 +43,6 @@
"Back": "返回",
"Batch Release": "批量放單",
"Batch release completed successfully.": "已完成批量放單",
"Edit Delivery Order Detail": "編輯交貨單詳情"
"Edit Delivery Order Detail": "編輯交貨單詳情",
"DO released successfully! Pick orders created.": "交貨單放單成功!提料單已建立。"
}

正在加载...
取消
保存