Kaynağa Gözat

客户管理部分页面

魏熙美 5 yıl önce
ebeveyn
işleme
64bb1238c4

+ 32
- 0
config/config.js Dosyayı Görüntüle

@@ -134,6 +134,38 @@ export default {
134 134
                 },
135 135
               ],
136 136
             },
137
+            {
138
+              path: '/customer',
139
+              name: '客户管理',
140
+              component: '../layouts/BlankLayout',
141
+              routes: [
142
+                {
143
+                  path: '/customer/drift/list',
144
+                  name: '游客列表',
145
+                  component: './customer/drift/index',
146
+                },
147
+                {
148
+                  path: '/customer/report/list',
149
+                  name: '报备客户',
150
+                  component: './customer/report/index',
151
+                },
152
+                {
153
+                  path: '/customer/recommendCustomer/list',
154
+                  name: '推荐客户',
155
+                  component: './customer/recommendCustomer/index',
156
+                },
157
+                {
158
+                  path: '/customer/recommendCustomer/audit',
159
+                  name: '', //审核
160
+                  component: './customer/recommendCustomer/audit',
161
+                },
162
+                {
163
+                  path: '/customer/independentList',
164
+                  name: '经济人',
165
+                  component: './customer/independentList/index',
166
+                },
167
+              ],
168
+            },
137 169
             {
138 170
               path: '/integralMall',
139 171
               name: '积分商城',

+ 66
- 0
src/pages/customer/drift/index.jsx Dosyayı Görüntüle

@@ -0,0 +1,66 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Table, Avatar, Alert } from 'antd';
3
+
4
+import request from '../../../utils/request';
5
+import apis from '../../../services/apis';
6
+
7
+function costomerDrift() {
8
+  // eslint-disable-next-line react-hooks/rules-of-hooks
9
+  const [dataSources, setDataSources] = useState({ records: [] })
10
+
11
+  // eslint-disable-next-line react-hooks/rules-of-hooks
12
+  useEffect(() => {
13
+   getList({ pageNumber: '1', pageSize: '10' })
14
+  }, [])
15
+
16
+  function getList(params) {
17
+    request({ ...apis.customer.drift, params: { ...params } }).then(res => {
18
+      setDataSources(res)
19
+    }).catch(err => {
20
+      // eslint-disable-next-line no-unused-expressions
21
+      <Alert
22
+        style={{
23
+          marginBottom: 24,
24
+        }}
25
+        message={err}
26
+        type="error"
27
+        showIcon
28
+      />
29
+    })
30
+  }
31
+
32
+  // 分页
33
+  function onChange(pageNum) {
34
+    // eslint-disable-next-line no-console
35
+    console.log('Page: ', pageNum);
36
+    getList({ pageNumber: pageNum, pageSize: 10 })
37
+  }
38
+
39
+  const columns = [
40
+    {
41
+      title: '头像',
42
+      dataIndex: 'avatarurl',
43
+      key: 'avatarurl',
44
+      render: (_, record) => <Avatar shape="square" src={record.avatarurl} size={64} icon="user" />,
45
+    },
46
+    {
47
+      title: '姓名',
48
+      dataIndex: 'nickname',
49
+      key: 'nickname',
50
+    },
51
+    {
52
+      title: '性别',
53
+      dataIndex: 'gender',
54
+      key: 'gender',
55
+      // eslint-disable-next-line no-nested-ternary
56
+      render: (_, record) => <><sapn>{ record.gender === '1' ? '男' : record.gender === '2' ? '女' : '未知' }</sapn></>,
57
+    },
58
+  ];
59
+
60
+  return (
61
+    // eslint-disable-next-line max-len
62
+    <Table dataSource={dataSources.records} columns={columns} pagination={{ total: dataSources.total, onChange }} />
63
+  )
64
+}
65
+
66
+export default costomerDrift

+ 165
- 0
src/pages/customer/independentList/index.jsx Dosyayı Görüntüle

