张延森 2 年之前
父節點
當前提交
796478485c

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

@@ -585,6 +585,12 @@ export default [
585 585
                 component: './broker/agentRule/index',
586 586
                 menuCode: '/broker/agentRule',
587 587
               },
588
+              {
589
+                path: '/broker/customer/list',
590
+                name: '经纪人客户列表',
591
+                component: './broker/customer/index',
592
+                hideInMenu: true,
593
+              },
588 594
             ],
589 595
           },
590 596
           {

+ 9
- 2
src/pages/broker/announcement/Edit/index.jsx 查看文件

@@ -38,6 +38,13 @@ const AnnouncementEdit = React.forwardRef((props, ref) => {
38 38
 
39 39
   const [loading, setLoading] = useState(false)
40 40
 
41
+  const handlePageChange = (path) => {
42
+    const page = pages.filter(x => x.page === path)[0]
43
+    if (page) {
44
+      setFieldsValue({ pageParam: page.queryStr })
45
+    }
46
+  }
47
+
41 48
   const handleSubmit = (e) => {
42 49
     validateFieldsAndScroll((err, values) => {
43 50
       if (err) return;
@@ -118,7 +125,7 @@ const AnnouncementEdit = React.forwardRef((props, ref) => {
118 125
           <FormItem label="跳转页面">
119 126
             {
120 127
               getFieldDecorator('linkPage')(
121
-                <Select style={fullWidth} allowClear>
128
+                <Select style={fullWidth} allowClear onChange={handlePageChange}>
122 129
                   {
123 130
                     pages.map(x => <Option key={x.page} value={x.page}>{x.title}</Option>)
124 131
                   }
@@ -126,7 +133,7 @@ const AnnouncementEdit = React.forwardRef((props, ref) => {
126 133
               )
127 134
             }
128 135
           </FormItem>
129
-          <FormItem label="页面参数">
136
+          <FormItem label="页面参数" help="默认不需要处理">
130 137
             {
131 138
               getFieldDecorator('pageParam')(<Input placeholder="key1=value1&key2=value2" />)
132 139
             }

+ 13
- 2
src/pages/broker/announcement/util.js 查看文件

@@ -5,8 +5,19 @@ export const showTypeList = [
5 5
 
6 6
 export const pages = [
7 7
   {
8
-    title: '页面1',
9
-    page: '/subpackages/pages/broker',
8
+    title: '成为经纪人',
9
+    page: '/subpackages/pages/broker/toBeBroker/index',
10
+    queryStr: 'recommendAgent={personId}'
11
+  },
12
+  {
13
+    title: '报备客户',
14
+    page: '/pages/mine/addCustomer/index',
15
+    queryStr: ''
16
+  },
17
+  {
18
+    title: '公告详情',
19
+    page: '/subpackages/pages/broker/firstScreenDetail/index',
20
+    queryStr: 'id={id}'
10 21
   }
11 22
 ]
12 23
 

+ 123
- 0
src/pages/broker/customer/index.jsx 查看文件

@@ -0,0 +1,123 @@
1
+import React, { useMemo, useRef, useState } from 'react'
2
+import { Button, notification, Spin, Badge, Select } from 'antd'
3
+import { router } from 'umi'
4
+import moment from 'moment'
5
+import QueryTable from '@/components/QueryTable'
6
+import { fetch, apis } from '@/utils/request';
7
+import { useEffect } from 'react'
8
+
9
+const searchFields = [
10
+  {
11
+    name: 'name',
12
+    label: '姓名',
13
+    placeholder: '请输入客户姓名',
14
+  },
15
+  {
16
+    name: 'phone',
17
+    label: '手机号',
18
+    placeholder: '请输入客户手机号',
19
+  },
20
+]
21
+
22
+export default (props) => {
23
+  const { history } = props
24
+  const { recommendPerson } = history.location.query
25
+
26
+  const ref = useRef()
27
+  const [notQuery, setNotQuery] = useState(true);
28
+
29
+  const tableColumns = [
30
+    {
31
+      title: '姓名',
32
+      dataIndex: 'name',
33
+      key: 'name',
34
+    },
35
+    {
36
+      title: '手机号',
37
+      dataIndex: 'phone',
38
+      key: 'phone',
39
+    },
40
+    {
41
+      title: '归属楼盘',
42
+      dataIndex: 'buildingName',
43
+      key: 'buildingName',
44
+    },
45
+    {
46
+      title: '客户状态',
47
+      dataIndex: 'status',
48
+      key: 'status',
49
+      render: (_, row) => {
50
+        if (!row.status || row.status <= 1) {
51
+          return '待审核';
52
+        } else if (row.status === 3) {
53
+          return '驳回';
54
+        } else {
55
+          if (!row.commission_date) {
56
+            return '结佣';
57
+          }
58
+          if (!row.signed_date) {
59
+            return '签约';
60
+          }
61
+          if (!row.preparatory_date) {
62
+            return '认筹';
63
+          }
64
+          if (!row.visit_date) {
65
+            return '到访';
66
+          }
67
+        }
68
+
69
+        return '未知';
70
+      }
71
+    },
72
+    {
73
+      title: '佣金总数',
74
+      dataIndex: 'totalCommission',
75
+      key: 'totalCommission',
76
+      align: 'right',
77
+      width: 120,
78
+      render: t => t && t > 0 ? `¥${Number(t / 100).toFixed(2)}元` : '-'
79
+    },
80
+    {
81
+      title: '已结佣金',
82
+      dataIndex: 'settledCommission',
83
+      key: 'settledCommission',
84
+      align: 'right',
85
+      width: 120,
86
+      render: t => t && t > 0 ? `¥${Number(t / 100).toFixed(2)}元` : '-'
87
+    },
88
+    {
89
+      title: '待结佣金',
90
+      dataIndex: 'unsettledCommission',
91
+      key: 'unsettledCommission',
92
+      align: 'right',
93
+      width: 120,
94
+      render: t => t && t > 0 ? `¥${Number(t / 100).toFixed(2)}元` : '-'
95
+    },
96
+    {
97
+      title: '时间',
98
+      dataIndex: 'createDate',
99
+      key: 'createDate',
100
+      align: 'center',
101
+      render: (t) => moment(t).format('YYYY-MM-DD HH:mm')
102
+    },
103
+  ]
104
+
105
+  useEffect(() => {
106
+    setNotQuery(!recommendPerson);
107
+
108
+    if (!recommendPerson) {
109
+      notification.warning({ message: "请设置经纪人" })
110
+    }
111
+  }, [recommendPerson])
112
+
113
+  return (
114
+    <QueryTable
115
+      ref={ref}
116
+      rowKey="channelCustomerId"
117
+      api={apis.broker.getCustomerList}
118
+      searchFields={searchFields}
119
+      columns={tableColumns}
120
+      params={{ recommendPerson }}
121
+    />
122
+  )
123
+}

+ 2
- 0
src/pages/broker/list/index.jsx 查看文件

@@ -1,6 +1,7 @@
1 1
 import React, { useMemo, useRef, useCallback, useState } from 'react'
2 2
 import { Button, notification, Spin, Badge, Select } from 'antd'
3 3
 import { router } from 'umi'
4
+import Link from 'umi/link';
4 5
 import moment from 'moment'
5 6
 import QueryTable from '@/components/QueryTable'
6 7
 import { fetch, apis } from '@/utils/request';
@@ -76,6 +77,7 @@ export default (props) => {
76 77
       key: 'customerNum',
77 78
       align: 'right',
78 79
       width: 120,
80
+      render: (t, row) => <Link to={`/broker/customer/list?recommendPerson=${row.personId}`}>{ !t ? 0 : t }</Link>
79 81
     },
80 82
     {
81 83
       title: '佣金总数',

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

@@ -2464,5 +2464,10 @@ export default {
2464 2464
       method: 'PUT',
2465 2465
       url: `${prefix}/building/:id/broker-manager`,
2466 2466
     },
2467
+    // 获取经纪人客户列表
2468
+    getCustomerList: {
2469
+      method: 'GET',
2470
+      url: `${prefix}/broker/customer`,
2471
+    },
2467 2472
   }
2468 2473
 };