浏览代码

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

zhoulisen 5 年前
父节点
当前提交
a2e3b76d09

+ 1
- 1
src/components/SelectButton/BuildSelect.jsx 查看文件

@@ -55,7 +55,7 @@ const BuildingSelect = props => {
55 55
       filterOption={(input, option) =>
56 56
         option.props.children && option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
57 57
       }>
58
-          {/* <Option key="" value="">全部项目</Option> */}
58
+          <Option key="" value="">全部项目</Option>
59 59
           {data.map(building => (
60 60
             <Option key={building.buildingId} value={building.buildingId}>{building.buildingName}</Option>
61 61
           ))}

+ 1
- 1
src/pages/activity/drainage/DrainageList.jsx 查看文件

@@ -9,7 +9,7 @@ import XForm, { FieldTypes } from '../../../components/XForm';
9 9
 import moment from 'moment';
10 10
 import AuthButton from '../../../components/AuthButton';
11 11
 import ImageUploader from '../../../components/XForm/ImageUpload';
12
-import BuildSelect from '../../../components/SelectButton/BuildSelect'
12
+import BuildSelect from '../../../components/SelectButton/BuildSelect2'
13 13
 import Prompt from 'umi/prompt';
14 14
 
15 15
 const toEditList = (row) => () => {

+ 1
- 1
src/pages/activity/editActivity.jsx 查看文件

@@ -6,7 +6,7 @@ import router from 'umi/router';
6 6
 import styles from '../style/GoodsList.less';
7 7
 import apis from '../../services/apis';
8 8
 import moment from 'moment';
9
-import BuildSelect from '../../components/SelectButton/BuildSelect'
9
+import BuildSelect from '../../components/SelectButton/BuildSelect2'
10 10
 import XForm, { FieldTypes } from '../../components/XForm';
11 11
 import Wangedit from '../../components/Wangedit/Wangedit'
12 12
 import request from '../../utils/request'

+ 1
- 1
src/pages/activity/groupActivity/editGroupActivity.jsx 查看文件

@@ -5,7 +5,7 @@ import styles from '../../style/GoodsList.less';
5 5
 import apis from '../../../services/apis';
6 6
 import moment from 'moment';
7 7
 import router from 'umi/router';
8
-import BuildSelect from '../../../components/SelectButton/BuildSelect'
8
+import BuildSelect from '../../../components/SelectButton/BuildSelect2'
9 9
 import XForm, { FieldTypes } from '../../../components/XForm';
10 10
 import Wangedit from '../../../components/Wangedit/Wangedit'
11 11
 import request from '../../../utils/request'

+ 1
- 1
src/pages/activity/helpActivity/edithelpActivity.jsx 查看文件

@@ -5,7 +5,7 @@ import styles from '../../style/GoodsList.less';
5 5
 import apis from '../../../services/apis';
6 6
 import moment from 'moment';
7 7
 import router from 'umi/router';
8
-import BuildSelect from '../../../components/SelectButton/BuildSelect'
8
+import BuildSelect from '../../../components/SelectButton/BuildSelect2'
9 9
 import XForm, { FieldTypes } from '../../../components/XForm';
10 10
 import Wangedit from '../../../components/Wangedit/Wangedit'
11 11
 import request from '../../../utils/request'

+ 1
- 1
src/pages/carouselFigure/editAdvertising.jsx 查看文件

@@ -4,7 +4,7 @@ import { FormattedMessage } from 'umi-plugin-react/locale';
4 4
 import styles from '../style/GoodsList.less';
5 5
 import moment from 'moment';
6 6
 import router from 'umi/router';
7
-import BuildSelect from '../../components/SelectButton/BuildSelect'
7
+import BuildSelect from '../../components/SelectButton/BuildSelect2'
8 8
 import CitySelect from '../../components/SelectButton/CitySelect2'
9 9
 import { FieldTypes, createForm } from '../../components/XForm';
10 10
 import Wangedit from '../../components/Wangedit/Wangedit';

+ 1
- 1
src/pages/carouselFigure/editCarousel.jsx 查看文件

@@ -4,7 +4,7 @@ import { FormattedMessage } from 'umi-plugin-react/locale';
4 4
 import moment from 'moment';
5 5
 import router from 'umi/router';
6 6
 import styles from '../style/GoodsList.less';
7
-import BuildSelect from '../../components/SelectButton/BuildSelect'
7
+import BuildSelect from '../../components/SelectButton/BuildSelect2'
8 8
 import CitySelect from '../../components/SelectButton/CitySelect2'
9 9
 import { createForm, FieldTypes } from '../../components/XForm';
10 10
 import Wangedit from '../../components/Wangedit/Wangedit'

+ 1
- 1
src/pages/carouselFigure/propaganda.jsx 查看文件

@@ -4,7 +4,7 @@ import { FormattedMessage } from 'umi-plugin-react/locale';
4 4
 import styles from '../style/GoodsList.less';
5 5
 import moment from 'moment';
6 6
 import router from 'umi/router';
7
-import BuildSelect from '../../components/SelectButton/BuildSelect'
7
+import BuildSelect from '../../components/SelectButton/BuildSelect2'
8 8
 import CitySelect from '../../components/SelectButton/CitySelect2'
9 9
 import { FieldTypes, createForm } from '../../components/XForm';
10 10
 import Wangedit from '../../components/Wangedit/Wangedit';

+ 8
- 3
src/pages/customer/customerlist/components/BatchAssistConsultant.jsx 查看文件

@@ -68,7 +68,7 @@ class ModalAttribution extends React.Component {
68 68
     request({ ...apis.customer.buildingConsultant, params: { ...params } }).then(res => {
69 69
       this.setState({ dataSource: res })
70 70
     }).catch(err => {
71
-
71
+      message.err(err)
72 72
     })
73 73
   }
74 74
 
@@ -101,11 +101,16 @@ class ModalAttribution extends React.Component {
101 101
     // 网路请求
102 102
     request({ ...apis.customer.batchConsultantAssist, data: { userId: record.userId, customerIds: this.state.visibleData.customerId } }).then(res => {
103 103
       // eslint-disable-next-line no-unused-expressions
104
-      this.openNotificationWithIcon('success', '操作成功')
104
+      debugger
105
+      if(res!= null && res.failNum > 0 ){
106
+        this.openNotificationWithIcon('success', '共'+res.totalNum+'条数据,失败操作'+res.failNum+'条')
107
+      }else{
108
+        this.openNotificationWithIcon('success', '操作成功')
109
+      }
105 110
       this.handleCancel()
106 111
     }).catch(err => {
107 112
       // eslint-disable-next-line no-unused-expressions
108
-      this.openNotificationWithIcon('error', err)
113
+  
109 114
     })
110 115
   }
111 116
 

+ 3
- 3
src/pages/customer/customerlist/components/assistConsultant.jsx 查看文件

@@ -64,7 +64,7 @@ class ModalAttribution extends React.Component {
64 64
     request({ ...apis.customer.buildingConsultant, params: { ...params } }).then(res => {
65 65
       this.setState({ dataSource: res })
66 66
     }).catch(err => {
67
-
67
+      message.err(err)
68 68
     })
69 69
   }
70 70
 
@@ -73,7 +73,7 @@ class ModalAttribution extends React.Component {
73 73
     request({ ...apis.customer.buildingConsultant, params: { ...params } }).then(res => {
74 74
       this.setState({ dataSource: res })
75 75
     }).catch(err => {
76
-
76
+      message.err(err)
77 77
     })
78 78
   }
79 79
 
@@ -99,7 +99,7 @@ class ModalAttribution extends React.Component {
99 99
       this.handleCancel()
100 100
     }).catch(err => {
101 101
       // eslint-disable-next-line no-unused-expressions
102
-      this.openNotificationWithIcon('error', err)
102
+
103 103
     })
104 104
   }
