Pārlūkot izejas kodu

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

xujing 5 gadus atpakaļ
vecāks
revīzija
7f2a00e393

+ 2
- 2
src/pages/customer/customerlist/components/BatchAssistConsultant.jsx Parādīt failu

72
   getList(params) {
72
   getList(params) {
73
     // 网路请求
73
     // 网路请求
74
     console.log('params: ', params)
74
     console.log('params: ', params)
75
-    request({ ...apis.customer.buildingConsultant,params: { ...params } }).then(res => {
75
+    request({ ...apis.customer.buildingConsultant }).then(res => {
76
       this.setState({ dataSource: res })
76
       this.setState({ dataSource: res })
77
     }).catch(err => {
77
     }).catch(err => {
78
       
78
       
90
    // 分页
90
    // 分页
91
   onChange(pageNum) {
91
   onChange(pageNum) {
92
 
92
 
93
-    this.getList({ pageNumber: pageNum, pageSize: 5, buildingId: this.state.visibleData.buildingName })
93
+    this.getUserList({ pageNumber: pageNum, pageSize: 5, buildingId: this.state.visibleData.buildingName })
94
   }
94
   }
95
 
95
 
96
   // 提交
96
   // 提交

+ 18
- 8
src/pages/customer/customerlist/index.jsx Parādīt failu

67
 
67
 
68
   const [batchAssistVisibleData, setBatchAssistVisibleData] = useState({ visible: false, customerId: [] })
68
   const [batchAssistVisibleData, setBatchAssistVisibleData] = useState({ visible: false, customerId: [] })
69
 
69
 
70
+  const [currentSelectedRows, setSelectedRows] = useState([])
71
+
70
   // const [page, setPage] = useState(1)
72
   // const [page, setPage] = useState(1)
71
 
73
 
72
   // eslint-disable-next-line react-hooks/rules-of-hooks
74
   // eslint-disable-next-line react-hooks/rules-of-hooks
178
         props.form.setFieldsValue(JSON.parse(localStorage.getItem("priPageParams")));
180
         props.form.setFieldsValue(JSON.parse(localStorage.getItem("priPageParams")));
179
 
181
 
180
         getList(JSON.parse(localStorage.getItem("priPageParams")))
182
         getList(JSON.parse(localStorage.getItem("priPageParams")))
181
-      }else{
183
+      } else {
182
         localStorage.setItem("priPageParams", JSON.stringify({ pageNumber: 1, pageSize: 10, customerType: value }))
184
         localStorage.setItem("priPageParams", JSON.stringify({ pageNumber: 1, pageSize: 10, customerType: value }))
183
-      getList({ pageNumber: 1, pageSize: 10, customerType: value })
185
+        getList({ pageNumber: 1, pageSize: 10, customerType: value })
184
       }
186
       }
185
 
187
 
186
     } else {
188
     } else {
259
   }
261
   }
260
 
262
 
261
   function batchAssistConsultant() {
263
   function batchAssistConsultant() {
264
+    console.log(personInfo, 'personInfo')
262
     if (personInfo.length <= 0) {
265
     if (personInfo.length <= 0) {
263
       return message.info("请至少选择一条数据");
266
       return message.info("请至少选择一条数据");
264
     }
267
     }
347
   const rowSelection = {
350
   const rowSelection = {
348
     onChange: (selectedRowKeys, selectedRows) => {
351
     onChange: (selectedRowKeys, selectedRows) => {
349
       console.log('selectedRowKeys:', selectedRowKeys, 'selectedRows: ', selectedRows);
352
       console.log('selectedRowKeys:', selectedRowKeys, 'selectedRows: ', selectedRows);
350
-      setPersonInfo(selectedRows)
353
+      // const array = selectedRows + personInfo
354
+
355
+      const newSelectedRows = personInfo.filter(x => !selectedRows.some(y => x.personId === y.personId))     // 去重
356
+                                .concat(selectedRows)                                                                 // 新增选择
357
+                                .filter(x => selectedRowKeys.some(y => y === x.personId))                             // 去掉未选的数据
358
+
359
+      // setSelectedRows(newSelectedRows)
360
+      setPersonInfo(newSelectedRows)
351
     },
361
     },
352
   };
362
   };
353
 
363
 
569
         </Form.Item>}
579
         </Form.Item>}
570
         <Form.Item >
580
         <Form.Item >
571
           {getFieldDecorator('startCreateDate')(
581
           {getFieldDecorator('startCreateDate')(
572
-            <DatePicker placeholder="注册开始时间" format="YYYY-MM-DD HH:mm:ss" showTime={{ format: 'HH:mm:ss' }}/>)}
582
+            <DatePicker placeholder="注册开始时间" format="YYYY-MM-DD HH:mm:ss" showTime={{ format: 'HH:mm:ss' }} />)}
573
         </Form.Item>
583
         </Form.Item>
574
         <Form.Item >
584
         <Form.Item >
575
           {getFieldDecorator('endCreateDate')(
585
           {getFieldDecorator('endCreateDate')(
576
-            <DatePicker placeholder="注册结束时间" format="YYYY-MM-DD HH:mm:ss" showTime={{ format: 'HH:mm:ss' }}/>)}
586
+            <DatePicker placeholder="注册结束时间" format="YYYY-MM-DD HH:mm:ss" showTime={{ format: 'HH:mm:ss' }} />)}
577
         </Form.Item>
587
         </Form.Item>
578
         <Form.Item>
588
         <Form.Item>
579
           {getFieldDecorator('sceneType')(
589
           {getFieldDecorator('sceneType')(
581
           )}
591
           )}
582
         </Form.Item>
592
         </Form.Item>
583
         <Form.Item>
593
         <Form.Item>
584
-        {getFieldDecorator('sharePersonName')(
594
+          {getFieldDecorator('sharePersonName')(
585
             <Input placeholder="推广人" />,
595
             <Input placeholder="推广人" />,
586
           )}
596
           )}
587
         </Form.Item>
597
         </Form.Item>
631
           //     onClick: () => toCustomerDateil(record),
641
           //     onClick: () => toCustomerDateil(record),
632
           //   };
642
           //   };
633
           // }}
643
           // }}
634
-          dataSource={dataSource.records} columns={privateColumns} pagination={{ current: dataSource.current, total: dataSource.total, pageSize: dataSource.size, onChange }} rowKey={r=>r.customerId} /> :
644
+          dataSource={dataSource.records} columns={privateColumns} pagination={{ current: dataSource.current, total: dataSource.total, pageSize: dataSource.size, onChange }} rowKey={r => r.customerId} /> :
635
         <Table rowSelection={rowSelection}
645
         <Table rowSelection={rowSelection}
636
           // onRow={record => {
646
           // onRow={record => {
637
           //   return {
647
           //   return {
638
           //     onClick: () => publicCustomerDetail(record),
648
           //     onClick: () => publicCustomerDetail(record),
639
           //   };
649
           //   };
640
           // }}
650
           // }}
641
-          dataSource={dataSource.records} columns={publicColumns} pagination={{ current: dataSource.current, total: dataSource.total, pageSize: dataSource.size, onChange }} rowKey={r=>r.customerId} />
651
+          dataSource={dataSource.records} columns={publicColumns} pagination={{ current: dataSource.current, total: dataSource.total, pageSize: dataSource.size, onChange }} rowKey={r => r.personId} />
642
       }
652
       }
643
 
653
 
644
       {/* 调整归属 */}
654
       {/* 调整归属 */}