|
@@ -22,6 +22,7 @@ const formItemLayout = {
|
22
|
22
|
const SelectContact = props => {
|
23
|
23
|
|
24
|
24
|
const [data, setData] = useState([]);
|
|
25
|
+ const [disabled, setDisabled] = useState(false);
|
25
|
26
|
const [visible, setVisible] = useState(false);
|
26
|
27
|
const [group, setGroup] = useState({ groupId: undefined, groupName: '充值' })
|
27
|
28
|
|
|
@@ -32,6 +33,7 @@ const SelectContact = props => {
|
32
|
33
|
|
33
|
34
|
|
34
|
35
|
const handleOk = (e) => {
|
|
36
|
+ setDisabled(true)
|
35
|
37
|
props.form.validateFieldsAndScroll((err, values) => {
|
36
|
38
|
console.log(values, "valuesvaluesvaluesvaluesvaluesvaluesvalues")
|
37
|
39
|
|
|
@@ -40,20 +42,24 @@ const SelectContact = props => {
|
40
|
42
|
message.info("操作成功")
|
41
|
43
|
setVisible(false)
|
42
|
44
|
props.onClick()
|
|
45
|
+ setDisabled(false)
|
|
46
|
+ props.form.resetFields();
|
|
47
|
+ }).catch(err => {
|
|
48
|
+ setDisabled(false)
|
43
|
49
|
})
|
|
50
|
+ } else {
|
|
51
|
+ setDisabled(false)
|
44
|
52
|
}
|
45
|
53
|
});
|
46
|
|
-
|
47
|
|
-
|
48
|
54
|
}
|
49
|
|
-// lineHeight: '32px'
|
|
55
|
+
|
50
|
56
|
const { getFieldDecorator } = props.form;
|
51
|
57
|
const regMoney = /^(\d+|\d+\.\d{1,2})$/;
|
52
|
58
|
return (
|
53
|
59
|
<>
|
54
|
|
- <Button onClick={() => setVisible(true)} type="primary" style={{ marginRight: '10%'}}>{group.groupName}
|
55
|
|
- {/* <Recharge orgId={newsData.orgId || ''} onClick={() => getDetail(orgId)} accountId={newsData.accountId || ''} /> */}
|
56
|
|
- </Button>
|
|
60
|
+ <Button onClick={() => setVisible(true)} type="primary" style={{ marginRight: '10%' }}>{group.groupName}
|
|
61
|
+ {/* <Recharge orgId={newsData.orgId || ''} onClick={() => getDetail(orgId)} accountId={newsData.accountId || ''} /> */}
|
|
62
|
+ </Button>
|
57
|
63
|
{/* <div onClick={() => setVisible(true)} style={{ padding: '0 15px', width: '100%', height: '100%' }}>{group.groupName}</div> */}
|
58
|
64
|
|
59
|
65
|
<Modal
|
|
@@ -63,7 +69,7 @@ const SelectContact = props => {
|
63
|
69
|
onCancel={() => setVisible(false)}
|
64
|
70
|
footer={[
|
65
|
71
|
<Button key="back" size="large" onClick={() => setVisible(false)}>取消</Button>,
|
66
|
|
- <Button key="submit" type="primary" size="large" onClick={() => handleOk()}>确认</Button>,
|
|
72
|
+ <Button key="submit" type="primary" size="large" disabled={disabled} onClick={() => handleOk()}>确认</Button>,
|
67
|
73
|
]}
|
68
|
74
|
>
|
69
|
75
|
<div>
|