Bläddra i källkod

公客私客页面

dingxin 5 år sedan
förälder
incheckning
4480f6221f

+ 6
- 0
config/routes.js Visa fil

@@ -128,6 +128,12 @@ export default [
128 128
                 name: '到访记录',
129 129
                 component: './customer/visiting/index',
130 130
               },
131
+              {
132
+                path: '/customer/customerlist/publicCustomerDetail',
133
+                name: '私客详情',
134
+                hideInMenu: true,
135
+                component: './customer/customerlist/publicCustomerDetail',
136
+              },
131 137
             ],
132 138
           },
133 139
           {

+ 83
- 30
src/pages/customer/customerlist/customerDetail.jsx Visa fil

@@ -17,6 +17,7 @@ function header(props) {
17 17
   // eslint-disable-next-line react-hooks/rules-of-hooks
18 18
   const [data, setData] = useState([{ visitRecords: [] }])
19 19
   const [dataConsultant, setDataonsultant] = useState({})
20
+  const [intentionData, setIntentionData] = useState([])
20 21
 
21 22
   // eslint-disable-next-line react-hooks/rules-of-hooks
22 23
   useEffect(() => {
@@ -35,7 +36,10 @@ function header(props) {
35 36
       setDataonsultant(res.geoInfo)
36 37
     })
37 38
   }
38
-
39
+// 分页
40
+  const changePageNum = pageNumber => {
41
+    // getList({ pageNum: pageNumber, pageSize: 10, ...props.form.getFieldsValue() })
42
+  }
39 43
   const columns = [
40 44
     {
41 45
       title: '访问事件',
@@ -58,55 +62,104 @@ function header(props) {
58 62
       render: (_, record) => <span>{record.visitDuration === null ? 0 : record.visitDuration }秒</span>,
59 63
     },
60 64
   ]
65
+  // 意向
66
+  const intention = [
67
+    {
68
+      title: 'Name',
69
+      dataIndex: 'name',
70
+      width: 150,
71
+      render: (_, record) => <span>香颂半岛</span>,
72
+    },
73
+    {
74
+      title: 'Address',
75
+      dataIndex: 'address',
76
+      render: (_, record) => <span style={{ marginLeft: '55%' }}>22</span>,
77
+    },
78
+  ];
79
+
80
+for (let i = 0; i < 100; i++) {
81
+  intentionData.push({
82
+    key: i,
83
+    name: `Edward King ${i}`,
84
+    age: 32,
85
+    address: `London, Park Lane no. ${i}`,
86
+  });
87
+}
61 88
   return (
62 89
     <>
63 90
       <div className={styles.cardBox}>
64 91
      {/* { console.log("data:",data),console.log("data:",dataConsultant)} */}
65
-        <div className={styles.leftBox}>
66
-          <p className={styles.tit}>置业顾问信息</p>
67
-          <img className={styles.touxiang} src={ data.consultant && data.consultant.picture } />
68
-          <p className={styles.infoItem}>姓名:{ data.consultant && data.consultant.name }</p>
69
-          <p className={styles.infoItem}>部门:{ data.consultant && data.consultant.department }</p>
70
-          <p className={styles.infoItem}>岗位:{ data.consultant && data.consultant.post }</p>
71
-          <p className={styles.infoItem}>号码:{ data.consultant && data.consultant.phone } </p>
72
-          <p className={styles.infoItem}>公司:{ data.consultant && data.consultant.company } </p>
73
-          <p className={styles.infoItem}>
74
-            所属项目:
75
-            {
76
-              data.consultant && data.consultant.projects.map((item, _) => <span>{item}</span>)
77
-            }
78
-          </p>
79
-        </div>
80 92
         <div className={styles.rightBox}>
81 93
           <p className={styles.tit}>客户信息</p>
82 94
           <img className={styles.touxiang} src={ data.picture && data.picture } />
83 95
           <div className={styles.right}>
84 96
             <p className={styles.rightItem}>用户名称:{ data.name }</p>
85 97
             <p className={styles.rightItem}>手机号码:{ data.phone }</p>
86
-            <p className={styles.rightItem}>来访渠道:活动分享</p>
98
+            <p className={styles.rightItem}>首次访问时间:{data.visitTime && moment(data.visitTime).format('YYYY-MM-DD')}</p>
99
+          </div>
100
+          <div className={styles.Centered}>
101
+          <p>访问时长:{ data.duration }秒</p>
102
+          <p>访问次数:{ data.visitTimes }</p>
103
+          <p className={styles.rightItem}>客户描述:{ data.describe }</p>
104
+          {/* <p>预约人数:{ data.visiteNum }</p> */}
105
+          </div>
106
+          <div className={styles.rightCentered}>
107
+          <p >需求类型:{ data.demandType }</p>
108
+          <p >价格区间:{data.priceRange }</p>
109
+          <p >物业类型:{ data.realtyManageType }</p>
110
+          {/* <p>预约人数:{ data.visiteNum }</p> */}
87 111
           </div>
88
-          <p className={styles.rightItem}>访问时长:{ data.duration }秒</p>
89
-          <p className={styles.rightItem}>访问次数:{ data.visitTimes }</p>
90
-          <p className={styles.rightItem}>预约人数:{ data.visiteNum }</p>
91
-          <p className={styles.rightItem}>首次访问时间:{data.visitTime && moment(data.visitTime).format('YYYY-MM-DD')}</p>
92
-          <p className={styles.rightItem}>预约到访时间:{data.appointmentTime && moment(data.appointmentTime).format('YYYY-MM-DD') }</p>
112
+          {/* <p className={styles.rightItem}>预约到访时间:{data.appointmentTime && moment(data.appointmentTime).format('YYYY-MM-DD') }</p> */}
93 113
           <div className={styles.rightInfo}>
94 114
             <p className={styles.rightItem}>国家:{ dataConsultant&&dataConsultant.country }</p>
95 115
             <p className={styles.rightItem}>省份:{ dataConsultant&&dataConsultant.provience }</p>
96 116
             <p className={styles.rightItem}>城市:{dataConsultant&&dataConsultant.city }</p>
97
-            <p className={styles.rightItem}>详细信息:</p>
98
-            <p className={styles.rightItem}>意向项目:{data.intention }</p>
99
-            <p className={styles.rightItem}>价格区间:{data.priceRange }</p>
100
-            <p className={styles.rightItem}>客户说明:{ data.verifyRemark }</p>
101
-            <p className={styles.rightItem}>客户描述:{ data.describe }</p>
102
-            <p className={styles.rightItem}>需求类型:{ data.demandType }</p>
103
-            <p className={styles.rightItem}>物业类型:{ data.realtyManageType }</p>
117
+            <p className={styles.rightItem}>来访渠道:活动分享</p>
118
+            {/* <p className={styles.rightItem}>详细信息:</p> */}
119
+            {/* <p className={styles.rightItem}>意向项目:{data.intention }</p> */} 
120
+            {/* <p className={styles.rightItem}>客户说明:{ data.verifyRemark }</p> */}
104 121
           </div>
105 122
         </div>
123
+        
124
+      </div>
125
+      <br></br>
126
+      <div className={styles.cardBox}>
127
+        <div className={styles.rightBoxCentre}>
128
+        <p className={styles.tit}>置业顾问信息</p>
129
+          <img className={styles.touxiang} src={ data.picture && data.picture } />
130
+          <p className={styles.infoItem}>曹玉文</p>
131
+          <div className={styles.right}>
132
+          {/* <p className={styles.infoItem}>姓名:{ data.consultant && data.consultant.name }</p>
133
+          <p className={styles.infoItem}>部门:{ data.consultant && data.consultant.department }</p> */}
134
+          <p className={styles.infoItem}>号码:{ data.consultant && data.consultant.phone } </p>
135
+          <p className={styles.infoItem}>岗位:{ data.consultant && data.consultant.post }</p>
136
+          </div>
137
+          <div className={styles.left}>
138
+          <p className={styles.infoItem}>公司:{ data.consultant && data.consultant.company } </p>
139
+          <p className={styles.infoItem}>
140
+            所属项目:
141
+            {
142
+              data.consultant && data.consultant.projects.map((item, _) => <span>{item}</span>)
143
+            }
144
+          </p>
145
+          </div>
146
+        </div>
147
+        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
148
+        <div className={styles.leftBoxCentre}>
149
+          <div className={styles.tit}>
150
+                <span>项目名称</span>
151
+                <span style={{ marginLeft: '47%' }}>项目名称</span>
152
+          </div>
153
+          {/* <img className={styles.touxiang} src={ data.picture && data.picture } /> */}
154
+          <div className={styles.infoItem}>
155
+          <Table columnWidth={10} showHeader={false} columns={intention} dataSource={intentionData} pagination={{ pageSize: 50 }} scroll={{ y: 240 }}/>,
156
+          </div>
157
+        </div>
158
+
106 159
       </div>
107 160
       <div className={styles.recordBox}>
108 161
         <p className={styles.tableName}>访问记录</p>
109
-        <Table dataSource={data.visitRecords} columns={columns} pagination={false} rowKey="customerDetail" />
162
+        <Table dataSource={data.visitRecords} columns={columns} pagination={false} rowKey="customerDetail" onChange={changePageNum}/>
110 163
       </div>
111 164
 
112 165
     </>

+ 73
- 3
src/pages/customer/customerlist/index.jsx Visa fil

@@ -8,6 +8,7 @@ import router from 'umi/router';
8 8
 
9 9
 import Attribution from './components/attribution'
10 10
 import IntegralRecord from './components/integralRecord'
11
+import ModalRecommendRecord from './components/recommend'
11 12
 import ChangeStatus from './components/changeStatus'
12 13
 import BuildSelect from '../../../components/SelectButton/BuildSelect'
13 14
 import AuthButton from '@/components/AuthButton';
@@ -50,6 +51,9 @@ function body(props) {
50 51
   const [statusVisibleData, setStatusVisibleData] = useState({ visible: false, customerId: '', status: '' })
51 52
   // 变更状态 ============= end
52 53
 
54
+  // 推荐客户
55
+  const [recommendVisibleData, setRecommendVisibleData] = useState({ visible: false, customerId: '' })
56
+
53 57
   // eslint-disable-next-line react-hooks/rules-of-hooks
54 58
   useEffect(() => {
55 59
     getList({ pageNumber: 1, pageSize: 10, customerType })
@@ -76,6 +80,7 @@ function body(props) {
76 80
     setRecordVisibleData({ visible: false, customerId: '' })
77 81
     setGVisibleData({ visible: false, customerId: '', realtyConsultant: '' })
78 82
     setStatusVisibleData({ visible: false, customerId: '', status: '' })
83
+    setRecommendVisibleData({ visible: false, customerId: '' })
79 84
   }
80 85
 
81 86
   // 提交事件
@@ -126,19 +131,30 @@ function body(props) {
126 131
     setGVisibleData({ visible: true, customerId: record.customerId, realtyConsultant: record.realtyConsultant, buildingId: record.buildingId })
127 132
     setRecordVisibleData({ visible: false, customerId: '' })
128 133
     setStatusVisibleData({ visible: false, customerId: '' })
134
+    setRecommendVisibleData({ visible: false, customerId: '' })
129 135
   }
130 136
 
131 137
   function showRecord(record) {
132 138
     setRecordVisibleData({ visible: true, customerId: record.customerId })
133 139
     setGVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
134 140
     setStatusVisibleData({ visible: false, customerId: '' })
141
+    setRecommendVisibleData({ visible: false, customerId: '' })
135 142
   }
136 143
 
137 144
   function showStatus(record) {
138 145
     setRecordVisibleData({ visible: false, customerId: '' })
139 146
     setGVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
147
+    setRecommendVisibleData({ visible: false, customerId: '' })
140 148
     setStatusVisibleData({ visible: true, customerId: record.customerId, status: record.status })
141 149
   }
150
+
151
+  // 推荐客户
152
+  function showRecommend(personId) {
153
+    setRecordVisibleData({ visible: false, customerId: '' })
154
+    setGVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
155
+    setStatusVisibleData({ visible: false, customerId: '', status: '' })
156
+    setRecommendVisibleData({ visible: true, customerId: personId })
157
+  }
142 158
   function toCustomerDateil(record) {
143 159
     router.push({
144 160
       pathname: '/customer/customerlist/customerDetail',
@@ -147,6 +163,15 @@ function body(props) {
147 163
       },
148 164
     });
149 165
   }
166
+  // 私客详情
167
+  function publicCustomerDetail(record) {
168
+    router.push({
169
+      pathname: '/customer/customerlist/publicCustomerDetail',
170
+      query: {
171
+        id: record.customerId,
172
+      },
173
+    });
174
+  }
150 175
 
151 176
   function exportCustomer () {
152 177
     const fieldsValue = getFieldsValue()
@@ -173,9 +198,18 @@ function body(props) {
173 198
 
174 199
   // 关闭调整归属的窗口
175 200
   function closeAttribution() {
201
+    alert(1)
176 202
     setGVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
177 203
     getList({ pageNum: 1, pageSize: 10, customerType, ...props.form.getFieldsValue() })
178 204
   }
205
+  // 回调关闭所有弹框
206
+  function closeAll() {
207
+    alert(1)
208
+    setRecordVisibleData({ visible: false, customerId: '' })
209
+    setGVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
210
+    setStatusVisibleData({ visible: false, customerId: '', status: '' })
211
+    setRecommendVisibleData({ visible: false, customerId: '' })
212
+  }
179 213
 
180 214
   const publicColumns = [
181 215
     {
@@ -209,6 +243,34 @@ function body(props) {
209 243
       align: 'center',
210 244
       width: '15%',
211 245
     },
246
+    {
247
+      title: '性别',
248
+      dataIndex: 'sex',
249
+      key: 'sex',
250
+      align: 'center',
251
+      width: '10%',
252
+      // eslint-disable-next-line no-nested-ternary
253
+      render: (_, record) => <><span>{record.sex === 1 ? '男' : record.sex === 2 ? '女' : '未知'}</span></>,
254
+    },
255
+    {
256
+      title: '操作',
257
+      dataIndex: 'customerId',
258
+      key: 'customerId',
259
+      align: 'center',
260
+      width: '25%',
261
+      // eslint-disable-next-line no-nested-ternary
262
+      render: (_, record) => (
263
+        <>
264
+          <AuthButton>
265
+            <Button className={customerType === 'private' ? Styles.displayS : Styles.text } type="link" onClick={() => publicCustomerDetail(record)}>查看详情</Button>
266
+          </AuthButton>
267
+          &nbsp;&nbsp;
268
+          <AuthButton>
269
+            <Button className={customerType === 'private' ? Styles.displayS : Styles.text } type="link" onClick={() => showRecommend(record.personId)}>推荐客户</Button>
270
+          </AuthButton>
271
+        </>
272
+      ),
273
+    },
212 274
   ]
213 275
 
214 276
   const privateColumns = [
@@ -290,12 +352,13 @@ function body(props) {
290 352
       // eslint-disable-next-line no-nested-ternary
291 353
       render: (_, record) => (
292 354
         <>
355
+            &nbsp;
293 356
           <AuthButton name="admin.customer.recommend.edit.id.put" noRight={null}>
294 357
             <Button className={customerType === 'private' ? Styles.text : Styles.displayS} type="link" onClick={() => showStatus(record)}>变更状态</Button>
295 358
             &nbsp;&nbsp;
296 359
             <Button className={customerType === 'private' ? Styles.text : Styles.displayS} type="link" onClick={() => showGM(record)}>调整归属</Button>
297 360
           </AuthButton>
298
-            <br />
361
+            &nbsp;&nbsp;
299 362
           <AuthButton name="admin.customer.recommend.get" noRight={null}>
300 363
             <Button className={customerType === 'private' ? Styles.text : Styles.displayS} type="link" onClick={() => toCustomerDateil(record)}>查看详情</Button>
301 364
           </AuthButton>
@@ -303,6 +366,10 @@ function body(props) {
303 366
           <AuthButton name="admin.mine.taPointsRecords.id.get" noRight={null}>
304 367
             <Button className={customerType === 'private' ? Styles.text : Styles.displayS} type="link" onClick={() => showRecord(record)}>积分记录</Button>
305 368
           </AuthButton>
369
+            &nbsp;
370
+          <AuthButton name="admin.mine.taPointsRecords.id.get" noRight={null}>
371
+            <Button className={customerType === 'private' ? Styles.text : Styles.displayS} type="link" onClick={() => showRecommend(record.customerId)}>推荐客户</Button>
372
+          </AuthButton>
306 373
         </>
307 374
       ),
308 375
     },
@@ -383,10 +450,13 @@ function body(props) {
383 450
       <Attribution visibleData={gVisibleData} onCancel={() => closeAttribution()}/>
384 451
 
385 452
       {/* 积分记录 */}
386
-      <IntegralRecord visibleData={recordVisibleData} />
453
+      <IntegralRecord visibleData={recordVisibleData} onCancel={() => closeAll()} />
387 454
 
388 455
       {/* 变更状态 */}
389
-      <ChangeStatus visibleData={statusVisibleData} />
456
+      <ChangeStatus visibleData={statusVisibleData} onCancel={() => closeAll()}/>
457
+
458
+      {/* 推荐客户 */}
459
+      <ModalRecommendRecord visibleData={recommendVisibleData} onCancel={() => closeAll()}/>
390 460
     </>
391 461
   );
392 462
 }

+ 64
- 6
src/pages/customer/customerlist/style.less Visa fil

@@ -77,9 +77,21 @@
77 77
 .cardBox{
78 78
   display: flex;
79 79
   .leftBox{
80
-    width:342px;
80
+    width:1000px;
81 81
     min-width:342px;
82
-    height:511px;
82
+    height:1000px;
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:865px;
93
+    min-width:342px;
94
+    height:290px;
83 95
     background:rgba(255,255,255,1);
84 96
     box-shadow:0px 0px 16px 2px rgba(0,0,0,0.12);
85 97
     border-radius:8px;
@@ -90,8 +102,31 @@
90 102
   }
91 103
   .rightBox{
92 104
     width:-webkit-fill-available;
93
-    height:511px;
94
-    min-width: 800px;
105
+    height:315px;
106
+    min-width: 100%;
107
+    background:rgba(255,255,255,1);
108
+    box-shadow:0px 0px 16px 2px rgba(0,0,0,0.12);
109
+    border-radius:8px;
110
+    display: inline-block;
111
+    padding: 30px;
112
+    overflow: hidden;
113
+    position: relative;
114
+  }
115
+  .rightBoxCentre{
116
+    width:865px;
117
+    height:315px;
118
+    min-width: 60%;
119
+    background:rgba(255,255,255,1);
120
+    box-shadow:0px 0px 16px 2px rgba(0,0,0,0.12);
121
+    border-radius:8px;
122
+    display: inline-block;
123
+    padding: 30px;
124
+    overflow: hidden;
125
+    position: relative;
126
+  }
127
+  .leftBoxCentre{
128
+    width:100%;
129
+    height:315px;
95 130
     background:rgba(255,255,255,1);
96 131
     box-shadow:0px 0px 16px 2px rgba(0,0,0,0.12);
97 132
     border-radius:8px;
@@ -128,10 +163,33 @@
128 163
     top:108px;
129 164
     left:170px;
130 165
   }
166
+  .left{
167
+    position: absolute;
168
+    top:108px;
169
+    left:60%;
170
+  }
131 171
   .rightInfo{
132 172
     position: absolute;
133
-    top:50px;
134
-    left:50%;
173
+    top:108px;
174
+    left:80%;
175
+  }
176
+
177
+  .Centered{
178
+    position: absolute;
179
+    top:108px;
180
+    left:30%;
181
+    margin: 0 0 15px 0;
182
+    color:#666;
183
+    font-size: 19px;
184
+  }
185
+
186
+  .rightCentered{
187
+    position: absolute;
188
+    top:108px;
189
+    left:55%;
190
+    margin: 0 0 15px 0;
191
+    color:#666;
192
+    font-size: 19px;
135 193
   }
136 194
   
137 195
 }

+ 5
- 0
src/services/apis.js Visa fil

@@ -286,6 +286,11 @@ export default {
286 286
       url: `${prefix}/customer/recommend/export`,
287 287
       action: 'admin.customer.recommend.export.get',
288 288
     },
289
+    recommendClient: {
290
+      method: 'GET',
291
+      url: `${prefix}/customer/recommend/:id`,
292
+      action: 'admin.customer.recommend.get',
293
+    },
289 294
   },
290 295
   indexEcharts: {
291 296
     list:{