@@ -0,0 +1,165 @@
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 { router } from 'umi';
8
+
9
+
10
+const { Option } = Select;
11
+// eslint-disable-next-line @typescript-eslint/no-unused-vars
12
+const { Meta } = Card;
13
+
14
+/**
15
+ *
16
+ *
17
+ * @param {*} props
18
+ * @returns
19
+ */
20
+function body(props) {
21
+  const { getFieldDecorator } = props.form
22
+
23
+  // eslint-disable-next-line react-hooks/rules-of-hooks
24
+  const [dataSource, setDataSource] = useState({ records: [] })
25
+
26
+  // eslint-disable-next-line react-hooks/rules-of-hooks
27
+  useEffect(() => {
28
+    getList({ pageNumber: 1, pageSize: 10 })
29
+  }, [])
30
+
31
+  function getList(params) {
32
+    // 网路请求
33
+    request({ ...apis.customer.agents, params: { ...params } }).then(res => {
34
+      setDataSource(res)
35
+    }).catch(err => {
36
+      // eslint-disable-next-line no-unused-expressions
37
+      <Alert
38
+        style={{
39
+          marginBottom: 24,
40
+        }}
41
+        message={err}
42
+        type="error"
43
+        showIcon
44
+      />
45
+    })
46
+  }
47
+
48
+  // 提交事件
49
+  function handleSubmit(e) {
50
+    e.preventDefault();
51
+    props.form.validateFields((err, values) => {
52
+      if (!err) {
53
+        getList({ pageNum: 1, pageSize: 10, ...values })
54
+      }
55
+    });
56
+  }
57
+
58
+  // Change 事件
59
+  function handleSelectChange(e) {
60
+    // eslint-disable-next-line no-console
61
+    console.log(e)
62
+  }
63
+
64
+  // 分页
65
+  function onChange(pageNum) {
66
+    // eslint-disable-next-line react-hooks/rules-of-hooks
67
+      getList({ pageNumber: pageNum, pageSize: 10 })
68
+  }
69
+
70
+  function toAudit(cuurentId) {
71
+    router.push({
72
+      pathname: '/customer/recommendCustomer/audit',
73
+      query: {
74
+        id: cuurentId,
75
+      },
76
+    })
77
+  }
78
+
79
+  const columns = [
80
+    {
81
+      title: '头像',
82
+      dataIndex: 'avatarurl',
83
+      key: 'avatarurl',
84
+      render: (_, record) => <Avatar shape="square" src={record.avatarurl} size={64} icon="user" />,
85
+    },
86
+    {
87
+      title: '姓名',
88
+      dataIndex: 'nickname',
89
+      key: 'nickname',
90
+    },
91
+    {
92
+      title: '电话',
93
+      dataIndex: 'phone',
94
+      key: 'phone',
95
+    },
96
+    {
97
+      title: '类型',
98
+      dataIndex: 'personTtype',
99
+      key: 'personType',
100
+    },
101
+    {
102
+      title: '所属渠道',
103
+      dataIndex: 'qudao',
104
+      key: 'qudao',
105
+    },
106
+    {
107
+      title: '性别',
108
+      dataIndex: 'gender',
109
+      key: 'gender',
110
+      // eslint-disable-next-line no-nested-ternary
111
+      render: (_, record) => <><sapn>{ record.gender === '1' ? '男' : record.gender === '2' ? '女' : '未知' }</sapn></>,
112
+    },
113
+    {
114
+      title: '操作',
115
+      dataIndex: 'customerId',
116
+      key: 'customerId',
117
+      render: (_, record) => (
118
+        <>
119
+          {
120
+            <>
121
+              <sapn style={{ color: 'rgba(239,39,58,1)' }}>查看详细</sapn>
122
+              &nbsp;&nbsp;&nbsp;&nbsp;
123
+              <sapn style={{ color: 'rgba(239,39,58,1)' }}>邀请经纪人</sapn>
124
+              &nbsp;&nbsp;&nbsp;&nbsp;
125
+              <sapn style={{ color: 'rgba(239,39,58,1)' }}>推荐客户</sapn>
126
+            </>
127
+          }
128
+        </>
129
+      ),
130
+    },
131
+  ]
132
+
133
+  return (
134
+    <>
135
+      <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
136
+        <Form.Item>
137
+          {getFieldDecorator('name')(
138
+            <Input
139
+              prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
140
+              placeholder="姓名"
141
+            />,
142
+          )}
143
+        </Form.Item>
144
+        <Form.Item>
145
+          {getFieldDecorator('tel')(
146
+            <Input
147
+              prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
148
+              placeholder="电话"
149
+            />,
150
+          )}
151
+        </Form.Item>
152
+        <Form.Item>
153
+          <Button type="primary" htmlType="submit" className={Styles.SubmitButton}>
154
+            搜索
155
+          </Button>
156
+        </Form.Item>
157
+      </Form>
158
+
159
+      <Table dataSource={dataSource.records} columns={columns} pagination={{ total: dataSource.total, onChange }} />
160
+    </>
161
+  );
162
+}
163
+const WrappedBody = Form.create({ name: 'body' })(body);
164
+
165
+export default WrappedBody

