From 8589265909bc0087564420059bd7ada6d5fcc08a Mon Sep 17 00:00:00 2001 From: callmeyan Date: Tue, 30 Jul 2024 10:37:22 +0800 Subject: [PATCH] feat: add bill initiated date and delivered date --- src/components/api-notification.tsx | 23 +++++++++++++++++++++++ src/components/bill/list.tsx | 16 ++++++++++++++-- src/i18n/translations/en.json | 1 + src/i18n/translations/sc.json | 3 ++- src/i18n/translations/tc.json | 3 ++- src/pages/bill/query.tsx | 11 +++++++++-- 6 files changed, 51 insertions(+), 6 deletions(-) create mode 100644 src/components/api-notification.tsx diff --git a/src/components/api-notification.tsx b/src/components/api-notification.tsx new file mode 100644 index 0000000..ce11aef --- /dev/null +++ b/src/components/api-notification.tsx @@ -0,0 +1,23 @@ +import {BizError} from "@/service/types.ts"; +import {Toast} from "@douyinfe/semi-ui"; +// import {useTranslation} from 'react-i18next'; + +export function showError (e: BizError,content:string = '') { + const {message, code} = e; + if(!content){ + if(code < 0){ + if(code == -40200|| code == -40201){ + content = 'Auth Error:' + }else if(code < -50415 && code > -50421){ + content = 'Payment Error:' + }else { + content = 'Service Error:' + } + } + } + content += `(${code}-${message})` + Toast.error({ + content, + duration: 3, + }) +} \ No newline at end of file diff --git a/src/components/bill/list.tsx b/src/components/bill/list.tsx index 75158f4..d46d726 100644 --- a/src/components/bill/list.tsx +++ b/src/components/bill/list.tsx @@ -67,17 +67,29 @@ export const BillList: React.FC = (props) => { dataIndex: 'application_number', width: 150, }, + { + title: '开始支付时间', + dataIndex: 'initiated_paid_at', + width: 150, + render: (value) => value?.length ?value: 'N/A' + }, + { + title: '到账时间', + dataIndex: 'delivered_at', + width: 150, + render: (value) => value?.length ?value: 'N/A' + }, { title: t('bill.title_paid_at'), dataIndex: 'paid_at', width: 150, - render: (value) => value ? dayjs(value).format('YYYY-MM-DD') : 'N/A', + render: (value) => value?.length ?value: 'N/A' }, { title: t('bill.title_create_at'), dataIndex: 'create_at', width: 150, - render: (value) => value ? dayjs(value).format('YYYY-MM-DD') : 'N/A', + render: (value) => value?.length ?value: 'N/A' }, { title: t('bill.title_student_name'), diff --git a/src/i18n/translations/en.json b/src/i18n/translations/en.json index eb0e30e..4a6ea54 100644 --- a/src/i18n/translations/en.json +++ b/src/i18n/translations/en.json @@ -31,6 +31,7 @@ "download-qr-code": "Download QR Code", "download_receipt": "Download receipt", "export_excel": "Export Excel", + "import_excel": "Import Bill", "paid": "Paid", "paid_confirm": "Please confirm the order status is set to paid", "pay_status": "Bill Status", diff --git a/src/i18n/translations/sc.json b/src/i18n/translations/sc.json index 33fc484..adaaed5 100644 --- a/src/i18n/translations/sc.json +++ b/src/i18n/translations/sc.json @@ -30,7 +30,8 @@ "confirmed": "已对账", "download-qr-code": "下载二维码", "download_receipt": "下载收据", - "export_excel": "导出账单列表", + "export_excel": "导出账单", + "import_excel": "导入账单", "paid": "已支付", "paid_confirm": "是否将此订单状态设为已支付", "pay_status": "账单状态", diff --git a/src/i18n/translations/tc.json b/src/i18n/translations/tc.json index f084bbf..6eb43e3 100644 --- a/src/i18n/translations/tc.json +++ b/src/i18n/translations/tc.json @@ -30,7 +30,8 @@ "confirmed": "已對帳", "download-qr-code": "下載二維碼", "download_receipt": "下載收據", - "export_excel": "Export Excel", + "export_excel": "導出賬單", + "import_excel": "導入賬單", "paid": "已支付", "paid_confirm": "是否將此訂單狀態設為已支付", "pay_status": "帳單狀態", diff --git a/src/pages/bill/query.tsx b/src/pages/bill/query.tsx index a5d0b39..28ff509 100644 --- a/src/pages/bill/query.tsx +++ b/src/pages/bill/query.tsx @@ -1,4 +1,4 @@ -import {Button, Divider, Modal, Notification, Popconfirm, Toast} from "@douyinfe/semi-ui"; +import {Button, ButtonGroup, Divider, Modal, Notification, Popconfirm, Toast} from "@douyinfe/semi-ui"; import {useState} from "react"; import {useRequest, useSetState} from "ahooks"; import {useTranslation} from "react-i18next"; @@ -105,12 +105,19 @@ const BillQuery = () => { }) } + const onImportExcel = ()=>{ + Toast.warning({content:'Not implemented'}) + } + return (
{t('bill.export_excel')}} + beforeTotalAmount={ + + + } onPageChange={(page_number) => { setBillQueryParams({ ...queryParams,