周立森 5 lat temu
rodzic
commit
6ba5396071

+ 141
- 45
src/pages/system/document/audit.jsx Wyświetl plik

@@ -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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
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
+            &nbsp;&nbsp;&nbsp;&nbsp;
138
+        <AuthButton name="admin.documentVerify.id.put" noRight={null}>
139
+              <Button onClick={() => handleOk(2)}>不通过</Button>
140
+            </AuthButton>
141
+            {/* &nbsp;&nbsp;&nbsp;&nbsp;
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
-        &nbsp;&nbsp;&nbsp;&nbsp;
81
-        <AuthButton name="admin.documentVerify.id.put" noRight={null}>
82
-          <Button onClick={() => onVerify(2)}>不通过</Button>
83
-        </AuthButton>
84
-        &nbsp;&nbsp;&nbsp;&nbsp;
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
 }

+ 21
- 22
src/pages/system/document/list.jsx Wyświetl plik

@@ -56,23 +56,14 @@ function body(props) {
56 56
   }
57 57
 
58 58
   function audit(record){
59
-    if(record.verifyStatus === 0){
59
+    
60 60
       router.push({
61 61
         pathname: '/system/document/audit',
62 62
         query: {
63
-          id: record.documentVerifyId,
63
+          id: record.personId,
64 64
         },
65 65
       })
66
-    }
67
-  else{
68
-    router.push({
69
-      pathname: '/system/document/see',
70
-      query: {
71
-        id: record.documentVerifyId,
72
-      },
73
-    })
74
-      
75
-    }
66
+   
76 67
   }
77 68
 
78 69
   const columns = [
@@ -80,34 +71,42 @@ function body(props) {
80 71
       title: '姓名',
81 72
       dataIndex: 'name',
82 73
       key: 'name',
74
+      align: 'center',
83 75
     },
84 76
     {
85 77
       title: '手机号',
86 78
       dataIndex: 'tel',
87 79
       key: 'tel',
80
+      align: 'center',
88 81
     },
89 82
     {
90 83
       title: '提交时间',
91 84
       dataIndex: 'createDate',
92 85
       key: 'createDate',
86
+      align: 'center',
93 87
       render: (createDate) => moment(createDate).format('YYYY-MM-DD')
94 88
     },
89
+
95 90
     {
96
-      title: '状态',
97
-      dataIndex: 'verifyStatus',
98
-      key: 'verifyStatus',
99
-      render: (x,row) => (
100
-        <>
101
-         
102
-            <span style={{ cursor: 'pointer' }}>{ row.verifyStatus === 0 ? '未审核' : row.verifyStatus === 1 ? '审核通过' : '审核未通过' }</span>
103
-           
104
-        </>
105
-      )
91
+      title: '已审核数',
92
+      dataIndex: 'totalSummit',
93
+      key: 'totalSummit',
94
+      align: 'center',
106 95
     },
96
+
97
+    {
98
+      title: '未审核数',
99
+      dataIndex: 'unverified',
100
+      key: 'unverified',
101
+      align: 'center',
102
+    },
103
+
104
+   
107 105
     {
108 106
       title: '操作',
109 107
       dataIndex: 'documentVerifyId',
110 108
       key: 'documentVerifyId',
109
+      align: 'center',
111 110
       render: (x,row) => (
112 111
         <>
113 112
           <AuthButton name="admin.documentVerify.id.get" noRight={null}>

+ 0
- 62
src/pages/system/document/see.jsx Wyświetl plik

@@ -1,62 +0,0 @@
1
-import React, { useState, useEffect } from 'react';
2
-import { Col, Row, Button, Modal } from 'antd'
3
-import { router } from 'umi';
4
-import ZmageImg from '../../../components/ZmageImg/ZmageImg'
5
-import request from '../../../utils/request';
6
-import apis from '../../../services/apis';
7
-
8
-
9
-function body (props) {
10
-  const documentVerifyId = props.location.query.id
11
-  const [data, setData] = useState([])
12
-
13
-  useEffect(() => {
14
-    getList()
15
-  }, [])
16
-// , documentVerifyId: documentVerifyId
17
-  function getList (_params) {
18
-    // 网路请求
19
-    console.log(props, '1111')
20
-    request({ ...apis.system.documentVerifyDetail, urlData: { id: documentVerifyId } }).then(data => {
21
-      console.log('data:', data.imgList)
22
-      setData(data.imgList)
23
-    }).catch(_err => {
24
-      // eslint-disable-next-line no-unused-expressions
25
-
26
-    })
27
-  }
28
-
29
-
30
-  const cancelPage = () => {
31
-    router.push({
32
-      pathname: '/system/document/list',
33
-    });
34
-  }
35
-
36
-
37
-  return (
38
-    <>
39
-      <div style={{ background: '#ECECEC', padding: '30px' }}>
40
-        <Row gutter={16}>
41
-          {
42
-            // data.consultant && data.consultant.projects.map((item, _) => <span>{item}</span>)
43
-            data.map(item =>
44
-              <Col span={6} key={item.documentImgId}>
45
-               <ZmageImg style={{ width: '300px', height: '400px' }} src={item.img} />
46
-              </Col>,
47
-            )
48
-          }
49
-        </Row>
50
-      </div>
51
-      <div style={{ marginTop: '10px', display: 'flex', justifyContent: 'center' }}>
52
-
53
-        <Button onClick={cancelPage}>返回</Button>
54
-
55
-      </div>
56
-
57
-
58
-    </>
59
-  )
60
-}
61
-
62
-export default body