+ 57
- 0
src/pages/customer/independentList/style.less Dosyayı Görüntüle

@@ -0,0 +1,57 @@
1
+.SubmitButton {
2
+  background: #3a91d5;
3
+  border-radius: 7px;
4
+  border: 0px;
5
+}
6
+.SelectFrom {
7
+  width: 180px;
8
+  background: #ffffff;
9
+  border-radius: 7px;
10
+  border: 1px solid #dbdbdb;
11
+}
12
+.addButton {
13
+  background: #50be00;
14
+  border-radius: 4px;
15
+  border: 0px;
16
+  margin: 10px 0px;
17
+}
18
+.cardText {
19
+  font-size: 18px;
20
+  color: #333;
21
+  line-height: 24px;
22
+  display: flex;
23
+  align-items: center;
24
+  position: relative;
25
+
26
+}
27
+.cardItem{
28
+  font-size: 18px;
29
+  font-weight: 400;
30
+  color: #666;
31
+  line-height: 24px;
32
+  display: flex;
33
+  align-items: center;  
34
+}
35
+.ediText {
36
+  font-size: 18px;
37
+  color: #ff925c;
38
+  line-height: 24px;
39
+  position: absolute;
40
+  right: 0;
41
+}
42
+.title{
43
+  display: inline-block;
44
+  width: 84px;
45
+  justify-content: space-between;
46
+  text-align: justify;
47
+  text-align-last:justify
48
+}
49
+
50
+.address { 
51
+  width: 400px;
52
+  height: 24px; 
53
+  text-overflow: ellipsis; 
54
+  white-space: nowrap;
55
+  overflow: hidden;
56
+}
57
+

+ 201
- 0
src/pages/customer/recommendCustomer/audit.jsx Dosyayı Görüntüle

