@@ -12,7 +12,7 @@ type Props = { | |||
const InfoCard: React.FC<Props> = ({ | |||
}) => { | |||
const { t } = useTranslation(); | |||
const { t } = useTranslation("jo"); | |||
const { control, getValues, register, watch } = useFormContext<JoDetail>(); | |||
@@ -55,13 +55,12 @@ const PickTable: React.FC<Props> = ({ | |||
align: "left", | |||
headerAlign: "left", | |||
}, | |||
{ | |||
field: "status", | |||
headerName: t("Status"), | |||
flex: 1, | |||
renderCell: (row) => { | |||
return upperFirst(row.value) | |||
return t(upperFirst(row.value)) | |||
}, | |||
}, | |||
], []) | |||
@@ -44,7 +44,15 @@ const PoSearch: React.FC<Props> = ({ | |||
const [totalCount, setTotalCount] = useState(initTotalCount); | |||
const searchCriteria: Criterion<SearchParamNames>[] = useMemo(() => { | |||
const searchCriteria: Criterion<SearchParamNames>[] = [ | |||
{ 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<Props> = ({ | |||
{ 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<Props> = ({ | |||
}, | |||
{ | |||
name: "code", | |||
label: t("Code"), | |||
label: `${t("Po No.")} &\n${t("Supplier")}`, | |||
renderCell: (params) => { | |||
return <>{params.code}<br/>{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)}<br/>{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) => <p>{item}</p>) | |||
}, | |||
}, | |||
{ | |||
name: "status", | |||
@@ -165,7 +178,7 @@ const PoSearch: React.FC<Props> = ({ | |||
<Grid container> | |||
<Grid item xs={8}> | |||
<Typography variant="h4" marginInlineEnd={2}> | |||
{t("Purchase Order")} | |||
{t("Purchase Receipt")} | |||
</Typography> | |||
</Grid> | |||
<Grid item xs={4} display="flex" justifyContent="end" alignItems="end"> | |||
@@ -189,6 +202,10 @@ const PoSearch: React.FC<Props> = ({ | |||
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) => { | |||
@@ -19,6 +19,7 @@ import { | |||
ProdScheduleResultByPage, | |||
SearchProdSchedule, | |||
fetchProdSchedules, | |||
fetchRoughProdSchedules, | |||
testDetailedSchedule, | |||
testRoughSchedule, | |||
} from "@/app/api/scheduling/actions"; | |||
@@ -168,7 +169,7 @@ const RSOverview: React.FC<Props> = ({ type, defaultInputs }) => { | |||
pageNum: pagingController.pageNum - 1, | |||
pageSize: pagingController.pageSize, | |||
}; | |||
const response = await fetchProdSchedules(params); | |||
const response = await fetchRoughProdSchedules(params); | |||
// console.log(response) | |||
if (response) { | |||
@@ -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"; | |||
@@ -281,7 +281,9 @@ function SearchResults<T extends ResultWithId>({ | |||
sx={column.sx} | |||
key={`${column.name.toString()}${idx}`} | |||
> | |||
{column.label} | |||
{column.label.split('\n').map((line, index) => ( | |||
<div key={index}>{line}</div> // Render each line in a div | |||
))} | |||
</TableCell> | |||
))} | |||
</TableRow> | |||
@@ -297,15 +299,15 @@ function SearchResults<T extends ResultWithId>({ | |||
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) => { | |||
@@ -81,5 +81,6 @@ | |||
"min": "分鐘", | |||
"mins": "分鐘", | |||
"Job Order": "工單", | |||
"Edit Job Order": "編輯工單", | |||
"Production": "生產流程" | |||
} |
@@ -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": "計劃中" | |||
} |
@@ -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": "總重量", | |||