zhoulisen 4 年前
父节点
当前提交
e352a4b9b0
共有 3 个文件被更改,包括 30 次插入45 次删除
  1. 1
    1
      config/config.js
  2. 14
    10
      src/pages/fundManagement/RefundOrder.jsx
  3. 15
    34
      src/pages/fundManagement/components/Refund.jsx

+ 1
- 1
config/config.js 查看文件

@@ -134,7 +134,7 @@ export default {
134 134
   proxy: {
135 135
     '/api': {
136 136
       // target: 'https://dev.fangdeal.cn',
137
-      target: 'http://192.168.0.153:8080/',
137
+      target: 'http://192.168.0.195:8080/',
138 138
       changeOrigin: true,
139 139
       // pathRewrite: { '^/server': '' },
140 140
     },

+ 14
- 10
src/pages/fundManagement/RefundOrder.jsx 查看文件

@@ -222,18 +222,22 @@ function header(props) {
222 222
     }
223 223
 
224 224
     const orderRefund = () => {
225
-        request({
226
-            ...apis.fund.refund, urlData: { id: row.orderId }, data: {
227
-                orgId: row.orgId,
228
-                amount: row.amount,
229
-            }
230
-        }).then(data => {
231
-            console.log(data)
232
-            getList({ pageNum: 1, pageSize: 10, orderType: 'refund' });
233 225
 
234
-        })
226
+        getList({ pageNum: 1, pageSize: 10, orderType: 'refund' });
235 227
 
236 228
         setRefundVisible(false)
229
+        // request({
230
+        //     ...apis.fund.refund, urlData: { id: row.orderId }, data: {
231
+        //         orgId: row.orgId,
232
+        //         amount: row.amount,
233
+        //     }
234
+        // }).then(data => {
235
+        //     console.log(data)
236
+        //     getList({ pageNum: 1, pageSize: 10, orderType: 'refund' });
237
+
238
+        // })
239
+
240
+        // setRefundVisible(false)
237 241
     }
238 242
     // 导出
239 243
     const exportList = () => {
@@ -286,7 +290,7 @@ function header(props) {
286 290
                 onOk={() => orderRefund()}
287 291
                 onCancel={() => handleCancel()}
288 292
                 footer={[
289
-                    <Button key="back" size="large"><Refund orgId={row.orgId} accountId={row.accountId} amount={row.amount || '0'} /></Button>,
293
+                    <Button key="back" size="large"><Refund orgId={row.orgId} accountId={row.accountId} amount={row.amount || '0'} onClick={orderRefund} orderId={row.orderId} /></Button>,
290 294
                     //     <span style={{ color: '#FF925C', cursor: 'pointer', display: 'inline-block' }} >
291 295
 
292 296
                     // </span>

+ 15
- 34
src/pages/fundManagement/components/Refund.jsx 查看文件

@@ -27,18 +27,26 @@ const SelectContact = props => {
27 27
     const [group, setGroup] = useState({ groupId: undefined, groupName: '退款' })
28 28
 
29 29
     useEffect(() => {
30
-        console.log(props, 'props')
31
-    }, [props.value])
32 30
 
31
+    }, [props.value])
33 32
 
34
-    const handleOk = (e) => {
33
+    const handleOk = () => {
35 34
         props.form.validateFieldsAndScroll((err, values) => {
36 35
             console.log(values, "valuesvaluesvaluesvaluesvaluesvaluesvalues")
37 36
             if (!err) {
38
-                request({ ...apis.fund.accoutRefund, urlData: { id: props.accountId || '' }, data: { ...values, orgId: props.orgId } }).then((data) => {
39
-                    message.info("操作成功")
37
+
38
+                request({
39
+                    ...apis.fund.refund, urlData: { id: props.orderId }, data: {
40
+                        orgId: props.orgId,
41
+                        // amount: props.amount,
42
+                        ...values,
43
+                    }
44
+                }).then(data => {
45
+                    console.log(data)
46
+                    message.success('操作成功')
40 47
                     setVisible(false)
41
-                    // props.onClick()
48
+                    // getList({ pageNum: 1, pageSize: 10, orderType: 'refund' });
49
+                    props.onClick()
42 50
                 })
43 51
             }
44 52
         });
@@ -46,17 +54,6 @@ const SelectContact = props => {
46 54
 
47 55
     }
48 56
 
49
-    // request({
50
-    //     ...apis.fund.refund, urlData: { id: row.orderId }, data: {
51
-    //         orgId: row.orgId,
52
-    //         amount: row.amount,
53
-    //     }
54
-    // }).then(data => {
55
-    //     console.log(data)
56
-    //     getList({ pageNum: 1, pageSize: 10, orderType: 'refund' });
57
-
58
-    // })
59
-
60 57
     const { getFieldDecorator } = props.form;
61 58
     const balance = regFenToYuan(props.realBalance)
62 59
     const regMoney = /^(\d+|\d+\.\d{1,2})$/;
@@ -75,27 +72,11 @@ const SelectContact = props => {
75 72
                 ]}
76 73
             >
77 74
                 <div>
78
-                    {/* <p style={{ color: 'red' }}>请先进行线下实际退款操作后再执行线上退款存档</p> */}
79 75
 
80 76
                     <Form {...formItemLayout} >
81
-
82
-                        {/* <Form.Item label="退款金额" >
83
-                            {getFieldDecorator('refundAmount', {
84
-                                rules: [{ required: true, message: '退款金额不能为空' },
85
-                                {
86
-                                    validator: (rule, value, callback) => {
87
-
88
-                                        callback(!regMoney.test(value) ? '金额最多两位小数' : value > balance.toString() ? '退款金额不能大于余额' : value < 0.01 ? '金额不得小于0.01' : undefined)
89
-
90
-                                    }
91
-                                }
92
-                                ],
93
-                            })(<Input type='number' placeholder="支持2位小数" addonAfter="元" />)}
94
-                        </Form.Item>
95
-                        <div style={{ marginBottom: '25px' }}><span style={{ width: '25%', display: 'inline-block', textAlign: 'right' }}>余额:</span>{balance}元</div> */}
96 77
                         <Form.Item label="退款凭证">
97 78
 
98
-                            <span>{props.amount}</span>
79
+                            <span>{regFenToYuan(props.amount)}元</span>
99 80
 
100 81
                         </Form.Item>
101 82
                         <Form.Item label="退款凭证" help="可上传银行转账截图、微信退款订单等截图作为查账线索">