✨ update
This commit is contained in:
parent
fc31bddddc
commit
e32b3853a3
@ -15,6 +15,7 @@ type SearchFormProps = {
|
||||
}
|
||||
type SearchFormFields = {
|
||||
dateRange?: Date[];
|
||||
delivered_at?: Date[];
|
||||
student_number?: string;
|
||||
merchant_ref?: string;
|
||||
id?: string;
|
||||
@ -32,8 +33,12 @@ const SearchForm: React.FC<SearchFormProps> = (props) => {
|
||||
const params: BillQueryParams = {}
|
||||
|
||||
if (value.dateRange && value.dateRange.length == 2) {
|
||||
params.start_date = dayjs(value.dateRange[0]).format('YYYY-MM-DD');
|
||||
params.end_date = dayjs(value.dateRange[1]).format('YYYY-MM-DD');
|
||||
params.start_initiated = dayjs(value.dateRange[0]).format('YYYY-MM-DD');
|
||||
params.end_initiated = dayjs(value.dateRange[1]).format('YYYY-MM-DD');
|
||||
}
|
||||
if (value.delivered_at && value.delivered_at.length == 2) {
|
||||
params.start_delivered = dayjs(value.delivered_at[0]).format('YYYY-MM-DD');
|
||||
params.end_delivered = dayjs(value.delivered_at[1]).format('YYYY-MM-DD');
|
||||
}
|
||||
if (value.id) {
|
||||
params.id = value.id;
|
||||
@ -52,6 +57,11 @@ const SearchForm: React.FC<SearchFormProps> = (props) => {
|
||||
if (value.confirm_status) {
|
||||
params.confirm_status = value.confirm_status;
|
||||
}
|
||||
// 支付方式
|
||||
if (value.payment_channel) {
|
||||
params.payment_channel = value.payment_channel;
|
||||
}
|
||||
|
||||
// 账单状态
|
||||
if (value.bill_status) {
|
||||
params.status = value.bill_status;
|
||||
@ -59,10 +69,6 @@ const SearchForm: React.FC<SearchFormProps> = (props) => {
|
||||
if(!props.showApply){
|
||||
params.status = 'PAID'
|
||||
}
|
||||
// 支付方式
|
||||
if (value.payment_channel) {
|
||||
params.payment_channel = value.payment_channel;
|
||||
}
|
||||
// 排序
|
||||
if(value.sort_by){
|
||||
const [field, order] = value.sort_by.split(' ')
|
||||
@ -72,7 +78,11 @@ const SearchForm: React.FC<SearchFormProps> = (props) => {
|
||||
params.sort_field = 'id'
|
||||
params.sort_order = 'DESC'
|
||||
}
|
||||
props.onSearch?.(params);
|
||||
|
||||
props.onSearch?.({
|
||||
...params,
|
||||
...value
|
||||
});
|
||||
}
|
||||
const {t, i18n} = useTranslation();
|
||||
// 根据语言变化更新订单状态options
|
||||
@ -106,7 +116,10 @@ const SearchForm: React.FC<SearchFormProps> = (props) => {
|
||||
</Form.DatePicker>
|
||||
</Col>
|
||||
<Col xxl={4} xl={6} md={8}>
|
||||
<Form.Input showClear field='id' label="ID / Merchant Ref" trigger='blur' placeholder={t('base.please_enter')}/>
|
||||
<Form.Input type={'number'} showClear field='id' label="ID" trigger='blur' placeholder={t('base.please_enter')}/>
|
||||
</Col>
|
||||
<Col xxl={4} xl={6} md={8}>
|
||||
<Form.Input showClear field='merchant_ref' label="Merchant Ref" trigger='blur' placeholder={t('base.please_enter')}/>
|
||||
</Col>
|
||||
<Col xxl={4} xl={6} md={8}>
|
||||
<Form.Input showClear field='student_number' label={t('base.student_number')} trigger='blur'
|
||||
@ -142,7 +155,7 @@ const SearchForm: React.FC<SearchFormProps> = (props) => {
|
||||
</Col>
|
||||
<Col xxl={4} xl={6} md={8}>
|
||||
<Form.Select
|
||||
field="bill_type" style={{width: '100%'}}
|
||||
field="confirm_bill_type" style={{width: '100%'}}
|
||||
label={t('manual.bill_type')}
|
||||
placeholder={t('manual.bill_type')}
|
||||
>
|
||||
|
18
src/types/bill.d.ts
vendored
18
src/types/bill.d.ts
vendored
@ -33,12 +33,30 @@ declare type BillQueryParam = {
|
||||
apply_status:string;
|
||||
id:string|number;
|
||||
merchant_ref:string;
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
bill_type:string;
|
||||
confirm_bill_type:string;
|
||||
student_number:string;
|
||||
application_number:string;
|
||||
payment_channel:string;
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
start_date:string;
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
end_date:string;
|
||||
start_initiated:string;
|
||||
end_initiated:string;
|
||||
start_delivered:string;
|
||||
end_delivered:string;
|
||||
merchant_ref:string;
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
department:string;
|
||||
confirm_status: ConfirmStatus;
|
||||
sort_field:string;
|
||||
|
Loading…
x
Reference in New Issue
Block a user