@@ -0,0 +1,201 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Table, Avatar, Radio, Upload, message } from 'antd';
3
+import ImageUpload from '../../../components/XForm/ImageUpload';
4
+import moment from 'moment';
5
+import request from '../../../utils/request';
6
+import apis from '../../../services/apis';
7
+import Styles from './style.less';
8
+import { router } from 'umi';
9
+
10
+const { Option } = Select;
11
+// eslint-disable-next-line @typescript-eslint/no-unused-vars
12
+const { Meta } = Card;
13
+
14
+const { TextArea } = Input;
15
+
16
+const tailFormItemLayout = {
17
+  labelCol: {
18
+    xs: { span: 20 },
19
+    sm: { span: 3 },
20
+  },
21
+  wrapperCol: {
22
+    xs: { span: 20 },
23
+    sm: { span: 16 },
24
+  },
25
+};
26
+
27
+function body(props) {
28
+  const { getFieldDecorator } = props.form
29
+
30
+  // eslint-disable-next-line react-hooks/rules-of-hooks
31
+  const [dataSource, setDataSource] = useState({ picture: '' })
32
+
33
+  const { id } = props.location.query;
34
+
35
+  if (id !== '') {
36
+    // eslint-disable-next-line react-hooks/rules-of-hooks
37
+    useEffect(() => {
38
+      getById(id)
39
+    }, [])
40
+  }
41
+
42
+  // 获取详情信息
43
+  function getById(currentId) {
44
+    const { url, method } = apis.customer.recommendGetById
45
+    const tempUrl = url.substring(0, url.lastIndexOf('id')).concat(currentId)
46
+
47
+    request({ url: tempUrl, method }).then(res => {
48
+      props.form.setFieldsValue(res)
49
+    })
50
+  }
51
+
52
+  function submitDate(params) {
53
+    const { url, method } = apis.customer.auto
54
+    const tempUrl = url.substring(0, url.lastIndexOf('id')).concat(params.customerId)
55
+
56
+    // props.form.setFieldsValue(res)
57
+    request({ url: tempUrl, method, params: { verifyStatus: params.verifyStatus } }).then(() => {
58
+      // eslint-disable-next-line no-unused-expressions
59
+      <Alert
60
+        style={{
61
+          marginBottom: 24,
62
+        }}
63
+        message="操作成功"
64
+        type="success"
65
+        showIcon
66
+      />
67
+      router.go(-1)
68
+    }).catch(err => {
69
+      // eslint-disable-next-line no-unused-expressions
70
+      <Alert
71
+        style={{
72
+          marginBottom: 24,
73
+        }}
74
+        message={err}
75
+        type="error"
76
+        showIcon
77
+      />
78
+    })
79
+  }
80
+
81
+  // 提交事件
82
+  function handleSubmit(e) {
83
+    e.preventDefault();
84
+    props.form.validateFields((err, values) => {
85
+      if (!err) {
86
+        submitDate({ ...values })
87
+      }
88
+    });
89
+  }
90
+
91
+  // Change 事件
92
+  function handleSelectChange(e) {
93
+    // eslint-disable-next-line no-console
94
+    console.log(e)
95
+  }
96
+
97
+  return (
98
+    <>
99
+      <Form {...tailFormItemLayout} onSubmit={e => handleSubmit(e, props)} style={{ width: '800px', margin: 'auto' }}>
100
+        <Form.Item label="客户ID" style={{ display: 'none' }}>
101
+          {getFieldDecorator('customerId')(
102
+            <Input
103
+              placeholder="客户ID"
104
+            />,
105
+          )}
106
+        </Form.Item>
107
+        <Form.Item label="意向项目:">
108
+          {getFieldDecorator('intention')(
109
+            <Input
110
+              placeholder="意向项目"
111
+            />,
112
+          )}
113
+        </Form.Item>
114
+        <Form.Item label="客户照片">
115
+          {getFieldDecorator('picture')(
116
+            <ImageUpload value={dataSource.picture} />,
117
+          )}
118
+        </Form.Item>
119
+        <Form.Item label="客户姓名">
120
+          {getFieldDecorator('name')(
121
+            <Input placeholder="客户姓名" />,
122
+          )}
123
+        </Form.Item>
124
+        <Form.Item label="客户电话">
125
+          {getFieldDecorator('phone')(
126
+            <Input placeholder="客户电话" />,
127
+          )}
128
+        </Form.Item>
129
+        <Form.Item label="客户性别">
130
+          {getFieldDecorator('sex')(
131
+            <Radio.Group>
132
+              <Radio value={1}>男</Radio>
133
+              <Radio value={2}>女</Radio>
134
+            </Radio.Group>,
135
+          )}
136
+        </Form.Item>
137
+        <Form.Item label="到访人数">
138
+          {getFieldDecorator('visiteNum')(
139
+            <Input placeholder="到访人数" />,
140
+          )}
141
+        </Form.Item>
142
+        <Form.Item label="客户描述">
143
+          {getFieldDecorator('describe')(
144
+            <TextArea placeholder="客户描述" rows={10} />,
145
+          )}
146
+        </Form.Item>
147
+        <Form.Item label="物业类型">
148
+          {getFieldDecorator('realtyManageType')(
149
+            <Input placeholder="物业类型" />,
150
+          )}
151
+        </Form.Item>
152
+        <Form.Item label="需求类型">
153
+          {getFieldDecorator('demandType')(
154
+            <Input placeholder="需求类型" />,
155
+          )}
156
+        </Form.Item>
157
+        <Form.Item label="价格区间">
158
+          {getFieldDecorator('priceRange')(
159
+            <Input placeholder="价格区间" />,
160
+          )}
161
+        </Form.Item>
162
+        <Form.Item label="报备日期">
163
+          {getFieldDecorator('reportDate')(
164
+            <DatePicker showTime placeholder="报备日期" />,
165
+          )}
166
+        </Form.Item>
167
+        <Form.Item label="状态">
168
+          {getFieldDecorator('verifyStatus')(
169
+            <Select style={{ width: '180px' }} placeholder="状态" onChange={handleSelectChange}>
170
+              <Option value={0}>未通过</Option>
171
+              <Option value={1}>已通过</Option>
172
+              <Option value={2}>已驳回</Option>
173
+            </Select>,
174
+          )}
175
+        </Form.Item>
176
+        <Form.Item label="归属置业顾问">
177
+            <Row gutter={8}>
178
+              <Col span={12}>
179
+                {getFieldDecorator('consultantName')(<Input placeholder="归属置业顾问" />)}
180
+              </Col>
181
+              <Col span={12}>
182
+                <Button>选择</Button>
183
+              </Col>
184
+            </Row>
185
+        </Form.Item>
186
+        <Form.Item style={{ display: 'flex', justifyContent: 'center' }}>
187
+          <Button type="primary" htmlType="submit" className={Styles.SubmitButton}>
188
+            搜索
189
+          </Button>
190
+          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
191
+          <Button onClick={() => router.go(-1)}>
192
+            取消
193
+          </Button>
194
+        </Form.Item>
195
+      </Form>
196
+    </>
197
+  );
198
+}
199
+const WrappedBody = Form.create({ name: 'body' })(body);
200
+
201
+export default WrappedBody

