魏熙美 5 年之前
父節點
當前提交
a2ca56d2bb
共有 1 個文件被更改,包括 17 次插入19 次删除
  1. 17
    19
      src/pages/customer/independentList/index.jsx

+ 17
- 19
src/pages/customer/independentList/index.jsx 查看文件

155
 
155
 
156
   // 挂载之后
156
   // 挂载之后
157
   componentDidMount () {
157
   componentDidMount () {
158
-    const { customerId } = this.state.visibleData
159
-    this.getList({ id: customerId, pageNumber: 1, pageSize: 5 })
158
+    
160
   }
159
   }
161
 
160
 
162
   componentDidUpdate (preProps, preState) {
161
   componentDidUpdate (preProps, preState) {
163
-    const { customerId } = this.state.visibleData
164
-    if (this.props.visibleData.customerId !== preState.visibleData.customerId) {
162
+    const { customerId } = this.props.visibleData
163
+    
164
+    if (this.props.visibleData.visible !== preState.visibleData.visible) {
165
       this.getList({ id: customerId, pageNumber: 1, pageSize: 5 })
165
       this.getList({ id: customerId, pageNumber: 1, pageSize: 5 })
166
       this.setState({ visibleData: this.props.visibleData });
166
       this.setState({ visibleData: this.props.visibleData });
167
     }
167
     }
170
   // 弹框确定按钮
170
   // 弹框确定按钮
171
   // eslint-disable-next-line react/sort-comp
171
   // eslint-disable-next-line react/sort-comp
172
   handleOk () {
172
   handleOk () {
173
-    this.setState({ visibleData: { visible: false, customerId: '', realtyConsultant: '' } })
173
+    this.setState({ dataSource: { records: [] } })
174
+    this.props.onCancel()
174
   }
175
   }
175
 
176
 
176
   // 弹框取消按钮
177
   // 弹框取消按钮
177
   handleCancel () {
178
   handleCancel () {
178
-    this.setState({ visibleData: { visible: false, customerId: '', realtyConsultant: '' } })
179
+    this.setState({ dataSource: { records: [] } })
180
+    this.props.onCancel()
179
   }
181
   }
180
 
182
 
181
   getList (params) {
183
   getList (params) {
182
-    const { customerId } = this.props.visibleData
183
-    if (customerId === '' || customerId === undefined) {
184
+    const { id } = params
185
+    console.log(id)
186
+    if (id === '' || id === undefined) {
184
       return
187
       return
185
     }
188
     }
186
     request({ ...apis.customer.InviteClientsList, params: { ...params } }).then(res => {
189
     request({ ...apis.customer.InviteClientsList, params: { ...params } }).then(res => {
187
       this.setState({ dataSource: res })
190
       this.setState({ dataSource: res })
188
     }).catch(err => {
191
     }).catch(err => {
189
       // eslint-disable-next-line no-unused-expressions
192
       // eslint-disable-next-line no-unused-expressions
190
-      <Alert
191
-        style={{
192
-          marginBottom: 24,
193
-        }}
194
-        message={err}
195
-        type="error"
196
-        showIcon
197
-      />
193
+    
198
     })
194
     })
199
   }
195
   }
200
 
196
 
236
     return (
232
     return (
237
       <>
233
       <>
238
         <Modal
234
         <Modal
239
-          title="推荐客户"
235
+          title="邀请经纪人"
240
           destroyOnClose="true"
236
           destroyOnClose="true"
241
           width={900}
237
           width={900}
242
           footer={null}
238
           footer={null}
451
         导出
447
         导出
452
       </Button>
448
       </Button>
453
       <Table rowKey="independentIndex" dataSource={dataSource.records} columns={columns} pagination={{ total: dataSource.total, onChange }} />
449
       <Table rowKey="independentIndex" dataSource={dataSource.records} columns={columns} pagination={{ total: dataSource.total, onChange }} />
454
-      {/* 调整归属 */}
450
+      {/* 推荐客户 */}
455
       <ModalTable visibleData={gVisibleData} />
451
       <ModalTable visibleData={gVisibleData} />
456
-      <InviteTable visibleData={gInviteData} />
452
+
453
+      {/* 邀请经纪人 */}
454
+      <InviteTable visibleData={gInviteData} onCancel={() => setGInviteData({ visible: false, customerId: '', realtyConsultant: '' })} />
457
     </>
455
     </>
458
   );
456
   );
459
 }
457
 }