This commit is contained in:
LittleBoy 2024-06-07 21:07:08 +08:00
parent 0047563204
commit 031434488d
5 changed files with 25 additions and 28 deletions

View File

@ -27,19 +27,16 @@ export const BillList: React.FC<BillListProps> = (props) => {
title: '#', title: '#',
dataIndex: 'id', dataIndex: 'id',
width: 120, width: 120,
fixed: true,
}, },
{ {
title: t('base.student_number'), title: t('base.student_number'),
dataIndex: 'student_number', dataIndex: 'student_number',
width: 150, width: 150,
fixed: true,
render: (value) => value ?? 'N/A' render: (value) => value ?? 'N/A'
}, },
{ {
title: t('base.bill_number'), title: t('base.bill_number'),
dataIndex: 'application_number', dataIndex: 'application_number',
fixed: true,
width: 150, width: 150,
}, },
{ {
@ -196,7 +193,7 @@ export const BillList: React.FC<BillListProps> = (props) => {
formatPageText: (params) => ( formatPageText: (params) => (
<div className="bill-list-pagination"> <div className="bill-list-pagination">
{props.tableFooter} {props.tableFooter}
{props.source?.pagination.recordTotal && <span>{t('page.record-show',params)}</span>} {props.source && props.source.pagination.recordTotal > 0 && <span>{t('page.record-show',params)}</span>}
</div> </div>
) )
}} }}

View File

@ -74,20 +74,20 @@ const SearchForm: React.FC<SearchFormProps> = (props) => {
<div className="bill-search-form"> <div className="bill-search-form">
<Form<SearchFormFields> onSubmit={formSubmit}> <Form<SearchFormFields> onSubmit={formSubmit}>
<Row type={'flex'} gutter={20}> <Row type={'flex'} gutter={20}>
<Col span={4}> <Col span={4} md={6}>
<Form.DatePicker type={'dateRange'} field="dateRange" label={t('bill.bill_date')} <Form.DatePicker type={'dateRange'} field="dateRange" label={t('bill.bill_date')}
style={{width: '100%'}}> style={{width: '100%'}}>
</Form.DatePicker> </Form.DatePicker>
</Col> </Col>
<Col span={4}> <Col span={4} md={6}>
<Form.Input field='student_number' label={t('base.student_number')} trigger='blur' <Form.Input field='student_number' label={t('base.student_number')} trigger='blur'
placeholder={t('base.please_enter')}/> placeholder={t('base.please_enter')}/>
</Col> </Col>
<Col span={4}> <Col span={4} md={6}>
<Form.Input field='application_number' label={t('base.bill_number')} trigger='blur' <Form.Input field='application_number' label={t('base.bill_number')} trigger='blur'
placeholder={t('base.please_enter')}/> placeholder={t('base.please_enter')}/>
</Col> </Col>
<Col span={4}> <Col span={4} md={6}>
<Form.Select showClear field="payment_channel" label={t('bill.title_pay_method')} <Form.Select showClear field="payment_channel" label={t('bill.title_pay_method')}
placeholder={t('base.please_select')} style={{width: '100%'}}> placeholder={t('base.please_select')} style={{width: '100%'}}>
<Form.Select.Option value="ASIAPAY">ASIAPAY</Form.Select.Option> <Form.Select.Option value="ASIAPAY">ASIAPAY</Form.Select.Option>
@ -95,14 +95,14 @@ const SearchForm: React.FC<SearchFormProps> = (props) => {
<Form.Select.Option value="PPS">PPS</Form.Select.Option> <Form.Select.Option value="PPS">PPS</Form.Select.Option>
</Form.Select> </Form.Select>
</Col> </Col>
<Col span={4}> <Col span={4} md={6}>
<Form.Select showClear field="bill_status" label={t('bill.pay_status')} <Form.Select showClear field="bill_status" label={t('bill.pay_status')}
placeholder={t('base.please_select')} style={{width: '100%'}}> placeholder={t('base.please_select')} style={{width: '100%'}}>
{billStatusOptions.map((item, index) => ( {billStatusOptions.map((item, index) => (
<Form.Select.Option key={index} value={item.value}>{item.label}</Form.Select.Option>))} <Form.Select.Option key={index} value={item.value}>{item.label}</Form.Select.Option>))}
</Form.Select> </Form.Select>
</Col> </Col>
{props.showApply && <Col span={4}> {props.showApply && <Col span={4} md={6}>
<Form.Select showClear field="apply_status" label={t('bill.title_reconciliation_status')} <Form.Select showClear field="apply_status" label={t('bill.title_reconciliation_status')}
placeholder={t('base.please_select')} style={{width: '100%'}}> placeholder={t('base.please_select')} style={{width: '100%'}}>
{applyStatusOptions.map((item, index) => ( {applyStatusOptions.map((item, index) => (

View File

@ -59,21 +59,21 @@ const BillQuery = () => {
} }
return (<div> return (<div>
<SearchForm showApply loading={loading} onSearch={setBillQueryParams}/> <SearchForm showApply loading={loading} onSearch={setBillQueryParams}/>
<Button onClick={()=>{ {/*<Button onClick={()=>{*/}
Sentry.showReportDialog({ {/* Sentry.showReportDialog({*/}
eventId:'Error: Query bill error',//'QueryBill Report' {/* eventId:'Error: Query bill error',//'QueryBill Report'*/}
user:{ {/* user:{*/}
email:'123123123', {/* email:'123123123',*/}
name:'test' {/* name:'test'*/}
}, {/* },*/}
lang:'zh-CN', {/* lang:'zh-CN',*/}
title:'看起来出现问题了', {/* title:'看起来出现问题了',*/}
subtitle:'请填写你遇到的问题', {/* subtitle:'请填写你遇到的问题',*/}
subtitle2:'', {/* subtitle2:'',*/}
labelComments:'问题类型', {/* labelComments:'问题类型',*/}
labelName:'问题类型', {/* labelName:'问题类型',*/}
}) {/* })*/}
}}></Button> {/*}}></Button>*/}
<BillList <BillList
type={'query'} loading={loading} type={'query'} loading={loading}
operationRender={operation} source={data} operationRender={operation} source={data}

View File

@ -30,7 +30,7 @@ const PayIndex = () => {
const updateBillSuccess = (billId: number, type: string, ref: string) =>{ const updateBillSuccess = (billId: number, type: string, ref: string) =>{
updateBillPaymentSuccess(billId, ref, type).then(bill => { updateBillPaymentSuccess(billId, ref, type).then(bill => {
setState({bill}) setState({bill})
}).finally(()=>{ }).catch(()=>{
setState({result:'fail'}) setState({result:'fail'})
}) })
} }
@ -47,7 +47,7 @@ const PayIndex = () => {
return; return;
} }
if (result == 'success') { if (result == 'success') {
updateBillSuccess(Number(bill), from , (from == 'asia_pay' ? search.get('Ref')! : search.get('callback_id')!)); updateBillSuccess(Number(bill), from , (from == 'ASIAPAY' ? search.get('Ref')! : search.get('callback_id')!));
} }
} }
setState({result, status}) setState({result, status})

2
src/types/core.d.ts vendored
View File

@ -4,7 +4,7 @@ declare type RecordList<T> = {
total: number; total: number;
pageSize: number; pageSize: number;
current: number; current: number;
recordTotal?: number; recordTotal: number;
sort?: string; sort?: string;
filter?: string; filter?: string;
}; };