OrderNotesEditModal.tsx
1.29 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
42
43
44
45
46
47
48
import { RESPONSE_CODE } from '@/constants/enum';
import { postServiceOrderNotesEdit } from '@/services';
import { ModalForm, ProFormTextArea } from '@ant-design/pro-components';
import { Form, message } from 'antd';
export default ({ setNotesEditVisible, notes, ids, notesType, onClose }) => {
const [form] = Form.useForm<{ name: string; company: string }>();
return (
<ModalForm<{
name: string;
company: string;
}>
width={500}
open
title="修改备注"
form={form}
autoFocusFirstInput
modalProps={{
okText: '保存',
cancelText: '取消',
destroyOnClose: true,
onCancel: () => {
setNotesEditVisible(false);
},
}}
submitTimeout={2000}
onFinish={async (values) => {
let body = {
id: ids[0],
notes: values.name,
notesType: notesType,
};
const res = await postServiceOrderNotesEdit({ data: body });
if (res.result === RESPONSE_CODE.SUCCESS) {
message.success(res.message);
onClose();
}
}}
onOpenChange={setNotesEditVisible}
>
<ProFormTextArea
width="lg"
name="name"
initialValue={notes}
placeholder="填写备注内容"
/>
</ModalForm>
);
};