105 105
 

+ 43
- 37
src/pages/customer/customerlist/index.jsx 查看文件

@@ -34,7 +34,8 @@ function body(props) {
34 34
   // eslint-disable-next-line react-hooks/rules-of-hooks
35 35
   const [dataSource, setDataSource] = useState({ records: [] })
36 36
   // eslint-disable-next-line react-hooks/rules-of-hooks
37
-  const [dataPub, setDataPub] = useState({ records: [] })
37
+  // const [columns, setColumns] = useState(privateColumns)
38
+
38 39
   // 默认私客
39 40
   // eslint-disable-next-line react-hooks/rules-of-hooks
40 41
   const [customerType, setCustomerType] = useState('private')
@@ -57,18 +58,22 @@ function body(props) {
57 58
   // 推荐客户
58 59
   const [recommendVisibleData, setRecommendVisibleData] = useState({ visible: false, customerId: '' })
59 60
 
60
-  const [assistVisibleData, setAssistVisibleData] = useState({ visible: false, customerId: '', buildingId: '' })
61
+  const [assistVisibleData, setAssistVisibleData] = useState({ visible: false, customerId: '',buildingId:'' })
61 62
 
62 63
   const [loadingStatus, setLoadingStatus] = useState(false)
63 64
 
64 65
   // 选中的公客信息
65 66
   const [personInfo, setPersonInfo] = useState([])
66 67
 
67
-  const [batchAssistVisibleData, setBatchAssistVisibleData] = useState({ visible: false, customerId: [], buildingId: '' })
68
+  const [batchAssistVisibleData, setBatchAssistVisibleData] = useState({ visible: false, customerId: [] ,buildingId:''})
68 69
 
69 70
   const [currentSelectedRows, setSelectedRows] = useState([])
70 71
 
71
-  const [selectedRowKeys, setSelectedRowKeys] = useState([])
72
+  const [selectedRowKeys,setSelectedRowKeys] = useState([])
73
+
74
+//  const [ radio, setRadio] = useState(true)
75
+
76
+  // const [page, setPage] = useState(1)
72 77
 
73 78
   // eslint-disable-next-line react-hooks/rules-of-hooks
74 79
   useEffect(() => {
@@ -88,16 +93,15 @@ function body(props) {
88 93
       localStorage.setItem("priPageParams", JSON.stringify({ pageNumber: 1, pageSize: 10, customerType }))
89 94
       getList({ pageNumber: 1, pageSize: 10, customerType })
90 95
     }
91
-  }, [])
96
+  }, []) 
92 97
 
