浏览代码

modal 不知道为啥联动出现,临时解决

魏熙美 5 年前
父节点
当前提交
0465619788
共有 2 个文件被更改,包括 16 次插入12 次删除
  1. 2
    2
      src/pages/customer/customerlist/components/integralRecord.jsx
  2. 14
    10
      src/pages/customer/customerlist/index.jsx

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

41
   // 弹框确定按钮
41
   // 弹框确定按钮
42
   // eslint-disable-next-line react/sort-comp
42
   // eslint-disable-next-line react/sort-comp
43
   handleOk() {
43
   handleOk() {
44
-    this.setState({ visibleData: { visible: false, customerId: '', realtyConsultant: '' } })
44
+    this.setState({ visibleData: { visible: false, customerId: '' } })
45
   }
45
   }
46
 
46
 
47
   // 弹框取消按钮
47
   // 弹框取消按钮
48
   handleCancel() {
48
   handleCancel() {
49
-    this.setState({ visibleData: { visible: false, customerId: '', realtyConsultant: '' } })
49
+    this.setState({ visibleData: { visible: false, customerId: '' } })
50
   }
50
   }
51
 
51
 
52
   getList(params) {
52
   getList(params) {

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

32
   // 调整归属 ============  start
32
   // 调整归属 ============  start
33
   // eslint-disable-next-line react-hooks/rules-of-hooks
33
   // eslint-disable-next-line react-hooks/rules-of-hooks
34
   const [gVisibleData, setGVisibleData] = useState({ visible: false, customerId: '', realtyConsultant: '' })
34
   const [gVisibleData, setGVisibleData] = useState({ visible: false, customerId: '', realtyConsultant: '' })
35
-
36
   // 调整归属 ============= end
35
   // 调整归属 ============= end
37
 
36
 
38
   // 积分记录 ============  start
37
   // 积分记录 ============  start
39
   // eslint-disable-next-line react-hooks/rules-of-hooks
38
   // eslint-disable-next-line react-hooks/rules-of-hooks
40
-  const [recordVisibleData, setRecordVisibleData] = useState({ visible: false, personId: '' })
41
-
39
+  const [recordVisibleData, setRecordVisibleData] = useState({ visible: false, customerId: '' })
42
   // 积分记录 ============= end
40
   // 积分记录 ============= end
43
 
41
 
44
   // eslint-disable-next-line react-hooks/rules-of-hooks
42
   // eslint-disable-next-line react-hooks/rules-of-hooks
92
     getList({ pageNumber: 1, pageSize: 10, customerType: value })
90
     getList({ pageNumber: 1, pageSize: 10, customerType: value })
93
   }
91
   }
94
 
92
 
95
-  // 调整归属 ============ start
96
-  // 调整归属 显示
97
-  function gM(row) {
98
-    setGVisibleData({ visible: true, customerId: row.customerId, realtyConsultant: row.realtyConsultant })
93
+  // 这里有个 Bug, 就是 Modal 弹框,会联动出现, 比如 我点击 调整归属的Model弹框, 那么 积分记录的Model弹框莫名其妙的也显示了
94
+  // 所有这里临时解决方法是,弹出一个Modal对话框的时候,把其他的对话框给隐藏
95
+
96
+function showGM(record) {
97
+    setGVisibleData({ visible: true, customerId: record.customerId, realtyConsultant: record.realtyConsultant })
98
+    setRecordVisibleData({ visible: false, customerId: '' })
99
+  }
100
+
101
+  function showRecord(record) {
102
+    setRecordVisibleData({ visible: true, customerId: record.customerId })
103
+    setGVisibleData({ visible: false, customerId: '', realtyConsultant: '' })
99
   }
104
   }
100
-  // 调整归属 ============ end
101
 
105
 
102
   const columns = [
106
   const columns = [
103
     {
107
     {
154
         <>
158
         <>
155
           <Button className={ customerType === 'private' ? Styles.text : Styles.displayS } type="link">变更状态</Button>
159
           <Button className={ customerType === 'private' ? Styles.text : Styles.displayS } type="link">变更状态</Button>
156
           &nbsp;&nbsp;
160
           &nbsp;&nbsp;
157
-          <Button className={ customerType === 'private' ? Styles.text : Styles.displayS } type="link" onClick={() => gM(record)}>调整归属</Button>
161
+          <Button className={ customerType === 'private' ? Styles.text : Styles.displayS } type="link" onClick={() => showGM(record)}>调整归属</Button>
158
           <br/>
162
           <br/>
159
           <Button className={ customerType === 'private' ? Styles.text : Styles.displayS } type="link">查看详情</Button>
163
           <Button className={ customerType === 'private' ? Styles.text : Styles.displayS } type="link">查看详情</Button>
160
           &nbsp;&nbsp;
164
           &nbsp;&nbsp;
161
-          <Button className={ customerType === 'private' ? Styles.text : Styles.displayS } type="link" onClick={ () => setRecordVisibleData({ visible: true, customerId: record.customerId }) }>积分记录</Button>
165
+          <Button className={ customerType === 'private' ? Styles.text : Styles.displayS } type="link" onClick={ () => showRecord(record) }>积分记录</Button>
162
         </>
166
         </>
163
       ),
167
       ),
164
     },
168
     },