zhoulisen 5 年前
父节点
当前提交
723a310cbf

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

22
     super(props);
22
     super(props);
23
     console.log(props, 'props')
23
     console.log(props, 'props')
24
     this.state = {
24
     this.state = {
25
-       dataSource: { records: [] },
26
-       visibleData: { visible: false, customerId: [], buildingName: '' },
25
+      dataSource: { records: [] },
26
+      visibleData: { visible: false, customerId: [], buildingName: '' },
27
+      buildingId: ''
27
     }
28
     }
28
   }
29
   }
29
 
30
 
33
   }
34
   }
34
 
35
 
35
   componentDidUpdate(preProps, preState) {
36
   componentDidUpdate(preProps, preState) {
37
+    // this.setState({ buildingId: this.props.visibleData.buildingId })
36
     console.log(this.props.visibleData)
38
     console.log(this.props.visibleData)
37
     if (this.props.visibleData.visible !== preState.visibleData.visible) {
39
     if (this.props.visibleData.visible !== preState.visibleData.visible) {
38
-      this.getList({ pageNumber: 1, pageSize: 5,buildingId: this.props.visibleData.buildingId})
40
+
41
+      this.getList({ pageNumber: 1, pageSize: 5, buildingId: this.props.visibleData.buildingId })
39
       this.setState({ visibleData: this.props.visibleData });
42
       this.setState({ visibleData: this.props.visibleData });
40
     }
43
     }
41
   }
44
   }
51
     this.props.onCancel()
54
     this.props.onCancel()
52
   }
55
   }
53
 
56
 
54
-  changBuilding(buildingId){
55
-    this.getUserList({ pageNumber: 1, pageSize: 5, buildingId: buildingId })
57
+  changBuilding(buildingId) {
58
+    this.getUserList({ pageNumber: 1, pageSize: 5, buildingId: this.buildingId })
56
     this.setState({ visibleData: { visible: this.props.visibleData.visible, customerId: this.props.visibleData.customerId, buildingName: buildingId } });
59
     this.setState({ visibleData: { visible: this.props.visibleData.visible, customerId: this.props.visibleData.customerId, buildingName: buildingId } });
57
   }
60
   }
58
 
61
 
59
-  getUserList(params){
62
+  getUserList(params) {
60
     console.log('params: ', params)
63
     console.log('params: ', params)
61
     if (params.buildingId === '' || params.buildingId === null || params.buildingId === undefined) {
64
     if (params.buildingId === '' || params.buildingId === null || params.buildingId === undefined) {
62
       return
65
       return
65
     request({ ...apis.customer.buildingConsultant, params: { ...params } }).then(res => {
68
     request({ ...apis.customer.buildingConsultant, params: { ...params } }).then(res => {
66
       this.setState({ dataSource: res })
69
       this.setState({ dataSource: res })
67
     }).catch(err => {
70
     }).catch(err => {
68
-      
71
+
69
     })
72
     })
70
   }
73
   }
71
 
74
 
72
   getList(params) {
75
   getList(params) {
73
     // 网路请求
76
     // 网路请求
74
     console.log('params: ', params)
77
     console.log('params: ', params)
75
-    request({ ...apis.customer.buildingConsultant , params: { ...params }}).then(res => {
78
+    request({ ...apis.customer.buildingConsultant, params: { ...params } }).then(res => {
76
       this.setState({ dataSource: res })
79
       this.setState({ dataSource: res })
77
     }).catch(err => {
80
     }).catch(err => {
78
-      
81
+
79
     })
82
     })
80
   }
83
   }
81
 
84
 
87
     });
90
     });
88
   };
91
   };
89
 
92
 
90
-   // 分页
93
+  // 分页
91
   onChange(pageNum) {
94
   onChange(pageNum) {
92
 
95
 
93
-    this.getUserList({ pageNumber: pageNum, pageSize: 5, buildingId: this.state.visibleData.buildingName })
96
+    this.getList({ pageNumber: pageNum, pageSize: 5, buildingId: this.state.visibleData.buildingId })
94
   }
97
   }
95
 
98
 
96
   // 提交
99
   // 提交
138
         dataIndex: 'personId',
141
         dataIndex: 'personId',
