|
@@ -1,12 +1,16 @@
|
1
|
1
|
import React, { useState, useEffect } from 'react';
|
2
|
2
|
import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Table, Avatar, Radio, Upload, message, notification } from 'antd';
|
3
|
|
-import ImageUpload from '../../../components/XForm/ImageUpload';
|
|
3
|
+import ImageUpload from '@/components/XForm/ImageUpload';
|
4
|
4
|
import moment from 'moment';
|
5
|
5
|
import request from '../../../utils/request';
|
6
|
6
|
import apis from '../../../services/apis';
|
7
|
7
|
import { router } from 'umi';
|
8
|
8
|
|
9
|
9
|
import Attribution from './components/attribution'
|
|
10
|
+import BuildingSelect from '@/components/SelectButton/BuildSelect2';
|
|
11
|
+import ConsultantSelect from '@/components/SelectButton/consultantSelect';
|
|
12
|
+import ChannelSelect from '@/components/SelectButton/channelSelect';
|
|
13
|
+
|
10
|
14
|
|
11
|
15
|
const { TextArea } = Input;
|
12
|
16
|
|
|
@@ -36,7 +40,7 @@ function body(props) {
|
36
|
40
|
const [visibleData, setVisibleData] = useState({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
|
37
|
41
|
|
38
|
42
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
39
|
|
- const [dataSource, setDataSource] = useState({ picture: '' })
|
|
43
|
+ const [data, setData] = useState({})
|
40
|
44
|
|
41
|
45
|
const { id } = props.location.query;
|
42
|
46
|
|
|
@@ -49,19 +53,61 @@ function body(props) {
|
49
|
53
|
|
50
|
54
|
// 获取详情信息
|
51
|
55
|
function getById(currentId) {
|
52
|
|
- request({ ...apis.customer.recommendGetById, urlData: { id: currentId } }).then(res => {
|
|
56
|
+ request({ ...apis.customer.getDetail, urlData: { id: currentId } }).then(res => {
|
53
|
57
|
// res.reportDate = moment(res.reportDate)
|
54
|
58
|
if(res){
|
55
|
|
- props.form.setFieldsValue({...res,reportDate:moment(res.reportDate)})
|
|
59
|
+ let channelCustomer = {}
|
|
60
|
+ if(res.channelCustomer){
|
|
61
|
+ channelCustomer.channelId=res.channelCustomer.channelId
|
|
62
|
+ channelCustomer.remark=res.channelCustomer.remark
|
|
63
|
+
|
|
64
|
+ }
|
|
65
|
+ if(res.customerVisit){
|
|
66
|
+ channelCustomer.imageUrl=res.customerVisit.imageUrl
|
|
67
|
+ // channelCustomer.remark=res.channelCustomer.remark
|
|
68
|
+
|
|
69
|
+ }
|
|
70
|
+
|
|
71
|
+ setData(res)
|
|
72
|
+ props.form.setFieldsValue({...res,...channelCustomer})
|
56
|
73
|
}
|
57
|
74
|
|
58
|
75
|
})
|
59
|
76
|
}
|
60
|
77
|
|
61
|
|
- function submitDate(params) {
|
|
78
|
+ function submitDate(data) {
|
62
|
79
|
// props.form.setFieldsValue(res)
|
63
|
|
- console.log(params, 'params')
|
64
|
|
- request({ ...apis.customer.auto, urlData: { id: params.customerId || props.form.getFieldValue('customerId') }, params: { verifyStatus: params.verifyStatus, realtyConsultant: props.form.getFieldValue('realtyConsultant') } }).then(() => {
|
|
80
|
+ console.log(data, 'data')
|
|
81
|
+ const params ={
|
|
82
|
+ auditResult:data.status,
|
|
83
|
+ channelCustomerId:id,
|
|
84
|
+ realtyConsultant:props.form.getFieldValue('realtyConsultant'),
|
|
85
|
+ name:props.form.getFieldValue('name'),
|
|
86
|
+ customerVisit:{
|
|
87
|
+ imageUrl:props.form.getFieldValue('imageUrl'),
|
|
88
|
+ },
|
|
89
|
+ remark:props.form.getFieldValue('remark'),
|
|
90
|
+ }
|
|
91
|
+ // {
|
|
92
|
+ // "auditResult": "string",
|
|
93
|
+ // "channelCustomerId": "string",
|
|
94
|
+ // "customerVisit": {
|
|
95
|
+ // "buildingId": "string",
|
|
96
|
+ // "createDate": "2021-07-31T16:56:21.899Z",
|
|
97
|
+ // "customerId": "string",
|
|
98
|
+ // "customerVisitId": "string",
|
|
99
|
+ // "imageUrl": "string",
|
|
100
|
+ // "name": "string",
|
|
101
|
+ // "orgId": 0,
|
|
102
|
+ // "realtyConsultant": "string",
|
|
103
|
+ // "realtyConsultantName": "string",
|
|
104
|
+ // "recommendName": "string",
|
|
105
|
+ // "recommendPerson": "string",
|
|
106
|
+ // "remark": "string"
|
|
107
|
+ // },
|
|
108
|
+ // "realtyConsultant": "string"
|
|
109
|
+ // }
|
|
110
|
+ request({ ...apis.customer.auto, urlData: { id: id }, data: { ...params }}).then(() => {
|
65
|
111
|
// eslint-disable-next-line no-unused-expressions
|
66
|
112
|
openNotificationWithIcon('success', '操作成功')
|
67
|
113
|
router.go(-1)
|
|
@@ -76,44 +122,26 @@ function body(props) {
|
76
|
122
|
e.preventDefault();
|
77
|
123
|
props.form.validateFields((err, values) => {
|
78
|
124
|
if (!err) {
|
79
|
|
- submitDate({ verifyStatus: '1' })
|
|
125
|
+ submitDate({ status: '1' })
|
80
|
126
|
// submitDate({ ...values })
|
81
|
127
|
}
|
82
|
128
|
});
|
83
|
129
|
}
|
84
|
130
|
|
85
|
|
- // Change 事件
|
86
|
|
- function handleSelectChange(e) {
|
87
|
|
- // eslint-disable-next-line no-console
|
88
|
|
- console.log(e)
|
89
|
|
- }
|
90
|
131
|
|
91
|
|
- // 显示选择置业顾问的窗口
|
92
|
|
- function showConsultant() {
|
93
|
|
- setVisibleData({ visible: true, customerId: props.form.getFieldValue('customerId'), realtyConsultant: props.form.getFieldValue('realtyConsultant'), buildingId: props.form.getFieldValue('buildingId') })
|
94
|
|
- }
|
95
|
132
|
|
96
|
|
- // 关闭选择置业顾问的窗口
|
97
|
|
- function closeConsultant() {
|
98
|
|
- setVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
|
99
|
|
- }
|
100
|
133
|
|
101
|
|
- // 选择置业顾问弹窗
|
102
|
|
- function consultantSuccess(e) {
|
103
|
|
- console.log(e)
|
104
|
|
- props.form.setFieldsValue({ realtyConsultant: e.realtyConsultant, consultantName: e.name })
|
105
|
|
- }
|
106
|
134
|
|
107
|
135
|
return (
|
108
|
136
|
<Card>
|
109
|
137
|
<Form {...tailFormItemLayout} onSubmit={e => handleSubmit(e)} style={{ maxWidth: '1000px' }}>
|
110
|
|
- <Form.Item label="客户ID" style={{ display: 'none' }}>
|
111
|
|
- {getFieldDecorator('customerId')(
|
|
138
|
+ {/* <Form.Item label="客户ID" style={{ display: 'none' }}>
|
|
139
|
+ {getFieldDecorator('channelCustomerId')(
|
112
|
140
|
<Input
|
113
|
141
|
placeholder="客户ID"
|
114
|
142
|
/>,
|
115
|
143
|
)}
|
116
|
|
- </Form.Item>
|
|
144
|
+ </Form.Item>*/}
|
117
|
145
|
<Form.Item label="项目ID" style={{ display: 'none' }}>
|
118
|
146
|
{getFieldDecorator('buildingId')(
|
119
|
147
|
<Input
|
|
@@ -121,83 +149,45 @@ function body(props) {
|
121
|
149
|
/>,
|
122
|
150
|
)}
|
123
|
151
|
</Form.Item>
|
124
|
|
- <Form.Item label="归属人" style={{ display: 'none' }}>
|
125
|
|
- {getFieldDecorator('realtyConsultant')(
|
126
|
|
- <Input
|
127
|
|
- placeholder="归属人"
|
128
|
|
- />,
|
129
|
|
- )}
|
130
|
|
- </Form.Item>
|
131
|
152
|
<Form.Item label="意向项目:">
|
132
|
|
- {getFieldDecorator('intention')(
|
133
|
|
- <Input
|
|
153
|
+ {getFieldDecorator('buildingId')(
|
|
154
|
+ <BuildingSelect
|
|
155
|
+ disabled
|
134
|
156
|
placeholder="意向项目"
|
|
157
|
+ style={{width:'100%'}}
|
135
|
158
|
/>,
|
136
|
159
|
)}
|
137
|
|
- </Form.Item>
|
138
|
|
- <Form.Item label="客户照片">
|
139
|
|
- {getFieldDecorator('picture')(
|
140
|
|
- <ImageUpload value={dataSource.picture} />,
|
141
|
|
- )}
|
142
|
|
- </Form.Item>
|
|
160
|
+ </Form.Item>
|
143
|
161
|
<Form.Item label="客户姓名">
|
144
|
162
|
{getFieldDecorator('name')(
|
145
|
163
|
<Input placeholder="客户姓名" />,
|
146
|
164
|
)}
|
147
|
165
|
</Form.Item>
|
148
|
|
- <Form.Item label="客户电话">
|
149
|
|
- {getFieldDecorator('phone')(
|
150
|
|
- <Input placeholder="客户电话" />,
|
|
166
|
+ <Form.Item label="归属渠道">
|
|
167
|
+ {getFieldDecorator('channelId')(
|
|
168
|
+ <ChannelSelect placeholder="归属渠道" disabled/>,
|
151
|
169
|
)}
|
152
|
170
|
</Form.Item>
|
153
|
|
- <Form.Item label="客户性别">
|
154
|
|
- {getFieldDecorator('sex')(
|
155
|
|
- <Radio.Group>
|
156
|
|
- <Radio value={1}>男</Radio>
|
157
|
|
- <Radio value={2}>女</Radio>
|
158
|
|
- </Radio.Group>,
|
|
171
|
+ <Form.Item label="归属置业顾问">
|
|
172
|
+ {getFieldDecorator('realtyConsultant')(
|
|
173
|
+ <ConsultantSelect placeholder="归属置业顾问" buildingId={props.form.getFieldValue('buildingId')} />,
|
159
|
174
|
)}
|
160
|
175
|
</Form.Item>
|
161
|
|
- <Form.Item label="到访人数">
|
162
|
|
- {getFieldDecorator('visiteNum')(
|
163
|
|
- <Input placeholder="到访人数" />,
|
|
176
|
+ <Form.Item label="到访照片">
|
|
177
|
+ {getFieldDecorator('imageUrl')(
|
|
178
|
+ <ImageUpload />,
|
164
|
179
|
)}
|
165
|
180
|
</Form.Item>
|
166
|
|
- <Form.Item label="客户描述">
|
167
|
|
- {getFieldDecorator('describe')(
|
|
181
|
+ <Form.Item label="备注">
|
|
182
|
+ {getFieldDecorator('remark')(
|
168
|
183
|
<TextArea placeholder="客户描述" rows={10} />,
|
169
|
184
|
)}
|
170
|
185
|
</Form.Item>
|
171
|
|
- <Form.Item label="物业类型">
|
172
|
|
- {getFieldDecorator('realtyManageType')(
|
173
|
|
- <Input placeholder="物业类型" />,
|
174
|
|
- )}
|
175
|
|
- </Form.Item>
|
176
|
|
- <Form.Item label="需求类型">
|
177
|
|
- {getFieldDecorator('demandType')(
|
178
|
|
- <Input placeholder="需求类型" />,
|
179
|
|
- )}
|
180
|
|
- </Form.Item>
|
181
|
|
- <Form.Item label="价格区间">
|
182
|
|
- {getFieldDecorator('priceRange')(
|
183
|
|
- <Input placeholder="价格区间" />,
|
184
|
|
- )}
|
185
|
|
- </Form.Item>
|
186
|
|
- <Form.Item label="报备日期">
|
187
|
|
- {getFieldDecorator('reportDate')(
|
188
|
|
- <DatePicker showTime placeholder="报备日期" />,
|
189
|
|
- )}
|
190
|
|
- </Form.Item>
|
191
|
|
- {/* <Form.Item label="状态">
|
192
|
|
- {getFieldDecorator('verifyStatus')(
|
193
|
|
- <Select style={{ width: '180px' }} placeholder="状态" onChange={handleSelectChange}>
|
194
|
|
- <Option value={0}>未通过</Option>
|
195
|
|
- <Option value={1}>已通过</Option>
|
196
|
|
- <Option value={2}>已驳回</Option>
|
197
|
|
- </Select>,
|
198
|
|
- )}onClick={() => submitDate({ verifyStatus: '1' })}
|
199
|
|
- </Form.Item> */}
|
200
|
|
- <Form.Item label="归属置业顾问"
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+ {/* <Form.Item label="归属置业顾问"
|
201
|
191
|
>
|
202
|
192
|
<Row gutter={8}>
|
203
|
193
|
<Col span={12}>
|
|
@@ -214,14 +204,14 @@ function body(props) {
|
214
|
204
|
<Button onClick={() => showConsultant()}>选择</Button>
|
215
|
205
|
</Col>
|
216
|
206
|
</Row>
|
217
|
|
- </Form.Item>
|
|
207
|
+ </Form.Item> */}
|
218
|
208
|
<Form.Item style={{ display: 'flex', justifyContent: 'center' }}>
|
219
|
|
- <Button type="primary" htmlType="submit" >
|
|
209
|
+ {data.status==='1'&&<><Button type="primary" htmlType="submit" >
|
220
|
210
|
审核通过
|
221
|
211
|
</Button>
|
222
|
|
- <Button type="danger" ghost style={{marginLeft: '4em'}} onClick={() => submitDate({ verifyStatus: '2' })}>
|
|
212
|
+ <Button type="danger" ghost style={{marginLeft: '4em'}} onClick={() => submitDate({ status: '2' })}>
|
223
|
213
|
驳回
|
224
|
|
- </Button>
|
|
214
|
+ </Button></>}
|
225
|
215
|
<Button style={{marginLeft: '4em'}} onClick={() => router.goBack(-1)}>
|
226
|
216
|
取消
|
227
|
217
|
</Button>
|
|
@@ -229,7 +219,7 @@ function body(props) {
|
229
|
219
|
</Form>
|
230
|
220
|
|
231
|
221
|
{/* 选择置业顾问 */}
|
232
|
|
- <Attribution visibleData={visibleData} onCancel={() => closeConsultant()} onSuccess={e => consultantSuccess(e)} />
|
|
222
|
+ {/* <Attribution visibleData={visibleData} onCancel={() => closeConsultant()} onSuccess={e => consultantSuccess(e)} /> */}
|
233
|
223
|
</Card>
|
234
|
224
|
);
|
235
|
225
|
}
|