update message
This commit is contained in:
parent
905ea2ae51
commit
46421fa3d5
@ -354,7 +354,6 @@ export const BillList: React.FC<BillListProps> = (props) => {
|
|||||||
|
|
||||||
</div>}
|
</div>}
|
||||||
<div className="bill-list-table">
|
<div className="bill-list-table">
|
||||||
{JSON.stringify(state.selectedKeys)}
|
|
||||||
<Table<BillModel>
|
<Table<BillModel>
|
||||||
bordered
|
bordered
|
||||||
columns={columns}
|
columns={columns}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import {Button, Select, Space, Divider, InputNumber, Modal,} from "@douyinfe/semi-ui";
|
import {Button, Select, Space, Divider, InputNumber, Modal} from "@douyinfe/semi-ui";
|
||||||
import React, {useEffect} from "react";
|
import React, {useEffect} from "react";
|
||||||
import {useSetState} from "ahooks";
|
import {useSetState} from "ahooks";
|
||||||
import MoneyFormat from "@/components/money-format.tsx";
|
import MoneyFormat from "@/components/money-format.tsx";
|
||||||
@ -121,6 +121,11 @@ export const BillTypeConfirmModal: React.FC<BillTypeConfirmProps> = (props) => {
|
|||||||
...state
|
...state
|
||||||
}]).then(() => {
|
}]).then(() => {
|
||||||
props.onClose?.(true)
|
props.onClose?.(true)
|
||||||
|
}).catch(e=>{
|
||||||
|
Modal.error({
|
||||||
|
title: 'Error',
|
||||||
|
content: `Confirmed Fail: ${e.message}`
|
||||||
|
})
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
setState({loading: false})
|
setState({loading: false})
|
||||||
})
|
})
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import {Button, Space, TabPane, Tabs, Notification, Popconfirm, Toast, Modal} from "@douyinfe/semi-ui";
|
import {Button, Space, TabPane, Tabs, Popconfirm, Toast, Modal} from "@douyinfe/semi-ui";
|
||||||
import {useRequest, useSetState} from "ahooks";
|
import {useRequest, useSetState} from "ahooks";
|
||||||
import {useTranslation} from "react-i18next";
|
import {useTranslation} from "react-i18next";
|
||||||
import {useState} from "react";
|
import {useState} from "react";
|
||||||
@ -19,7 +19,7 @@ const BillReconciliation = () => {
|
|||||||
confirm_status: 'CONFIRMED'
|
confirm_status: 'CONFIRMED'
|
||||||
}), {
|
}), {
|
||||||
refreshDeps: [queryParams],
|
refreshDeps: [queryParams],
|
||||||
onSuccess:()=>{
|
onSuccess: () => {
|
||||||
setState({checkingId: -1})
|
setState({checkingId: -1})
|
||||||
},
|
},
|
||||||
onError: (e: Error) => {
|
onError: (e: Error) => {
|
||||||
@ -36,16 +36,16 @@ const BillReconciliation = () => {
|
|||||||
})
|
})
|
||||||
const confirmBill = (records: number[]) => {
|
const confirmBill = (records: number[]) => {
|
||||||
if (records.length == 0) {
|
if (records.length == 0) {
|
||||||
Notification.error({title: 'Notice', content: t('bill.confirm_select_empty')})
|
Toast.error({content: t('bill.confirm_select_empty')})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const arr = data?.list.filter(item =>records.includes(item.id));
|
const arr = data?.list.filter(item => records.includes(item.id));
|
||||||
if(!arr) return;
|
if (!arr) return;
|
||||||
for (let i = 0; i < arr.length; i++) {
|
for (let i = 0; i < arr.length; i++) {
|
||||||
const item = arr[i];
|
const item = arr[i];
|
||||||
|
|
||||||
// 判断confirm的总金额是否和实付金额相等
|
// 判断confirm的总金额是否和实付金额相等
|
||||||
const total = item.detail_confirms? item.detail_confirms.reduce((total, item) => {
|
const total = item.detail_confirms ? item.detail_confirms.reduce((total, item) => {
|
||||||
return total + Number(item.amount)
|
return total + Number(item.amount)
|
||||||
}, 0) : 0;
|
}, 0) : 0;
|
||||||
|
|
||||||
@ -60,7 +60,7 @@ const BillReconciliation = () => {
|
|||||||
|
|
||||||
setState({checkingId: records.length > 1 ? 0 : Number(records[0])})
|
setState({checkingId: records.length > 1 ? 0 : Number(records[0])})
|
||||||
confirmBills(records).then(() => {
|
confirmBills(records).then(() => {
|
||||||
Notification.success({title: 'Notice', content: t('bill.confirm_success')})
|
Toast.success({content: t('bill.confirm_success')})
|
||||||
refresh()
|
refresh()
|
||||||
}).catch((e: BizError) => {
|
}).catch((e: BizError) => {
|
||||||
Toast.error({
|
Toast.error({
|
||||||
@ -109,18 +109,18 @@ const BillReconciliation = () => {
|
|||||||
source={data} type={'reconciliation'}
|
source={data} type={'reconciliation'}
|
||||||
operationRender={queryParams.apply_status == 'CHECKED' ? undefined : operation}
|
operationRender={queryParams.apply_status == 'CHECKED' ? undefined : operation}
|
||||||
beforeTotalAmount={<div>{queryParams.apply_status != 'CHECKED' && (
|
beforeTotalAmount={<div>{queryParams.apply_status != 'CHECKED' && (
|
||||||
(selectKeys.length == 0 )? <Button theme={'solid'} disabled style={{marginRight: 10}}>
|
(selectKeys.length == 0) ? <Button theme={'solid'} disabled style={{marginRight: 10}}>
|
||||||
{t('bill.confirm_batch')}
|
|
||||||
</Button> :
|
|
||||||
<Popconfirm
|
|
||||||
title={'Notice'}
|
|
||||||
content={`${t('bill.cancel_confirm_bills')}?`}
|
|
||||||
onConfirm={() => confirmBill(selectKeys as number[])}
|
|
||||||
>
|
|
||||||
<Button theme={'solid'} style={{marginRight: 10}}>
|
|
||||||
{t('bill.confirm_batch')}
|
{t('bill.confirm_batch')}
|
||||||
</Button>
|
</Button> :
|
||||||
</Popconfirm>
|
<Popconfirm
|
||||||
|
title={'Notice'}
|
||||||
|
content={`${t('bill.cancel_confirm_bills')}?`}
|
||||||
|
onConfirm={() => confirmBill(selectKeys as number[])}
|
||||||
|
>
|
||||||
|
<Button theme={'solid'} style={{marginRight: 10}}>
|
||||||
|
{t('bill.confirm_batch')}
|
||||||
|
</Button>
|
||||||
|
</Popconfirm>
|
||||||
)}</div>}
|
)}</div>}
|
||||||
onRowSelection={queryParams.apply_status == 'CHECKED' ? undefined : (keys: (number | string)[]) => {
|
onRowSelection={queryParams.apply_status == 'CHECKED' ? undefined : (keys: (number | string)[]) => {
|
||||||
setSelectedKeys(keys);
|
setSelectedKeys(keys);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user