xujing 5 lat temu
rodzic
commit
2fe774fc13

+ 1
- 1
src/pages/fundManagement/AccountDetail.jsx Wyświetl plik

@@ -111,7 +111,7 @@ function header(props) {
111 111
                             <Button htmlType="submit" type="primary" style={{ marginRight: '10%' }}>
112 112
                                 <Recharge orgId={newsData.orgId || ''} onClick={() => getDetail(orgId)} accountId={newsData.accountId || ''} />
113 113
                             </Button>
114
-                            <Button >返回</Button>
114
+                            <Button onClick={() => router.go(-1)}>返回</Button>
115 115
                         </div>
116 116
                     </div>
117 117
                 }

+ 2
- 2
src/pages/fundManagement/AccountManagement.jsx Wyświetl plik

@@ -107,9 +107,9 @@ function header(props) {
107 107
             width: '120px',
108 108
             render: (x, row) => (
109 109
                 <>
110
-                    <span style={{ color: '#FF925C', cursor: 'pointer', marginRight: '16px', display: 'inline-block' }}><Recharge onClick={() => getList({ pageNum: 1, pageSize: 10 })} orgId={row.orgId} accountId={row.accountId} /></span>
110
+                    <span style={{ color: '#FF925C', cursor: 'pointer', marginRight: '16px', display: 'inline-block' }}><Recharge onClick={handleReset} orgId={row.orgId} accountId={row.accountId} /></span>
111 111
                     <span style={{ color: '#FF925C', cursor: 'pointer', display: 'inline-block' }} >
112
-                        <Refund orgId={row.orgId} accountId={row.accountId} onClick={() => getList({ pageNum: 1, pageSize: 10 })} realBalance={row.realBalance || '0'} />
112
+                        <Refund orgId={row.orgId} accountId={row.accountId} onClick={handleReset} realBalance={row.realBalance || '0'} />
113 113
                     </span>
114 114
                 </>
115 115
             ),

+ 1
- 1
src/pages/fundManagement/ConsumeOrder.jsx Wyświetl plik

@@ -148,7 +148,7 @@ function header(props) {
148 148
             submitValue.startDate = null
149 149
             submitValue.endDate = null
150 150
         }
151
-        request({ ...apis.fund.consumeOrderExport, params: { itemType: 'redPacket', orgId, ...submitValue } }).then(data => {
151
+        request({ ...apis.fund.consumeOrderExport, params: { orderType: 'redPacket', orgId, ...submitValue } }).then(data => {
152 152
             if (!data) {
153 153
                 return
154 154
             }

+ 1
- 1
src/pages/fundManagement/RechargeOrder.jsx Wyświetl plik

@@ -141,7 +141,7 @@ function header(props) {
141 141
             submitValue.startDate = null
142 142
             submitValue.endDate = null
143 143
         }
144
-        request({ ...apis.fund.rechargeOrderExport, params: { itemType: 'recharge', orgId, ...submitValue } }).then(data => {
144
+        request({ ...apis.fund.rechargeOrderExport, params: { orderType: 'recharge', orgId, ...submitValue } }).then(data => {
145 145
             if (!data) {
146 146
                 return
147 147
             }

+ 3
- 3
src/pages/fundManagement/RefundOrder.jsx Wyświetl plik

@@ -117,14 +117,14 @@ function header(props) {
117 117
             dataIndex: 'tradingStatus',
118 118
             key: 'tradingStatus',
119 119
             align: 'center',
120
-            render: (x, row) => <><span>{row.tradingStatus == '0' ? '已申请' : row.tradingStatus == '1' ? '已退款' : '已驳回'}</span></>
120
+            render: (x, row) => <><span>{row.tradingStatus == 'processing' ? '已申请' : row.tradingStatus == 'success' ? '已退款' : row.tradingStatus == 'fail' ? '已驳回' : ''}</span></>
121 121
         },
122 122
         {
123 123
             title: '驳回原因',
124 124
             dataIndex: 'auditResult',
125 125
             key: 'auditResult',
126 126
             align: 'center',
127
-            render: (x, row) => <>{row.tradingStatus == '2' && <span>{row.auditResult}</span>}</>
127
+            render: (x, row) => <>{row.tradingStatus == 'fail' && <span>{row.auditResult}</span>}</>
128 128
         },
129 129
         {
130 130
             title: '退款凭证',
@@ -244,7 +244,7 @@ function header(props) {
244 244
             submitValue.startDate = null
245 245
             submitValue.endDate = null
246 246
         }
247
-        request({ ...apis.fund.refundOrderExport, params: { itemType: 'refund', orgId, ...submitValue } }).then(data => {
247
+        request({ ...apis.fund.refundOrderExport, params: { orderType: 'refund', orgId, ...submitValue } }).then(data => {
248 248
             if (!data) {
249 249
                 return
250 250
             }

+ 10
- 2
src/pages/fundManagement/components/Recharge.jsx Wyświetl plik

@@ -34,7 +34,7 @@ const SelectContact = props => {
34 34
     const handleOk = (e) => {
35 35
         props.form.validateFieldsAndScroll((err, values) => {
36 36
             console.log(values, "valuesvaluesvaluesvaluesvaluesvaluesvalues")
37
-            
37
+
38 38
             if (!err) {
39 39
                 request({ ...apis.fund.recharge, urlData: { id: props.accountId || '' }, data: { ...values, orgId: props.orgId } }).then((data) => {
40 40
                     message.info("操作成功")
@@ -48,6 +48,7 @@ const SelectContact = props => {
48 48
     }
49 49
 
50 50
     const { getFieldDecorator } = props.form;
51
+    const regMoney = /^(\d+|\d+\.\d{1,2})$/;
51 52
     return (
52 53
         <div>
53 54
             <span onClick={() => setVisible(true)}>{group.groupName}</span>
@@ -68,7 +69,14 @@ const SelectContact = props => {
68 69
 
69 70
                         <Form.Item label="充值金额" >
70 71
                             {getFieldDecorator('rechargeAmount', {
71
-                                rules: [{ required: true, message: '充值金额不能为空' }],
72
+                                rules: [
73
+                                    { required: true, message: '充值金额不能为空' },
74
+                                    {
75
+                                        validator: (rule, value, callback) => {
76
+                                            callback(value < 0.01 || value > 99999.99 ? '金额最多5位整数 2位小数' : !regMoney.test(value) ? '金额最多两位小数' : undefined)
77
+                                        }
78
+                                    }
79
+                                ],
72 80
                             })(<Input type='number' placeholder="支持2位小数" addonAfter="元" />)}
73 81
                         </Form.Item>
74 82
 

+ 13
- 4
src/pages/fundManagement/components/Refund.jsx Wyświetl plik

@@ -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 }],