139
         key: 'personId',
142
         key: 'personId',
140
         // eslint-disable-next-line no-nested-ternary
143
         // eslint-disable-next-line no-nested-ternary
141
-        render: (_, record) => <>{ <Button type="danger" onClick={() => this.submitGm(record)}>确定</Button>}</>, },
144
+        render: (_, record) => <>{<Button type="danger" onClick={() => this.submitGm(record)}>确定</Button>}</>,
145
+      },
142
     ]
146
     ]
143
     return (
147
     return (
144
       <>
148
       <>
145
         <Modal
149
         <Modal
146
-            title="分配置业顾问"
147
-            width={800}
148
-            destroyOnClose="true"
149
-            footer={null}
150
-            visible={this.state.visibleData.visible}
151
-            onCancel={(e) => this.handleCancel(e)}
152
-          >
153
-            <span>你正在为{this.props.visibleData.customerId.length}位公客分配置业顾问</span><br/><br/>
154
-            {this.props.visibleData.buildingId == null && <BuildSelect onChange={this.changBuilding.bind(this)} value={this.state.visibleData.buildingName} />}
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
-          </Modal>
150
+          title="分配置业顾问"
151
+          width={800}
152
+          destroyOnClose="true"
153
+          footer={null}
154
+          visible={this.state.visibleData.visible}
155
+          onCancel={(e) => this.handleCancel(e)}
156
+        >
157
+          <span>你正在为{this.props.visibleData.customerId.length}位公客分配置业顾问</span><br /><br />
158
+          {this.props.visibleData.buildingId == null && <BuildSelect onChange={this.changBuilding.bind(this)} value={this.state.visibleData.buildingName} />}
159
+          <Table rowKey="BatchAssistConsultant" dataSource={this.state.dataSource.records} columns={columns} pagination={{ pageSize: 5, total: this.state.dataSource.total, onChange: e => this.onChange(e) }} />
160
+        </Modal>
157
       </>
161
       </>
158
     );
162
     );
159
   }
163
   }

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

21
   constructor(props) {
21
   constructor(props) {
22
     super(props);
22
     super(props);
23
     this.state = {
23
     this.state = {
24
-       dataSource: { records: [] },
25
-       visibleData: { visible: false, customerId: '', buildingName: '' },
24
+      dataSource: { records: [] },
25
+      visibleData: { visible: false, customerId: '', buildingName: '' },
26
     }
26
     }
27
   }
27
   }
28
 
28
 
34
   componentDidUpdate(preProps, preState) {
34
   componentDidUpdate(preProps, preState) {
35
     console.log(this.props.visibleData)
35
     console.log(this.props.visibleData)
36
     if (this.props.visibleData.visible !== preState.visibleData.visible) {
36
     if (this.props.visibleData.visible !== preState.visibleData.visible) {
37
-      this.getList({ pageNumber: 1, pageSize: 5, customerId: this.props.visibleData.customerId,buildingId:this.props.visibleData.buildingId })
37
+      this.getList({ pageNumber: 1, pageSize: 5, customerId: this.props.visibleData.customerId, buildingId: this.props.visibleData.buildingId })
38
       this.setState({ visibleData: this.props.visibleData });
38
       this.setState({ visibleData: this.props.visibleData });
39
     }
39
     }
40
   }
40
   }
50
     this.props.onCancel()
50
     this.props.onCancel()
51
   }
51
   }
52
 
52
 
53
-  changBuilding(buildingId){
53
+  changBuilding(buildingId) {
54
     this.getUserList({ pageNumber: 1, pageSize: 5, buildingId: buildingId })
54
     this.getUserList({ pageNumber: 1, pageSize: 5, buildingId: buildingId })
55
     this.setState({ visibleData: { visible: this.props.visibleData.visible, customerId: this.props.visibleData.customerId, buildingName: buildingId } });
55
     this.setState({ visibleData: { visible: this.props.visibleData.visible, customerId: this.props.visibleData.customerId, buildingName: buildingId } });
56
   }
56
   }
57
 
57
 
