|
@@ -0,0 +1,193 @@
|
|
1
|
+import React, { useState, useEffect } from 'react';
|
|
2
|
+import { Form, Input, Button, Card, Icon, Avatar, Select, message, Table, Divider, Tag, Pagination, Modal, Breadcrumb,Row,Col } from 'antd';
|
|
3
|
+import router from 'umi/router';
|
|
4
|
+import moment from 'moment';
|
|
5
|
+import apis from '../../../services/apis';
|
|
6
|
+import request from '../../../utils/request';
|
|
7
|
+
|
|
8
|
+function financialContact(props) {
|
|
9
|
+
|
|
10
|
+ const { Meta } = Card;
|
|
11
|
+ // const [taNoticeList, setTaNoticeList] = useState([])
|
|
12
|
+ const [data, setData] = useState({})
|
|
13
|
+ const [visible, setVisible] = useState(false);
|
|
14
|
+ const [currentData, setCurrentData] = useState('');
|
|
15
|
+
|
|
16
|
+ useEffect(() => {
|
|
17
|
+ getList({ pageNum: 1, pageSize: 10 });
|
|
18
|
+ }, [])
|
|
19
|
+ // 查询列表
|
|
20
|
+
|
|
21
|
+ const getList = params => {
|
|
22
|
+ request({ ...apis.funds.list, params: { ...params,contactType: "sell" } }).then(data => {
|
|
23
|
+ setData(data)
|
|
24
|
+ })
|
|
25
|
+ }
|
|
26
|
+
|
|
27
|
+ function handleSubmit(e) {
|
|
28
|
+ e.preventDefault();
|
|
29
|
+ props.form.validateFields((err, values) => {
|
|
30
|
+ if (!err) {
|
|
31
|
+ // eslint-disable-next-line no-console
|
|
32
|
+ console.log('提交数据: ', values)
|
|
33
|
+ getList({ ...values })
|
|
34
|
+ }
|
|
35
|
+ });
|
|
36
|
+ }
|
|
37
|
+
|
|
38
|
+ function handleReset() {
|
|
39
|
+ props.form.resetFields();
|
|
40
|
+
|
|
41
|
+ getList({ pageNum: 1, pageSize: 10 })
|
|
42
|
+ }
|
|
43
|
+
|
|
44
|
+ const columns = [
|
|
45
|
+ {
|
|
46
|
+ title: '姓名',
|
|
47
|
+ dataIndex: 'contactName',
|
|
48
|
+ key: 'contactName',
|
|
49
|
+ align: 'center',
|
|
50
|
+ },
|
|
51
|
+ {
|
|
52
|
+ title: '性别',
|
|
53
|
+ dataIndex: 'sex',
|
|
54
|
+ key: 'sex',
|
|
55
|
+ align: 'center',
|
|
56
|
+ render: x => <span>{x == 1 ? '男' : x === 2 ? '女' : '未知'}</span >,
|
|
57
|
+ },
|
|
58
|
+ {
|
|
59
|
+ title: '头像',
|
|
60
|
+ dataIndex: 'avatar',
|
|
61
|
+ key: 'avatar',
|
|
62
|
+ align: 'center',
|
|
63
|
+ render: (x, row) => <img src={row.avatar} alt="" width="93px" height="93px"></img >,
|
|
64
|
+ },
|
|
65
|
+ {
|
|
66
|
+ title: '固话',
|
|
67
|
+ dataIndex: 'telephone',
|
|
68
|
+ key: 'telephone',
|
|
69
|
+ align: 'center',
|
|
70
|
+ },
|
|
71
|
+ {
|
|
72
|
+ title: '手机号',
|
|
73
|
+ dataIndex: 'phone',
|
|
74
|
+ key: 'phone',
|
|
75
|
+ align: 'center',
|
|
76
|
+ },
|
|
77
|
+ {
|
|
78
|
+ title: '头衔',
|
|
79
|
+ dataIndex: 'appellation',
|
|
80
|
+ key: 'appellation',
|
|
81
|
+ align: 'center',
|
|
82
|
+ },
|
|
83
|
+ ]
|
|
84
|
+
|
|
85
|
+ const changePageNum = pageNumber => {
|
|
86
|
+ props.form.validateFields((err, values) => {
|
|
87
|
+ if (!err) {
|
|
88
|
+ getList({ pageNum: pageNumber, pageSize: 10, ...values })
|
|
89
|
+ }
|
|
90
|
+ });
|
|
91
|
+ }
|
|
92
|
+
|
|
93
|
+ const openModel =(wxImg)=>{
|
|
94
|
+ console.log(wxImg)
|
|
95
|
+ if(wxImg){
|
|
96
|
+ setVisible(true)
|
|
97
|
+ setCurrentData(wxImg)
|
|
98
|
+ }
|
|
99
|
+ }
|
|
100
|
+
|
|
101
|
+ const onCancel = () => {
|
|
102
|
+ setVisible(false)
|
|
103
|
+ }
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+ const { getFieldDecorator } = props.form
|
|
107
|
+
|
|
108
|
+ return (
|
|
109
|
+
|
|
110
|
+ <>
|
|
111
|
+ <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
|
|
112
|
+ <Form.Item>
|
|
113
|
+ {getFieldDecorator('contactName')(
|
|
114
|
+ <Input
|
|
115
|
+ placeholder="姓名"
|
|
116
|
+ />,
|
|
117
|
+ )}
|
|
118
|
+ </Form.Item>
|
|
119
|
+ <Form.Item>
|
|
120
|
+ {getFieldDecorator('telephone')(
|
|
121
|
+ <Input
|
|
122
|
+ placeholder="固话"
|
|
123
|
+ />,
|
|
124
|
+ )}
|
|
125
|
+ </Form.Item>
|
|
126
|
+ <Form.Item>
|
|
127
|
+ {getFieldDecorator('phone')(
|
|
128
|
+ <Input
|
|
129
|
+ placeholder="手机号"
|
|
130
|
+ />,
|
|
131
|
+ )}
|
|
132
|
+ </Form.Item>
|
|
133
|
+ <Form.Item>
|
|
134
|
+ <Button type="primary" htmlType="submit"> 搜索</Button>
|
|
135
|
+ <Button style={{ marginLeft: 8 }} onClick={handleReset}>重置</Button>
|
|
136
|
+ </Form.Item>
|
|
137
|
+ </Form>
|
|
138
|
+ {/* <div style={{ marginTop: '20px' }}>
|
|
139
|
+ <Button type="primary" style={{ float: 'right', marginBottom: '20px', zIndex: 1 }} >导出</Button>
|
|
140
|
+ </div> */}
|
|
141
|
+
|
|
142
|
+ <Row>
|
|
143
|
+ {(data.records || []).map((x, index) => (
|
|
144
|
+ <Col key={index} span={6}>
|
|
145
|
+ <Card
|
|
146
|
+ style={{ width: 300, marginTop: 16 }}
|
|
147
|
+ actions={[
|
|
148
|
+ <span>{"TEL:" + x.phone}</span>,
|
|
149
|
+ <span onClick={() => openModel(x.wxCardImg)}>加微信</span>,
|
|
150
|
+ ]}
|
|
151
|
+ >
|
|
152
|
+ <Meta
|
|
153
|
+ style={{ height: 100 }}
|
|
154
|
+ avatar={<Avatar src={x.avatar ? x.avatar : "https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png"} />}
|
|
155
|
+ title={x.contactName}
|
|
156
|
+ description={x.appellation}
|
|
157
|
+ />
|
|
158
|
+ </Card>
|
|
159
|
+ </Col>
|
|
160
|
+ ))}
|
|
161
|
+ </Row>
|
|
162
|
+
|
|
163
|
+ <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
|
|
164
|
+ <Pagination
|
|
165
|
+ showQuickJumper
|
|
166
|
+ defaultCurrent={1}
|
|
167
|
+ total={data.total} onChange={e => changePageNum(e)} current={data.current} />
|
|
168
|
+ </div>
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+ <Modal
|
|
172
|
+ title="加我微信"
|
|
173
|
+ width="500px"
|
|
174
|
+ visible={visible}
|
|
175
|
+ onCancel={onCancel}
|
|
176
|
+ footer={[]}
|
|
177
|
+ >
|
|
178
|
+ <div style={{textAlign:'center',display:'inline-grid',width:'100%'}}>
|
|
179
|
+ <img src={currentData} alt="" style={{margin:'0 auto'}}/>
|
|
180
|
+ <p>扫码加我微信聊</p>
|
|
181
|
+ </div>
|
|
182
|
+
|
|
183
|
+ </Modal>
|
|
184
|
+ </>
|
|
185
|
+
|
|
186
|
+ )
|
|
187
|
+}
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+const WrappedFinancialContact = Form.create({ name: 'financialContact' })(financialContact);
|
|
191
|
+
|
|
192
|
+export default WrappedFinancialContact
|
|
193
|
+
|