瀏覽代碼

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

# Conflicts:
#	src/pages/channel/independentList/index.jsx
魏超 5 年之前
父節點
當前提交
8cf1d99f41

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

@@ -1,10 +1,11 @@
1 1
 import React, { useState, useEffect } from 'react';
2 2
 import { Form, Input, Button, Icon, Select, Tabs, Radio, DatePicker, message, Upload } from 'antd';
3 3
 import { FormattedMessage } from 'umi-plugin-react/locale';
4
+import Prompt from 'umi/prompt';
5
+import router from 'umi/router';
4 6
 import styles from '../style/GoodsList.less';
5 7
 import apis from '../../services/apis';
6 8
 import moment from 'moment';
7
-import router from 'umi/router';
8 9
 import BuildSelect from '../../components/SelectButton/BuildSelect'
9 10
 import XForm, { FieldTypes } from '../../components/XForm';
10 11
 import Wangedit from '../../components/Wangedit/Wangedit'
@@ -16,7 +17,6 @@ import touxiang from '../../assets/touxiang.jpg';
16 17
 import poster1 from '../../assets/poster1.png';
17 18
 import poster2 from '../../assets/poster2.png';
18 19
 import xiaochengxu from '../../assets/xiaochengxu.png'
19
-import Prompt from 'umi/prompt';
20 20
 
21 21
 const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
22 22
 const { TextArea } = Input;