+ 191
- 0
src/pages/customer/recommendCustomer/index.jsx Dosyayı Görüntüle

@@ -0,0 +1,191 @@
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 { router } from 'umi';
8
+
9
+
10
+const { Option } = Select;
11
+// eslint-disable-next-line @typescript-eslint/no-unused-vars
12
+const { Meta } = Card;
13
+
14
+/**
15
+ *
16
+ *
17
+ * @param {*} props
18
+ * @returns
19
+ */
20
+function body(props) {
21
+  const { getFieldDecorator } = props.form
22
+
23
+  // eslint-disable-next-line react-hooks/rules-of-hooks
24
+  const [dataSource, setDataSource] = useState({ records: [] })
25
+
26
+  // eslint-disable-next-line react-hooks/rules-of-hooks
27
+  useEffect(() => {
28
+    getList({ pageNumber: 1, pageSize: 10 })
29
+  }, [])
30
+
31
+  function getList(params) {
32
+    // 网路请求
33
+    request({ ...apis.customer.recommender, params: { ...params } }).then(res => {
34
+      setDataSource(res)
35
+    }).catch(err => {
36
+      // eslint-disable-next-line no-unused-expressions
37
+      <Alert
38
+        style={{
39
+          marginBottom: 24,
40
+        }}
41
+        message={err}
42
+        type="error"
43
+        showIcon
44
+      />
45
+    })
46
+  }
47
+
48
+  // 提交事件
49
+  function handleSubmit(e) {
50
+    e.preventDefault();
51
+    props.form.validateFields((err, values) => {
52
+      if (!err) {
53
+        getList({ pageNum: 1, pageSize: 10, ...values })
54
+      }
55
+    });
56
+  }
57
+
58
+  // Change 事件
59
+  function handleSelectChange(e) {
60
+    // eslint-disable-next-line no-console
61
+    console.log(e)
62
+  }
63
+
64
+  // 分页
65
+  function onChange(pageNum) {
66
+    // eslint-disable-next-line react-hooks/rules-of-hooks
67
+      getList({ pageNumber: pageNum, pageSize: 10 })
68
+  }
69
+
70
+  function toAudit(cuurentId) {
71
+    router.push({
72
+      pathname: '/customer/recommendCustomer/audit',
73
+      query: {
74
+        id: cuurentId,
75
+      },
76
+    })
77
+  }
78
+
79
+  const columns = [
80
+    {
81
+      title: '头像',
82
+      dataIndex: 'picture',
83
+      key: 'picture',
84
+      render: (_, record) => <Avatar shape="square" src={record.picture} size={64} icon="user" />,
85
+    },
86
+    {
87
+      title: '姓名',
88
+      dataIndex: 'name',
89
+      key: 'name',
90
+    },
91
+    {
92
+      title: '电话',
93
+      dataIndex: 'phone',
94
+      key: 'phone',
95
+    },
96
+    {
97
+      title: '性别',
98
+      dataIndex: 'sex',
99
+      key: 'sex',
100
+      // eslint-disable-next-line no-nested-ternary
101
+      render: (_, record) => <><sapn>{ record.sex === 1 ? '男' : record.sex === 2 ? '女' : '未知' }</sapn></>,
102
+    },
103
+    {
104
+      title: '意向项目',
105
+      dataIndex: 'intention',
106
+      key: 'intention',
107
+    },
108
+    {
109
+      title: '推荐人',
110
+      dataIndex: 'consultantName',
111
+      key: 'consultantName',
112
+      render: (_, record) => <><sapn>{ record.recommendName + " " + record.recommendTel }</sapn></>,
113
+    },
114
+    {
115
+      title: '推荐时间',
116
+      dataIndex: 'createDate',
117
+      key: 'createDate',
118
+      render: (_, record) => <><sapn>{ moment(record.createDate).format('YYYY-MM-DD') }</sapn></>,
119
+    },
120
+    {
121
+      title: '状态',
122
+      dataIndex: 'createDate',
123
+      key: 'createDate',
124
+      render: (_, record) => <><sapn>{ record.verifyStatus === 0 ? '未通过': record.verifyStatus === 1 ? '已通过' : record.verifyStatus === 2 ? '已驳回' : '' }</sapn></>,
125
+    },
126
+    {
127
+      title: '操作',
128
+      dataIndex: 'customerId',
129
+      key: 'customerId',
130
+      render: (_, record) => (
131
+        <>
132
+          {
133
+            record.verifyStatus === 0 ? <sapn style={{ color: 'rgba(239,39,58,1)' }} onClick={() => toAudit(record.customerId)}>审核</sapn> : ''
134
+          }
135
+        </>
136
+      ),
137
+    },
138
+  ]
139
+
140
+  return (
141
+    <>
142
+      <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
143
+        <Form.Item>
144
+          {getFieldDecorator('name')(
145
+            <Input
146
+              prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
147
+              placeholder="姓名"
148
+            />,
149
+          )}
150
+        </Form.Item>
151
+        <Form.Item>
152
+          {getFieldDecorator('tel')(
153
+            <Input
154
+              prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
155
+              placeholder="电话"
156
+            />,
157
+          )}
158
+        </Form.Item>
159
+        <Form.Item>
160
+          {getFieldDecorator('consultName')(
161
+            <Input placeholder="推荐人" />,
162
+          )}
163
+        </Form.Item>
164
+        <Form.Item>
165
+          {getFieldDecorator('consultTel')(
166
+            <Input placeholder="推荐人电话" />,
167
+          )}
168
+        </Form.Item>
169
+        <Form.Item>
170
+          {getFieldDecorator('verifyStatus')(
171
+            <Select style={{ width: '180px' }} placeholder="状态" onChange={handleSelectChange}>
172
+              <Option value={0}>未通过</Option>
173
+              <Option value={1}>已通过</Option>
174
+              <Option value={2}>已驳回</Option>
175
+            </Select>,
176
+          )}
177
+        </Form.Item>
178
+        <Form.Item>
179
+          <Button type="primary" htmlType="submit" className={Styles.SubmitButton}>
180
+            搜索
181
+          </Button>
182
+        </Form.Item>
183
+      </Form>
184
+
185
+      <Table dataSource={dataSource.records} columns={columns} pagination={{ total: dataSource.total, onChange }} />
186
+    </>
187
+  );
188
+}
189
+const WrappedBody = Form.create({ name: 'body' })(body);
190
+
191
+export default WrappedBody

