|
@@ -1,5 +1,5 @@
|
1
|
1
|
import React, { useState, useEffect } from 'react';
|
2
|
|
-import { Form, Modal, Button, Table, message, Input, Icon, Pagination } from 'antd';
|
|
2
|
+import { Form, Modal, Button, Table, message, Input, InputNumber, Icon, Pagination } from 'antd';
|
3
|
3
|
import XForm, { FieldTypes } from '../../../components/XForm';
|
4
|
4
|
import request from '../../../utils/request';
|
5
|
5
|
import apis from '../../../services/apis';
|
|
@@ -47,6 +47,8 @@ const SelectContact = props => {
|
47
|
47
|
}
|
48
|
48
|
|
49
|
49
|
const { getFieldDecorator } = props.form;
|
|
50
|
+ const balance = regFenToYuan(props.realBalance)
|
|
51
|
+ const regMoney = /^(\d+|\d+\.\d{1,2})$/;
|
50
|
52
|
return (
|
51
|
53
|
<div>
|
52
|
54
|
<span onClick={() => setVisible(true)}>{group.groupName}</span>
|
|
@@ -65,13 +67,20 @@ const SelectContact = props => {
|
65
|
67
|
<p style={{ color: 'red' }}>请先进行线下实际退款操作后再执行线上退款存档</p>
|
66
|
68
|
<Form {...formItemLayout} >
|
67
|
69
|
|
68
|
|
- <Form.Item label="充值金额" >
|
|
70
|
+ <Form.Item label="退款金额" >
|
69
|
71
|
{getFieldDecorator('refundAmount', {
|
70
|
72
|
rules: [{ required: true, message: '退款金额不能为空' },
|
71
|
|
- { max: 20 }],
|
|
73
|
+ {
|
|
74
|
+ validator: (rule, value, callback) => {
|
|
75
|
+
|
|
76
|
+ callback(!regMoney.test(value) ? '金额最多两位小数' : value > balance.toString() ? '退款金额不能大于余额' : value < 0.01 ? '金额不得小于0.01' : undefined)
|
|
77
|
+
|
|
78
|
+ }
|
|
79
|
+ }
|
|
80
|
+ ],
|
72
|
81
|
})(<Input type='number' placeholder="支持2位小数" addonAfter="元" />)}
|
73
|
82
|
</Form.Item>
|
74
|
|
- <div style={{ marginBottom: '25px' }}><span style={{ width: '25%', display: 'inline-block', textAlign: 'right' }}>余额:</span>{regFenToYuan(props.realBalance)}元</div>
|
|
83
|
+ <div style={{ marginBottom: '25px' }}><span style={{ width: '25%', display: 'inline-block', textAlign: 'right' }}>余额:</span>{balance}元</div>
|
75
|
84
|
<Form.Item label="退款凭证" help="可上传银行转账截图、微信退款订单等截图作为查账线索">
|
76
|
85
|
{getFieldDecorator('certificateList', {
|
77
|
86
|
rules: [{ required: false }],
|