From b57847cf1478e3d8813fa2b4186b384178249423 Mon Sep 17 00:00:00 2001 From: "sosuke.iwabuchi" Date: Fri, 14 Jul 2023 16:03:22 +0900 Subject: [PATCH] =?UTF-8?q?=E3=81=AF=E3=81=8C=E3=81=8D=E4=B8=80=E6=8B=AC?= =?UTF-8?q?=E3=83=80=E3=82=A6=E3=83=B3=E3=83=AD=E3=83=BC=E3=83=89=E5=AF=BE?= =?UTF-8?q?=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/index.ts | 2 ++ src/api/url.ts | 6 ++++++ .../custom/hello-techno/detail.tsx | 4 +++- .../custom/hello-techno/list.tsx | 15 ++++++++++++++- 4 files changed, 25 insertions(+), 2 deletions(-) diff --git a/src/api/index.ts b/src/api/index.ts index e15e188..b4cfcb5 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -49,6 +49,8 @@ export const ApiId = { HT_CUSTOM_RECEIPT_ISSUING_ORDER_CREATE: id++, HT_CUSTOM_USE_SUMMARIES: id++, HT_CUSTOM_USE_SUMMARY_DOWNLOAD_CSV: id++, + HT_CUSTOM_DOWNLOAD_RECEIPT_LETTER: id++, + HT_CUSTOM_DOWNLOAD_RECEIPT_LETTERS: id++, } as const; export type ApiId = (typeof ApiId)[keyof typeof ApiId]; diff --git a/src/api/url.ts b/src/api/url.ts index 3218c24..0a31d33 100644 --- a/src/api/url.ts +++ b/src/api/url.ts @@ -42,6 +42,10 @@ const urls = { "custom/hello-techno/receipt-issuing-order/create", [A.HT_CUSTOM_USE_SUMMARIES]: "custom/hello-techno/use-summaries", [A.HT_CUSTOM_USE_SUMMARY_DOWNLOAD_CSV]: "custom/hello-techno/use-summary/csv", + [A.HT_CUSTOM_DOWNLOAD_RECEIPT_LETTER]: + "custom/hello-techno/receipt-letter/download", + [A.HT_CUSTOM_DOWNLOAD_RECEIPT_LETTERS]: + "custom/hello-techno/receipt-letters/download", }; const prefixs = { @@ -49,6 +53,8 @@ const prefixs = { [A.DOWNLOAD_RECEIPT]: "", [A.DOWNLOAD_RECEIPT_LETTER]: "", [A.HT_CUSTOM_USE_SUMMARY_DOWNLOAD_CSV]: "", + [A.HT_CUSTOM_DOWNLOAD_RECEIPT_LETTER]: "", + [A.HT_CUSTOM_DOWNLOAD_RECEIPT_LETTERS]: "", }; const DEFAULT_API_URL_PREFIX = "api"; diff --git a/src/pages/dashboard/receipt-issuing-order/custom/hello-techno/detail.tsx b/src/pages/dashboard/receipt-issuing-order/custom/hello-techno/detail.tsx index 3a2dc15..5178bd6 100644 --- a/src/pages/dashboard/receipt-issuing-order/custom/hello-techno/detail.tsx +++ b/src/pages/dashboard/receipt-issuing-order/custom/hello-techno/detail.tsx @@ -188,7 +188,9 @@ export default function ReceiptIssuingOrderDetail() { }, [order]); const downloadUrl = useMemo(() => { - return getFullUrl(ApiId.DOWNLOAD_RECEIPT_LETTER) + "?id=" + order?.id; + return ( + getFullUrl(ApiId.HT_CUSTOM_DOWNLOAD_RECEIPT_LETTER) + "?id=" + order?.id + ); }, [order]); useEffect(() => { diff --git a/src/pages/dashboard/receipt-issuing-order/custom/hello-techno/list.tsx b/src/pages/dashboard/receipt-issuing-order/custom/hello-techno/list.tsx index b9b30ab..60b2840 100644 --- a/src/pages/dashboard/receipt-issuing-order/custom/hello-techno/list.tsx +++ b/src/pages/dashboard/receipt-issuing-order/custom/hello-techno/list.tsx @@ -153,7 +153,20 @@ function SearchBox({ table }: CommonProps) { return data.status_order_mail_datetime !== null; }); if (data) { - return getFullUrl(ApiId.DOWNLOAD_RECEIPT_LETTER) + "?id=" + data.id; + const f = form.getValues(); + return ( + getFullUrl(ApiId.HT_CUSTOM_DOWNLOAD_RECEIPT_LETTERS) + + "?" + + new URLSearchParams({ + ...f, + order_date_from: f.order_date_from + ? f.order_date_from.toISOString() + : "", + order_date_to: f.order_date_to ? f.order_date_to.toISOString() : "", + include_done: f.include_done ? "1" : "0", + done: f.include_done ? "1" : "0", + }) + ); } return ""; }, [table.row]);