feat: add bill initiated date and delivered date
This commit is contained in:
parent
69c067bd9d
commit
8589265909
23
src/components/api-notification.tsx
Normal file
23
src/components/api-notification.tsx
Normal file
@ -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,
|
||||||
|
})
|
||||||
|
}
|
@ -67,17 +67,29 @@ export const BillList: React.FC<BillListProps> = (props) => {
|
|||||||
dataIndex: 'application_number',
|
dataIndex: 'application_number',
|
||||||
width: 150,
|
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'),
|
title: t('bill.title_paid_at'),
|
||||||
dataIndex: 'paid_at',
|
dataIndex: 'paid_at',
|
||||||
width: 150,
|
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'),
|
title: t('bill.title_create_at'),
|
||||||
dataIndex: 'create_at',
|
dataIndex: 'create_at',
|
||||||
width: 150,
|
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'),
|
title: t('bill.title_student_name'),
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
"download-qr-code": "Download QR Code",
|
"download-qr-code": "Download QR Code",
|
||||||
"download_receipt": "Download receipt",
|
"download_receipt": "Download receipt",
|
||||||
"export_excel": "Export Excel",
|
"export_excel": "Export Excel",
|
||||||
|
"import_excel": "Import Bill",
|
||||||
"paid": "Paid",
|
"paid": "Paid",
|
||||||
"paid_confirm": "Please confirm the order status is set to paid",
|
"paid_confirm": "Please confirm the order status is set to paid",
|
||||||
"pay_status": "Bill Status",
|
"pay_status": "Bill Status",
|
||||||
|
@ -30,7 +30,8 @@
|
|||||||
"confirmed": "已对账",
|
"confirmed": "已对账",
|
||||||
"download-qr-code": "下载二维码",
|
"download-qr-code": "下载二维码",
|
||||||
"download_receipt": "下载收据",
|
"download_receipt": "下载收据",
|
||||||
"export_excel": "导出账单列表",
|
"export_excel": "导出账单",
|
||||||
|
"import_excel": "导入账单",
|
||||||
"paid": "已支付",
|
"paid": "已支付",
|
||||||
"paid_confirm": "是否将此订单状态设为已支付",
|
"paid_confirm": "是否将此订单状态设为已支付",
|
||||||
"pay_status": "账单状态",
|
"pay_status": "账单状态",
|
||||||
|
@ -30,7 +30,8 @@
|
|||||||
"confirmed": "已對帳",
|
"confirmed": "已對帳",
|
||||||
"download-qr-code": "下載二維碼",
|
"download-qr-code": "下載二維碼",
|
||||||
"download_receipt": "下載收據",
|
"download_receipt": "下載收據",
|
||||||
"export_excel": "Export Excel",
|
"export_excel": "導出賬單",
|
||||||
|
"import_excel": "導入賬單",
|
||||||
"paid": "已支付",
|
"paid": "已支付",
|
||||||
"paid_confirm": "是否將此訂單狀態設為已支付",
|
"paid_confirm": "是否將此訂單狀態設為已支付",
|
||||||
"pay_status": "帳單狀態",
|
"pay_status": "帳單狀態",
|
||||||
|
@ -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 {useState} from "react";
|
||||||
import {useRequest, useSetState} from "ahooks";
|
import {useRequest, useSetState} from "ahooks";
|
||||||
import {useTranslation} from "react-i18next";
|
import {useTranslation} from "react-i18next";
|
||||||
@ -105,12 +105,19 @@ const BillQuery = () => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const onImportExcel = ()=>{
|
||||||
|
Toast.warning({content:'Not implemented'})
|
||||||
|
}
|
||||||
|
|
||||||
return (<div>
|
return (<div>
|
||||||
<SearchForm showApply loading={loading} onSearch={setBillQueryParams}/>
|
<SearchForm showApply loading={loading} onSearch={setBillQueryParams}/>
|
||||||
<BillList
|
<BillList
|
||||||
type={'query'} loading={loading} source={data}
|
type={'query'} loading={loading} source={data}
|
||||||
operationRender={operation} operationRenderWidth={180}
|
operationRender={operation} operationRenderWidth={180}
|
||||||
beforeTotalAmount={<Button loading={state.exporting} onClick={onExportExcel} theme={'solid'} type={'secondary'}>{t('bill.export_excel')}</Button>}
|
beforeTotalAmount={<ButtonGroup style={{marginRight:20}} theme={'solid'}>
|
||||||
|
<Button onClick={onImportExcel}>{t('bill.import_excel')}</Button>
|
||||||
|
<Button loading={state.exporting} onClick={onExportExcel}>{t('bill.export_excel')}</Button>
|
||||||
|
</ButtonGroup>}
|
||||||
onPageChange={(page_number) => {
|
onPageChange={(page_number) => {
|
||||||
setBillQueryParams({
|
setBillQueryParams({
|
||||||
...queryParams,
|
...queryParams,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user