diff --git a/src/components/Qc/QcStockInModal.tsx b/src/components/Qc/QcStockInModal.tsx index ce55928..7c2be1e 100644 --- a/src/components/Qc/QcStockInModal.tsx +++ b/src/components/Qc/QcStockInModal.tsx @@ -438,8 +438,10 @@ const QcStockInModal: React.FC = ({ // confirmButtonText: t("confirm putaway"), html: ""}); // onOpenPutaway(); const isJobOrderBom = (stockInLineInfo?.jobOrderId != null || printSource === "productionProcess") - && stockInLineInfo?.bomDescription === "WIP"; - if (isJobOrderBom) { + && stockInLineInfo?.bomDescription === "WIP"; + const isFaItem = (stockInLineInfo?.itemNo ?? "").toUpperCase().includes("FA"); + const shouldAutoPutaway = isJobOrderBom || isFaItem; + if (shouldAutoPutaway) { // Auto putaway to default warehouse const defaultWarehouseId = stockInLineInfo?.defaultWarehouseId ?? 489; diff --git a/src/components/StockRecord/SearchPage.tsx b/src/components/StockRecord/SearchPage.tsx index 096a265..fe23530 100644 --- a/src/components/StockRecord/SearchPage.tsx +++ b/src/components/StockRecord/SearchPage.tsx @@ -166,7 +166,9 @@ const SearchPage: React.FC = ({ dataList: initialDataList }) => { const params: SearchStockTransactionRequest = { itemCode: itemCode, itemName: itemName, - type: filterArgs.type?.trim() || null, + type: (filterArgs.type?.trim() && filterArgs.type?.trim() !== "All") + ? filterArgs.type.trim() + : null, // type="All" 時傳 null,不套用 type 篩選 startDate: filterArgs.startDate || null, endDate: filterArgs.endDate || null, pageNum: pagingController.pageNum - 1 || 0, @@ -379,7 +381,7 @@ const SearchPage: React.FC = ({ dataList: initialDataList }) => { setFilterArgs({ itemCode: itemCode || undefined, itemName: itemName || undefined, - type: type || undefined, + type: (type && type !== "All") ? type : undefined, // "All" 不放入 filterArgs startDate: startDate || undefined, endDate: endDate || undefined, });