|
@@ -1,10 +1,28 @@
|
1
|
|
-import React, { useState } from 'react'
|
2
|
|
-import { Table, Form, Icon, Input, Button } from 'antd'
|
|
1
|
+import React, { useState, useEffect } from 'react'
|
|
2
|
+import { Table, Form, Icon, Input, Button, message } from 'antd'
|
|
3
|
+import request from '../../../utils/request';
|
|
4
|
+import apis from '../../../services/apis';
|
|
5
|
+import { router } from 'umi';
|
3
|
6
|
|
4
|
7
|
function body(props) {
|
5
|
8
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
6
|
9
|
const [dataSource, setDataSource] = useState({ records: [] })
|
7
|
10
|
|
|
11
|
+ useEffect(() => {
|
|
12
|
+ getList({ pageNumber: 1, pageSize: 10 })
|
|
13
|
+ }, [])
|
|
14
|
+
|
|
15
|
+ function getList(params) {
|
|
16
|
+ // 网路请求
|
|
17
|
+ request({ ...apis.system.documentVerifylist, params: { ...params } }).then(data => {
|
|
18
|
+ console.log('data:',data)
|
|
19
|
+ setDataSource(data)
|
|
20
|
+ }).catch(err => {
|
|
21
|
+ // eslint-disable-next-line no-unused-expressions
|
|
22
|
+
|
|
23
|
+ })
|
|
24
|
+ }
|
|
25
|
+
|
8
|
26
|
/**
|
9
|
27
|
* 提交
|
10
|
28
|
* @param e
|
|
@@ -12,9 +30,10 @@ function body(props) {
|
12
|
30
|
function handleSubmit(e) {
|
13
|
31
|
e.preventDefault();
|
14
|
32
|
props.form.validateFields((err, values) => {
|
15
|
|
- if (!err) {
|
16
|
|
- console.log('Received values of form: ', values);
|
17
|
|
- }
|
|
33
|
+ getList({ pageNumber: 1, pageSize: 10, ...values})
|
|
34
|
+ // if (!err) {
|
|
35
|
+ // console.log('Received values of form: ', values);
|
|
36
|
+ // }
|
18
|
37
|
});
|
19
|
38
|
}
|
20
|
39
|
|
|
@@ -34,6 +53,26 @@ function body(props) {
|
34
|
53
|
props.form.resetFields();
|
35
|
54
|
}
|
36
|
55
|
|
|
56
|
+ function audit(record){
|
|
57
|
+ if(record.verifyStatus === 0){
|
|
58
|
+ router.push({
|
|
59
|
+ pathname: '/system/document/audit',
|
|
60
|
+ query: {
|
|
61
|
+ id: record.documentVerifyId,
|
|
62
|
+ },
|
|
63
|
+ })
|
|
64
|
+ }
|
|
65
|
+ else{
|
|
66
|
+ router.push({
|
|
67
|
+ pathname: '/system/document/see',
|
|
68
|
+ query: {
|
|
69
|
+ id: record.documentVerifyId,
|
|
70
|
+ },
|
|
71
|
+ })
|
|
72
|
+
|
|
73
|
+ }
|
|
74
|
+ }
|
|
75
|
+
|
37
|
76
|
const columns = [
|
38
|
77
|
{
|
39
|
78
|
title: '姓名',
|
|
@@ -52,13 +91,27 @@ function body(props) {
|
52
|
91
|
},
|
53
|
92
|
{
|
54
|
93
|
title: '状态',
|
55
|
|
- dataIndex: 'status',
|
56
|
|
- key: 'status',
|
|
94
|
+ dataIndex: 'verifyStatus',
|
|
95
|
+ key: 'verifyStatus',
|
|
96
|
+ render: (x,row) => (
|
|
97
|
+ <>
|
|
98
|
+
|
|
99
|
+ <span style={{ cursor: 'pointer' }}>{ row.verifyStatus === 0 ? '未审核' : row.verifyStatus === 1 ? '审核通过' : '审核未通过' }</span>
|
|
100
|
+
|
|
101
|
+ </>
|
|
102
|
+ )
|
57
|
103
|
},
|
58
|
104
|
{
|
59
|
105
|
title: '操作',
|
60
|
106
|
dataIndex: 'documentVerifyId',
|
61
|
107
|
key: 'documentVerifyId',
|
|
108
|
+ render: (x,row) => (
|
|
109
|
+ <>
|
|
110
|
+
|
|
111
|
+ <span style={{ color: '#1990FF',cursor: 'pointer' }} onClick={()=>audit(row)}>{ row.verifyStatus === 0 ? '审核' : '查看' }</span>
|
|
112
|
+
|
|
113
|
+ </>
|
|
114
|
+ )
|
62
|
115
|
},
|
63
|
116
|
]
|
64
|
117
|
|
|
@@ -67,14 +120,14 @@ function body(props) {
|
67
|
120
|
<>
|
68
|
121
|
<Form layout="inline" onSubmit={handleSubmit}>
|
69
|
122
|
<Form.Item>
|
70
|
|
- {getFieldDecorator('username')(
|
|
123
|
+ {getFieldDecorator('name')(
|
71
|
124
|
<Input
|
72
|
125
|
placeholder="用户名"
|
73
|
126
|
/>,
|
74
|
127
|
)}
|
75
|
128
|
</Form.Item>
|
76
|
129
|
<Form.Item>
|
77
|
|
- {getFieldDecorator('phone')(
|
|
130
|
+ {getFieldDecorator('tel')(
|
78
|
131
|
<Input
|
79
|
132
|
placeholder="手机号"
|
80
|
133
|
/>,
|
|
@@ -90,7 +143,7 @@ function body(props) {
|
90
|
143
|
</Button>
|
91
|
144
|
</Form.Item>
|
92
|
145
|
</Form>
|
93
|
|
- <Table dataSource={dataSource.records} pagination={{ total: dataSource.total, pageSize: dataSource.pageSize, onChange: (page, pageSize) => onPageNum(page, pageSize), defaultCurrent: 1 }} columns={columns} />
|
|
146
|
+ <Table style={{marginTop: '30px'}} dataSource={dataSource.records} pagination={{ total: dataSource.total, pageSize: dataSource.pageSize, onChange: (page, pageSize) => onPageNum(page, pageSize), defaultCurrent: 1 }} columns={columns} />
|
94
|
147
|
</>
|
95
|
148
|
)
|
96
|
149
|
}
|