diff --git a/src/components/JoSearch/JoSearch.tsx b/src/components/JoSearch/JoSearch.tsx index c9931c7..6655a92 100644 --- a/src/components/JoSearch/JoSearch.tsx +++ b/src/components/JoSearch/JoSearch.tsx @@ -23,7 +23,7 @@ import { SessionWithTokens } from "@/config/authConfig"; import { createStockInLine } from "@/app/api/stockIn/actions"; import { msg } from "../Swal/CustomAlerts"; import dayjs from "dayjs"; -import { fetchInventories } from "@/app/api/inventory/actions"; +//import { fetchInventories } from "@/app/api/inventory/actions"; import { InventoryResult } from "@/app/api/inventory"; import { PrinterCombo } from "@/app/api/settings/printer"; import { JobTypeResponse } from "@/app/api/jo/actions"; @@ -76,16 +76,21 @@ const JoSearch: React.FC = ({ defaultInputs, bomCombo, printerCombo, jobT useEffect(() => { const fetchDetailedJos = async () => { const detailedMap = new Map(); - - for (const jo of filteredJos) { - try { - const detailedJo = await fetchJoDetailClient(jo.id); - detailedMap.set(jo.id, detailedJo); - } catch (error) { - console.error(`Error fetching detail for JO ${jo.id}:`, error); - } + try { + const results = await Promise.all( + filteredJos.map((jo) => + fetchJoDetailClient(jo.id).then((detail) => ({ id: jo.id, detail })).catch((error) => { + console.error(`Error fetching detail for JO ${jo.id}:`, error); + return null; + }) + ) + ); + results.forEach((r) => { + if (r) detailedMap.set(r.id, r.detail); + }); + } catch (error) { + console.error("Error fetching JO details:", error); } - setDetailedJos(detailedMap); }; @@ -93,7 +98,7 @@ const JoSearch: React.FC = ({ defaultInputs, bomCombo, printerCombo, jobT fetchDetailedJos(); } }, [filteredJos]); - +/* useEffect(() => { const fetchInventoryData = async () => { try { @@ -102,9 +107,9 @@ const JoSearch: React.FC = ({ defaultInputs, bomCombo, printerCombo, jobT name: "", type: "", pageNum: 0, - pageSize: 1000 + pageSize: 200, }); - setInventoryData(inventoryResponse.records); + setInventoryData(inventoryResponse.records ?? []); } catch (error) { console.error("Error fetching inventory data:", error); } @@ -112,6 +117,7 @@ const JoSearch: React.FC = ({ defaultInputs, bomCombo, printerCombo, jobT fetchInventoryData(); }, []); + */ const getStockAvailable = (pickLine: JoDetailPickLine) => { const inventory = inventoryData.find(inventory => diff --git a/src/components/Jodetail/FinishedGoodSearchWrapper.tsx b/src/components/Jodetail/FinishedGoodSearchWrapper.tsx index dd7c64d..48e2956 100644 --- a/src/components/Jodetail/FinishedGoodSearchWrapper.tsx +++ b/src/components/Jodetail/FinishedGoodSearchWrapper.tsx @@ -16,6 +16,8 @@ const JodetailSearchWrapper: React.FC & SubComponents = async () => { type: undefined, status: undefined, itemName: undefined, + pageNum: 0, + pageSize: 50, }), fetchPrinterCombo(), ]); diff --git a/src/components/Jodetail/JodetailSearch.tsx b/src/components/Jodetail/JodetailSearch.tsx index 7012e25..9698dbf 100644 --- a/src/components/Jodetail/JodetailSearch.tsx +++ b/src/components/Jodetail/JodetailSearch.tsx @@ -218,8 +218,10 @@ const JodetailSearch: React.FC = ({ pickOrders, printerCombo }) => { // 在组件加载时获取未分配订单 useEffect(() => { - loadUnassignedOrders(); - }, [loadUnassignedOrders]); + if (tabIndex === 0) { + loadUnassignedOrders(); + } + }, [tabIndex, loadUnassignedOrders]); const handleTabChange = useCallback>( (_e, newValue) => { diff --git a/src/components/PoDetail/PoInputGrid.tsx b/src/components/PoDetail/PoInputGrid.tsx index 115a86b..b9cb8d9 100644 --- a/src/components/PoDetail/PoInputGrid.tsx +++ b/src/components/PoDetail/PoInputGrid.tsx @@ -525,7 +525,7 @@ const closeNewModal = useCallback(() => { width: 150, // flex: 0.5, renderCell: (params) => { - return params.row.uom?.udfudesc; + return itemDetail.uom?.udfudesc; }, }, { diff --git a/src/components/ProductionProcess/ProductionProcessList.tsx b/src/components/ProductionProcess/ProductionProcessList.tsx index 956bdbd..dcdde39 100644 --- a/src/components/ProductionProcess/ProductionProcessList.tsx +++ b/src/components/ProductionProcess/ProductionProcessList.tsx @@ -220,7 +220,7 @@ const ProductProcessList: React.FC = ({ onSelectProcess display: "flex", flexDirection: "column", border: "1px solid", - borderColor: "success.main", + borderColor: "blue", }} > = ({ onSelectProcess - - {t("Item Name")}: {process.itemCode} {process.itemName} + + {/* {t("Item Name")}: */} + {process.itemCode} {process.itemName} {t("Production Priority")}: {process.productionPriority} diff --git a/src/components/PutAwayScan/PutAwayModal.tsx b/src/components/PutAwayScan/PutAwayModal.tsx index d14df1b..4119ed9 100644 --- a/src/components/PutAwayScan/PutAwayModal.tsx +++ b/src/components/PutAwayScan/PutAwayModal.tsx @@ -57,17 +57,16 @@ const style = { left: "50%", transform: "translate(-50%, -50%)", bgcolor: "background.paper", - pt: { xs: 0.5, sm: 1, md: 1.5 }, - px: { xs: 1, sm: 1.5, md: 2 }, - pb: { xs: 0.5, sm: 1, md: 1.5 }, - width: { xs: "95%", sm: "85%", md: "75%", lg: "70%" }, - maxWidth: "900px", - maxHeight: { xs: "98vh", sm: "95vh", md: "90vh" }, + pt: { xs: 0.5, sm: 0.75, md: 1 }, + px: { xs: 1, sm: 1, md: 1.5 }, + pb: { xs: 0.5, sm: 0.75, md: 1 }, + width: { xs: "95%", sm: "72%", md: "60%", lg: "70%" }, + maxWidth: "720px", + maxHeight: { xs: "98vh", sm: "92vh", md: "88vh" }, overflow: "hidden", display: "flex", flexDirection: "column", }; - const scannerStyle = { position: "absolute", top: "50%", @@ -442,9 +441,9 @@ const PutAwayModal: React.FC = ({ open, onClose, warehouse, stockInLineId {itemDetail != undefined ? ( <> - - 處理上架 - + + 處理上架 + {itemDetail.jobOrderId ? ( diff --git a/src/i18n/zh/common.json b/src/i18n/zh/common.json index c09a6cb..62c2ed7 100644 --- a/src/i18n/zh/common.json +++ b/src/i18n/zh/common.json @@ -277,7 +277,7 @@ "Equipment Code": "設備編號", "Seq": "步驟", "SEQ": "步驟", - "Item Name": "物料名稱", + "Item Name": "產品名稱", "Job Order Info": "工單信息", "Matching Stock": "工單對料", "No data found": "沒有找到資料", diff --git a/src/i18n/zh/inventory.json b/src/i18n/zh/inventory.json index a8eafd1..8d0e127 100644 --- a/src/i18n/zh/inventory.json +++ b/src/i18n/zh/inventory.json @@ -21,7 +21,7 @@ "Item-lotNo-ExpiryDate": "貨品-批號-到期日", "not available": "不可用", "Book Qty": "帳面庫存", - "Submit Quantity": "提交數量", + "Submit Quantity": "實際問題數量", "Batch Submit All": "批量提交所有", "Batch Save All": "批量保存所有", "Batch Submit All": "批量提交所有", diff --git a/src/i18n/zh/jo.json b/src/i18n/zh/jo.json index ae2bb11..0839f0e 100644 --- a/src/i18n/zh/jo.json +++ b/src/i18n/zh/jo.json @@ -146,7 +146,7 @@ "Start QR Scan": "開始QR掃碼", "Stop QR Scan": "停止QR掃碼", "Rows per page": "每頁行數", - "Job Order Item Name": "工單物料名稱", + "Job Order Item Name": "工單產品名稱", "Job Order Code": "工單編號", "View Details": "查看詳情", "Skip": "跳過", @@ -327,7 +327,7 @@ "acceptedQty": "接受數量", "bind": "綁定", "expiryDate": "有效期", - "itemName": "物料名稱", + "itemName": "產品名稱", "itemNo": "成品編號", "not default warehosue": "不是默認倉庫", "printQty": "打印數量", diff --git a/src/i18n/zh/qcItemAll.json b/src/i18n/zh/qcItemAll.json index 370113b..1599e01 100644 --- a/src/i18n/zh/qcItemAll.json +++ b/src/i18n/zh/qcItemAll.json @@ -42,7 +42,7 @@ "Select Qc Item": "選擇品檢項目", "Select Type": "選擇類型", "Item Code": "物料編號", - "Item Name": "物料名稱", + "Item Name": "產品名稱", "Qc Category Code": "品檢模板編號", "Qc Category Name": "品檢模板名稱", "Qc Item Code": "品檢項目編號",