93 98
   function getList(params) {
94 99
     // 网路请求
100
+    // setDataSource([])
101
+    // setRadio(true)
95 102
     request({ ...apis.customer.customerRecommend, params: { ...params } }).then(res => {
96
-      if (params.customerType === 'private') {
97
-        setDataSource(res)
98
-      } else {
99
-        setDataPub(res)
100
-      }
103
+      setDataSource(res)
104
+      setRadio(false)
101 105
     }).catch(err => {
102 106
       // eslint-disable-next-line no-unused-expressions
103 107
       <Alert
@@ -175,9 +179,9 @@ function body(props) {
175 179
 
176 180
   // 私客/公客切换
177 181
   function radioButtonHandleSizeChange(e) {
178
-
182
+    
179 183
     displayNone()
180
-
184
+    
181 185
     props.form.resetFields();
182 186
     const { value } = e.target
183 187
     setCustomerType(value)
@@ -199,8 +203,8 @@ function body(props) {
199 203
         // const { getFieldDecorator } = JSON.parse(localStorage.getItem("pageParams"))
200 204
         getList({ customerType, ...JSON.parse(localStorage.getItem("pubPageParams")) })
201 205
       } else {
202
-        localStorage.setItem("pubPageParams", JSON.stringify({ pageNumber: 1, pageSize: 10, customerType: 'public' }))
203
-        getList({ pageNumber: 1, pageSize: 10, customerType: 'public' })
206
+        localStorage.setItem("pubPageParams", JSON.stringify({ pageNumber: 1, pageSize: 10, customerType: value }))
207
+        getList({ pageNumber: 1, pageSize: 10, customerType: value })
204 208
       }
205 209
     }
206 210
 
@@ -211,7 +215,7 @@ function body(props) {
211 215
   function handleReset() {
212 216
     props.form.resetFields();
213 217
     if (customerType === 'private') {
214
-      localStorage.setItem("priPageParams", JSON.stringify({ pageNumber: 1, pageSize: 10, customerType: 'private' }));
218
+      localStorage.setItem("priPageParams", JSON.stringify({ pageNumber: 1, pageSize: 10, customerType: 'private', }));
215 219
       getList(JSON.parse(localStorage.getItem("priPageParams")))
216 220
     } else {
217 221
       localStorage.setItem("pubPageParams", JSON.stringify({ pageNumber: 1, pageSize: 10, customerType: 'public' }))
@@ -229,7 +233,7 @@ function body(props) {
229 233
     setRecordVisibleData({ visible: false, customerId: '' })
230 234
     setStatusVisibleData({ visible: false, customerId: '' })
231 235
     setRecommendVisibleData({ visible: false, customerId: '' })
232
-    setBatchAssistVisibleData({ visible: false, customerId: '', buildingId: '' })
236
+    setBatchAssistVisibleData({ visible: false, customerId: '',buildingId:'' })
233 237
   }
234 238
 
235 239
   function showRecord(record) {
@@ -237,7 +241,7 @@ function body(props) {
237 241
     setGVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
238 242
     setStatusVisibleData({ visible: false, customerId: '' })
239 243
     setRecommendVisibleData({ visible: false, customerId: '' })
240
-    setBatchAssistVisibleData({ visible: false, customerId: '', buildingId: '' })
244
+    setBatchAssistVisibleData({ visible: false, customerId: '',buildingId:'' })
241 245
   }
242 246
 
243 247
   function showStatus(record) {
@@ -245,7 +249,7 @@ function body(props) {
245 249
     setGVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
246 250
     setRecommendVisibleData({ visible: false, customerId: '' })
247 251
     setStatusVisibleData({ visible: true, customerId: record.customerId, status: record.status })
248
-    setBatchAssistVisibleData({ visible: false, customerId: '', buildingId: '' })
252
+    setBatchAssistVisibleData({ visible: false, customerId: '' ,buildingId:''})
249 253
   }
250 254
 
251 255
   // 推荐客户
@@ -258,13 +262,13 @@ function body(props) {
258 262
   }
259 263
 
260 264
   //分配置业顾问
261
-  function assistConsultant(personId, buildingId) {
265
+  function assistConsultant(personId,buildingId) {
262 266
     setGVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
263 267
     setRecordVisibleData({ visible: false, customerId: '' })
264 268
     setStatusVisibleData({ visible: false, customerId: '' })
265 269
     setRecommendVisibleData({ visible: false, customerId: '' })
266
-    setAssistVisibleData({ visible: true, customerId: personId, buildingId: buildingId })
267
-    setBatchAssistVisibleData({ visible: false, customerId: '', buildingId: '' })
270
+    setAssistVisibleData({ visible: true, customerId: personId ,buildingId:buildingId})
271
+    setBatchAssistVisibleData({ visible: false, customerId: '' ,buildingId:''})
268 272
   }
269 273
 
270 274
   function batchAssistConsultant() {
@@ -277,22 +281,22 @@ function body(props) {
277 281
     const compareSet = new Set();
278 282
     personInfo.filter(record => {
279 283
       compareSet.add(record.buildingName)
280
-    })
284
+    } )
281 285
 
282
-    if (compareSet.size != 1) {
283
-      return message.info("请选择项目");
286
+    if(compareSet.size != 1){
287
+      return message.info("选中的公客存在于不同项目中,请分开进行分配置业顾问操作");
284 288
     }
285 289
 
286 290
     // const newSelectedRows = personInfo.filter()  
287
-
291
+    
288 292
     // console.log(newSelectedRows,'newSelectedRows')
289 293
 
290 294
     setGVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
291 295
     setRecordVisibleData({ visible: false, customerId: '' })
292 296
     setStatusVisibleData({ visible: false, customerId: '' })
293 297
     setRecommendVisibleData({ visible: false, customerId: '' })
294
-    setAssistVisibleData({ visible: false, customerId: '', buildingId: '' })
295
-    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})
296 300
   }
297 301
 
298 302
   function toCustomerDateil(record) {
@@ -321,7 +325,7 @@ function body(props) {
321 325
         download(response)
322 326
         setLoadingStatus(false)
323 327
       }).catch(error => {
324
-        message.err('连接超时');
328
+        message.err("连接超时");
325 329
         setLoadingStatus(false)
326 330
       })
327 331
   }
@@ -343,10 +347,13 @@ function body(props) {
343 347
   function closeAttribution() {
344 348
     setGVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
345 349
     if (customerType === 'private') {
346
-      getList(JSON.parse(localStorage.getItem('priPageParams')))
350
+
351
+      getList(JSON.parse(localStorage.getItem("priPageParams")))
347 352
     } else {
348
-      getList(JSON.parse(localStorage.getItem('pubPageParams')))
353
+
354
+      getList(JSON.parse(localStorage.getItem("pubPageParams")))
349 355
     }
356
+
350 357
   }
351 358
   // 回调关闭所有弹框
352 359
   function closeAll() {
@@ -354,7 +361,7 @@ function body(props) {
354 361
     setGVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
355 362
     setStatusVisibleData({ visible: false, customerId: '', status: '' })
356 363
     setRecommendVisibleData({ visible: false, customerId: '' })
357
-    setAssistVisibleData({ visible: false, customerId: '', buildingId: '' })
364
+    setAssistVisibleData({ visible: false, customerId: '',buildingId:'' })
358 365
     setBatchAssistVisibleData({ visible: false, customerId: '' })
359 366
     if (customerType === 'private') {
360 367
 
@@ -372,11 +379,10 @@ function body(props) {
372 379
       console.log('selectedRowKeys:', selectedRowKeys, 'selectedRows: ', selectedRows);
373 380
       setSelectedRowKeys(selectedRowKeys)
374 381
       const newSelectedRows = personInfo.filter(x => !selectedRows.some(y => x.customerId === y.customerId))     // 去重
375
-        .concat(selectedRows)                                                                 // 新增选择
376
-        .filter(x => selectedRowKeys.some(y => y === x.customerId))                             // 去掉未选的数据
382
+                                .concat(selectedRows)                                                                 // 新增选择
383
+                                .filter(x => selectedRowKeys.some(y => y === x.customerId))                             // 去掉未选的数据
377 384
 
378 385
       // setSelectedRows(newSelectedRows)
379
-      console.log(newSelectedRows, "33333333333333333333")
380 386
       setPersonInfo(newSelectedRows)
381 387
     },
382 388
   };
@@ -389,7 +395,7 @@ function body(props) {
389 395
       align: 'center',
390 396
       width: '15%',
391 397
       // render: (_, record) => <Avatar shape="square" style={{ color: 'blue', cursor: 'pointer' }} onClick={() => publicCustomerDetail(record)} src={customerType === 'private' ? record.picture : record.avatarurl} size={64} icon="user" />,
392
-      render: (_, record) => <Avatar shape="square" style={{ color: 'blue', cursor: 'pointer' }} onClick={() => publicCustomerDetail(record)} src={record.picture} size={64} icon="user" />,
398
+      render: (_, record) => <Avatar shape="square" style={{ color: 'blue', cursor: 'pointer' }} onClick={() => publicCustomerDetail(record)} src={record.picture } size={64} icon="user" />,
393 399
     },
394 400
     {
395 401
       title: '姓名',
@@ -455,7 +461,7 @@ function body(props) {
455 461
             <Button className={customerType === 'private' ? Styles.displayS : Styles.text} type="link" onClick={() => showRecommend(record.personId)}>推荐客户</Button>
456 462
           </AuthButton>
457 463
           <AuthButton name="admin.customer.assign" noRight={null}>
458
-            <Button className={customerType === 'private' ? Styles.displayS : Styles.text} type="link" onClick={() => assistConsultant(record.customerId, record.buildingId)}>分配置业顾问</Button>
464
+            <Button className={customerType === 'private' ? Styles.displayS : Styles.text} type="link" onClick={() => assistConsultant(record.customerId,record.buildingId)}>分配置业顾问</Button>
459 465
           </AuthButton>
460 466
           <AuthButton name="admin.mine.taPointsRecords.point.record" noRight={null}>
461 467
             <Button className={Styles.text} type="link" onClick={() => showRecord(record)}>积分记录</Button>
@@ -579,7 +585,7 @@ function body(props) {
579 585
   return (
580 586
     <>
581 587
       <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
582
-        {customerType === 'public' && <Form.Item>
588
+      {customerType === 'public' && <Form.Item>
583 589
           {getFieldDecorator('belongStatus')(
584 590
             <Select style={{ width: '180px' }} placeholder="是否归属项目" onChange={handleSelectChange}>
585 591
               <Option value={1}>是</Option>

+ 1
- 1
src/pages/integralMall/editGoods.jsx 查看文件

@@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react';
2 2
 import { Input, Menu, Dropdown, Button, Icon, message, Table, Divider, Tag, Select, Form, Alert } from 'antd';
3 3
 import { FormattedMessage } from 'umi-plugin-react/locale';
4 4
 import channels from '../channel/channelList.less';
5
-import BuildSelect from '../../components/SelectButton/BuildSelect'
5
+import BuildSelect from '../../components/SelectButton/BuildSelect2'
6 6
 import XForm, { FieldTypes } from '../../components/XForm';
7 7
 import Wangedit from '../../components/Wangedit/Wangedit'
8 8
 import router from 'umi/router';

+ 1
- 1
src/pages/news/list/editNewsList.jsx 查看文件

@@ -5,7 +5,7 @@ import styles from '../../style/GoodsList.less';
5 5
 import apis from '../../../services/apis';
6 6
 import moment from 'moment';
7 7
 import router from 'umi/router';
8
-import BuildSelect from '../../../components/SelectButton/BuildSelect'
8
+import BuildSelect from '../../../components/SelectButton/BuildSelect2'
9 9
 import NewsTypeSelect from '../../../components/SelectButton/NewTypeSelect'
10 10
 import  { FieldTypes, createForm } from '../../../components/XForm';
11 11
 import Wangedit from '../../../components/Wangedit/Wangedit'