魏熙美 пре 5 година
родитељ
комит
a2ca56d2bb
1 измењених фајлова са 17 додато и 19 уклоњено
  1. 17
    19
      src/pages/customer/independentList/index.jsx

+ 17
- 19
src/pages/customer/independentList/index.jsx Прегледај датотеку

@@ -155,13 +155,13 @@ class InviteTable extends React.Component {
155 155
 
156 156
   // 挂载之后
157 157
   componentDidMount () {
158
-    const { customerId } = this.state.visibleData
159
-    this.getList({ id: customerId, pageNumber: 1, pageSize: 5 })
158
+    
160 159
   }
161 160
 
162 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 165
       this.getList({ id: customerId, pageNumber: 1, pageSize: 5 })
166 166
       this.setState({ visibleData: this.props.visibleData });
167 167
     }
@@ -170,31 +170,27 @@ class InviteTable extends React.Component {
170 170
   // 弹框确定按钮
171 171
   // eslint-disable-next-line react/sort-comp
172 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 178
   handleCancel () {
178
-    this.setState({ visibleData: { visible: false, customerId: '', realtyConsultant: '' } })
179
+    this.setState({ dataSource: { records: [] } })
180
+    this.props.onCancel()
179 181
   }
180 182
 
181 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 187
       return
185 188
     }
186 189
     request({ ...apis.customer.InviteClientsList, params: { ...params } }).then(res => {
187 190
       this.setState({ dataSource: res })
188 191
     }).catch(err => {
189 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,7 +232,7 @@ class InviteTable extends React.Component {
236 232
     return (
237 233
       <>
238 234
         <Modal
239
-          title="推荐客户"
235
+          title="邀请经纪人"
240 236
           destroyOnClose="true"
241 237
           width={900}
242 238
           footer={null}
@@ -451,9 +447,11 @@ function body (props) {
451 447
         导出
452 448
       </Button>
453 449
       <Table rowKey="independentIndex" dataSource={dataSource.records} columns={columns} pagination={{ total: dataSource.total, onChange }} />
454
-      {/* 调整归属 */}
450
+      {/* 推荐客户 */}
455 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
 }