From a1e25d83bc68ce5108b68df3817a8399eeb42941 Mon Sep 17 00:00:00 2001 From: "CANCERYS\\kw093" Date: Wed, 3 Jun 2026 17:15:55 +0800 Subject: [PATCH] bug fix --- src/components/DoSearch/DoSearch.tsx | 2 +- .../WorkbenchGoodPickExecutionDetail.tsx | 34 ++++++++++++++----- .../ImportBom/ImportBomResultForm.tsx | 2 +- .../StockIssue/StockIssueRecordTab.tsx | 11 +++++- src/i18n/zh/do.json | 7 ++++ 5 files changed, 45 insertions(+), 11 deletions(-) diff --git a/src/components/DoSearch/DoSearch.tsx b/src/components/DoSearch/DoSearch.tsx index 945128a..31beb22 100644 --- a/src/components/DoSearch/DoSearch.tsx +++ b/src/components/DoSearch/DoSearch.tsx @@ -584,7 +584,7 @@ const DoSearch: React.FC = ({ filterArgs, searchQuery, onDeliveryOrderSea ${currentSearchParams.code ? `${t("Code")}: ${currentSearchParams.code} ` : ""} ${currentSearchParams.shopName ? `${t("Shop Name")}: ${currentSearchParams.shopName} ` : ""} ${currentSearchParams.estimatedArrivalDate ? `${t("Estimated Arrival")}: ${currentSearchParams.estimatedArrivalDate} ` : ""} - ${status ? `${t("Status")}: ${status} ` : ""} + ${status ? `${t("Status")}: ${t(status)} ` : ""}

`, diff --git a/src/components/DoWorkbench/WorkbenchGoodPickExecutionDetail.tsx b/src/components/DoWorkbench/WorkbenchGoodPickExecutionDetail.tsx index 5ceec58..48dac12 100644 --- a/src/components/DoWorkbench/WorkbenchGoodPickExecutionDetail.tsx +++ b/src/components/DoWorkbench/WorkbenchGoodPickExecutionDetail.tsx @@ -150,6 +150,20 @@ function hasPendingActiveRowForStockInLine( ); } +/** Any pending active SOL for this item (e.g. scan different location, same lot no → auto-switch). */ +function hasPendingActiveRowForItem( + indexes: { activeLotsByItemId: Map }, + itemId: number, + processedByItemId: ProcessedStockOutLinesByItemId, +): boolean { + const activeLots = indexes.activeLotsByItemId.get(itemId) ?? []; + return activeLots.some( + (lot) => + isLotRowPending(lot) && + !isStockOutLineAlreadyProcessed(processedByItemId, itemId, lot.stockOutLineId), + ); +} + function findExactActiveMatchForStockInLine( stockInLineLots: any[], scannedItemId: number, @@ -1560,14 +1574,18 @@ const fetchAllCombinedLotData = useCallback(async (userId?: number, pickOrderIdO const scannedItemId = qrData.itemId; const scannedStockInLineId = qrData.stockInLineId; - if ( - !hasPendingActiveRowForStockInLine( - indexes, - scannedItemId, - scannedStockInLineId, - processedQrCombinations, - ) - ) { + const hasPendingOnScannedSil = hasPendingActiveRowForStockInLine( + indexes, + scannedItemId, + scannedStockInLineId, + processedQrCombinations, + ); + const hasPendingOnItem = hasPendingActiveRowForItem( + indexes, + scannedItemId, + processedQrCombinations, + ); + if (!hasPendingOnScannedSil && !hasPendingOnItem) { console.log( ` [SKIP] No pending stock-out line left for itemId=${scannedItemId}, stockInLineId=${scannedStockInLineId}`, ); diff --git a/src/components/ImportBom/ImportBomResultForm.tsx b/src/components/ImportBom/ImportBomResultForm.tsx index 12a94c0..d2e563b 100644 --- a/src/components/ImportBom/ImportBomResultForm.tsx +++ b/src/components/ImportBom/ImportBomResultForm.tsx @@ -271,7 +271,7 @@ type Props = { {items.length > 0 && ( 將匯入 {items.length} 個 BOM - {wipCount > 0 ? `,其中 ${wipCount} 個同時建立 WIP` : ""} + {wipCount > 0 ? `,其中 ${wipCount} 個同時建立 半成品` : ""} {drinkCount > 0 ? `,${drinkCount} 個飲料` : ""} {powderMixtureCount > 0 ? `,${powderMixtureCount} 個箱料粉` : ""} diff --git a/src/components/StockIssue/StockIssueRecordTab.tsx b/src/components/StockIssue/StockIssueRecordTab.tsx index 3942f65..31332a9 100644 --- a/src/components/StockIssue/StockIssueRecordTab.tsx +++ b/src/components/StockIssue/StockIssueRecordTab.tsx @@ -160,7 +160,16 @@ const StockIssueRecordTab: React.FC = ({ kind }) => { label: kind === "expiry" ? t("Expiry Item Qty") : t("Bad Item Qty"), renderCell: (row) => ( <> - {Number(row.qty).toFixed(2)} {row.uomDesc ?? ""} + {Number(row.qty).toFixed(2)} + + ), + }, + { + name: "uomDesc", + label: t("UOM"), + renderCell: (row) => ( + <> + {row.uomDesc ?? ""} ), }, diff --git a/src/i18n/zh/do.json b/src/i18n/zh/do.json index 9afffb0..5ab7452 100644 --- a/src/i18n/zh/do.json +++ b/src/i18n/zh/do.json @@ -10,6 +10,10 @@ "Estimated Arrival To": "預計送貨日期至", "Status": "來貨狀態", "Etra": "加單", + "Loading": "正在加載...", + "No delivery orders selected for batch release. Uncheck orders you want to exclude, or search again to reset selection.": "沒有選擇送貨訂單進行批量放單。取消勾選您想排除的訂單,或重新搜索以重置選擇。", + "No Records": "沒有找到記錄", + "OK": "確認", "Truck X": "車線-X", "DO Workbench": "新版成品出倉", "Order Date From": "訂單日期", @@ -48,8 +52,11 @@ "Supplier Name": "供應商名稱", "Details": "詳情", "Pending": "待處理", + "pending": "待處理", "Receiving": "接收中", + "receiving": "接收中", "Completed": "已完成", + "completed": "已完成", "Please wait": "請稍候", "Selected Shop(s): ": "已選擇店舖數量: ", "Selected Item(s): ": "總貨品數量: ",