| @@ -19,12 +19,15 @@ import { | |||||
| ProdScheduleResultByPage, | ProdScheduleResultByPage, | ||||
| SearchProdSchedule, | SearchProdSchedule, | ||||
| fetchProdSchedules, | fetchProdSchedules, | ||||
| testDetailedSchedule, | |||||
| testRoughSchedule, | |||||
| } from "@/app/api/scheduling/actions"; | } from "@/app/api/scheduling/actions"; | ||||
| import { arrayToDateString, decimalFormatter } from "@/app/utils/formatUtil"; | import { arrayToDateString, decimalFormatter } from "@/app/utils/formatUtil"; | ||||
| import { isEqual, uniqBy } from "lodash"; | import { isEqual, uniqBy } from "lodash"; | ||||
| import dayjs from "dayjs"; | import dayjs from "dayjs"; | ||||
| import { defaultPagingController } from "../SearchResults/SearchResults"; | import { defaultPagingController } from "../SearchResults/SearchResults"; | ||||
| import { ScheduleType } from "@/app/api/scheduling"; | import { ScheduleType } from "@/app/api/scheduling"; | ||||
| import { Button, Stack } from "@mui/material"; | |||||
| // type RecordStructure ={ | // type RecordStructure ={ | ||||
| // id: number, | // id: number, | ||||
| @@ -248,8 +251,29 @@ const RSOverview: React.FC<Props> = ({ type, defaultInputs }) => { | |||||
| refetchData(defaultInputs, "reset"); | refetchData(defaultInputs, "reset"); | ||||
| }, []); | }, []); | ||||
| const testRoughScheduleClick = useCallback(async () => { | |||||
| const response = await testRoughSchedule() | |||||
| if (response) { | |||||
| refetchData(inputs, "paging"); | |||||
| } | |||||
| }, []); | |||||
| return ( | return ( | ||||
| <> | <> | ||||
| <Stack | |||||
| direction="row" | |||||
| justifyContent="flex-end" | |||||
| flexWrap="wrap" | |||||
| rowGap={2} | |||||
| > | |||||
| <Button | |||||
| variant="contained" | |||||
| onClick={testRoughScheduleClick} | |||||
| > | |||||
| {t("Test Rough Schedule")} | |||||
| </Button> | |||||
| </Stack> | |||||
| <SearchBox | <SearchBox | ||||
| criteria={searchCriteria} | criteria={searchCriteria} | ||||
| onSearch={(query) => { | onSearch={(query) => { | ||||
| @@ -273,7 +297,7 @@ const RSOverview: React.FC<Props> = ({ type, defaultInputs }) => { | |||||
| setPagingController={setPagingController} | setPagingController={setPagingController} | ||||
| pagingController={pagingController} | pagingController={pagingController} | ||||
| totalCount={totalCount} | totalCount={totalCount} | ||||
| // isAutoPaging={false} | |||||
| // isAutoPaging={false} | |||||
| /> | /> | ||||
| </> | </> | ||||
| ); | ); | ||||