浏览代码

工單提貨台批號標籤清單排除全部 4F 倉位。

Co-authored-by: Cursor <[email protected]>
fix負數倉
CANCERYS\kw093 2 天前
父节点
当前提交
a9253fb9f4
共有 2 个文件被更改,包括 23 次插入 和 7 次删除
  1. +21
    -6
      src/components/DoWorkbench/WorkbenchLotLabelPrintModal.tsx
  2. +2
    -1
      src/components/JoWorkbench/newJobPickExecution.tsx

+ 21
- 6
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<WorkbenchLotLabelPrintModalProps> = ({
open,
onClose,
@@ -159,6 +165,7 @@ const WorkbenchLotLabelPrintModal: React.FC<WorkbenchLotLabelPrintModalProps> =
statusTitleText,
statusTitleSeverity = "error",
warehouseCodePrefixFilter,
excludeWarehouseCodePrefixes,
hideTriggeredLot = false,
triggerLotAvailableQty = null,
triggerLotUom = null,
@@ -450,14 +457,22 @@ const WorkbenchLotLabelPrintModal: React.FC<WorkbenchLotLabelPrintModalProps> =
]);

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;


+ 2
- 1
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<Props> = ({ filterArgs, onBackToList, printerCombo = [] }) => {
const workbenchMode = true;
const { t } = useTranslation("jo");
@@ -4642,6 +4642,7 @@ const JobPickExecution: React.FC<Props> = ({ filterArgs, onBackToList, printerCo
workbenchLotLabelContextLot != null
}
warehouseCodePrefixFilter={lotFloorPrefixFilter}
excludeWarehouseCodePrefixes={["4F"]}
triggerLotAvailableQty={
workbenchLotLabelContextLot != null
? Number(workbenchLotLabelContextLot.availableQty)


正在加载...
取消
保存