dingxin 5 years ago
parent
commit
4ebd047054

+ 11
- 0
config/routes.js View File

@@ -123,6 +123,11 @@ export default [
123 123
                 name: '经纪人',
124 124
                 component: './customer/independentList/index',
125 125
               },
126
+              {
127
+                path: '/customer/visiting',
128
+                name: '到访记录',
129
+                component: './customer/visiting/index',
130
+              },
126 131
             ],
127 132
           },
128 133
           {
@@ -419,6 +424,12 @@ export default [
419 424
                 hideInMenu: true,
420 425
                 component: './system/document/audit',
421 426
               },
427
+              {
428
+                path: '/system/document/see',
429
+                name: '客户资料查看',
430
+                hideInMenu: true,
431
+                component: './system/document/see',
432
+              },
422 433
             ],
423 434
           },
424 435
           {

+ 169
- 0
src/pages/customer/visiting/index.jsx View File

@@ -0,0 +1,169 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Table, Avatar } from 'antd';
3
+import moment from 'moment';
4
+import request from '../../../utils/request';
5
+import apis from '../../../services/apis';
6
+import Styles from './style.less';
7
+import BuildSelect from '../../../components/SelectButton/BuildSelect'
8
+import AuthButton from '@/components/AuthButton';
9
+
10
+const columns = [
11
+  {
12
+    title: '头像',
13
+    dataIndex: 'picture',
14
+    key: 'picture',
15
+    align: 'center',
16
+    width: '15%',
17
+    render: (_, record) => <Avatar shape="square"  size={64} icon="user" />,
18
+  },
19
+  {
20
+    title: '姓名',
21
+    dataIndex: 'name',
22
+    key: 'name',
23
+    align: 'center',
24
+    width: '10%',
25
+    // eslint-disable-next-line no-nested-ternary
26
+    // render: (_, record) => <><span>{customerType === 'private' ? record.name : record.nickname}</span></>,
27
+  },
28
+  {
29
+    title: '电话',
30
+    dataIndex: 'phone',
31
+    key: 'phone',
32
+    align: 'center',
33
+    width: '15%',
34
+  },
35
+  {
36
+    title: '性别',
37
+    dataIndex: 'sex',
38
+    key: 'sex',
39
+    align: 'center',
40
+    width: '15%',
41
+  },
42
+  {
43
+    title: '置业顾问',
44
+    dataIndex: 'asdf',
45
+    key: 'asdf',
46
+    align: 'center',
47
+    width: '15%',
48
+  },
49
+  {
50
+    title: '置业顾问电话',
51
+    dataIndex: 'tel',
52
+    key: 'tel',
53
+    align: 'center',
54
+    width: '15%',
55
+  },
56
+  {
57
+    title: '到访时间',
58
+    dataIndex: 'time',
59
+    key: 'time',
60
+    align: 'center',
61
+    width: '15%',
62
+  },
63
+]
64
+
65
+const data = [
66
+
67
+]
68
+
69
+function onChangetime(dates, dateStrings) {
70
+ 
71
+  // setEndDate(dateStrings[1])
72
+  // setStartDate(dateStrings[0])
73
+  
74
+}
75
+
76
+function exportReport() {
77
+  // request({ ...apis.customer.customerRecommendReportExport, responseType: 'blob' })
78
+  //   .then(response => {
79
+  //     download(response)
80
+  //   })
81
+}
82
+
83
+
84
+
85
+
86
+
87
+
88
+
89
+function body (props) {
90
+  const { getFieldDecorator, getFieldsValue } = props.form
91
+  const { RangePicker } = DatePicker;
92
+
93
+  function handleReset() {
94
+    props.form.resetFields();
95
+    // getList({ pageNumber: 1, pageSize: 10, customerType })
96
+  }
97
+
98
+  function handleSubmit(e) {
99
+ 
100
+  }
101
+
102
+  // 分页
103
+  function onChange(pageNum) {
104
+   
105
+    // getList({ pageNumber: pageNum, pageSize: 9 })
106
+  }
107
+
108
+  return (
109
+    <>
110
+    <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
111
+       <Form.Item>
112
+          {getFieldDecorator('buildingId')(
113
+            <BuildSelect />,
114
+          )}
115
+        </Form.Item>
116
+       
117
+        <Form.Item>
118
+          {getFieldDecorator('name')(
119
+            <Input
120
+              prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
121
+              placeholder="姓名"
122
+            />,
123
+          )}
124
+        </Form.Item>
125
+        <Form.Item>
126
+          {getFieldDecorator('tel')(
127
+            <Input
128
+              prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
129
+              placeholder="电话"
130
+            />,
131
+          )}
132
+        </Form.Item>
133
+        
134
+         <Form.Item label="到访时间">
135
+          { getFieldDecorator('time')(
136
+            <RangePicker
137
+            style={{ width: '400px' }}
138
+            // placeholder="到访时间"
139
+            // ranges={{
140
+            //   Today: [moment(), moment()],
141
+            //   'This Month': [moment().startOf('month'), moment().endOf('month')],
142
+            // }}
143
+            // defaultValue={[moment(new Date(new Date().setDate((new Date().getDate() - 6))), 'YYYY-MM-DD HH:MM:SS'), moment(new Date(), 'YYYY-MM-DD HH:MM:SS')]}
144
+            showTime
145
+            onChange={onChangetime}
146
+          />
147
+          )}
148
+        </Form.Item>
149
+        <Form.Item>
150
+            <Button type="primary" htmlType="submit" >
151
+              查询
152
+            </Button>
153
+            <Button style={{ marginLeft: 8 }} onClick={handleReset}>
154
+              重置
155
+            </Button>
156
+        </Form.Item>
157
+      </Form>
158
+      <Button type="primary" onClick={() => exportReport()} style={{ float: 'right', margin: '20px 0', zIndex: 1 }}>
159
+        导出
160
+      </Button>
161
+
162
+      <Table dataSource={data} columns={columns} pagination={{ total: 1, onChange }} />
163
+      {/* pagination={{ total: dataSource.total, onChange }} */}
164
+    </>
165
+  );
166
+}
167
+const WrappedBody = Form.create({ name: 'body' })(body);
168
+
169
+export default WrappedBody

