| @@ -1,3 +1,5 @@ | |||
| import { Clear } from "@mui/icons-material"; | |||
| import AccountCircleIcon from "@mui/icons-material/AccountCircle"; | |||
| import { | |||
| Box, | |||
| Button, | |||
| @@ -5,8 +7,6 @@ import { | |||
| DialogActions, | |||
| DialogContent, | |||
| DialogTitle, | |||
| Drawer, | |||
| FormControl, | |||
| Grid, | |||
| IconButton, | |||
| Stack, | |||
| @@ -16,25 +16,23 @@ import { | |||
| TableContainer, | |||
| TablePagination, | |||
| TableRow, | |||
| TextField, | |||
| Tooltip, | |||
| Typography, | |||
| } from "@mui/material"; | |||
| import { Dictionary } from "@types"; | |||
| import { ApiId } from "api"; | |||
| import { | |||
| ReceiptIssuingOrderHTCustom, | |||
| getReceiptIssuingOrders, | |||
| } from "api/custom/hello-techno/receipt-issuing-order"; | |||
| import { getFullUrl } from "api/url"; | |||
| 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 { SearchConditionContextProvider } from "contexts/SearchConditionContext"; | |||
| import useAPICall from "hooks/useAPICall"; | |||
| import useAuth from "hooks/useAuth"; | |||
| import useBackDrop from "hooks/useBackDrop"; | |||
| import useDashboard from "hooks/useDashBoard"; | |||
| import useNavigateCustom from "hooks/useNavigateCustom"; | |||
| @@ -43,12 +41,7 @@ import useTable, { UseTableReturn } from "hooks/useTable"; | |||
| import { useEffect, useMemo, useState } from "react"; | |||
| import { useForm } from "react-hook-form"; | |||
| 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 { Clear } from "@mui/icons-material"; | |||
| export default function ReceiptIssuingOrderList() { | |||
| const { setHeaderTitle, setTabs } = useDashboard( | |||
| @@ -141,6 +134,16 @@ function SearchBox({ table }: CommonProps) { | |||
| return !!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) => { | |||
| addCondition(data); | |||
| }; | |||
| @@ -282,6 +285,17 @@ function SearchBox({ table }: CommonProps) { | |||
| </IconButton> | |||
| )} | |||
| </Grid> | |||
| {/* <Grid item xs></Grid> */} | |||
| <Grid item xs={3}> | |||
| <Typography>はがき一括</Typography> | |||
| <Button | |||
| variant="contained" | |||
| disabled={!downloadLetterUrl} | |||
| href={downloadLetterUrl} | |||
| > | |||
| ダウンロード | |||
| </Button> | |||
| </Grid> | |||
| </Grid> | |||
| </Box> | |||
| <Dialog | |||