|
@@ -1,15 +1,192 @@
|
1
|
1
|
import React, { useState, useEffect } from 'react';
|
2
|
|
-import { Form, Input, Button, Icon, Select, Tabs, Radio, DatePicker, message, Upload } from 'antd';
|
3
|
|
-import { FormattedMessage } from 'umi-plugin-react/locale';
|
|
2
|
+import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Radio, Tag, Tooltip, Tabs, Table, notification, Modal } from 'antd';
|
4
|
3
|
import moment from 'moment';
|
5
|
|
-import router from 'umi/router';
|
|
4
|
+import request from '../../../../utils/request';
|
6
|
5
|
import apis from '../../../../services/apis';
|
|
6
|
+import Styles from './style.less';
|
|
7
|
+import { router } from 'umi';
|
|
8
|
+import BlockSelect from '../../../../components/HouseSelect/BlockSelect'
|
|
9
|
+import UnitSelect from '../../../../components/HouseSelect/UnitSelect'
|
|
10
|
+import FloorSelect from '../../../../components/HouseSelect/FloorSelect'
|
|
11
|
+import RoomSelect from '../../../../components/HouseSelect/RoomSelect'
|
|
12
|
+import ApartmentSelect from '../../../../components/HouseSelect/ApartmentSelect';
|
7
|
13
|
|
8
|
|
-const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
|
9
|
|
-const { TextArea } = Input;
|
|
14
|
+/**
|
|
15
|
+ *图片设置
|
|
16
|
+ *
|
|
17
|
+ * @param {*} props
|
|
18
|
+ * @returns
|
|
19
|
+ */
|
|
20
|
+function PreselectionRecord(props) {
|
|
21
|
+ // eslint-disable-next-line react-hooks/rules-of-hooks
|
|
22
|
+ const [data, setData] = useState([])
|
|
23
|
+ const {salesBatchId} = props.salesBatchId
|
|
24
|
+ console.log(salesBatchId,'updateNameupdateNameupdateName');
|
|
25
|
+ useEffect(() => {
|
|
26
|
+ getList()
|
|
27
|
+ }, [])
|
10
|
28
|
|
11
|
|
-const PreselectionRecord = props => {
|
12
|
|
- return <div><span>预选记录</span></div>
|
13
|
|
-}
|
|
29
|
+ function openNotificationWithIcon(type, message) {
|
|
30
|
+ notification[type]({
|
|
31
|
+ message,
|
|
32
|
+ description:
|
|
33
|
+ '',
|
|
34
|
+ });
|
|
35
|
+ }
|
|
36
|
+
|
|
37
|
+ function getList(params) {
|
|
38
|
+ // 网路请求
|
|
39
|
+ request({ ...apis.house.taPreselectRecord, params: { ...params,salesBatchId: salesBatchId } }).then(res => {
|
|
40
|
+ console.log(res,"resresres")
|
|
41
|
+ setData(res)
|
|
42
|
+ }).catch(err => {
|
|
43
|
+ openNotificationWithIcon('error', err.message)
|
|
44
|
+ })
|
|
45
|
+ }
|
|
46
|
+
|
|
47
|
+ // 重置搜索
|
|
48
|
+ function handleReset () {
|
|
49
|
+ props.form.resetFields();
|
|
50
|
+ getList({ pageNumber: 1, pageSize: 10 })
|
|
51
|
+ }
|
|
52
|
+
|
|
53
|
+ // 分页
|
|
54
|
+ function changePageNum(pageNumber) {
|
|
55
|
+ // eslint-disable-next-line react-hooks/rules-of-hooks
|
|
56
|
+ getList({ pageNumber: pageNumber, pageSize: 10})
|
|
57
|
+ }
|
14
|
58
|
|
15
|
|
-export default PreselectionRecord
|
|
59
|
+ const rowSelection = {
|
|
60
|
+ onChange: (selectedRowKeys, selectedRows) => {
|
|
61
|
+ console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows);
|
|
62
|
+ },
|
|
63
|
+ };
|
|
64
|
+
|
|
65
|
+ // 提交事件
|
|
66
|
+ const handleSubmit = e => {
|
|
67
|
+ e.preventDefault();
|
|
68
|
+ props.form.validateFields((err, values) => {
|
|
69
|
+ if (!err) {
|
|
70
|
+ console.log('提交数据: ', values)
|
|
71
|
+ getList({ pageNumber: 1, pageSize: 10, ...values })
|
|
72
|
+ }
|
|
73
|
+ });
|
|
74
|
+ }
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+ const columns = [
|
|
78
|
+ {
|
|
79
|
+ title: '房源编号',
|
|
80
|
+ dataIndex: 'houseId',
|
|
81
|
+ key: 'houseId',
|
|
82
|
+ },
|
|
83
|
+ {
|
|
84
|
+ title: '楼栋',
|
|
85
|
+ dataIndex: 'blockName',
|
|
86
|
+ key: 'blockName',
|
|
87
|
+ render: blockName => <><span>{blockName}幢</span></>,
|
|
88
|
+ },
|
|
89
|
+ {
|
|
90
|
+ title: '单元',
|
|
91
|
+ dataIndex: 'unitName',
|
|
92
|
+ key: 'unitName',
|
|
93
|
+ render: unitName => <><span>{unitName}单元</span></>,
|
|
94
|
+ },
|
|
95
|
+ {
|
|
96
|
+ title: '层',
|
|
97
|
+ dataIndex: 'floorName',
|
|
98
|
+ key: 'floorName',
|
|
99
|
+ render: floorName => <><span>{floorName}层</span></>,
|
|
100
|
+ },
|
|
101
|
+ {
|
|
102
|
+ title: '房号',
|
|
103
|
+ dataIndex: 'roomName',
|
|
104
|
+ key: 'roomName',
|
|
105
|
+ },
|
|
106
|
+ {
|
|
107
|
+ title: '对应户型',
|
|
108
|
+ dataIndex: 'apartmentName',
|
|
109
|
+ key: 'apartmentName',
|
|
110
|
+ },
|
|
111
|
+ {
|
|
112
|
+ title: '用户昵称',
|
|
113
|
+ dataIndex: 'nameOrnick',
|
|
114
|
+ key: 'nameOrnick',
|
|
115
|
+ },
|
|
116
|
+ {
|
|
117
|
+ title: '用户姓名',
|
|
118
|
+ dataIndex: 'name',
|
|
119
|
+ key: 'name',
|
|
120
|
+ },
|
|
121
|
+ {
|
|
122
|
+ title: '用户头像',
|
|
123
|
+ dataIndex: 'avatarurl',
|
|
124
|
+ key: 'avatarurl',
|
|
125
|
+ render: (text, records) => <img src={records.avatarurl} width={50} height={50} />,
|
|
126
|
+ },
|
|
127
|
+ {
|
|
128
|
+ title: '用户手机号',
|
|
129
|
+ dataIndex: 'phone',
|
|
130
|
+ key: 'phone',
|
|
131
|
+ },
|
|
132
|
+
|
|
133
|
+ {
|
|
134
|
+ title: '预选状态',
|
|
135
|
+ dataIndex: 'status',
|
|
136
|
+ key: 'status',
|
|
137
|
+ render: status => <><span>{status == 0 ? '否' : status == 1 ? '是' : ''}</span></>,
|
|
138
|
+ },
|
|
139
|
+ {
|
|
140
|
+ title: '状态修改时间',
|
|
141
|
+ dataIndex: 'updateDate',
|
|
142
|
+ key: 'updateDate',
|
|
143
|
+ },
|
|
144
|
+ {
|
|
145
|
+ title: '最后修改人',
|
|
146
|
+ dataIndex: 'updateName',
|
|
147
|
+ key: 'updateName',
|
|
148
|
+ },
|
|
149
|
+ ]
|
|
150
|
+ const { getFieldDecorator } = props.form
|
|
151
|
+ return (
|
|
152
|
+ <>
|
|
153
|
+ <Form layout="inline" onSubmit={e => handleSubmit(e)}>
|
|
154
|
+ <Form.Item>
|
|
155
|
+ {getFieldDecorator('houseId')(
|
|
156
|
+ <Input placeholder="房源编号"/>,
|
|
157
|
+ )}
|
|
158
|
+ </Form.Item>
|
|
159
|
+ <Form.Item>
|
|
160
|
+ {getFieldDecorator('phone')(
|
|
161
|
+ <Input placeholder="用户手机号"/>,
|
|
162
|
+ )}
|
|
163
|
+ </Form.Item>
|
|
164
|
+ <Form.Item>
|
|
165
|
+ {getFieldDecorator('apartmentId')(
|
|
166
|
+ <ApartmentSelect buildingId={props.buildingId} />
|
|
167
|
+ )}
|
|
168
|
+ </Form.Item>
|
|
169
|
+ <Form.Item>
|
|
170
|
+ {getFieldDecorator('status')(
|
|
171
|
+ <Select placeholder="预选状态" style={{width: '120px'}}>
|
|
172
|
+ <Option value="0">否</Option>
|
|
173
|
+ <Option value="1">是</Option>
|
|
174
|
+ </Select>,
|
|
175
|
+ )}
|
|
176
|
+ </Form.Item>
|
|
177
|
+
|
|
178
|
+ <Form.Item>
|
|
179
|
+ <Button type="primary" htmlType="submit" >
|
|
180
|
+ 搜索
|
|
181
|
+ </Button>
|
|
182
|
+ <Button style={{ marginLeft: 8 }} onClick={handleReset}>
|
|
183
|
+ 重置
|
|
184
|
+ </Button>
|
|
185
|
+ </Form.Item>
|
|
186
|
+ </Form>
|
|
187
|
+ <Table rowSelection={rowSelection} dataSource={data.records} columns={columns} pagination={{ total: data.total, onChange: e => this.changePageNum(e) }} rowKey="House" />
|
|
188
|
+ </>
|
|
189
|
+ )
|
|
190
|
+}
|
|
191
|
+const WrappedHeader = Form.create({ name: 'PreselectionRecord' })(PreselectionRecord);
|
|
192
|
+export default WrappedHeader
|