曾国涛
authored
|
1
2
|
import { RESPONSE_CODE } from '@/constants/enum';
import { postServiceInvoiceReissueAudit } from '@/services';
|
曾国涛
authored
|
3
|
import { ModalForm, ProFormTextArea } from '@ant-design/pro-components';
|
曾国涛
authored
|
4
5
|
import { Button, Form, message } from 'antd';
|
曾国涛
authored
|
6
|
export default ({ recordIds, onClose }) => {
|
曾国涛
authored
|
7
8
9
10
|
const [form] = Form.useForm<{ name: string; company: string }>();
return (
<ModalForm
title="审核"
|
曾国涛
authored
|
11
|
trigger={<a type="primary">审核</a>}
|
曾国涛
authored
|
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
form={form}
autoFocusFirstInput
modalProps={{
destroyOnClose: true,
onCancel: () => console.log('run'),
}}
submitTimeout={2000}
submitter={{
searchConfig: {
submitText: '通过',
resetText: '取消',
},
render: (props, defaultDoms) => {
return [
|
曾国涛
authored
|
26
|
defaultDoms[0],
|
曾国涛
authored
|
27
|
<Button
|
曾国涛
authored
|
28
|
type={'primary'}
|
曾国涛
authored
|
29
30
31
|
key="ok"
onClick={async () => {
const res = await postServiceInvoiceReissueAudit({
|
曾国涛
authored
|
32
33
34
35
|
data: {
...form.getFieldsValue(),
recordIds,
passed: false,
|
曾国涛
authored
|
36
37
38
39
40
|
},
});
if (res.result === RESPONSE_CODE.SUCCESS) {
message.success('提交成功');
}
|
曾国涛
authored
|
41
|
props.submit();
|
曾国涛
authored
|
42
43
|
}}
>
|
曾国涛
authored
|
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
驳回
</Button>,
<Button
type={'primary'}
key="ok"
onClick={async () => {
const res = await postServiceInvoiceReissueAudit({
data: {
...form.getFieldsValue(),
recordIds,
passed: true,
},
});
if (res.result === RESPONSE_CODE.SUCCESS) {
message.success('提交成功');
}
props.submit();
}}
>
通过
|
曾国涛
authored
|
64
65
66
67
|
</Button>,
];
},
}}
|
曾国涛
authored
|
68
69
70
|
onFinish={async () => {
onClose();
return true;
|
曾国涛
authored
|
71
72
|
}}
>
|
曾国涛
authored
|
73
|
<ProFormTextArea name="notes" label="备注" />
|
曾国涛
authored
|
74
75
76
|
</ModalForm>
);
};
|