OrderDrawer.tsx
2.52 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
// import { PlusOutlined } from '@ant-design/icons';
import { DrawerForm, ProFormText } from '@ant-design/pro-components';
import { Form, message } from 'antd';
const waitTime = (time: number = 100) => {
return new Promise((resolve) => {
setTimeout(() => {
resolve(true);
}, time);
});
};
export default ({ onClose }) => {
const [form] = Form.useForm<{ name: string; company: string }>();
return (
<DrawerForm<{
name: string;
company: string;
}>
open
title="新建订单"
resize={{
onResize() {
console.log('resize!');
},
maxWidth: window.innerWidth * 0.8,
minWidth: 400,
}}
// layout="horizontal"
// labelCol={{ span: 8 }}
form={form}
autoFocusFirstInput
drawerProps={{
destroyOnClose: true,
}}
submitTimeout={2000}
onFinish={async (values) => {
console.log(
'%c [ ]-40',
'font-size:13px; background:pink; color:#bf2c9f;',
values,
);
console.log(values.name);
message.success('提交成功');
// 不返回不会关闭弹框
// onClose();
return true;
}}
onOpenChange={(val) => {
!val && onClose();
}}
>
<h2>订单基本信息</h2>
<ProFormText
name="orderId"
width="lg"
label="订单编号"
placeholder="请输入名称"
/>
<ProFormText
width="lg"
name="orderName"
label="销售代号"
placeholder="请输入名称"
/>
<h2>商品基本信息</h2>
<ProFormText width="lg" name="id" label="支付总金额" />
<h2>商品1</h2>
<ProFormText width="lg" name="id" label="支付总金额" />
{/* <ProFormDateRangePicker name="contractTime" label="合同生效时间" /> */}
{/* <ProForm.Group>
<ProFormSelect
options={[
{
value: 'chapter',
label: '盖章后生效',
},
]}
width="xs"
name="useMode"
label="合同约定生效方式"
/>
<ProFormSelect
width="xs"
options={[
{
value: 'time',
label: '履行完终止',
},
]}
formItemProps={{
style: {
margin: 0,
},
}}
name="unusedMode"
label="合同约定失效效方式"
/>
</ProForm.Group>
*/}
</DrawerForm>
);
};