+ 57
- 0
src/pages/customer/recommendCustomer/style.less Dosyayı Görüntüle

@@ -0,0 +1,57 @@
1
+.SubmitButton {
2
+  background: #3a91d5;
3
+  border-radius: 7px;
4
+  border: 0px;
5
+}
6
+.SelectFrom {
7
+  width: 180px;
8
+  background: #ffffff;
9
+  border-radius: 7px;
10
+  border: 1px solid #dbdbdb;
11
+}
12
+.addButton {
13
+  background: #50be00;
14
+  border-radius: 4px;
15
+  border: 0px;
16
+  margin: 10px 0px;
17
+}
18
+.cardText {
19
+  font-size: 18px;
20
+  color: #333;
21
+  line-height: 24px;
22
+  display: flex;
23
+  align-items: center;
24
+  position: relative;
25
+
26
+}
27
+.cardItem{
28
+  font-size: 18px;
29
+  font-weight: 400;
30
+  color: #666;
31
+  line-height: 24px;
32
+  display: flex;
33
+  align-items: center;  
34
+}
35
+.ediText {
36
+  font-size: 18px;
37
+  color: #ff925c;
38
+  line-height: 24px;
39
+  position: absolute;
40
+  right: 0;
41
+}
42
+.title{
43
+  display: inline-block;
44
+  width: 84px;
45
+  justify-content: space-between;
46
+  text-align: justify;
47
+  text-align-last:justify
48
+}
49
+
50
+.address { 
51
+  width: 400px;
52
+  height: 24px; 
53
+  text-overflow: ellipsis; 
54
+  white-space: nowrap;
55
+  overflow: hidden;
56
+}
57
+

