diff --git a/src/components/JoSave/InfoCard.tsx b/src/components/JoSave/InfoCard.tsx index 2e71216..6f6ad06 100644 --- a/src/components/JoSave/InfoCard.tsx +++ b/src/components/JoSave/InfoCard.tsx @@ -12,7 +12,7 @@ type Props = { const InfoCard: React.FC = ({ }) => { - const { t } = useTranslation(); + const { t } = useTranslation("jo"); const { control, getValues, register, watch } = useFormContext(); diff --git a/src/components/JoSave/PickTable.tsx b/src/components/JoSave/PickTable.tsx index e508181..7946492 100644 --- a/src/components/JoSave/PickTable.tsx +++ b/src/components/JoSave/PickTable.tsx @@ -55,13 +55,12 @@ const PickTable: React.FC = ({ align: "left", headerAlign: "left", }, - { field: "status", headerName: t("Status"), flex: 1, renderCell: (row) => { - return upperFirst(row.value) + return t(upperFirst(row.value)) }, }, ], []) diff --git a/src/components/PoSearch/PoSearch.tsx b/src/components/PoSearch/PoSearch.tsx index 0db878d..7a6d30e 100644 --- a/src/components/PoSearch/PoSearch.tsx +++ b/src/components/PoSearch/PoSearch.tsx @@ -44,7 +44,15 @@ const PoSearch: React.FC = ({ const [totalCount, setTotalCount] = useState(initTotalCount); const searchCriteria: Criterion[] = useMemo(() => { const searchCriteria: Criterion[] = [ - { label: t("Code"), paramName: "code", type: "text" }, + { label: t("Po No."), paramName: "code", type: "text" }, + { label: t("Order Date"), label2: t("Order Date To"), paramName: "orderDate", type: "dateRange" }, + { + label: t("Escalated"), + paramName: "escalated", + type: "select", + options: [t("Escalated"), t("NotEscalated")], + }, + { label: t("ETA"), label2: t("ETA To"), paramName: "estimatedArrivalDate", type: "dateRange" }, { label: t("Status"), paramName: "status", @@ -55,12 +63,6 @@ const PoSearch: React.FC = ({ { label: t(`completed`), value: `completed` }, ], }, - { - label: t("Escalated"), - paramName: "escalated", - type: "select", - options: [t("Escalated"), t("NotEscalated")], - }, ]; return searchCriteria; }, [t, po]); @@ -84,22 +86,33 @@ const PoSearch: React.FC = ({ }, { name: "code", - label: t("Code"), + label: `${t("Po No.")} &\n${t("Supplier")}`, + renderCell: (params) => { + return <>{params.code}
{params.supplier} + }, }, { name: "orderDate", - label: t("OrderDate"), + label: `${t("Order Date")} &\n${t("ETA")}`, renderCell: (params) => { - return ( - dayjs(params.orderDate) - .add(-1, "month") - .format(OUTPUT_DATE_FORMAT) - ); + // return ( + // dayjs(params.estimatedArrivalDate) + // .add(-1, "month") + // .format(OUTPUT_DATE_FORMAT) + // ); + return <>{arrayToDateString(params.orderDate)}
{arrayToDateString(params.estimatedArrivalDate)} }, }, { - name: "supplier", - label: t("Supplier"), + name: "itemDetail", + label: t("Item Detail"), + renderCell: (params) => { + if (!params.itemDetail) { + return "N/A" + } + const items = params.itemDetail.split(",") + return items.map((item) =>

{item}

) + }, }, { name: "status", @@ -165,7 +178,7 @@ const PoSearch: React.FC = ({ - {t("Purchase Order")} + {t("Purchase Receipt")} @@ -189,6 +202,10 @@ const PoSearch: React.FC = ({ query.escalated === "All" ? undefined : query.escalated === t("Escalated"), + estimatedArrivalDate: query.estimatedArrivalDate === "Invalid Date" ? "" : query.estimatedArrivalDate, + estimatedArrivalDateTo: query.estimatedArrivalDateTo === "Invalid Date" ? "" : query.estimatedArrivalDateTo, + orderDate: query.orderDate === "Invalid Date" ? "" : query.orderDate, + orderDateTo: query.orderDateTo === "Invalid Date" ? "" : query.orderDateTo, }); // setFilteredPo((prev) => // po.filter((p) => { diff --git a/src/components/RoughSchedule/RoughSchedileSearchView.tsx b/src/components/RoughSchedule/RoughSchedileSearchView.tsx index e627f87..50146b5 100644 --- a/src/components/RoughSchedule/RoughSchedileSearchView.tsx +++ b/src/components/RoughSchedule/RoughSchedileSearchView.tsx @@ -19,6 +19,7 @@ import { ProdScheduleResultByPage, SearchProdSchedule, fetchProdSchedules, + fetchRoughProdSchedules, testDetailedSchedule, testRoughSchedule, } from "@/app/api/scheduling/actions"; @@ -168,7 +169,7 @@ const RSOverview: React.FC = ({ type, defaultInputs }) => { pageNum: pagingController.pageNum - 1, pageSize: pagingController.pageSize, }; - const response = await fetchProdSchedules(params); + const response = await fetchRoughProdSchedules(params); // console.log(response) if (response) { diff --git a/src/components/RoughSchedule/RoughScheduleWrapper.tsx b/src/components/RoughSchedule/RoughScheduleWrapper.tsx index 6f04543..3f2eaa8 100644 --- a/src/components/RoughSchedule/RoughScheduleWrapper.tsx +++ b/src/components/RoughSchedule/RoughScheduleWrapper.tsx @@ -2,8 +2,7 @@ import { fetchAllItems } from "@/app/api/settings/item"; import { RoughScheduleLoading } from "./RoughScheduleLoading"; import RSOverview from "./RoughSchedileSearchView"; import { - SearchProdSchedule, - fetchProdSchedules, + SearchProdSchedule } from "@/app/api/scheduling/actions"; import { ScheduleType } from "@/app/api/scheduling"; diff --git a/src/components/SearchResults/SearchResults.tsx b/src/components/SearchResults/SearchResults.tsx index c4b42fb..8c8bd62 100644 --- a/src/components/SearchResults/SearchResults.tsx +++ b/src/components/SearchResults/SearchResults.tsx @@ -281,7 +281,9 @@ function SearchResults({ sx={column.sx} key={`${column.name.toString()}${idx}`} > - {column.label} + {column.label.split('\n').map((line, index) => ( +
{line}
// Render each line in a div + ))} ))} @@ -297,15 +299,15 @@ function SearchResults({ tabIndex={-1} key={item.id} onClick={(event) => { - setCheckboxIds - ? handleRowClick(event, item, columns) - : undefined - - if (onRowClick) { - onRowClick(item) - } + setCheckboxIds + ? handleRowClick(event, item, columns) + : undefined + + if (onRowClick) { + onRowClick(item) } } + } role={setCheckboxIds ? "checkbox" : undefined} > {columns.map((column, idx) => { diff --git a/src/i18n/zh/common.json b/src/i18n/zh/common.json index 1838fd1..82f1be2 100644 --- a/src/i18n/zh/common.json +++ b/src/i18n/zh/common.json @@ -81,5 +81,6 @@ "min": "分鐘", "mins": "分鐘", "Job Order": "工單", + "Edit Job Order": "編輯工單", "Production": "生產流程" } diff --git a/src/i18n/zh/jo.json b/src/i18n/zh/jo.json new file mode 100644 index 0000000..e0aaacc --- /dev/null +++ b/src/i18n/zh/jo.json @@ -0,0 +1,19 @@ +{ + "Job Order": "工單", + "Create Job Order": "創建工單", + "Edit Job Order Detail": "編輯工單", + + "Details": "細節", + "Code": "編號", + "Name": "名稱", + "Req. Qty": "需求數量", + "UoM": "單位", + "Status": "狀態", + "Lot No.": "批號", + "Bom": "物料清單", + + "Release": "發佈", + + "Pending": "待提料", + "Planning": "計劃中" +} \ No newline at end of file diff --git a/src/i18n/zh/purchaseOrder.json b/src/i18n/zh/purchaseOrder.json index 7377887..a034c24 100644 --- a/src/i18n/zh/purchaseOrder.json +++ b/src/i18n/zh/purchaseOrder.json @@ -1,7 +1,12 @@ { "Purchase Order": "採購訂單", + "Purchase Receipt": "採購來貨", "Code": "編號", "OrderDate": "下單日期", + "Order Date": "下單日期", + "Order Date To": "下單日期至", + "ETA": "預計到貨日期", + "ETA To": "預計到貨日期至", "Details": "詳情", "Supplier": "供應商", "Status": "狀態", @@ -20,8 +25,10 @@ "Complete PO": "完成採購訂單", "General": "一般", "Bind Storage": "綁定倉位", + "Po No.": "採購訂單編號", "itemNo": "項目編號", "itemName": "項目名稱", + "Item Detail": "項目詳情", "qty": "數量", "uom": "計量單位", "total weight": "總重量",