ソースを参照

Merge branch 'dev' of http://git.ycjcjy.com/zhiyuxing/estateagents-admin-manager into dev

顾绍勇 5 年 前
コミット
6e2ae672a9
共有2 個のファイルを変更した29 個の追加32 個の削除を含む
  1. 1
    1
      src/pages/carouselFigure/customImg/list.jsx
  2. 28
    31
      src/pages/customer/customerlist/index.jsx

+ 1
- 1
src/pages/carouselFigure/customImg/list.jsx ファイルの表示

@@ -54,7 +54,7 @@ function header(props) {
54 54
       <Table dataSource={data}>
55 55
         <Column title="图片" dataIndex="imgUrl" key="imgUrl" 
56 56
         render={(text, record) => (
57
-        <img src={record.imgUrl} height="120px" width="150px" />
57
+        <img src={record.imgUrl} height="120px" width="150px" style={{ objectFit: 'contain' }}/>
58 58
         )}/>
59 59
         <Column title="类型" dataIndex="imgType" key="imgType" 
60 60
         render={(text, record) => (

+ 28
- 31
src/pages/customer/customerlist/index.jsx ファイルの表示

@@ -58,20 +58,20 @@ function body(props) {
58 58
   // 推荐客户
59 59
   const [recommendVisibleData, setRecommendVisibleData] = useState({ visible: false, customerId: '' })
60 60
 
61
-  const [assistVisibleData, setAssistVisibleData] = useState({ visible: false, customerId: '',buildingId:'' })
61
+  const [assistVisibleData, setAssistVisibleData] = useState({ visible: false, customerId: '', buildingId: '' })
62 62
 
63 63
   const [loadingStatus, setLoadingStatus] = useState(false)
64 64
 
65 65
   // 选中的公客信息
66 66
   const [personInfo, setPersonInfo] = useState([])
67 67
 
68
-  const [batchAssistVisibleData, setBatchAssistVisibleData] = useState({ visible: false, customerId: [] ,buildingId:''})
68
+  const [batchAssistVisibleData, setBatchAssistVisibleData] = useState({ visible: false, customerId: [], buildingId: '' })
69 69
 
70 70
   const [currentSelectedRows, setSelectedRows] = useState([])
71 71
 
72
-  const [selectedRowKeys,setSelectedRowKeys] = useState([])
72
+  const [selectedRowKeys, setSelectedRowKeys] = useState([])
73 73
 
74
-//  const [ radio, setRadio] = useState(true)
74
+  //  const [ radio, setRadio] = useState(true)
75 75
 
76 76
   // const [page, setPage] = useState(1)
77 77
 
@@ -93,7 +93,7 @@ function body(props) {
93 93
       localStorage.setItem("priPageParams", JSON.stringify({ pageNumber: 1, pageSize: 10, customerType }))
94 94
       getList({ pageNumber: 1, pageSize: 10, customerType })
95 95
     }
96
-  }, []) 
96
+  }, [])
97 97
 
