|
@@ -1,92 +1,188 @@
|
1
|
1
|
import React, { useState, useEffect } from 'react';
|
2
|
|
-import { Col, Row, Button, Modal } from 'antd'
|
|
2
|
+import { Col, Row, Button, Modal, Input } from 'antd'
|
3
|
3
|
import ZmageImg from '../../../components/ZmageImg/ZmageImg'
|
4
|
4
|
import request from '../../../utils/request';
|
5
|
5
|
import apis from '../../../services/apis';
|
6
|
6
|
import { router } from 'umi';
|
7
|
7
|
import AuthButton from '../../../components/AuthButton';
|
|
8
|
+import moment from 'moment';
|
8
|
9
|
|
9
|
10
|
function body (props) {
|
10
|
11
|
const documentVerifyId = props.location.query.id
|
11
|
12
|
const [data, setData] = useState([])
|
12
|
13
|
|
|
14
|
+ // const [status,setStatus] = useState()
|
13
|
15
|
useEffect(() => {
|
14
|
16
|
getList()
|
15
|
|
-
|
|
17
|
+ // setVisible(false)
|
|
18
|
+ // setReasonValue()
|
|
19
|
+ // useState(2)
|
16
|
20
|
}, [])
|
17
|
21
|
// , documentVerifyId: documentVerifyId
|
18
|
22
|
function getList (params) {
|
19
|
23
|
// 网路请求
|
20
|
24
|
console.log(props, '1111')
|
21
|
25
|
request({ ...apis.system.documentVerifyDetail, urlData: { id: documentVerifyId } }).then(data => {
|
22
|
|
- console.log('data:', data)
|
23
|
|
- setData(data.imgList)
|
|
26
|
+ console.log('data:', data.records)
|
|
27
|
+
|
|
28
|
+ setData(data.records)
|
24
|
29
|
}).catch(err => {
|
25
|
30
|
// eslint-disable-next-line no-unused-expressions
|
26
|
31
|
|
27
|
32
|
})
|
28
|
33
|
}
|
29
|
34
|
|
30
|
|
- function onVerify (params) {
|
31
|
|
- // 网路请求
|
32
|
|
- request({ ...apis.system.updateVerify, urlData: { id: documentVerifyId }, data: { verifyStatus: params } }).then(data => {
|
33
|
35
|
|
34
|
|
- }).catch(err => {
|
35
|
|
- // eslint-disable-next-line no-unused-expressions
|
36
|
36
|
|
37
|
|
- })
|
|
37
|
+ const cancelPage = () => {
|
|
38
|
+ router.push({
|
|
39
|
+ pathname: '/system/document/list',
|
|
40
|
+ });
|
38
|
41
|
}
|
39
|
42
|
|
40
|
43
|
|
|
44
|
+ const Card = (props) => {
|
|
45
|
+ const [visible, setVisible] = useState()
|
|
46
|
+ const [reasonValue, setReasonValue] = useState('')
|
|
47
|
+ useEffect(() => {
|
|
48
|
+ setVisible(false)
|
|
49
|
+ }, [])
|
|
50
|
+
|
41
|
51
|
|
42
|
|
- const handleOk = () => {
|
|
52
|
+ function onVerify (params) {
|
|
53
|
+ // 网路请求
|
|
54
|
+ console.log(reasonValue, "111212")
|
|
55
|
+ request({ ...apis.system.updateVerify, urlData: { id: props.data.documentVerifyId }, data: { verifyStatus: params, rejectReason: reasonValue } }).then(data => {
|
|
56
|
+ console.log(data, "datadata")
|
|
57
|
+ getList()
|
|
58
|
+ }).catch(err => {
|
43
|
59
|
|
44
|
60
|
|
45
|
|
- Modal.confirm({
|
46
|
|
- title: '审核通过后,将给当前用户发放积分 确认审核通过?',
|
47
|
|
- okText: '确认',
|
48
|
|
- cancelText: '取消',
|
49
|
|
- onOk () {
|
|
61
|
+ })
|
|
62
|
+ }
|
50
|
63
|
|
51
|
|
- onVerify(1)
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+ const handleOk = (data) => {
|
|
67
|
+
|
|
68
|
+ if (data == 1) {
|
|
69
|
+ Modal.confirm({
|
|
70
|
+ title: '审核通过后,将给当前用户发放积分 确认审核通过?',
|
|
71
|
+ okText: '确认',
|
|
72
|
+ cancelText: '取消',
|
|
73
|
+ onOk () {
|
|
74
|
+
|
|
75
|
+ onVerify(1)
|
|
76
|
+ }
|
|
77
|
+ });
|
|
78
|
+ } else {
|
|
79
|
+ setVisible(true)
|
52
|
80
|
}
|
53
|
|
- });
|
54
|
|
- }
|
|
81
|
+ }
|
55
|
82
|
|
56
|
|
- const cancelPage = () => {
|
57
|
|
- router.push({
|
58
|
|
- pathname: '/system/document/list',
|
59
|
|
- });
|
|
83
|
+ const showModal = () => {
|
|
84
|
+ setVisible(true)
|
|
85
|
+ };
|
|
86
|
+
|
|
87
|
+ const handleOk1 = e => {
|
|
88
|
+ console.log(e);
|
|
89
|
+ onVerify(2)
|
|
90
|
+
|
|
91
|
+ setVisible(false)
|
|
92
|
+
|
|
93
|
+ };
|
|
94
|
+
|
|
95
|
+ const handleCancel = e => {
|
|
96
|
+
|
|
97
|
+ setVisible(false)
|
|
98
|
+ };
|
|
99
|
+
|
|
100
|
+ const Reason = e => {
|
|
101
|
+ console.log(e.target.value)
|
|
102
|
+ // e.target.
|
|
103
|
+ setReasonValue(e.target.value)
|
|
104
|
+ }
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+ console.log("props", props.data)
|
|
108
|
+ const carddata = props.data.imgList
|
|
109
|
+ return (
|
|
110
|
+ <>
|
|
111
|
+ <div style={{ background: '#ffffff', padding: '40px', marginTop: '30px',borderRadius: '12px', boxShadow: '0px 0px 16px 2px rgba(0,0,0,0.12)'}}>
|
|
112
|
+ <p style={{ fontSize: '0.096rem'}}>
|
|
113
|
+ <span>资料说明:{props.data.documentTitle} </span>
|
|
114
|
+ <span>提交时间:{moment(props.data.createDate).format('YYYY-MM-DD')} </span>
|
|
115
|
+ <span style={{ float: "right", fontWeight: "bold", marginRight: '30px' }} className={props.data.verifyStatus == 0 ? "unaudited" : props.data.verifyStatus == 1 ? "auditPass" : "noauditPass"} >
|
|
116
|
+ {props.data.verifyStatus == 0 ? "待审核" : props.data.verifyStatus == 1 ? "审核通过" : "不通过"}
|
|
117
|
+ </span>
|
|
118
|
+ </p>
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+ <div style={{ fontSize: '0.096rem'}}>资料图片:
|
|
122
|
+ <Row gutter={16}>
|
|
123
|
+ {
|
|
124
|
+ // data.consultant && data.consultant.projects.map((item, _) => <span>{item}</span>)
|
|
125
|
+ carddata.map((data, inx) =>
|
|
126
|
+ <Col span={4} style={{ textAlign: "center" }}>
|
|
127
|
+ <ZmageImg style={{ width: '128px', height: '128px', marginTop: '30px' }} src={data.img} />
|
|
128
|
+ </Col>
|
|
129
|
+ )
|
|
130
|
+ }
|
|
131
|
+ </Row>
|
|
132
|
+ </div>
|
|
133
|
+ {props.data.verifyStatus == 0 && <div style={{ marginTop: '10px', display: 'flex', justifyContent: 'center' }}>
|
|
134
|
+ <AuthButton name="admin.documentVerify.id.put" noRight={null}>
|
|
135
|
+ <Button type="primary" onClick={() => handleOk(1)}>通过</Button>
|
|
136
|
+ </AuthButton>
|
|
137
|
+
|
|
138
|
+ <AuthButton name="admin.documentVerify.id.put" noRight={null}>
|
|
139
|
+ <Button onClick={() => handleOk(2)}>不通过</Button>
|
|
140
|
+ </AuthButton>
|
|
141
|
+ {/*
|
|
142
|
+ <Button onClick={cancelPage}>返回</Button> */}
|
|
143
|
+
|
|
144
|
+ </div>}
|
|
145
|
+ <Modal
|
|
146
|
+ title="驳回原因"
|
|
147
|
+ visible={visible}
|
|
148
|
+ onOk={handleOk1}
|
|
149
|
+ onCancel={handleCancel}
|
|
150
|
+ okText="确认"
|
|
151
|
+ cancelText="取消"
|
|
152
|
+ >
|
|
153
|
+ <Input value={reasonValue} onChange={e => Reason(e)} />
|
|
154
|
+ </Modal>
|
|
155
|
+ </div>
|
|
156
|
+
|
|
157
|
+ </>
|
|
158
|
+ )
|
|
159
|
+ // return <div>111</div>
|
60
|
160
|
}
|
61
|
161
|
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
|
62
|
165
|
return (
|
63
|
166
|
<>
|
64
|
|
- <div style={{ background: '#ECECEC', padding: '30px' }}>
|
65
|
|
- <Row gutter={16}>
|
66
|
|
- {
|
67
|
|
- // data.consultant && data.consultant.projects.map((item, _) => <span>{item}</span>)
|
68
|
|
- data.map((data, inx) =>
|
69
|
|
- <Col span={6}>
|
70
|
|
- <ZmageImg style={{ width: '300px', height: '400px' }} src={data.img} />
|
71
|
|
- </Col>
|
72
|
|
- )
|
73
|
|
- }
|
74
|
|
- </Row>
|
75
|
|
- </div>
|
76
|
|
- <div style={{ marginTop: '10px', display: 'flex', justifyContent: 'center' }}>
|
77
|
|
- <AuthButton name="admin.documentVerify.id.put" noRight={null}>
|
78
|
|
- <Button type="primary" onClick={() => handleOk()}>通过</Button>
|
79
|
|
- </AuthButton>
|
80
|
|
-
|
81
|
|
- <AuthButton name="admin.documentVerify.id.put" noRight={null}>
|
82
|
|
- <Button onClick={() => onVerify(2)}>不通过</Button>
|
83
|
|
- </AuthButton>
|
84
|
|
-
|
85
|
|
- <Button onClick={cancelPage}>返回</Button>
|
|
167
|
+ {/* <div>111</div> */}
|
|
168
|
+ <div>{console.log("data1", data)}
|
|
169
|
+ {
|
|
170
|
+ // data.consultant && data.consultant.projects.map((item, _) => <span>{item}</span>)
|
|
171
|
+ data.map((data, inx) =>
|
|
172
|
+
|
|
173
|
+ <Card data={data}></Card>
|
|
174
|
+ // <Col span={6}>
|
|
175
|
+ // <ZmageImg style={{ width: '300px', height: '400px' }} src={data.img} />
|
|
176
|
+ // </Col>
|
|
177
|
+ )
|
|
178
|
+ }
|
|
179
|
+ {/* <Card data = {data.records}></Card> */}
|
86
|
180
|
|
87
|
181
|
</div>
|
88
|
182
|
|
89
|
183
|
|
|
184
|
+
|
|
185
|
+
|
90
|
186
|
</>
|
91
|
187
|
)
|
92
|
188
|
}
|