|
|
@@ -28,14 +28,12 @@ const PoSearch: React.FC<Props> = ({ po, warehouse }) => { |
|
|
|
const searchCriteria: Criterion<SearchParamNames>[] = useMemo(() => { |
|
|
|
var searchCriteria: Criterion<SearchParamNames>[] = [ |
|
|
|
{ label: t("Code"), paramName: "code", type: "text" }, |
|
|
|
// { label: t("Name"), paramName: "name", type: "text" }, |
|
|
|
{ label: t("Status"), paramName: "status", type: "select", options: ["PENDING", "RECEIVING", "COMPLETED"] }, |
|
|
|
{ label: t("Escalated"), paramName: "escalated", type: "select", options: [t("Escalated"), t("NotEscalated")] }, |
|
|
|
]; |
|
|
|
return searchCriteria; |
|
|
|
}, [t, po]); |
|
|
|
|
|
|
|
const {data: session} = useSession(); |
|
|
|
|
|
|
|
console.log(session); |
|
|
|
|
|
|
|
const onDetailClick = useCallback( |
|
|
|
(po: PoResult) => { |
|
|
@@ -75,7 +73,7 @@ const PoSearch: React.FC<Props> = ({ po, warehouse }) => { |
|
|
|
label: t("Escalated"), |
|
|
|
renderCell: (params) => { |
|
|
|
return params.escalated ? <NotificationIcon color="warning"/> : undefined |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
// { |
|
|
|
// name: "name", |
|
|
@@ -133,10 +131,11 @@ const PoSearch: React.FC<Props> = ({ po, warehouse }) => { |
|
|
|
onSearch={(query) => { |
|
|
|
setFilteredPo( |
|
|
|
po.filter((p) => { |
|
|
|
return p.code |
|
|
|
.toLowerCase() |
|
|
|
.includes(query.code.toLowerCase()); |
|
|
|
// p.name.toLowerCase().includes(query.name.toLowerCase()) |
|
|
|
return ( |
|
|
|
p.code.toLowerCase().includes(query.code.toLowerCase()) && |
|
|
|
(query.status === "All" || p.status === query.status) && |
|
|
|
(query.escalated === "All" || p.escalated === (query.escalated === t("Escalated"))) |
|
|
|
) |
|
|
|
}) |
|
|
|
); |
|
|
|
}} |
|
|
|