浏览代码

客户资料

周立森 5 年前
父节点
当前提交
deef2bc894
共有 5 个文件被更改,包括 226 次插入18 次删除
  1. 6
    0
      config/routes.js
  2. 74
    8
      src/pages/system/document/audit.jsx
  3. 63
    10
      src/pages/system/document/list.jsx
  4. 64
    0
      src/pages/system/document/see.jsx
  5. 19
    0
      src/services/apis.js

+ 6
- 0
config/routes.js 查看文件

@@ -424,6 +424,12 @@ export default [
424 424
                 hideInMenu: true,
425 425
                 component: './system/document/audit',
426 426
               },
427
+              {
428
+                path: '/system/document/see',
429
+                name: '客户资料查看',
430
+                hideInMenu: true,
431
+                component: './system/document/see',
432
+              },
427 433
             ],
428 434
           },
429 435
           {

+ 74
- 8
src/pages/system/document/audit.jsx 查看文件

@@ -1,22 +1,88 @@
1
-import React from 'react'
2
-import { Col, Row, Button } from 'antd'
1
+import React, { useState, useEffect } from 'react';
2
+import { Col, Row, Button, Modal} from 'antd'
3 3
 import ZmageImg from '../../../components/ZmageImg/ZmageImg'
4
+import request from '../../../utils/request';
5
+import apis from '../../../services/apis';
6
+import { router } from 'umi';
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
+  }, [])
17
+// , documentVerifyId: documentVerifyId
18
+  function getList (params) {
19
+    // 网路请求
20
+    console.log(props,'1111')
21
+    request({ ...apis.system.documentVerifyDetail, urlData:{ id:documentVerifyId }  }).then(data => {
22
+      console.log('data:', data.imgList)
23
+      setData(data.imgList)
24
+    }).catch(err => {
25
+      // eslint-disable-next-line no-unused-expressions
26
+
27
+    })
28
+  }
29
+  
30
+  function onVerify (params) {
31
+
32
+    alert(params)
33
+    // 网路请求
34
+    request({ ...apis.system.updateTaPolicy, urlData:{ id:documentVerifyId }, data:  {  verifyStatus: params}  }).then(data => {
35
+    
36
+    }).catch(err => {
37
+      // eslint-disable-next-line no-unused-expressions
38
+
39
+    })
40
+  }
41
+
42
+
43
+
44
+  const handleOk =  () => {
45
+    Modal.confirm({
46
+      title: '审核通过后,将给当前用户发放积分 确认审核通过?',
47
+      okText: '确认',
48
+      cancelText: '取消',
49
+      onOk() {
50
+       
51
+        onVerify(2)
52
+      }
53
+    });
54
+  }
55
+
56
+  const cancelPage = () =>{
57
+    router.push({
58
+      pathname: '/system/document/list',
59
+    });
60
+  }
4 61
 
5
-function body(props) {
6 62
   return (
7 63
     <>
8 64
       <div style={{ background: '#ECECEC', padding: '30px' }}>
9 65
         <Row gutter={16}>
10
-          <Col span={6}>
11
-            <ZmageImg style={{ width: '300px', height: '400px' }} src="https://estateagents.oss-cn-shanghai.aliyuncs.com/miniapp/upload/images/1571303731819-1.jpg" />
12
-          </Col>
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
+          }
13 74
         </Row>
14 75
       </div>
15 76
       <div style={{ marginTop: '10px', display: 'flex', justifyContent: 'center' }}>
16
-        <Button type="primary">通过</Button>
77
+        <Button type="primary" onClick={()=>handleOk()}>通过</Button>
78
+        &nbsp;&nbsp;&nbsp;&nbsp;
79
+        <Button onClick={()=>onVerify(2)}>不通过</Button>
17 80
         &nbsp;&nbsp;&nbsp;&nbsp;
18
-        <Button>不通过</Button>
81
+        <Button onClick={cancelPage}>返回</Button>
82
+        
19 83
       </div>
84
+     
85
+      
20 86
     </>
21 87
   )
22 88
 }

+ 63
- 10
src/pages/system/document/list.jsx 查看文件

@@ -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
 }

+ 64
- 0
src/pages/system/document/see.jsx 查看文件

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

+ 19
- 0
src/services/apis.js 查看文件

@@ -607,6 +607,25 @@ export default {
607 607
       method: 'POST',
608 608
       action: 'admin.taBuildingReport.add.post',
609 609
     },
610
+
611
+    documentVerifylist:{
612
+      url: `${prefix}/documentVerify`,
613
+      method: 'GET',
614
+      action: 'admin.documentVerify.get',
615
+    },
616
+    documentVerifyDetail:{
617
+      url: `${prefix}/documentVerify/:id`,
618
+      method: 'GET',
619
+      action: 'admin.documentVerify.id.get',
620
+    },
621
+    updateTaPolicy: {
622
+      url: `${prefix}/documentVerify/:id`,
623
+      method: 'PUT',
624
+      action: 'admin.documentVerify.id.put',
625
+    },
626
+// /admin/documentVerify  查询审核列表,参数 pageNum, pageSize, name, tel
627
+// /documentVerify/{id}   根据id查询详情
628
+// /admin/documentVerify/{id} 根据Id修改
610 629
   },
611 630
   staff: {
612 631
     taUser: {