|
@@ -1,5 +1,5 @@
|
1
|
1
|
import React, { PureComponent, useState, useEffect } from 'react'
|
2
|
|
-import { Modal, Row, Col, Table, Pagination, Button, Form, Input,message } from 'antd'
|
|
2
|
+import { Modal, Row, Col, Table, Pagination, Button, Form, Input, message, Select } from 'antd'
|
3
|
3
|
import EnDash from '../EnDash'
|
4
|
4
|
import AuthButton from '@/components/AuthButton';
|
5
|
5
|
|
|
@@ -10,13 +10,58 @@ import request from '../../../../../../utils/request';
|
10
|
10
|
|
11
|
11
|
const Refund = props => {
|
12
|
12
|
const raiseRecordId = props.raiseRecordId;
|
|
13
|
+ const raiseId = props.raiseId;
|
|
14
|
+ const [data, setData] = useState([])
|
13
|
15
|
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+ useEffect(() => {
|
|
19
|
+ getList();
|
|
20
|
+ }, [props,raiseRecordId])
|
|
21
|
+
|
|
22
|
+ function getList(params) {
|
|
23
|
+ request({
|
|
24
|
+ ...apis.house.taRaiseById,
|
|
25
|
+ urlData: { id: raiseId }
|
|
26
|
+ }).then((data) => {
|
|
27
|
+ setData(data)
|
|
28
|
+ })
|
|
29
|
+ }
|
|
30
|
+
|
|
31
|
+ function toDecimal2 (x){
|
|
32
|
+ var f = parseFloat(x);
|
|
33
|
+ if (isNaN(f)) {
|
|
34
|
+ return false;
|
|
35
|
+ }
|
|
36
|
+ var f = Math.round(x * 100) / 100;
|
|
37
|
+ var s = f.toString();
|
|
38
|
+ var rs = s.indexOf('.');
|
|
39
|
+ if (rs < 0) {
|
|
40
|
+ rs = s.length;
|
|
41
|
+ s += '.';
|
|
42
|
+ }
|
|
43
|
+ while (s.length <= rs + 2) {
|
|
44
|
+ s += '0';
|
|
45
|
+ }
|
|
46
|
+ return s;
|
|
47
|
+ }
|
|
48
|
+ function regFenToYuan(fen){
|
|
49
|
+ var num = fen;
|
|
50
|
+ num = fen * 0.01;
|
|
51
|
+ num += '';
|
|
52
|
+ var reg = num.indexOf('.') > -1 ? /(\d{1,3})(?=(?:\d{3})+\.)/g : /(\d{1,3})(?=(?:\d{3})+$)/g;
|
|
53
|
+ num = num.replace(reg, '$1');
|
|
54
|
+ num = toDecimal2(num)
|
|
55
|
+ return num
|
|
56
|
+ }
|
|
57
|
+
|
14
|
58
|
function handleSubmit (e) {
|
15
|
59
|
e.preventDefault();
|
16
|
60
|
props.form.validateFields((err, values) => {
|
17
|
61
|
if (!err){
|
18
|
62
|
request({ ...apis.house.refund, data: {targetId:raiseRecordId, targetType:"house", refundReason:values.refundReason}, }).then((data) => {
|
19
|
|
- message.info("操作成功")
|
|
63
|
+ console.log('caozuochgegngong')
|
|
64
|
+ message.info("操作成功,微信退费会有延迟,请在稍后查询认筹单状态")
|
20
|
65
|
props.onSuccess(false);
|
21
|
66
|
}).catch((err) => {
|
22
|
67
|
// message.info(err.msg)
|
|
@@ -31,6 +76,18 @@ const Refund = props => {
|
31
|
76
|
<>
|
32
|
77
|
<Modal footer={null} title="退款" visible={props.visible} onCancel={props.onCancel} width={600}>
|
33
|
78
|
<Form labelCol={{ span: 7 }} wrapperCol={{ span: 12 }} onSubmit={handleSubmit}>
|
|
79
|
+ <div><span>当前系统设置认筹金额:{regFenToYuan(data.raisePrice)}元</span></div>
|
|
80
|
+ <div><span>用户实付金额:{regFenToYuan(data.raisePrice)}元</span></div>
|
|
81
|
+ <div><span>即将退费金额:{regFenToYuan(data.raisePrice)}元</span></div>
|
|
82
|
+ <Form.Item label="退费方式" labelAlign='left'>
|
|
83
|
+ {getFieldDecorator('refundType', {
|
|
84
|
+ rules: [{ required: true, message: ' 退款原因' }],initialValue:'onLine'
|
|
85
|
+ })(
|
|
86
|
+ <Select style={{width: '120px'}} disabled>
|
|
87
|
+ <Option value="onLine">线上退费</Option>
|
|
88
|
+ </Select>,
|
|
89
|
+ )}
|
|
90
|
+ </Form.Item>
|
34
|
91
|
<Form.Item label="退款原因" labelAlign='left'>
|
35
|
92
|
{getFieldDecorator('refundReason', {
|
36
|
93
|
rules: [{ required: true, message: ' 退款原因' }],
|
|
@@ -42,6 +99,11 @@ const Refund = props => {
|
42
|
99
|
</Button>
|
43
|
100
|
</Form.Item>
|
44
|
101
|
</Form>
|
|
102
|
+ <div>
|
|
103
|
+ <font style={{color:'#999'}}>支持退费的认筹单:</font><br/>
|
|
104
|
+ <font style={{color:'#999'}}>1.认筹单缴费状态为已缴费且缴费结果为成功且退费状态为未退费的。</font><br/><br/>
|
|
105
|
+ <font style={{color:'#999'}}>注意:发起线上退费后需要微信和银行处理,退费是否成功结果请到退费记录中查看</font><br/>
|
|
106
|
+ </div>
|
45
|
107
|
</Modal>
|
46
|
108
|
</>
|
47
|
109
|
);
|