|
@@ -1,5 +1,5 @@
|
1
|
1
|
import React, { useState, useEffect } from 'react';
|
2
|
|
-import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Table, Avatar, Radio, Upload, message } from 'antd';
|
|
2
|
+import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Table, Avatar, Radio, Upload, message, notification } from 'antd';
|
3
|
3
|
import ImageUpload from '../../../components/XForm/ImageUpload';
|
4
|
4
|
import moment from 'moment';
|
5
|
5
|
import request from '../../../utils/request';
|
|
@@ -7,6 +7,8 @@ import apis from '../../../services/apis';
|
7
|
7
|
import Styles from './style.less';
|
8
|
8
|
import { router } from 'umi';
|
9
|
9
|
|
|
10
|
+import Attribution from './components/attribution'
|
|
11
|
+
|
10
|
12
|
const { Option } = Select;
|
11
|
13
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
12
|
14
|
const { Meta } = Card;
|
|
@@ -24,9 +26,20 @@ const tailFormItemLayout = {
|
24
|
26
|
},
|
25
|
27
|
};
|
26
|
28
|
|
|
29
|
+const openNotificationWithIcon = (type, message) => {
|
|
30
|
+ notification[type]({
|
|
31
|
+ message,
|
|
32
|
+ description:
|
|
33
|
+ '',
|
|
34
|
+ });
|
|
35
|
+}
|
|
36
|
+
|
27
|
37
|
function body(props) {
|
28
|
38
|
const { getFieldDecorator } = props.form
|
29
|
39
|
|
|
40
|
+ // eslint-disable-next-line react-hooks/rules-of-hooks
|
|
41
|
+ const [visibleData, setVisibleData] = useState({ visible: false, customerId: '', realtyConsultant: '' })
|
|
42
|
+
|
30
|
43
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
31
|
44
|
const [dataSource, setDataSource] = useState({ picture: '' })
|
32
|
45
|
|
|
@@ -49,27 +62,13 @@ function body(props) {
|
49
|
62
|
|
50
|
63
|
function submitDate(params) {
|
51
|
64
|
// props.form.setFieldsValue(res)
|
52
|
|
- request({ ...apis.customer.auto, urlData: { id: params.customerId }, params: { verifyStatus: params.verifyStatus } }).then(() => {
|
|
65
|
+ request({ ...apis.customer.auto, urlData: { id: params.customerId || props.form.getFieldValue('customerId') }, params: { verifyStatus: params.verifyStatus } }).then(() => {
|
53
|
66
|
// eslint-disable-next-line no-unused-expressions
|
54
|
|
- <Alert
|
55
|
|
- style={{
|
56
|
|
- marginBottom: 24,
|
57
|
|
- }}
|
58
|
|
- message="操作成功"
|
59
|
|
- type="success"
|
60
|
|
- showIcon
|
61
|
|
- />
|
|
67
|
+ openNotificationWithIcon('success', '操作成功')
|
62
|
68
|
router.go(-1)
|
63
|
69
|
}).catch(err => {
|
64
|
70
|
// eslint-disable-next-line no-unused-expressions
|
65
|
|
- <Alert
|
66
|
|
- style={{
|
67
|
|
- marginBottom: 24,
|
68
|
|
- }}
|
69
|
|
- message={err}
|
70
|
|
- type="error"
|
71
|
|
- showIcon
|
72
|
|
- />
|
|
71
|
+
|
73
|
72
|
})
|
74
|
73
|
}
|
75
|
74
|
|
|
@@ -89,6 +88,21 @@ function body(props) {
|
89
|
88
|
console.log(e)
|
90
|
89
|
}
|
91
|
90
|
|
|
91
|
+ // 显示选择置业顾问的窗口
|
|
92
|
+ function showConsultant() {
|
|
93
|
+ setVisibleData({ visible: true, customerId: props.form.getFieldValue('customerId'), realtyConsultant: props.form.getFieldValue('realtyConsultant') })
|
|
94
|
+ }
|
|
95
|
+
|
|
96
|
+ // 关闭选择置业顾问的窗口
|
|
97
|
+ function closeConsultant() {
|
|
98
|
+ setVisibleData({ visible: false, customerId: '', realtyConsultant: '' })
|
|
99
|
+ }
|
|
100
|
+
|
|
101
|
+ // 选择置业顾问弹窗
|
|
102
|
+ function consultantSuccess(e) {
|
|
103
|
+ props.form.setFieldsValue({ realtyConsultant: e.realtyConsultant, consultantName: e.name })
|
|
104
|
+ }
|
|
105
|
+
|
92
|
106
|
return (
|
93
|
107
|
<>
|
94
|
108
|
<Form {...tailFormItemLayout} onSubmit={e => handleSubmit(e)} style={{ width: '800px', margin: 'auto' }}>
|
|
@@ -99,6 +113,13 @@ function body(props) {
|
99
|
113
|
/>,
|
100
|
114
|
)}
|
101
|
115
|
</Form.Item>
|
|
116
|
+ <Form.Item label="归属人" style={{ display: 'none' }}>
|
|
117
|
+ {getFieldDecorator('realtyConsultant')(
|
|
118
|
+ <Input
|
|
119
|
+ placeholder="归属人"
|
|
120
|
+ />,
|
|
121
|
+ )}
|
|
122
|
+ </Form.Item>
|
102
|
123
|
<Form.Item label="意向项目:">
|
103
|
124
|
{getFieldDecorator('intention')(
|
104
|
125
|
<Input
|
|
@@ -159,7 +180,7 @@ function body(props) {
|
159
|
180
|
<DatePicker showTime placeholder="报备日期" />,
|
160
|
181
|
)}
|
161
|
182
|
</Form.Item>
|
162
|
|
- <Form.Item label="状态">
|
|
183
|
+ {/* <Form.Item label="状态">
|
163
|
184
|
{getFieldDecorator('verifyStatus')(
|
164
|
185
|
<Select style={{ width: '180px' }} placeholder="状态" onChange={handleSelectChange}>
|
165
|
186
|
<Option value={0}>未通过</Option>
|
|
@@ -167,27 +188,30 @@ function body(props) {
|
167
|
188
|
<Option value={2}>已驳回</Option>
|
168
|
189
|
</Select>,
|
169
|
190
|
)}
|
170
|
|
- </Form.Item>
|
|
191
|
+ </Form.Item> */}
|
171
|
192
|
<Form.Item label="归属置业顾问">
|
172
|
193
|
<Row gutter={8}>
|
173
|
194
|
<Col span={12}>
|
174
|
|
- {getFieldDecorator('consultantName')(<Input placeholder="归属置业顾问" />)}
|
|
195
|
+ {getFieldDecorator('consultantName')(<Input placeholder="请选择置业顾问" />)}
|
175
|
196
|
</Col>
|
176
|
197
|
<Col span={12}>
|
177
|
|
- <Button>选择</Button>
|
|
198
|
+ <Button onClick={() => showConsultant()}>选择</Button>
|
178
|
199
|
</Col>
|
179
|
200
|
</Row>
|
180
|
201
|
</Form.Item>
|
181
|
202
|
<Form.Item style={{ display: 'flex', justifyContent: 'center' }}>
|
182
|
|
- <Button type="primary" htmlType="submit" className={Styles.SubmitButton}>
|
183
|
|
- 确定
|
|
203
|
+ <Button type="primary" className={Styles.SubmitButton} onClick={() => submitDate({ verifyStatus: '1' })}>
|
|
204
|
+ 审核通过
|
184
|
205
|
</Button>
|
185
|
206
|
|
186
|
|
- <Button onClick={() => router.go(-1)}>
|
187
|
|
- 取消
|
|
207
|
+ <Button onClick={() => submitDate({ verifyStatus: '2' })}>
|
|
208
|
+ 驳回
|
188
|
209
|
</Button>
|
189
|
210
|
</Form.Item>
|
190
|
211
|
</Form>
|
|
212
|
+
|
|
213
|
+ {/* 选择置业顾问 */}
|
|
214
|
+ <Attribution visibleData={visibleData} onCancel={() => closeConsultant()} onSuccess={e => consultantSuccess(e)}/>
|
191
|
215
|
</>
|
192
|
216
|
);
|
193
|
217
|
}
|