diff --git a/src/components/DoWorkbench/WorkbenchLotLabelPrintModal.tsx b/src/components/DoWorkbench/WorkbenchLotLabelPrintModal.tsx index 1d477005..7ed3bbc8 100644 --- a/src/components/DoWorkbench/WorkbenchLotLabelPrintModal.tsx +++ b/src/components/DoWorkbench/WorkbenchLotLabelPrintModal.tsx @@ -91,6 +91,12 @@ export interface WorkbenchLotLabelPrintModalProps { /** 與 statusTitleText 搭配;預設 error(舊版固定紅字) */ statusTitleSeverity?: "success" | "warning" | "error"; warehouseCodePrefixFilter?: string; + /** + * Hide lots whose warehouse code equals an entry or starts with `{entry}-`. + * JO passes `4F` so the pick-station list matches the suggestion block list. + * The row that opened the dialog stays visible. + */ + excludeWarehouseCodePrefixes?: string[]; /** * When true, omit the API 「scanned」 lot from the merged list (legacy FG-style). * Workbench should leave false so the current row’s lot appears for label print / scan-pick. @@ -147,7 +153,7 @@ function isLabelPrinter(p: Printer): boolean { return s.includes("label") && !s.includes("a4"); } -/** FP-MTMS Version Checklist | Functions Ref. No. 30 | v1.0.1 | 2026-07-22 */ +/** FP-MTMS Version Checklist | Functions Ref. No. 30 | v1.0.2 | 2026-11-02 */ const WorkbenchLotLabelPrintModal: React.FC = ({ open, onClose, @@ -159,6 +165,7 @@ const WorkbenchLotLabelPrintModal: React.FC = statusTitleText, statusTitleSeverity = "error", warehouseCodePrefixFilter, + excludeWarehouseCodePrefixes, hideTriggeredLot = false, triggerLotAvailableQty = null, triggerLotUom = null, @@ -450,14 +457,22 @@ const WorkbenchLotLabelPrintModal: React.FC = ]); const filteredLots = useMemo(() => { - const prefix = String(warehouseCodePrefixFilter ?? "").trim(); - if (!prefix) return availableLots; + const prefix = String(warehouseCodePrefixFilter ?? "").trim().toUpperCase(); + const blocked = (excludeWarehouseCodePrefixes ?? []) + .map((entry) => entry.trim().toUpperCase()) + .filter((entry) => entry.length > 0); return availableLots.filter((lot) => { - // 使用者從本列開啟視窗:即使 API 未帶 warehouseCode,仍應顯示目前這筆批號 + // 使用者從本列開啟視窗:即使倉位在排除清單,仍顯示目前這筆批號 if (lot._scanned) return true; - return String(lot.warehouseCode ?? "").startsWith(prefix); + const code = String(lot.warehouseCode ?? "").trim().toUpperCase(); + const blockedHit = blocked.some( + (entry) => code === entry || code.startsWith(`${entry}-`), + ); + if (blockedHit) return false; + if (!prefix) return true; + return code.startsWith(prefix); }); - }, [availableLots, warehouseCodePrefixFilter]); + }, [availableLots, warehouseCodePrefixFilter, excludeWarehouseCodePrefixes]); const selectedPrinter = useMemo(() => { if (selectedPrinterId === "") return null; diff --git a/src/components/JoWorkbench/newJobPickExecution.tsx b/src/components/JoWorkbench/newJobPickExecution.tsx index e62f9d5a..dc51879e 100644 --- a/src/components/JoWorkbench/newJobPickExecution.tsx +++ b/src/components/JoWorkbench/newJobPickExecution.tsx @@ -618,7 +618,7 @@ const QrCodeModal: React.FC<{ ); }; -/** FP-MTMS Version Checklist | Functions Ref. No. 43 | v1.0.1 | 2026-08-10 */ +/** FP-MTMS Version Checklist | Functions Ref. No. 43 | v1.0.2 | 2026-11-02 */ const JobPickExecution: React.FC = ({ filterArgs, onBackToList, printerCombo = [] }) => { const workbenchMode = true; const { t } = useTranslation("jo"); @@ -4642,6 +4642,7 @@ const JobPickExecution: React.FC = ({ filterArgs, onBackToList, printerCo workbenchLotLabelContextLot != null } warehouseCodePrefixFilter={lotFloorPrefixFilter} + excludeWarehouseCodePrefixes={["4F"]} triggerLotAvailableQty={ workbenchLotLabelContextLot != null ? Number(workbenchLotLabelContextLot.availableQty)