| @@ -1,3 +1,5 @@ | |||||
| import { Clear } from "@mui/icons-material"; | |||||
| import AccountCircleIcon from "@mui/icons-material/AccountCircle"; | |||||
| import { | import { | ||||
| Box, | Box, | ||||
| Button, | Button, | ||||
| @@ -5,8 +7,6 @@ import { | |||||
| DialogActions, | DialogActions, | ||||
| DialogContent, | DialogContent, | ||||
| DialogTitle, | DialogTitle, | ||||
| Drawer, | |||||
| FormControl, | |||||
| Grid, | Grid, | ||||
| IconButton, | IconButton, | ||||
| Stack, | Stack, | ||||
| @@ -16,25 +16,23 @@ import { | |||||
| TableContainer, | TableContainer, | ||||
| TablePagination, | TablePagination, | ||||
| TableRow, | TableRow, | ||||
| TextField, | |||||
| Tooltip, | Tooltip, | ||||
| Typography, | Typography, | ||||
| } from "@mui/material"; | } from "@mui/material"; | ||||
| import { Dictionary } from "@types"; | import { Dictionary } from "@types"; | ||||
| import { ApiId } from "api"; | |||||
| import { | import { | ||||
| ReceiptIssuingOrderHTCustom, | ReceiptIssuingOrderHTCustom, | ||||
| getReceiptIssuingOrders, | getReceiptIssuingOrders, | ||||
| } from "api/custom/hello-techno/receipt-issuing-order"; | } from "api/custom/hello-techno/receipt-issuing-order"; | ||||
| import { getFullUrl } from "api/url"; | |||||
| import { PageID, TabID } from "codes/page"; | import { PageID, TabID } from "codes/page"; | ||||
| import { | |||||
| FormProvider, | |||||
| RHFCheckbox, | |||||
| RHFSelect, | |||||
| RHFTextField, | |||||
| } from "components/hook-form"; | |||||
| import { FormProvider, RHFCheckbox, RHFTextField } from "components/hook-form"; | |||||
| import RHFDatePicker from "components/hook-form/RHFDatePicker"; | |||||
| import { TableHeadCustom } from "components/table"; | import { TableHeadCustom } from "components/table"; | ||||
| import { SearchConditionContextProvider } from "contexts/SearchConditionContext"; | import { SearchConditionContextProvider } from "contexts/SearchConditionContext"; | ||||
| import useAPICall from "hooks/useAPICall"; | import useAPICall from "hooks/useAPICall"; | ||||
| import useAuth from "hooks/useAuth"; | |||||
| import useBackDrop from "hooks/useBackDrop"; | import useBackDrop from "hooks/useBackDrop"; | ||||
| import useDashboard from "hooks/useDashBoard"; | import useDashboard from "hooks/useDashBoard"; | ||||
| import useNavigateCustom from "hooks/useNavigateCustom"; | import useNavigateCustom from "hooks/useNavigateCustom"; | ||||
| @@ -43,12 +41,7 @@ import useTable, { UseTableReturn } from "hooks/useTable"; | |||||
| import { useEffect, useMemo, useState } from "react"; | import { useEffect, useMemo, useState } from "react"; | ||||
| import { useForm } from "react-hook-form"; | import { useForm } from "react-hook-form"; | ||||
| import { getPath } from "routes/path"; | import { getPath } from "routes/path"; | ||||
| import AccountCircleIcon from "@mui/icons-material/AccountCircle"; | |||||
| import { RHFSelectMuiliple } from "components/hook-form/RHFSelect"; | |||||
| import useAuth from "hooks/useAuth"; | |||||
| import RHFDatePicker from "components/hook-form/RHFDatePicker"; | |||||
| import { dateParse, formatDateStr } from "utils/datetime"; | import { dateParse, formatDateStr } from "utils/datetime"; | ||||
| import { Clear } from "@mui/icons-material"; | |||||
| export default function ReceiptIssuingOrderList() { | export default function ReceiptIssuingOrderList() { | ||||
| const { setHeaderTitle, setTabs } = useDashboard( | const { setHeaderTitle, setTabs } = useDashboard( | ||||
| @@ -141,6 +134,16 @@ function SearchBox({ table }: CommonProps) { | |||||
| return !!orderDateFrom || !!orderDateTo; | return !!orderDateFrom || !!orderDateTo; | ||||
| }, [orderDateFrom, orderDateTo]); | }, [orderDateFrom, orderDateTo]); | ||||
| const downloadLetterUrl: string = useMemo(() => { | |||||
| const data = table.row.find((data) => { | |||||
| return data.status_order_mail_datetime !== null; | |||||
| }); | |||||
| if (data) { | |||||
| return getFullUrl(ApiId.DOWNLOAD_RECEIPT_LETTER) + "?id=" + data.id; | |||||
| } | |||||
| return ""; | |||||
| }, [table.row]); | |||||
| const handleSubmit = async (data: FormProps) => { | const handleSubmit = async (data: FormProps) => { | ||||
| addCondition(data); | addCondition(data); | ||||
| }; | }; | ||||
| @@ -282,6 +285,17 @@ function SearchBox({ table }: CommonProps) { | |||||
| </IconButton> | </IconButton> | ||||
| )} | )} | ||||
| </Grid> | </Grid> | ||||
| {/* <Grid item xs></Grid> */} | |||||
| <Grid item xs={3}> | |||||
| <Typography>はがき一括</Typography> | |||||
| <Button | |||||
| variant="contained" | |||||
| disabled={!downloadLetterUrl} | |||||
| href={downloadLetterUrl} | |||||
| > | |||||
| ダウンロード | |||||
| </Button> | |||||
| </Grid> | |||||
| </Grid> | </Grid> | ||||
| </Box> | </Box> | ||||
| <Dialog | <Dialog | ||||