+ 169
- 0
src/pages/customer/report/index.jsx Dosyayı Görüntüle

@@ -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
+
8
+
9
+const { Option } = Select;
10
+// eslint-disable-next-line @typescript-eslint/no-unused-vars
11
+const { Meta } = Card;
12
+
13
+const tempDate = [{ code: 's101' }]
14
+
15
+/**
16
+ *
17
+ *
18
+ * @param {*} props
19
+ * @returns
20
+ */
21
+function body(props) {
22
+  const { getFieldDecorator } = props.form
23
+
24
+  // eslint-disable-next-line react-hooks/rules-of-hooks
25
+  const [dataSource, setDataSource] = useState({ records: [] })
26
+
27
+  // eslint-disable-next-line react-hooks/rules-of-hooks
28
+  useEffect(() => {
29
+    getList({ pageNumber: 1, pageSize: 9 })
30
+  }, [])
31
+
32
+  function getList(params) {
33
+    // 网路请求
34
+    request({ ...apis.customer.report, params: { ...params } }).then(res => {
35
+      setDataSource(res)
36
+    }).catch(err => {
37
+      // eslint-disable-next-line no-unused-expressions
38
+      <Alert
39
+        style={{
40
+          marginBottom: 24,
41
+        }}
42
+        message={err}
43
+        type="error"
44
+        showIcon
45
+      />
46
+    })
47
+  }
48
+
49
+  // 提交事件
50
+  function handleSubmit(e) {
51
+    e.preventDefault();
52
+    props.form.validateFields((err, values) => {
53
+      if (!err) {
54
+        getList({ pageNum: 1, pageSize: 10, ...values })
55
+      }
56
+    });
57
+  }
58
+
59
+  // Change 事件
60
+  function handleSelectChange(e) {
61
+    // eslint-disable-next-line no-console
62
+    console.log(e)
63
+  }
64
+
65
+  // 分页
66
+  function onChange(pageNum) {
67
+    // eslint-disable-next-line react-hooks/rules-of-hooks
68
+      getList({ pageNumber: pageNum, pageSize: 9 })
69
+  }
70
+
71
+  const columns = [
72
+    {
73
+      title: '头像',
74
+      dataIndex: 'picture',
75
+      key: 'picture',
76
+      render: (_, record) => <Avatar shape="square" src={record.picture} size={64} icon="user" />,
77
+    },
78
+    {
79
+      title: '姓名',
80
+      dataIndex: 'name',
81
+      key: 'name',
82
+    },
83
+    {
84
+      title: '电话',
85
+      dataIndex: 'phone',
86
+      key: 'phone',
87
+    },
88
+    {
89
+      title: '性别',
90
+      dataIndex: 'sex',
91
+      key: 'sex',
92
+      // eslint-disable-next-line no-nested-ternary
93
+      render: (_, record) => <><sapn>{ record.sex === 1 ? '男' : record.sex === 2 ? '女' : '未知' }</sapn></>,
94
+    },
95
+    {
96
+      title: '意向项目',
97
+      dataIndex: 'intention',
98
+      key: 'intention',
99
+    },
100
+    {
101
+      title: '置业顾问',
102
+      dataIndex: 'consultantName',
103
+      key: 'consultantName',
104
+    },
105
+    {
106
+      title: '置业顾问手机号',
107
+      dataIndex: 'consultTel',
108
+      key: 'consultTel',
109
+    },
110
+  ]
111
+
112
+  return (
113
+    <>
114
+      <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
115
+        <Form.Item>
116
+          {getFieldDecorator('name')(
117
+            <Input
118
+              prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
119
+              placeholder="姓名"
120
+            />,
121
+          )}
122
+        </Form.Item>
123
+        <Form.Item>
124
+          {getFieldDecorator('tel')(
125
+            <Input
126
+              prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
127
+              placeholder="电话"
128
+            />,
129
+          )}
130
+        </Form.Item>
131
+        <Form.Item>
132
+          {getFieldDecorator('consultName')(
133
+            <Input placeholder="推荐人" />,
134
+          )}
135
+        </Form.Item>
136
+        <Form.Item>
137
+          {getFieldDecorator('consultTel')(
138
+            <Input placeholder="推荐电话" />,
139
+          )}
140
+        </Form.Item>
141
+        <Form.Item>
142
+          {getFieldDecorator('sex')(
143
+            <Select style={{ width: '180px' }} placeholder="性别" onChange={handleSelectChange}>
144
+              <Option value="1">男</Option>
145
+              <Option value="0">女</Option>
146
+            </Select>,
147
+          )}
148
+        </Form.Item>
149
+        <Form.Item>
150
+          {getFieldDecorator('buildingId')(
151
+            <Select style={{ width: '180px' }} placeholder="意向项目" onChange={handleSelectChange}>
152
+              <Option value="male">male</Option>
153
+            </Select>,
154
+          )}
155
+        </Form.Item>
156
+        <Form.Item>
157
+          <Button type="primary" htmlType="submit" className={Styles.SubmitButton}>
158
+            搜索
159
+          </Button>
160
+        </Form.Item>
161
+      </Form>
162
+
163
+      <Table dataSource={dataSource.records} columns={columns} pagination={{ total: dataSource.total, onChange }} />
164
+    </>
165
+  );
166
+}
167
+const WrappedBody = Form.create({ name: 'body' })(body);
168
+
169
+export default WrappedBody

