Yansen 2 yıl önce
ebeveyn
işleme
5201ea02fe
2 değiştirilmiş dosya ile 57 ekleme ve 41 silme
  1. 54
    37
      src/pages/broker/list/detail.jsx
  2. 3
    4
      src/pages/broker/list/index.jsx

+ 54
- 37
src/pages/broker/list/detail.jsx Dosyayı Görüntüle

@@ -1,53 +1,70 @@
1
-import { getBrokerDetails } from '@/services/apis';
2 1
 import { useEffect, useRef } from 'react';
3 2
 import React from 'react';
4
-import { Avatar, Row, Col } from 'antd';
3
+import { Modal, Descriptions, Typography, Table } from 'antd';
5 4
 import apis from '@/services/apis';
6 5
 import request from '@/utils/request';
7 6
 
8
-function agentDeal (props) {
9
-  const { detail, personId } = props;
7
+const { Title, Paragraph, Text } = Typography;
10 8
 
11
-  useEffect(() => {
12
-    request({
13
-      ...apis.broker.getBrokerDetails, params: { personId: detail.personId }
14
-    }).then((res) => {
15
-      console.log('res', res)
16
-    });
17
-  });
9
+function agentDeal (props) {
10
+  const { detail, open, onCancel } = props;
11
+  const { personId } = detail || {}
18 12
 
13
+  const [cardList, setCardList] = React.useState([]);
19 14
 
20
-  const list = [
21
-    {
22
-      title: '姓名',
23
-      render: detail.name,
24
-    },
15
+  const columns = [
25 16
     {
26
-      title: '手机号',
27
-      render: detail.phone,
17
+      title: '开户行',
18
+      dataIndex: 'bankName',
19
+      key: 'bankName',
20
+      render: t => <Text copyable>{t || '-'}</Text>
28 21
     },
29 22
     {
30
-      title: '身份证号',
31
-      render: detail.idNo,
23
+      title: '卡号',
24
+      dataIndex: 'cardNo',
25
+      key: 'cardNo',
26
+      render: t => <Text copyable>{t || '-'}</Text>
32 27
     },
33
-    {
34
-      title: '银行卡号',
35
-      // render: detail.personId,
36
-    },
37
-  ];
28
+  ]
29
+
30
+  useEffect(() => {
31
+    if (personId) {
32
+      request({
33
+        ...apis.broker.getBrokerDetails,
34
+        params: { personId, pageSize: 100 }
35
+      }).then((res) => {
36
+        setCardList(res.records || []);
37
+      });
38
+    }
39
+  }, [personId]);
40
+
38 41
   return (
39
-    <>
40
-      <Row>
41
-        {list.map((x, index) => {
42
-          return (
43
-            <div key={index} style={{ marginBottom: '20px', display: 'flex' }}>
44
-              <Col span={7}>{x.title}:</Col>
45
-              <Col span={17}>{x.render || '--'}</Col>
46
-            </div>
47
-          );
48
-        })}
49
-      </Row>
50
-    </>
42
+    <Modal
43
+      width={800}
44
+      visible={open}
45
+      title={detail.name || detail.nickname || '详情'}
46
+      onCancel={onCancel}
47
+      onOk={onCancel}
48
+      footer={null}
49
+    >
50
+      <Paragraph>
51
+        <h4 style={{ fontSize: '16px', marginBottom: '1em' }}>基础信息</h4>
52
+        <Descriptions column={3}>
53
+          <Descriptions.Item label="姓 名"><Text copyable>{detail.name || detail.nickname || '-'}</Text></Descriptions.Item>
54
+          <Descriptions.Item label="手 机"><Text copyable>{detail.phone || '-'}</Text></Descriptions.Item>
55
+          <Descriptions.Item label="身份证"><Text copyable>{detail.idNo || '-'}</Text></Descriptions.Item>
56
+        </Descriptions>
57
+      </Paragraph>
58
+      <Paragraph style={{ marginTop: '4em' }}>
59
+        <h4 style={{ fontSize: '16px', marginBottom: '1em' }}>银行卡信息</h4>
60
+        <Table
61
+          columns={columns}
62
+          dataSource={cardList}
63
+          rowKey="cardId"
64
+          pagination={false}
65
+        />
66
+      </Paragraph>
67
+    </Modal>
51 68
   );
52 69
 }
53 70
 

+ 3
- 4
src/pages/broker/list/index.jsx Dosyayı Görüntüle

@@ -134,7 +134,8 @@ export default (props) => {
134 134
           {/* to={`/admin/bkBankCard?personId=${row}`}  , router.push(`/admin/bkBankCard?personId=${row.personId}`) */}
135 135
           <Button
136 136
             type="link" onClick={() => {
137
-              setDetail(row), setOpen(true)
137
+              setDetail(row);
138
+              setOpen(true);
138 139
             }}
139 140
 
140 141
           >
@@ -154,9 +155,7 @@ export default (props) => {
154 155
         searchFields={searchFields}
155 156
         columns={tableColumns}
156 157
       />
157
-      <Modal title="经纪人详情" visible={open} onOk={hideModal} onCancel={hideModal} footer={null}>
158
-        <DealDetail detail={detail} personId={personId} api={apis.broker.getBrokerDetails} />
159
-      </Modal>
158
+      <DealDetail detail={detail} open={open} onCancel={hideModal} />
160 159
     </>
161 160
   )
162 161
 }