InvoicingModal.tsx
1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import { RESPONSE_CODE } from '@/constants/enum';
import { postServiceInvoiceInvoicing } from '@/services';
import { ModalForm } from '@ant-design/pro-components';
import { Button, Form, message } from 'antd';
export default ({ selectedRowKeys, reloadRecordTable }) => {
const [form] = Form.useForm<{ name: string; company: string }>();
return (
<ModalForm<{
name: string;
company: string;
}>
title="开票"
trigger={
<Button type="primary" disabled={selectedRowKeys?.length === 0}>
开票
</Button>
}
form={form}
autoFocusFirstInput
modalProps={{
destroyOnClose: true,
onCancel: () => console.log('run'),
}}
submitTimeout={2000}
onFinish={async () => {
let res = await postServiceInvoiceInvoicing({
data: {
invoiceRecordIds: selectedRowKeys,
},
});
if (res.result === RESPONSE_CODE.SUCCESS) {
message.success(res.message);
}
reloadRecordTable();
message.success('提交成功');
return true;
}}
></ModalForm>
);
};