+ 57
- 0
src/pages/customer/report/style.less Dosyayı Görüntüle

@@ -0,0 +1,57 @@
1
+.SubmitButton {
2
+  background: #3a91d5;
3
+  border-radius: 7px;
4
+  border: 0px;
5
+}
6
+.SelectFrom {
7
+  width: 180px;
8
+  background: #ffffff;
9
+  border-radius: 7px;
10
+  border: 1px solid #dbdbdb;
11
+}
12
+.addButton {
13
+  background: #50be00;
14
+  border-radius: 4px;
15
+  border: 0px;
16
+  margin: 10px 0px;
17
+}
18
+.cardText {
19
+  font-size: 18px;
20
+  color: #333;
21
+  line-height: 24px;
22
+  display: flex;
23
+  align-items: center;
24
+  position: relative;
25
+
26
+}
27
+.cardItem{
28
+  font-size: 18px;
29
+  font-weight: 400;
30
+  color: #666;
31
+  line-height: 24px;
32
+  display: flex;
33
+  align-items: center;  
34
+}
35
+.ediText {
36
+  font-size: 18px;
37
+  color: #ff925c;
38
+  line-height: 24px;
39
+  position: absolute;
40
+  right: 0;
41
+}
42
+.title{
43
+  display: inline-block;
44
+  width: 84px;
45
+  justify-content: space-between;
46
+  text-align: justify;
47
+  text-align-last:justify
48
+}
49
+
50
+.address { 
51
+  width: 400px;
52
+  height: 24px; 
53
+  text-overflow: ellipsis; 
54
+  white-space: nowrap;
55
+  overflow: hidden;
56
+}
57
+

+ 26
- 0
src/services/apis.js Dosyayı Görüntüle

@@ -39,4 +39,30 @@ export default {
39 39
       url: `${prefix}/tdBuildingType/id`,
40 40
     },
41 41
   },
42
+  customer: {
43
+    drift: {
44
+      method: 'GET',
45
+      url: `${prefix}/customer/recommend/drift`,
46
+    },
47
+    report: {
48
+      method: 'GET',
49
+      url: `${prefix}/customer/recommend/report`,
50
+    },
51
+    recommender: {
52
+      method: 'GET',
53
+      url: `${prefix}/customer/recommend/recommender`,
54
+    },
55
+    auto: {
56
+      method: 'PUT',
57
+      url: `${prefix}/customer/recommend/verify/id`,
58
+    },
59
+    recommendGetById: {
60
+      method: 'GET',
61
+      url: `${prefix}/customer/recommend/getById/id`,
62
+    },
63
+    agents: {
64
+      method: 'GET',
65
+      url: `${prefix}/customer/agents`,
66
+    },
67
+  },
42 68
 }