@@ -72,16 +72,15 @@ const BasicForm = props => {
72 72
     function compareDate(dateTime1, dateTime2) {
73 73
       return new Date(dateTime1) > new Date(dateTime2)
74 74
     }
75
-    
76 75
     // 1)修改后的开始时间不得大于当前时间(会存在已经成功报名的用户)
77 76
 
78 77
     // (2)修改后开始时间<当前时间<修改后结束时间:活动进行中
79 78
 
80 79
     // (3)修改后结束时间<当前时间:活动已结束
81 80
     if (showSignupTime[0]) {
82
-      const date = data.signupTime
81
+      // const date = data.signupTime
83 82
       const nowDate = new Date()
84
-      console.log(compareDate(nowDate, showSignupTime[0]))
83
+      // console.log(compareDate(nowDate, showSignupTime[0]))
85 84
       if (compareDate(nowDate, showSignupTime[0])) {
86 85
         return true
87 86
       } else {

+ 3
- 2
src/pages/channel/independentList/index.jsx 查看文件

@@ -47,6 +47,7 @@ class ModalTable extends React.Component {
47 47
   }
48 48
 
49 49
   getList(params) {
50
+    // eslint-disable-next-line no-console
50 51
     console.log('this.state.visibleData', this.state.visibleData)
51 52
     const { customerId } = this.state.visibleData
52 53
     if (customerId === '' || customerId === undefined) {
@@ -156,13 +157,13 @@ class ModalTable extends React.Component {
156 157
           // onOk={() => this.handleOk()}
157 158
           onCancel={(e) => this.handleCancel(e)}
158 159
         >
159
-          <Table rowKey="independentList" dataSource={this.state.dataSource.records} columns={columns} pagination={{ pageSize: 5, total: this.state.dataSource.total, onChange: e => this.onChange(e) }} />
160
+          <Table rowKey="independentList" dataSource={this.state.dataSource.records} columns={columns} pagination={{ current: this.state.dataSource.current, pageSize: this.state.dataSource.size, total: this.state.dataSource.total, onChange: e => this.onChange(e) }} />
160 161
         </Modal>
161 162
       </>
162 163
     );
163 164
   }
164 165
 }
165
-
166
+// defaultCurrent={1} total={dataSource.total} pageSize={6} onChange={onChange} current={dataSource.current}
166 167
 
167 168
 /**
168 169
  * 邀请客户

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

@@ -35,7 +35,7 @@ class ModalAttribution extends React.Component {
35 35
   componentDidUpdate(preProps, preState) {
36 36
     console.log(this.props.visibleData)
37 37
     if (this.props.visibleData.visible !== preState.visibleData.visible) {
38
-      this.getList({ pageNumber: 1, pageSize: 5, customerId: this.props.visibleData.customerId })
38
+      this.getList({ pageNumber: 1, pageSize: 5, customerId: this.props.visibleData.customerId ,buildingId: this.props.visibleData.buildingId})
39 39
       this.setState({ visibleData: this.props.visibleData });
40 40
     }
41 41
   }
@@ -72,7 +72,7 @@ class ModalAttribution extends React.Component {
72 72
   getList(params) {
73 73
     // 网路请求
74 74
     console.log('params: ', params)
75
-    request({ ...apis.customer.buildingConsultant }).then(res => {
75
+    request({ ...apis.customer.buildingConsultant , params: { ...params }}).then(res => {
76 76
       this.setState({ dataSource: res })
77 77
     }).catch(err => {
78 78
       
@@ -151,7 +151,7 @@ class ModalAttribution extends React.Component {
151 151
             onCancel={(e) => this.handleCancel(e)}
152 152
           >
153 153
             <span>你正在为{this.props.visibleData.customerId.length}位公客分配置业顾问</span><br/><br/>
154
-            <BuildSelect onChange={this.changBuilding.bind(this)} value={this.state.visibleData.buildingName} />
154
+            {this.props.visibleData.buildingId == null && <BuildSelect onChange={this.changBuilding.bind(this)} value={this.state.visibleData.buildingName} />}
155 155
             <Table rowKey="BatchAssistConsultant" dataSource={this.state.dataSource.records} columns={columns} pagination={{pageSize: 5, total: this.state.dataSource.total, onChange: e => this.onChange(e) }} />
156 156
           </Modal>
157 157
       </>

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

@@ -34,7 +34,7 @@ class ModalAttribution extends React.Component {
34 34
   componentDidUpdate(preProps, preState) {
35 35
     console.log(this.props.visibleData)
36 36
     if (this.props.visibleData.visible !== preState.visibleData.visible) {
37
-      this.getList({ pageNumber: 1, pageSize: 5, customerId: this.props.visibleData.customerId })
37
+      this.getList({ pageNumber: 1, pageSize: 5, customerId: this.props.visibleData.customerId,buildingId:this.props.visibleData.buildingId })
38 38
       this.setState({ visibleData: this.props.visibleData });
39 39
     }
40 40
   }
@@ -147,7 +147,7 @@ class ModalAttribution extends React.Component {
147 147
             visible={this.state.visibleData.visible}
148 148
             onCancel={(e) => this.handleCancel(e)}
149 149
           >
150
-            <BuildSelect onChange={this.changBuilding.bind(this)} value={this.state.visibleData.buildingName} />
150
+            {this.props.visibleData.buildingId == null && <BuildSelect  onChange={this.changBuilding.bind(this)} value={this.state.visibleData.buildingName} />}
151 151
             <Table rowKey="assistConsultant" dataSource={this.state.dataSource.records} columns={columns} pagination={{pageSize: 5, total: this.state.dataSource.total, onChange: e => this.onChange(e) }} />
152 152
           </Modal>
153 153
       </>

+ 33
- 13
src/pages/customer/customerlist/index.jsx 查看文件

@@ -58,17 +58,19 @@ function body(props) {
58 58
   // 推荐客户
59 59
   const [recommendVisibleData, setRecommendVisibleData] = useState({ visible: false, customerId: '' })
60 60
 
61
-  const [assistVisibleData, setAssistVisibleData] = useState({ visible: false, customerId: '' })
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: [] })
68
+  const [batchAssistVisibleData, setBatchAssistVisibleData] = useState({ visible: false, customerId: [] ,buildingId:''})
69 69
 
70 70
   const [currentSelectedRows, setSelectedRows] = useState([])
71 71
 
72
+  const [selectedRowKeys,setSelectedRowKeys] = useState([])
73
+
72 74
 //  const [ radio, setRadio] = useState(true)
73 75
 
74 76
   // const [page, setPage] = useState(1)
@@ -91,7 +93,7 @@ function body(props) {
91 93
       localStorage.setItem("priPageParams", JSON.stringify({ pageNumber: 1, pageSize: 10, customerType }))
92 94
       getList({ pageNumber: 1, pageSize: 10, customerType })
93 95
     }
94
-  }, [])
96
+  }, []) 
95 97
 
96 98
   function getList(params) {
97 99
     // 网路请求
@@ -124,6 +126,8 @@ function body(props) {
124 126
   function handleSubmit(e) {
125 127
     displayNone()
126 128
 
129
+    setPersonInfo([])
130
+    setSelectedRowKeys([])
127 131
 
128 132
     e.preventDefault();
129 133
     props.form.validateFields((err, values) => {
@@ -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: '' })
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: '' })
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: '' })
252
+    setBatchAssistVisibleData({ visible: false, customerId: '' ,buildingId:''})
249 253
   }
250 254
 
251 255
   // 推荐客户
@@ -258,26 +262,41 @@ function body(props) {
258 262
   }
259 263
 
260 264
   //分配置业顾问
261
-  function assistConsultant(personId) {
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 })
267
-    setBatchAssistVisibleData({ visible: false, customerId: '' })
270
+    setAssistVisibleData({ visible: true, customerId: personId ,buildingId:buildingId})
271
+    setBatchAssistVisibleData({ visible: false, customerId: '' ,buildingId:''})
268 272
   }
269 273
 
270 274
   function batchAssistConsultant() {
271 275
     console.log(personInfo, 'personInfo')
276
+    console.log(personInfo.length)
272 277
     if (personInfo.length <= 0) {
273 278
       return message.info("请至少选择一条数据");
274 279
     }
280
+
281
+    const compareSet = new Set();
282
+    personInfo.filter(record => {
283
+      compareSet.add(record.buildingName)
284
+    } )
285
+
286
+    if(compareSet.size != 1){
287
+      return message.info("请选择项目");
288
+    }
289
+
290
+    // const newSelectedRows = personInfo.filter()  
291
+    
292
+    // console.log(newSelectedRows,'newSelectedRows')
293
+
275 294
     setGVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
276 295
     setRecordVisibleData({ visible: false, customerId: '' })
277 296
     setStatusVisibleData({ visible: false, customerId: '' })
278 297
     setRecommendVisibleData({ visible: false, customerId: '' })
279
-    setAssistVisibleData({ visible: false, customerId: '' })
280
-    setBatchAssistVisibleData({ visible: true, customerId: personInfo })
298
+    setAssistVisibleData({ visible: false, customerId: '',buildingId:'' })
299
+    setBatchAssistVisibleData({ visible: true, customerId: personInfo, buildingId: personInfo[0].buildingId})
281 300
   }
282 301
 
283 302
   function toCustomerDateil(record) {
@@ -342,7 +361,7 @@ function body(props) {
342 361
     setGVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
343 362
     setStatusVisibleData({ visible: false, customerId: '', status: '' })
344 363
     setRecommendVisibleData({ visible: false, customerId: '' })
345
-    setAssistVisibleData({ visible: false, customerId: '' })
364
+    setAssistVisibleData({ visible: false, customerId: '',buildingId:'' })
346 365
     setBatchAssistVisibleData({ visible: false, customerId: '' })
347 366
     if (customerType === 'private') {
348 367
 
@@ -363,6 +382,7 @@ function body(props) {
363 382
                                 .filter(x => selectedRowKeys.some(y => y === x.customerId))                             // 去掉未选的数据
364 383
 
365 384
       // setSelectedRows(newSelectedRows)
385
+      console.log(newSelectedRows,"33333333333333333333")
366 386
       setPersonInfo(newSelectedRows)
367 387
     },
368 388
   };
@@ -441,7 +461,7 @@ function body(props) {
441 461
             <Button className={customerType === 'private' ? Styles.displayS : Styles.text} type="link" onClick={() => showRecommend(record.personId)}>推荐客户</Button>
442 462
           </AuthButton>
443 463
           <AuthButton name="admin.customer.assign" noRight={null}>
444
-            <Button className={customerType === 'private' ? Styles.displayS : Styles.text} type="link" onClick={() => assistConsultant(record.customerId)}>分配置业顾问</Button>
464
+            <Button className={customerType === 'private' ? Styles.displayS : Styles.text} type="link" onClick={() => assistConsultant(record.customerId,record.buildingId)}>分配置业顾问</Button>
445 465
           </AuthButton>
446 466
           <AuthButton name="admin.mine.taPointsRecords.point.record" noRight={null}>
447 467
             <Button className={Styles.text} type="link" onClick={() => showRecord(record)}>积分记录</Button>