58
-  getUserList(params){
58
+  getUserList(params) {
59
     console.log('params: ', params)
59
     console.log('params: ', params)
60
     if (params.buildingId === '' || params.buildingId === null || params.buildingId === undefined) {
60
     if (params.buildingId === '' || params.buildingId === null || params.buildingId === undefined) {
61
       return
61
       return
64
     request({ ...apis.customer.buildingConsultant, params: { ...params } }).then(res => {
64
     request({ ...apis.customer.buildingConsultant, params: { ...params } }).then(res => {
65
       this.setState({ dataSource: res })
65
       this.setState({ dataSource: res })
66
     }).catch(err => {
66
     }).catch(err => {
67
-      
67
+
68
     })
68
     })
69
   }
69
   }
70
 
70
 
73
     request({ ...apis.customer.buildingConsultant, params: { ...params } }).then(res => {
73
     request({ ...apis.customer.buildingConsultant, params: { ...params } }).then(res => {
74
       this.setState({ dataSource: res })
74
       this.setState({ dataSource: res })
75
     }).catch(err => {
75
     }).catch(err => {
76
-      
76
+
77
     })
77
     })
78
   }
78
   }
79
 
79
 
85
     });
85
     });
86
   };
86
   };
87
 
87
 
88
-   // 分页
88
+  // 分页
89
   onChange(pageNum) {
89
   onChange(pageNum) {
90
-    this.getList({ pageNumber: pageNum, pageSize: 5, buildingId: this.state.visibleData.buildingName })
90
+    this.getList({ pageNumber: pageNum, pageSize: 5, customerId: this.props.visibleData.customerId, buildingId: this.props.visibleData.buildingId })
91
   }
91
   }
92
 
92
 
93
   // 提交
93
   // 提交
135
         dataIndex: 'personId',
135
         dataIndex: 'personId',
136
         key: 'personId',
136
         key: 'personId',
137
         // eslint-disable-next-line no-nested-ternary
137
         // eslint-disable-next-line no-nested-ternary
138
-        render: (_, record) => <>{ <Button type="danger" onClick={() => this.submitGm(record)}>确定</Button>}</>, },
138
+        render: (_, record) => <>{<Button type="danger" onClick={() => this.submitGm(record)}>确定</Button>}</>,
139
+      },
139
     ]
140
     ]
140
     return (
141
     return (
141
       <>
142
       <>
142
         <Modal
143
         <Modal
143
-            title="分配置业顾问"
144
-            width={800}
145
-            destroyOnClose="true"
146
-            footer={null}
147
-            visible={this.state.visibleData.visible}
148
-            onCancel={(e) => this.handleCancel(e)}
149
-          >
150
-            {this.props.visibleData.buildingId == null && <BuildSelect  onChange={this.changBuilding.bind(this)} value={this.state.visibleData.buildingName} />}
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
-          </Modal>
144
+          title="分配置业顾问"
145
+          width={800}
146
+          destroyOnClose="true"
147
+          footer={null}
148
+          visible={this.state.visibleData.visible}
149
+          onCancel={(e) => this.handleCancel(e)}
150
+        >
151
+          {this.props.visibleData.buildingId == null && <BuildSelect onChange={this.changBuilding.bind(this)} value={this.state.visibleData.buildingName} />}
152
+          <Table rowKey="assistConsultant" dataSource={this.state.dataSource.records} columns={columns} pagination={{ pageSize: 5, total: this.state.dataSource.total, onChange: e => this.onChange(e) }} />
153
+        </Modal>
153
       </>
154
       </>
154
     );
155
     );
155
   }
156
   }

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

699
           //     onClick: () => publicCustomerDetail(record),
699
           //     onClick: () => publicCustomerDetail(record),
700
           //   };
700
           //   };
701
           // }}
701
           // }}
702
-          dataSource={dataPub.records} columns={publicColumns} pagination={{ current: dataPub.current, total: dataPub.total, pageSize: dataPub.size, onChange }} rowKey={r => r.customerId} >{console.log(dataPub, '123')}</Table>
702
+          dataSource={dataPub.records} columns={publicColumns} pagination={{ current: dataPub.current, total: dataPub.total, pageSize: dataPub.size, onChange }} rowKey={r => r.customerId} ></Table>
703
       }
703
       }
704
 
704
 
705
       {/* 调整归属 */}
705
       {/* 调整归属 */}