98 98
   function getList(params) {
99 99
     // 网路请求
@@ -179,9 +179,9 @@ function body(props) {
179 179
 
180 180
   // 私客/公客切换
181 181
   function radioButtonHandleSizeChange(e) {
182
-    
182
+
183 183
     displayNone()
184
-    
184
+
185 185
     props.form.resetFields();
186 186
     const { value } = e.target
187 187
     setCustomerType(value)
@@ -233,7 +233,7 @@ function body(props) {
233 233
     setRecordVisibleData({ visible: false, customerId: '' })
234 234
     setStatusVisibleData({ visible: false, customerId: '' })
235 235
     setRecommendVisibleData({ visible: false, customerId: '' })
236
-    setBatchAssistVisibleData({ visible: false, customerId: '',buildingId:'' })
236
+    setBatchAssistVisibleData({ visible: false, customerId: '', buildingId: '' })
237 237
   }
238 238
 
239 239
   function showRecord(record) {
@@ -241,7 +241,7 @@ function body(props) {
241 241
     setGVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
242 242
     setStatusVisibleData({ visible: false, customerId: '' })
243 243
     setRecommendVisibleData({ visible: false, customerId: '' })
244
-    setBatchAssistVisibleData({ visible: false, customerId: '',buildingId:'' })
244
+    setBatchAssistVisibleData({ visible: false, customerId: '', buildingId: '' })
245 245
   }
246 246
 
247 247
   function showStatus(record) {
@@ -249,7 +249,7 @@ function body(props) {
249 249
     setGVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
250 250
     setRecommendVisibleData({ visible: false, customerId: '' })
251 251
     setStatusVisibleData({ visible: true, customerId: record.customerId, status: record.status })
252
-    setBatchAssistVisibleData({ visible: false, customerId: '' ,buildingId:''})
252
+    setBatchAssistVisibleData({ visible: false, customerId: '', buildingId: '' })
253 253
   }
254 254
 
255 255
   // 推荐客户
@@ -262,13 +262,13 @@ function body(props) {
262 262
   }
263 263
 
264 264
   //分配置业顾问
265
-  function assistConsultant(personId,buildingId) {
265
+  function assistConsultant(personId, buildingId) {
266 266
     setGVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
267 267
     setRecordVisibleData({ visible: false, customerId: '' })
268 268
     setStatusVisibleData({ visible: false, customerId: '' })
269 269
     setRecommendVisibleData({ visible: false, customerId: '' })
270
-    setAssistVisibleData({ visible: true, customerId: personId ,buildingId:buildingId})
271
-    setBatchAssistVisibleData({ visible: false, customerId: '' ,buildingId:''})
270
+    setAssistVisibleData({ visible: true, customerId: personId, buildingId: buildingId })
271
+    setBatchAssistVisibleData({ visible: false, customerId: '', buildingId: '' })
272 272
   }
273 273
 
274 274
   function batchAssistConsultant() {
@@ -281,22 +281,22 @@ function body(props) {
281 281
     const compareSet = new Set();
282 282
     personInfo.filter(record => {
283 283
       compareSet.add(record.buildingName)
284
-    } )
284
+    })
285 285
 
286
-    if(compareSet.size != 1){
286
+    if (compareSet.size != 1) {
287 287
       return message.info("请选择项目");
288 288
     }
289 289
 
290 290
     // const newSelectedRows = personInfo.filter()  
291
-    
291
+
292 292
     // console.log(newSelectedRows,'newSelectedRows')
293 293
 
294 294
     setGVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
295 295
     setRecordVisibleData({ visible: false, customerId: '' })
296 296
     setStatusVisibleData({ visible: false, customerId: '' })
297 297
     setRecommendVisibleData({ visible: false, customerId: '' })
298
-    setAssistVisibleData({ visible: false, customerId: '',buildingId:'' })
299
-    setBatchAssistVisibleData({ visible: true, customerId: personInfo, buildingId: personInfo[0].buildingId})
298
+    setAssistVisibleData({ visible: false, customerId: '', buildingId: '' })
299
+    setBatchAssistVisibleData({ visible: true, customerId: personInfo, buildingId: personInfo[0].buildingId })
300 300
   }
301 301
 
302 302
   function toCustomerDateil(record) {
@@ -325,7 +325,7 @@ function body(props) {
325 325
         download(response)
326 326
         setLoadingStatus(false)
327 327
       }).catch(error => {
328
-        message.err("连接超时");
328
+        message.err('连接超时');
329 329
         setLoadingStatus(false)
330 330
       })
331 331
   }
@@ -347,13 +347,10 @@ function body(props) {
347 347
   function closeAttribution() {
348 348
     setGVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
349 349
     if (customerType === 'private') {
350
-
351
-      getList(JSON.parse(localStorage.getItem("priPageParams")))
350
+      getList(JSON.parse(localStorage.getItem('priPageParams')))
352 351
     } else {
353
-
354
-      getList(JSON.parse(localStorage.getItem("pubPageParams")))
352
+      getList(JSON.parse(localStorage.getItem('pubPageParams')))
355 353
     }
356
-
357 354
   }
358 355
   // 回调关闭所有弹框
359 356
   function closeAll() {
@@ -361,7 +358,7 @@ function body(props) {
361 358
     setGVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
362 359
     setStatusVisibleData({ visible: false, customerId: '', status: '' })
363 360
     setRecommendVisibleData({ visible: false, customerId: '' })
364
-    setAssistVisibleData({ visible: false, customerId: '',buildingId:'' })
361
+    setAssistVisibleData({ visible: false, customerId: '', buildingId: '' })
365 362
     setBatchAssistVisibleData({ visible: false, customerId: '' })
366 363
     if (customerType === 'private') {
367 364
 
@@ -379,11 +376,11 @@ function body(props) {
379 376
       console.log('selectedRowKeys:', selectedRowKeys, 'selectedRows: ', selectedRows);
380 377
       setSelectedRowKeys(selectedRowKeys)
381 378
       const newSelectedRows = personInfo.filter(x => !selectedRows.some(y => x.customerId === y.customerId))     // 去重
382
-                                .concat(selectedRows)                                                                 // 新增选择
383
-                                .filter(x => selectedRowKeys.some(y => y === x.customerId))                             // 去掉未选的数据
379
+        .concat(selectedRows)                                                                 // 新增选择
380
+        .filter(x => selectedRowKeys.some(y => y === x.customerId))                             // 去掉未选的数据
384 381
 
385 382
       // setSelectedRows(newSelectedRows)
386
-      console.log(newSelectedRows,"33333333333333333333")
383
+      console.log(newSelectedRows, "33333333333333333333")
387 384
       setPersonInfo(newSelectedRows)
388 385
     },
389 386
   };
@@ -396,7 +393,7 @@ function body(props) {
396 393
       align: 'center',
397 394
       width: '15%',
398 395
       // render: (_, record) => <Avatar shape="square" style={{ color: 'blue', cursor: 'pointer' }} onClick={() => publicCustomerDetail(record)} src={customerType === 'private' ? record.picture : record.avatarurl} size={64} icon="user" />,
399
-      render: (_, record) => <Avatar shape="square" style={{ color: 'blue', cursor: 'pointer' }} onClick={() => publicCustomerDetail(record)} src={record.picture } size={64} icon="user" />,
396
+      render: (_, record) => <Avatar shape="square" style={{ color: 'blue', cursor: 'pointer' }} onClick={() => publicCustomerDetail(record)} src={record.picture} size={64} icon="user" />,
400 397
     },
401 398
     {
402 399
       title: '姓名',
@@ -462,7 +459,7 @@ function body(props) {
462 459
             <Button className={customerType === 'private' ? Styles.displayS : Styles.text} type="link" onClick={() => showRecommend(record.personId)}>推荐客户</Button>
463 460
           </AuthButton>
464 461
           <AuthButton name="admin.customer.assign" noRight={null}>
465
-            <Button className={customerType === 'private' ? Styles.displayS : Styles.text} type="link" onClick={() => assistConsultant(record.customerId,record.buildingId)}>分配置业顾问</Button>
462
+            <Button className={customerType === 'private' ? Styles.displayS : Styles.text} type="link" onClick={() => assistConsultant(record.customerId, record.buildingId)}>分配置业顾问</Button>
466 463
           </AuthButton>
467 464
           <AuthButton name="admin.mine.taPointsRecords.point.record" noRight={null}>
468 465
             <Button className={Styles.text} type="link" onClick={() => showRecord(record)}>积分记录</Button>
@@ -586,7 +583,7 @@ function body(props) {
586 583
   return (
587 584
     <>
588 585
       <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
589
-      {customerType === 'public' && <Form.Item>
586
+        {customerType === 'public' && <Form.Item>
590 587
           {getFieldDecorator('belongStatus')(
591 588
             <Select style={{ width: '180px' }} placeholder="是否归属项目" onChange={handleSelectChange}>
592 589
               <Option value={1}>是</Option>