+ 151
- 0
src/pages/customer/visiting/style.less View File

@@ -0,0 +1,151 @@
1
+.SubmitButton {
2
+  background: rgba(239,39,58,1);
3
+  border-radius: 7px;
4
+  border: 0px;
5
+}
6
+.text {
7
+  color: rgba(239,39,58,1);
8
+}
9
+.SelectFrom {
10
+  width: 180px;
11
+  background: #ffffff;
12
+  border-radius: 7px;
13
+  border: 1px solid #dbdbdb;
14
+}
15
+.addButton {
16
+  background: #50be00;
17
+  border-radius: 4px;
18
+  border: 0px;
19
+  margin: 10px 0px;
20
+}
21
+.cardText {
22
+  color: #333;
23
+  display: flex;
24
+  align-items: center;
25
+  position: relative;
26
+  line-height: 1.5;
27
+  font-size: 0.106rem;
28
+  margin-bottom: 0.08rem;
29
+
30
+}
31
+.cardItem{
32
+  color: #666;
33
+  display: flex;
34
+  align-items: center; 
35
+  line-height: 1.5;
36
+  font-size: 0.106rem;
37
+  margin-bottom: 0.08rem; 
38
+}
39
+.ediText {
40
+  font-size: 0.106rem;
41
+  color: #ff925c;
42
+  line-height: 24px;
43
+  position: absolute;
44
+  right: 0;
45
+}
46
+.title{
47
+  display: inline-block;
48
+  width:  0.54rem;
49
+  justify-content: space-between;
50
+  text-align: justify;
51
+  text-align-last:justify
52
+}
53
+
54
+.address { 
55
+  width: 400px;
56
+  height: 24px; 
57
+  text-overflow: ellipsis; 
58
+  white-space: nowrap;
59
+  overflow: hidden;
60
+}
61
+
62
+.pitchButton { 
63
+  border-color: rgba(255,126,72,1);
64
+  background-color: rgba(255,126,72,1);
65
+  color: rgba(255,255,255,1); 
66
+}
67
+.noButton {
68
+  border-color: rgba(255,126,72,1);
69
+  color: rgba(255,126,72,1);
70
+}
71
+.displayS {
72
+  display: none;
73
+}
74
+
75
+
76
+// 客户详情样式
77
+.cardBox{
78
+  display: flex;
79
+  .leftBox{
80
+    width:342px;
81
+    min-width:342px;
82
+    height:511px;
83
+    background:rgba(255,255,255,1);
84
+    box-shadow:0px 0px 16px 2px rgba(0,0,0,0.12);
85
+    border-radius:8px;
86
+    display: inline-block;
87
+    margin-right: 30px;
88
+    padding: 30px;
89
+    overflow: hidden;
90
+  }
91
+  .rightBox{
92
+    width:-webkit-fill-available;
93
+    height:511px;
94
+    min-width: 800px;
95
+    background:rgba(255,255,255,1);
96
+    box-shadow:0px 0px 16px 2px rgba(0,0,0,0.12);
97
+    border-radius:8px;
98
+    display: inline-block;
99
+    padding: 30px;
100
+    overflow: hidden;
101
+    position: relative;
102
+  }
103
+  .tit{
104
+    font-size:24px;
105
+    font-weight:600;
106
+    color:#222;
107
+    margin: 10px 0 0 0;
108
+  }
109
+  .touxiang{
110
+    width: 120px;
111
+    width: 120px;
112
+    border-radius: 6px;
113
+    margin: 30px 0 20px 0;
114
+  }
115
+  .infoItem{
116
+    color:#666;
117
+    font-size: 19px;
118
+    margin: 0 0 10px 0;
119
+    
120
+  }
121
+  .rightItem{
122
+    color:#666;
123
+    font-size: 19px;
124
+    margin: 0 0 15px 0;
125
+  }
126
+  .right{
127
+    position: absolute;
128
+    top:108px;
129
+    left:170px;
130
+  }
131
+  .rightInfo{
132
+    position: absolute;
133
+    top:50px;
134
+    left:50%;
135
+  }
136
+  
137
+}
138
+.recordBox{
139
+  width:100%;
140
+  background:rgba(255,255,255,1);
141
+  box-shadow:0px 0px 16px 2px rgba(0,0,0,0.12);
142
+  border-radius:8px;
143
+  margin-top: 30px;
144
+  padding: 30px;
145
+  .tableName{
146
+    font-size:24px;
147
+    font-weight:600;
148
+    color:#222;
149
+  }
150
+}
151
+

+ 74
- 8
src/pages/system/document/audit.jsx View File

@@ -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 View File

@@ -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 View File

@@ -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 View File

@@ -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: {