李志伟 hace 3 años
padre
commit
91bf2516ac

+ 6
- 0
config/routes.js Ver fichero

@@ -215,6 +215,12 @@ export default [
215 215
         access: 'fi-withdraw',
216 216
         component: './Finance/Withdrawal',
217 217
       },
218
+      {
219
+        path: '/Finance/Withdrawal/audit.jsx',
220
+        name: '提现审批',
221
+        component: './Finance/Withdrawal/audit.jsx',
222
+        hideInMenu: true,
223
+      },
218 224
     ],
219 225
   },
220 226
   {

+ 35
- 34
src/pages/Finance/AccountLog/index.jsx Ver fichero

@@ -1,5 +1,3 @@
1
-import React, { useState, useEffect } from 'react';
2
-import { Button, Modal, Form, Select } from 'antd';
3 1
 import { PageHeaderWrapper } from '@ant-design/pro-layout';
4 2
 import moment from 'moment';
5 3
 import PageTable from '@/components/PageTable';
@@ -8,21 +6,15 @@ import { getAccountLogList } from '@/services/accountLog'
8 6
 const formatterTime = (val) => {
9 7
   return val ? moment(val).format('YYYY-MM-DD HH:mm:ss') : '';
10 8
 };
11
-const FormItem = Form.Item;
12
-const formItemLayout = { labelCol: { span: 6 }, wrapperCol: { span: 14 } };
13
-const { Option } = Select;
14 9
 
15 10
 export default (props) => {
16
-  const [show, setShow] = useState(false)
17
-  const [evaluation, setEval] = useState()
18
-  const [machineryTypeList, setMachineryTypeList] = useState([]);
19
-  const [cooperativeList, setCooperativeList] = useState([]);
20
-
21 11
   const columns = [
22 12
     {
23
-      title: '订单号',
24
-      dataIndex: 'orderNo',
25
-      key: 'orderNo',
13
+      title: '发生时间',
14
+      dataIndex: 'payDate',
15
+      key: 'payDate',
16
+      search: false,
17
+      render: (t) => formatterTime(t),
26 18
     },
27 19
     {
28 20
       title: '下单人',
@@ -35,38 +27,47 @@ export default (props) => {
35 27
       key: 'phone',
36 28
     },
37 29
     {
38
-      title: '发生时间',
39
-      dataIndex: 'payDate',
40
-      key: 'payDate',
41
-      search: false,
42
-      render: (t) => formatterTime(t),
30
+      title: '订单号',
31
+      dataIndex: 'orderNo',
32
+      key: 'orderNo',
33
+    },
34
+    {
35
+      title: '类型',
36
+      dataIndex: 'chargeType',
37
+      key: 'chargeType',
38
+      render: (_, record) => {
39
+        return record.chargeType === 'order_pay'
40
+          ? '订单收入'
41
+          : record.chargeType === 'order_refund'
42
+            ? '用户退款'
43
+            : record.chargeType === 'withdraw'
44
+              ? '提现' : ''
45
+      },
46
+      valueType: 'select',
47
+      valueEnum: {
48
+        'order_pay': { text: '订单收入' },
49
+        'order_refund': { text: '用户退款' },
50
+        'withdraw': { text: '提现' },
51
+      },
43 52
     },
44 53
     {
45 54
       title: '支付方式',
46 55
       dataIndex: 'feeType',
47 56
       key: 'feeType',
48 57
       search: false,
49
-      render: (t) => '',
50
-    },
51
-    {
52
-      title: '到账时间',
53
-      dataIndex: 'date',
54
-      key: 'date',
55
-      render: (t) => '',
56
-      search: false
57
-    },
58
-    {
59
-      title: '到账方式',
60
-      dataIndex: 'Type',
61
-      key: 'Type',
62
-      search: false,
63
-      render: (t) => '',
58
+      render: (_, record) => {
59
+        return record.chargeType === 'order_refund' ? '原路返回' :
60
+          record.chargeType === 'withdraw' ? '银行卡转账' : ''
61
+      },
64 62
     },
65 63
     {
66 64
       title: '费用',
67 65
       dataIndex: 'money',
68 66
       key: 'money',
69
-      render: (t) => t / 100,
67
+      render: (_, record) => {
68
+        return record.chargeType === 'order_pay'
69
+          ? '+' + (record.money / 100) : '-' + (record.money / 100)
70
+      },
70 71
       search: false
71 72
     },
72 73
   ];

+ 71
- 0
src/pages/Finance/Withdrawal/audit.jsx Ver fichero

@@ -0,0 +1,71 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Card, Form, Button } from 'antd';
3
+import ProCard from '@ant-design/pro-card';
4
+import { getWithdrawalDetail } from '@/services/withdrawal'
5
+import { history } from 'umi';
6
+import TextArea from 'antd/lib/input/TextArea';
7
+
8
+const FormItem = Form.Item;
9
+const formItemLayout = { labelCol: { span: 6 }, wrapperCol: { span: 14 } };
10
+const goBack = () => {
11
+  history.goBack();
12
+};
13
+export default (props) => {
14
+  const { location } = props;
15
+  const { id } = location.query;
16
+  const [withdrawal, setWithdrawal] = useState();
17
+  const [remarks, setRemarks] = useState()
18
+
19
+  useEffect(() => {
20
+    getWithdrawalDetail(id).then((res) => {
21
+      setWithdrawal(res)
22
+    }).catch((err) => {
23
+      console.log(err.message)
24
+    });
25
+  }, [id])
26
+  return (
27
+    <Card>
28
+      <ProCard tabs={{ type: 'card' }}>
29
+        <ProCard.TabPane key={1} tab="提现审批">
30
+          <Form {...formItemLayout}>
31
+            <FormItem label="申请人">
32
+              {withdrawal?.userName}
33
+            </FormItem>
34
+            <FormItem label="联系电话">
35
+              {withdrawal?.phone}
36
+            </FormItem>
37
+            <FormItem label="合作社">
38
+              {withdrawal?.orgName}
39
+            </FormItem>
40
+            <FormItem label="合作社余额">
41
+              {withdrawal?.amountLeft / 100}
42
+            </FormItem>
43
+            <FormItem label="提现银行">
44
+              {withdrawal?.bankCard.ownerBank}
45
+            </FormItem>
46
+            <FormItem label="提现账户">
47
+              {withdrawal?.bankCard.cardNo}
48
+            </FormItem>
49
+            <FormItem label="申请金额">
50
+              {withdrawal?.money / 100}
51
+            </FormItem>
52
+            <FormItem label="处理结果">
53
+              <TextArea placeholder='请输入处理结果(必填)' rows='3' style={{ width: '350px' }} value={remarks} onInput={(e) => { setRemarks(e.detail.value) }} />
54
+            </FormItem>
55
+            <FormItem label=" " colon={false}>
56
+              <Button type="primary" style={{ marginRight: '16px' }} onClick={() => goBack()}>
57
+                同意
58
+              </Button>
59
+              <Button type="primary" style={{ marginRight: '16px' }} onClick={() => goBack()}>
60
+                拒绝
61
+              </Button>
62
+              <Button type="default" onClick={() => goBack()}>
63
+                返回
64
+              </Button>
65
+            </FormItem>
66
+          </Form>
67
+        </ProCard.TabPane>
68
+      </ProCard>
69
+    </Card>
70
+  );
71
+};

+ 80
- 1
src/pages/Finance/Withdrawal/index.jsx Ver fichero

@@ -1,3 +1,82 @@
1
+import { PageHeaderWrapper } from '@ant-design/pro-layout';
2
+import { history } from 'umi';
3
+import moment from 'moment';
4
+import { Button } from 'antd'
5
+import PageTable from '@/components/PageTable';
6
+import { getWithdrawalList } from '@/services/withdrawal'
7
+
8
+const formatterTime = (val) => {
9
+  return val ? moment(val).format('YYYY-MM-DD HH:mm:ss') : '';
10
+};
11
+const goAudit = (val) => {
12
+  history.push(`./withdrawal/audit.jsx?id=${val.withdrawalId}`);
13
+}
1 14
 export default (props) => {
2
-  return <div>提现管理</div>;
15
+  const columns = [
16
+    {
17
+      title: '申请时间',
18
+      dataIndex: 'createDate',
19
+      key: 'createDate',
20
+      search: false,
21
+      render: (t) => formatterTime(t),
22
+    },
23
+    {
24
+      title: '申请人',
25
+      dataIndex: 'userName',
26
+      key: 'userName',
27
+    },
28
+    {
29
+      title: '费用',
30
+      dataIndex: 'money',
31
+      key: 'money',
32
+      render: (t) => t / 100,
33
+      search: false
34
+    },
35
+    //未审批  同意  不同意
36
+    {
37
+      title: '审批状态',
38
+      dataIndex: 'auditStatus',
39
+      key: 'auditStatus',
40
+      render: (_, record) => {
41
+        return record.auditStatus === 0 ? '未审批' :
42
+          record.auditStatus === 1 ? '未审批' : '拒绝'
43
+      },
44
+      valueType: 'select',
45
+      valueEnum: {
46
+        0: { text: '未审批' },
47
+        1: { text: '同意' },
48
+        '-1': { text: '拒绝' },
49
+      },
50
+    },
51
+    {
52
+      title: '审批时间',
53
+      dataIndex: 'postedDate',
54
+      key: 'postedDate',
55
+      search: false,
56
+      render: (t) => t != '-' ? formatterTime(t) : '-',
57
+    },
58
+    {
59
+      title: '操作',
60
+      valueType: 'option',
61
+      key: 'option',
62
+      ellipsis: true,
63
+      render: (_, record) => [
64
+        <Button style={{ padding: 0 }} type="link" key={1} onClick={() => goAudit(record)}>
65
+          审批
66
+        </Button>,
67
+      ],
68
+    },
69
+  ];
70
+
71
+  return (
72
+    <PageHeaderWrapper>
73
+      <PageTable
74
+        request={getWithdrawalList}
75
+        // expfunc={exportPersonList}
76
+        columns={columns}
77
+        rowKey="withdrawalId"
78
+        options={false}
79
+      />
80
+    </PageHeaderWrapper>
81
+  );
3 82
 };

+ 19
- 0
src/services/withdrawal.js Ver fichero

@@ -0,0 +1,19 @@
1
+import request from '@/utils/request';
2
+
3
+/**
4
+ * 审批
5
+ * @param {*} data
6
+ * @returns
7
+ */
8
+export const updateWithdrawal = (id, data) => request(`/withdrawal/${id}`, { method: 'put', data });
9
+
10
+/**
11
+ * 查询提现列表
12
+ * @param {*} params
13
+ * @returns
14
+ */
15
+export const getWithdrawalList = (params) => request('/withdrawal', { params });
16
+/**
17
+ * 查询提现详情
18
+ */
19
+export const getWithdrawalDetail = (id) => request(`/withdrawal/${id}`);