|
@@ -1,56 +1,61 @@
|
1
|
|
-import { useState, useEffect } from 'react'
|
2
|
|
-import withLayout from '@/layout'
|
3
|
|
-import { ScrollView, Input, Image, Block, Picker } from '@tarojs/components'
|
4
|
|
-import '@/assets/css/iconfont.css'
|
5
|
|
-import { getCardList, getAgents } from '@/services/card'
|
6
|
|
-import { fetch } from '@/utils/request'
|
7
|
|
-import Taro from '@tarojs/taro'
|
|
1
|
+import { useState, useEffect } from "react";
|
|
2
|
+import withLayout from "@/layout";
|
|
3
|
+import { ScrollView, Input, Image, Block, Picker } from "@tarojs/components";
|
|
4
|
+import "@/assets/css/iconfont.css";
|
|
5
|
+import { getCardList, getAgents } from "@/services/card";
|
|
6
|
+import { fetch } from "@/utils/request";
|
|
7
|
+import Taro from "@tarojs/taro";
|
8
|
8
|
import { formatDate } from "@/utils/chatDate";
|
9
|
|
-import { API_SURE_CHIP, API_BUILDING_HOUSE_TYPE, API_SURE_SIGN, API_SURE_BUY, API_CUSTOMER_DETAILINFO } from '@/constants/api'
|
10
|
|
-import './index.scss'
|
|
9
|
+import {
|
|
10
|
+ API_SURE_CHIP,
|
|
11
|
+ API_BUILDING_HOUSE_TYPE,
|
|
12
|
+ API_SURE_SIGN,
|
|
13
|
+ API_SURE_BUY,
|
|
14
|
+ API_CUSTOMER_DETAILINFO,
|
|
15
|
+} from "@/constants/api";
|
|
16
|
+import "./index.scss";
|
|
17
|
+import { ROLE_CODE } from "@/constants/user";
|
11
|
18
|
|
12
|
19
|
export default withLayout((props) => {
|
13
|
|
-
|
14
|
|
- const { router } = props
|
15
|
|
- const { name, buildingId, type, id, channelId } = router.params
|
16
|
|
-
|
17
|
|
-
|
|
20
|
+ const { router, person } = props;
|
|
21
|
+ const { name, buildingId, type, id, channelId } = router.params;
|
|
22
|
+ console.log(person, "===");
|
18
|
23
|
const [RenChouData, setRenChouData] = useState({
|
19
|
24
|
name,
|
20
|
|
- realtyConsultant: '',
|
21
|
|
- remark: '',
|
22
|
|
- })
|
23
|
|
-
|
|
25
|
+ realtyConsultant: "",
|
|
26
|
+ remark: "",
|
|
27
|
+ });
|
24
|
28
|
|
25
|
29
|
const [QianYueData, setQianYueData] = useState({
|
26
|
30
|
name,
|
27
|
|
- realtyConsultant: '',
|
28
|
|
- remark: '',
|
29
|
|
- dividendsName: '',
|
30
|
|
- dividendsPer: '',
|
31
|
|
- houseInfo: '',
|
32
|
|
- houseType: '',
|
33
|
|
- price: '',
|
34
|
|
- successDate: '',
|
35
|
|
- })
|
36
|
|
-
|
37
|
|
- const [FormData, setFormData] = useState({ ...RenChouData })
|
38
|
|
-
|
39
|
|
- const [ConsultantList, setConsultantList] = useState([])
|
40
|
|
- const [HouseTypeList, setHouseTypeList] = useState([])
|
41
|
|
- const [CurrnetConsultant, setCurrnetConsultant] = useState({})
|
42
|
|
-
|
43
|
|
- const [SuccessDate, setSuccessDate] = useState(null)
|
44
|
|
- const [channelCustomerId, setChannelCustomerId] = useState(null)
|
45
|
|
-
|
|
31
|
+ realtyConsultant: "",
|
|
32
|
+ remark: "",
|
|
33
|
+ dividendsName: "",
|
|
34
|
+ dividendsPer: "",
|
|
35
|
+ houseInfo: "",
|
|
36
|
+ houseType: "",
|
|
37
|
+ price: "",
|
|
38
|
+ successDate: "",
|
|
39
|
+ });
|
|
40
|
+
|
|
41
|
+ const [FormData, setFormData] = useState({ ...RenChouData });
|
|
42
|
+
|
|
43
|
+ const [ConsultantList, setConsultantList] = useState([]);
|
|
44
|
+ const [HouseTypeList, setHouseTypeList] = useState([]);
|
|
45
|
+ const [CurrnetConsultant, setCurrnetConsultant] = useState({});
|
|
46
|
+
|
|
47
|
+ const [SuccessDate, setSuccessDate] = useState(null);
|
|
48
|
+ const [channelCustomerId, setChannelCustomerId] = useState(null);
|
|
49
|
+ const [channelCustomerInfo, setChannelCustomerIdInfo] = useState({});
|
46
|
50
|
const [StatusList] = useState([
|
47
|
|
- { name: '认筹', id: 3 },
|
48
|
|
- { name: '签约', id: 4 },
|
49
|
|
- { name: '结佣', id: 5 },
|
50
|
|
- ])
|
51
|
|
- const [CurrentStatusId, setCurrentStatusId] = useState(3)
|
|
51
|
+ { name: "认筹", id: 3 },
|
|
52
|
+ { name: "签约", id: 4 },
|
|
53
|
+ { name: "全款到账", id: 6 },
|
|
54
|
+ { name: "结佣", id: 5 },
|
|
55
|
+ ]);
|
|
56
|
+ const [CurrentStatusId, setCurrentStatusId] = useState(3);
|
52
|
57
|
|
53
|
|
- const [CurrentRoomTypeId, setCurrentRoomTypeId] = useState(null)
|
|
58
|
+ const [CurrentRoomTypeId, setCurrentRoomTypeId] = useState(null);
|
54
|
59
|
|
55
|
60
|
useEffect(() => {
|
56
|
61
|
if (buildingId) {
|
|
@@ -58,325 +63,505 @@ export default withLayout((props) => {
|
58
|
63
|
pageNumber: 1,
|
59
|
64
|
pageSize: 50,
|
60
|
65
|
buildingId,
|
61
|
|
- }
|
|
66
|
+ };
|
62
|
67
|
getCardList(params).then((res) => {
|
63
|
|
- const { records } = res
|
64
|
|
- setConsultantList(records || [])
|
65
|
|
- })
|
|
68
|
+ const { records } = res;
|
|
69
|
+ setConsultantList(records || []);
|
|
70
|
+ });
|
66
|
71
|
}
|
67
|
|
- }, [buildingId])
|
68
|
|
-
|
69
|
|
-
|
|
72
|
+ }, [buildingId]);
|
70
|
73
|
|
71
|
74
|
const [agentsInfo, setAgentsInfo] = useState({
|
72
|
|
- name: '',
|
73
|
|
- channelName: ' ',
|
74
|
|
- })
|
75
|
|
-
|
|
75
|
+ name: "",
|
|
76
|
+ channelName: " ",
|
|
77
|
+ });
|
76
|
78
|
|
77
|
79
|
useEffect(() => {
|
78
|
|
- fetch({ url: `${API_CUSTOMER_DETAILINFO}/${id}`, method: 'get' }).then((res) => {
|
79
|
|
- //获取经纪人信息
|
80
|
|
- setAgentsInfo({ name: res.name })
|
81
|
|
- getAgents({ personId: res?.recommendPerson }).then((e) => {
|
82
|
|
- let ganentsList = e.records
|
83
|
|
- if ((ganentsList || []).length) {
|
84
|
|
- // ganentsList
|
85
|
|
- setAgentsInfo({ name: res.name, channelName: ganentsList[0].channelName })
|
|
80
|
+ fetch({ url: `${API_CUSTOMER_DETAILINFO}/${id}`, method: "get" }).then(
|
|
81
|
+ (res) => {
|
|
82
|
+ //获取经纪人信息
|
|
83
|
+ setChannelCustomerIdInfo(res);
|
|
84
|
+ setAgentsInfo({ name: res.name });
|
|
85
|
+ getAgents({ personId: res?.recommendPerson }).then((e) => {
|
|
86
|
+ let ganentsList = e.records;
|
|
87
|
+ if ((ganentsList || []).length) {
|
|
88
|
+ // ganentsList
|
|
89
|
+ setAgentsInfo({
|
|
90
|
+ name: res.name,
|
|
91
|
+ channelName: ganentsList[0].channelName,
|
|
92
|
+ });
|
|
93
|
+ }
|
|
94
|
+ });
|
|
95
|
+
|
|
96
|
+ if (CurrentStatusId - 0 === 3) {
|
|
97
|
+ setFormData({
|
|
98
|
+ ...FormData,
|
|
99
|
+ ...res?.customerPreparatory,
|
|
100
|
+ realtyConsultant: res?.realtyConsultant,
|
|
101
|
+ });
|
|
102
|
+ } else {
|
|
103
|
+ setFormData({
|
|
104
|
+ ...FormData,
|
|
105
|
+ ...res?.customerPreparatory,
|
|
106
|
+ realtyConsultant: res?.realtyConsultant,
|
|
107
|
+ });
|
86
|
108
|
}
|
87
|
|
- })
|
88
|
|
-
|
89
|
|
- if (CurrentStatusId - 0 === 3) {
|
90
|
|
- setFormData({ ...FormData, ...res?.customerPreparatory, realtyConsultant: res?.realtyConsultant })
|
91
|
|
- } else {
|
92
|
|
- setFormData({ ...FormData, ...res?.customerPreparatory, realtyConsultant: res?.realtyConsultant })
|
93
|
109
|
|
94
|
|
- }
|
95
|
|
-
|
96
|
|
- setChannelCustomerId(res?.channelCustomer?.channelCustomerId)
|
97
|
|
- setRenChouData({ ...RenChouData, ...res?.customerPreparatory, realtyConsultant: res?.realtyConsultant })
|
98
|
|
- if ((res.customerSignatory || []).length) {
|
99
|
|
- let customerSignatory = res.customerSignatory[0]
|
100
|
|
- customerSignatory.dividendsPer = customerSignatory.dividendsName.substring(customerSignatory.dividendsName.indexOf('|') + 1, customerSignatory.dividendsName.indexOf('%'))
|
101
|
|
- customerSignatory.dividendsName = customerSignatory.dividendsName.substring(0, customerSignatory.dividendsName.indexOf('|'))
|
102
|
|
- setQianYueData({ ...QianYueData, ...customerSignatory, realtyConsultant: res?.realtyConsultant })
|
103
|
|
- // setQianYueData({ ...QianYueData, ...customerSignatory, realtyConsultant: (res.customerSignatory || []).length ? res.customerSignatory[0].realtyConsultant : null })
|
104
|
|
-
|
105
|
|
- HouseTypeList.map((item) => {
|
106
|
|
- if (item.apartmentId === res.customerSignatory[0].houseType) {
|
107
|
|
- setCurrentRoomTypeId(item.apartmentId)
|
|
110
|
+ setChannelCustomerId(res?.channelCustomer?.channelCustomerId);
|
|
111
|
+ setRenChouData({
|
|
112
|
+ ...RenChouData,
|
|
113
|
+ ...res?.customerPreparatory,
|
|
114
|
+ realtyConsultant: res?.realtyConsultant,
|
|
115
|
+ });
|
|
116
|
+ if ((res.customerSignatory || []).length) {
|
|
117
|
+ let customerSignatory = res.customerSignatory[0];
|
|
118
|
+ customerSignatory.dividendsPer =
|
|
119
|
+ customerSignatory.dividendsName.substring(
|
|
120
|
+ customerSignatory.dividendsName.indexOf("|") + 1,
|
|
121
|
+ customerSignatory.dividendsName.indexOf("%")
|
|
122
|
+ );
|
|
123
|
+ customerSignatory.dividendsName =
|
|
124
|
+ customerSignatory.dividendsName.substring(
|
|
125
|
+ 0,
|
|
126
|
+ customerSignatory.dividendsName.indexOf("|")
|
|
127
|
+ );
|
|
128
|
+ setQianYueData({
|
|
129
|
+ ...QianYueData,
|
|
130
|
+ ...customerSignatory,
|
|
131
|
+ realtyConsultant: res?.realtyConsultant,
|
|
132
|
+ });
|
|
133
|
+ // setQianYueData({ ...QianYueData, ...customerSignatory, realtyConsultant: (res.customerSignatory || []).length ? res.customerSignatory[0].realtyConsultant : null })
|
|
134
|
+
|
|
135
|
+ HouseTypeList.map((item) => {
|
|
136
|
+ if (item.apartmentId === res.customerSignatory[0].houseType) {
|
|
137
|
+ setCurrentRoomTypeId(item.apartmentId);
|
|
138
|
+ }
|
|
139
|
+ });
|
|
140
|
+ setSuccessDate(
|
|
141
|
+ res.customerSignatory[0].successDate?.substring(0, 10)
|
|
142
|
+ );
|
|
143
|
+ }
|
|
144
|
+ // const ConsultantId = CurrentStatusId === 3 ? res.customerPreparatory?.realtyConsultant : (res.customerSignatory || []).length ? res.customerSignatory[0].realtyConsultant : null
|
|
145
|
+ const ConsultantId =
|
|
146
|
+ CurrentStatusId === 3
|
|
147
|
+ ? res?.realtyConsultant
|
|
148
|
+ : (res.customerSignatory || []).length
|
|
149
|
+ ? res.customerSignatory[0].realtyConsultant
|
|
150
|
+ : null;
|
|
151
|
+ // setRenChouData({ realtyConsultant: res?.realtyConsultant })
|
|
152
|
+ console.log(`ConsultantId is`, ConsultantId, id);
|
|
153
|
+
|
|
154
|
+ return ConsultantList.map((item) => {
|
|
155
|
+ if (item.id === ConsultantId || `${item.userId}` === ConsultantId) {
|
|
156
|
+ setCurrnetConsultant(item);
|
108
|
157
|
}
|
109
|
|
- })
|
110
|
|
- setSuccessDate(res.customerSignatory[0].successDate?.substring(0, 10))
|
|
158
|
+ });
|
111
|
159
|
}
|
112
|
|
- // const ConsultantId = CurrentStatusId === 3 ? res.customerPreparatory?.realtyConsultant : (res.customerSignatory || []).length ? res.customerSignatory[0].realtyConsultant : null
|
113
|
|
- const ConsultantId = CurrentStatusId === 3 ? res?.realtyConsultant : (res.customerSignatory || []).length ? res.customerSignatory[0].realtyConsultant : null
|
114
|
|
- // setRenChouData({ realtyConsultant: res?.realtyConsultant })
|
115
|
|
- console.log(`ConsultantId is`, ConsultantId, id)
|
116
|
|
-
|
117
|
|
-
|
118
|
|
- return ConsultantList.map((item) => {
|
119
|
|
- if (item.id === ConsultantId || `${item.userId}` === ConsultantId) {
|
120
|
|
- setCurrnetConsultant(item)
|
121
|
|
- }
|
122
|
|
- })
|
123
|
|
- })
|
124
|
|
- }, [ConsultantList, HouseTypeList, CurrentStatusId,])
|
|
160
|
+ );
|
|
161
|
+ }, [ConsultantList, HouseTypeList, CurrentStatusId]);
|
125
|
162
|
|
126
|
163
|
useEffect(() => {
|
127
|
164
|
if (CurrentStatusId - 0 !== 3 && buildingId) {
|
128
|
|
- fetch({ url: `${API_BUILDING_HOUSE_TYPE}?buildingId=${buildingId}&pageSize=${500}`, method: 'get' }).then((res) => {
|
129
|
|
- setHouseTypeList(res.records || [])
|
130
|
|
- })
|
|
165
|
+ fetch({
|
|
166
|
+ url: `${API_BUILDING_HOUSE_TYPE}?buildingId=${buildingId}&pageSize=${500}`,
|
|
167
|
+ method: "get",
|
|
168
|
+ }).then((res) => {
|
|
169
|
+ setHouseTypeList(res.records || []);
|
|
170
|
+ });
|
131
|
171
|
}
|
132
|
|
- }, [CurrentStatusId, buildingId])
|
|
172
|
+ }, [CurrentStatusId, buildingId]);
|
133
|
173
|
|
134
|
174
|
useEffect(() => {
|
135
|
|
- console.log('FormData', FormData)
|
136
|
|
- }, [FormData])
|
|
175
|
+ console.log("FormData", FormData);
|
|
176
|
+ }, [FormData]);
|
137
|
177
|
|
138
|
178
|
const CutStatus = (item) => {
|
139
|
179
|
return () => {
|
140
|
|
- setCurrentStatusId(item.id)
|
|
180
|
+ setCurrentStatusId(item.id);
|
141
|
181
|
if (item.id - 0 === 3) {
|
142
|
|
- setFormData({ ...RenChouData })
|
143
|
|
-
|
|
182
|
+ setFormData({ ...RenChouData });
|
144
|
183
|
} else if (item.id - 0 === 4) {
|
145
|
|
- setFormData({ ...QianYueData })
|
146
|
|
-
|
|
184
|
+ setFormData({ ...QianYueData });
|
147
|
185
|
} else if (item.id - 0 === 5) {
|
148
|
|
- setFormData({ ...QianYueData })
|
|
186
|
+ setFormData({ ...QianYueData });
|
149
|
187
|
}
|
150
|
|
- }
|
151
|
|
- }
|
|
188
|
+ };
|
|
189
|
+ };
|
152
|
190
|
|
153
|
191
|
const CutRoomType = (item) => {
|
154
|
192
|
return () => {
|
155
|
|
- let resData = { ...FormData }
|
156
|
|
- resData.houseType = item.apartmentId
|
157
|
|
- setFormData({ ...resData })
|
158
|
|
- setCurrentRoomTypeId(item.apartmentId)
|
159
|
|
- }
|
160
|
|
- }
|
|
193
|
+ let resData = { ...FormData };
|
|
194
|
+ resData.houseType = item.apartmentId;
|
|
195
|
+ setFormData({ ...resData });
|
|
196
|
+ setCurrentRoomTypeId(item.apartmentId);
|
|
197
|
+ };
|
|
198
|
+ };
|
161
|
199
|
|
162
|
200
|
const InputChange = (key, e) => {
|
163
|
|
- let resData = { ...FormData }
|
164
|
|
- resData[key] = e.detail.value
|
165
|
|
- setFormData({ ...resData })
|
166
|
|
- }
|
|
201
|
+ let resData = { ...FormData };
|
|
202
|
+ resData[key] = e.detail.value;
|
|
203
|
+ setFormData({ ...resData });
|
|
204
|
+ };
|
167
|
205
|
|
168
|
206
|
const PickerChange = (key, e) => {
|
169
|
|
- let resData = { ...FormData }
|
170
|
|
- if (key === 'realtyConsultant') {
|
171
|
|
- resData[key] = ConsultantList[e.detail.value].id
|
172
|
|
- resData.realtyConsultantName = ConsultantList[e.detail.value].name
|
173
|
|
- setCurrnetConsultant(ConsultantList[e.detail.value])
|
|
207
|
+ let resData = { ...FormData };
|
|
208
|
+ if (key === "realtyConsultant") {
|
|
209
|
+ resData[key] = ConsultantList[e.detail.value].id;
|
|
210
|
+ resData.realtyConsultantName = ConsultantList[e.detail.value].name;
|
|
211
|
+ setCurrnetConsultant(ConsultantList[e.detail.value]);
|
174
|
212
|
}
|
175
|
|
- setFormData({ ...resData })
|
176
|
|
- }
|
|
213
|
+ setFormData({ ...resData });
|
|
214
|
+ };
|
177
|
215
|
|
178
|
216
|
const CheckForm = () => {
|
179
|
|
- if (CurrentStatusId === 3) { // 认筹
|
180
|
|
- if (FormData.name === '') {
|
181
|
|
- Taro.showToast({ title: '姓名不能为空', icon: 'none', duration: 2000 })
|
182
|
|
- return false
|
|
217
|
+ if (CurrentStatusId === 3) {
|
|
218
|
+ // 认筹
|
|
219
|
+ if (FormData.name === "") {
|
|
220
|
+ Taro.showToast({ title: "姓名不能为空", icon: "none", duration: 2000 });
|
|
221
|
+ return false;
|
183
|
222
|
}
|
184
|
223
|
// if (FormData.realtyConsultant === '') {
|
185
|
224
|
// Taro.showToast({ title: '请选择内场接待', icon: 'none', duration: 2000 })
|
186
|
225
|
// return false
|
187
|
226
|
// }
|
188
|
|
- } else if (CurrentStatusId === 4) { // 签约
|
189
|
|
-
|
|
227
|
+ } else if (CurrentStatusId === 4) {
|
|
228
|
+ // 签约
|
190
|
229
|
}
|
191
|
|
- return true
|
192
|
|
- }
|
|
230
|
+ return true;
|
|
231
|
+ };
|
193
|
232
|
|
194
|
233
|
const ToSubmit = () => {
|
195
|
234
|
if (CurrentStatusId === 3) {
|
196
|
|
- fetch({ url: API_SURE_CHIP, method: 'put', payload: { customerId: id, customerPreparatory: { ...FormData, channelId: channelId === 'null' || channelId === null ? '' : channelId, channelCustomerId, } } }).then(() => {
|
197
|
|
- Taro.showToast({ title: '修改成功', icon: 'none', duration: 2000 })
|
|
235
|
+ fetch({
|
|
236
|
+ url: API_SURE_CHIP,
|
|
237
|
+ method: "put",
|
|
238
|
+ payload: {
|
|
239
|
+ customerId: id,
|
|
240
|
+ customerPreparatory: {
|
|
241
|
+ ...FormData,
|
|
242
|
+ channelId:
|
|
243
|
+ channelId === "null" || channelId === null ? "" : channelId,
|
|
244
|
+ channelCustomerId,
|
|
245
|
+ },
|
|
246
|
+ },
|
|
247
|
+ }).then(() => {
|
|
248
|
+ Taro.showToast({ title: "修改成功", icon: "none", duration: 2000 });
|
198
|
249
|
setTimeout(() => {
|
199
|
|
- Taro.navigateBack({ delta: 1 })
|
200
|
|
- }, 2000)
|
201
|
|
- })
|
|
250
|
+ Taro.navigateBack({ delta: 1 });
|
|
251
|
+ }, 2000);
|
|
252
|
+ });
|
202
|
253
|
} else if (CurrentStatusId === 4) {
|
203
|
|
- let params = {}
|
|
254
|
+ let params = {};
|
204
|
255
|
for (let key in FormData) {
|
205
|
|
- if (key !== 'dividendsName' && key !== 'dividendsPer') {
|
206
|
|
- params[key] = { ...FormData }[key]
|
207
|
|
- console.log("🚀 ~ file: index.jsx ~ line 202 ~ ToSubmit ~ FormData", FormData)
|
|
256
|
+ if (key !== "dividendsName" && key !== "dividendsPer") {
|
|
257
|
+ params[key] = { ...FormData }[key];
|
|
258
|
+ console.log(
|
|
259
|
+ "🚀 ~ file: index.jsx ~ line 202 ~ ToSubmit ~ FormData",
|
|
260
|
+ FormData
|
|
261
|
+ );
|
208
|
262
|
}
|
209
|
263
|
}
|
210
|
|
- params.dividendsName = `${FormData.dividendsName}|${FormData.dividendsPer}%`
|
211
|
|
- fetch({ url: API_SURE_SIGN, method: 'put', payload: { customerId: id, customerSignatory: { ...params, channelId: channelId === 'null' || channelId === null ? '' : channelId, channelCustomerId, } } }).then(() => {
|
212
|
|
- Taro.showToast({ title: '修改成功', icon: 'none', duration: 2000 })
|
|
264
|
+ params.dividendsName = `${FormData.dividendsName}|${FormData.dividendsPer}%`;
|
|
265
|
+ fetch({
|
|
266
|
+ url: API_SURE_SIGN,
|
|
267
|
+ method: "put",
|
|
268
|
+ payload: {
|
|
269
|
+ customerId: id,
|
|
270
|
+ customerSignatory: {
|
|
271
|
+ ...params,
|
|
272
|
+ channelId:
|
|
273
|
+ channelId === "null" || channelId === null ? "" : channelId,
|
|
274
|
+ channelCustomerId,
|
|
275
|
+ },
|
|
276
|
+ },
|
|
277
|
+ }).then(() => {
|
|
278
|
+ Taro.showToast({ title: "修改成功", icon: "none", duration: 2000 });
|
213
|
279
|
setTimeout(() => {
|
214
|
|
- Taro.navigateBack({ delta: 1 })
|
215
|
|
- }, 2000)
|
216
|
|
- })
|
|
280
|
+ Taro.navigateBack({ delta: 1 });
|
|
281
|
+ }, 2000);
|
|
282
|
+ });
|
217
|
283
|
} else if (CurrentStatusId === 5) {
|
218
|
|
- let params = {}
|
|
284
|
+ let params = {};
|
219
|
285
|
for (let key in FormData) {
|
220
|
|
- if (key !== 'dividendsName' && key !== 'dividendsPer') {
|
221
|
|
- params[key] = { ...FormData }[key]
|
|
286
|
+ if (key !== "dividendsName" && key !== "dividendsPer") {
|
|
287
|
+ params[key] = { ...FormData }[key];
|
222
|
288
|
}
|
223
|
289
|
}
|
224
|
|
- params.dividendsName = `${FormData.dividendsName}|${FormData.dividendsPer}%`
|
225
|
|
- fetch({ url: API_SURE_BUY, method: 'put', payload: { customerId: id, customerSignatory: { ...params, channelId: channelId === 'null' || channelId === null ? '' : channelId, channelCustomerId, } } }).then(() => {
|
226
|
|
- Taro.showToast({ title: '修改成功', icon: 'none', duration: 2000 })
|
|
290
|
+ params.dividendsName = `${FormData.dividendsName}|${FormData.dividendsPer}%`;
|
|
291
|
+ fetch({
|
|
292
|
+ url: API_SURE_BUY,
|
|
293
|
+ method: "put",
|
|
294
|
+ payload: {
|
|
295
|
+ customerId: id,
|
|
296
|
+ customerSignatory: {
|
|
297
|
+ ...params,
|
|
298
|
+ channelId:
|
|
299
|
+ channelId === "null" || channelId === null ? "" : channelId,
|
|
300
|
+ channelCustomerId,
|
|
301
|
+ },
|
|
302
|
+ },
|
|
303
|
+ }).then(() => {
|
|
304
|
+ Taro.showToast({ title: "修改成功", icon: "none", duration: 2000 });
|
227
|
305
|
setTimeout(() => {
|
228
|
|
- Taro.navigateBack({ delta: 1 })
|
229
|
|
- }, 2000)
|
230
|
|
- })
|
|
306
|
+ Taro.navigateBack({ delta: 1 });
|
|
307
|
+ }, 2000);
|
|
308
|
+ });
|
231
|
309
|
}
|
232
|
|
- }
|
|
310
|
+ };
|
233
|
311
|
|
234
|
312
|
const SuccessDateChange = (e) => {
|
235
|
|
- let resData = { ...FormData }
|
236
|
|
- resData.successDate = new Date(e.detail.value)
|
237
|
|
- setFormData(resData)
|
238
|
|
- setSuccessDate(e.detail.value)
|
239
|
|
- }
|
240
|
|
-
|
|
313
|
+ let resData = { ...FormData };
|
|
314
|
+ resData.successDate = new Date(e.detail.value);
|
|
315
|
+ setFormData(resData);
|
|
316
|
+ setSuccessDate(e.detail.value);
|
|
317
|
+ };
|
241
|
318
|
|
242
|
319
|
return (
|
243
|
|
- <view className='Page changeVisit'>
|
244
|
|
-
|
|
320
|
+ <view className="Page changeVisit">
|
245
|
321
|
<ScrollView scroll-y>
|
246
|
|
- <view className='PageContent'>
|
247
|
|
-
|
248
|
|
- <text className='required'>变更状态</text>
|
249
|
|
- <view className='FormLine flex-h'>
|
250
|
|
- <view className='flex-item'>
|
251
|
|
- <view className='CheckBoxList'>
|
252
|
|
- {
|
253
|
|
- StatusList.map((item, index) => (
|
254
|
|
- <view key={`StatusItem-${index}`} onClick={CutStatus(item)} style={{ marginRight: index === 2 ? '0px' : '44rpx' }}>
|
255
|
|
- <text>{item.name}</text>
|
256
|
|
- {
|
257
|
|
- CurrentStatusId === item.id &&
|
258
|
|
- <Image mode='widthFix' src={require('@/assets/findHouse-icon1.png')}></Image>
|
259
|
|
- }
|
260
|
|
- </view>
|
261
|
|
- ))
|
262
|
|
- }
|
|
322
|
+ <view className="PageContent">
|
|
323
|
+ <text className="required">变更状态</text>
|
|
324
|
+ <view className="FormLine flex-h">
|
|
325
|
+ <view className="flex-item">
|
|
326
|
+ <view className="CheckBoxList">
|
|
327
|
+ {StatusList.map((item, index) => (
|
|
328
|
+ <view
|
|
329
|
+ key={`StatusItem-${index}`}
|
|
330
|
+ onClick={CutStatus(item)}
|
|
331
|
+ style={{ marginRight: index === 2 ? "0px" : "44rpx" }}
|
|
332
|
+ >
|
|
333
|
+ <text>{item.name}</text>
|
|
334
|
+ {CurrentStatusId === item.id && (
|
|
335
|
+ <Image
|
|
336
|
+ mode="widthFix"
|
|
337
|
+ src={require("@/assets/findHouse-icon1.png")}
|
|
338
|
+ ></Image>
|
|
339
|
+ )}
|
|
340
|
+ </view>
|
|
341
|
+ ))}
|
263
|
342
|
</view>
|
264
|
343
|
</view>
|
265
|
344
|
</view>
|
266
|
345
|
|
267
|
|
- <text className='required'>客户姓名</text>
|
268
|
|
- <view className='FormLine flex-h'>
|
269
|
|
- <view className='flex-item'>
|
270
|
|
- <Input placeholder='请输入姓名' disabled={CurrentStatusId === 5} value={agentsInfo.name} onInput={InputChange.bind(this, 'name')}></Input>
|
|
346
|
+ <text className="required">客户姓名</text>
|
|
347
|
+ <view className="FormLine flex-h">
|
|
348
|
+ <view className="flex-item">
|
|
349
|
+ <Input
|
|
350
|
+ placeholder="请输入姓名"
|
|
351
|
+ disabled={CurrentStatusId === 5}
|
|
352
|
+ value={agentsInfo.name}
|
|
353
|
+ onInput={InputChange.bind(this, "name")}
|
|
354
|
+ ></Input>
|
271
|
355
|
</view>
|
272
|
356
|
</view>
|
273
|
357
|
|
274
|
|
-
|
275
|
|
- <text>归属渠道</text>
|
276
|
|
- <view className='FormLine flex-h'>
|
277
|
|
- <view className='flex-item'>
|
278
|
|
- <Input placeholder='请输入渠道' disabled value={agentsInfo.channelName}></Input>
|
279
|
|
- </view>
|
280
|
|
- </view>
|
|
358
|
+ {/* {channelCustomer.recommendPersonType === ROLE_CODE.BROKER ? (
|
|
359
|
+ <>
|
|
360
|
+ <text>报备经纪人</text>
|
|
361
|
+ <view className="FormLine flex-h">
|
|
362
|
+ <view className="flex-item">
|
|
363
|
+ <text>{channelCustomer.recommendPersonName}</text>
|
|
364
|
+
|
|
365
|
+ </view>
|
|
366
|
+ </view>
|
|
367
|
+ </>
|
|
368
|
+ ) : (
|
|
369
|
+ <>
|
|
370
|
+ <text>归属渠道</text>
|
|
371
|
+ <view className="FormLine flex-h">
|
|
372
|
+ <view className="flex-item">
|
|
373
|
+ <text>{channelCustomer.channelName}</text>
|
|
374
|
+
|
|
375
|
+ </view>
|
|
376
|
+ </view>
|
|
377
|
+ </>
|
|
378
|
+ )} */}
|
|
379
|
+
|
|
380
|
+ {channelCustomerInfo?.channelCustomer?.recommendPersonType ===
|
|
381
|
+ ROLE_CODE.BROKER ? (
|
|
382
|
+ <>
|
|
383
|
+ <text>报备经纪人</text>
|
|
384
|
+ <view className="FormLine flex-h">
|
|
385
|
+ <view className="flex-item">
|
|
386
|
+ <Input
|
|
387
|
+ placeholder="请输入经纪人"
|
|
388
|
+ disabled
|
|
389
|
+ value={
|
|
390
|
+ channelCustomerInfo.channelCustomer?.recommendPersonName
|
|
391
|
+ }
|
|
392
|
+ ></Input>
|
|
393
|
+ </view>
|
|
394
|
+ </view>
|
|
395
|
+ </>
|
|
396
|
+ ) : (
|
|
397
|
+ <>
|
|
398
|
+ <text>归属渠道</text>
|
|
399
|
+ <view className="FormLine flex-h">
|
|
400
|
+ <view className="flex-item">
|
|
401
|
+ <Input
|
|
402
|
+ placeholder="请输入渠道"
|
|
403
|
+ disabled
|
|
404
|
+ value={agentsInfo.channelName}
|
|
405
|
+ ></Input>
|
|
406
|
+ </view>
|
|
407
|
+ </view>
|
|
408
|
+ </>
|
|
409
|
+ )}
|
281
|
410
|
|
282
|
411
|
<text>内场接待</text>
|
283
|
|
- <view className='FormLine flex-h'>
|
284
|
|
- <view className='flex-item'>
|
285
|
|
- <Picker range-key='name' range={ConsultantList} value={0} onChange={PickerChange.bind(this, 'realtyConsultant')}>{CurrnetConsultant.name || '请选择'}</Picker>
|
|
412
|
+ <view className="FormLine flex-h">
|
|
413
|
+ <view className="flex-item">
|
|
414
|
+ <Picker
|
|
415
|
+ range-key="name"
|
|
416
|
+ range={ConsultantList}
|
|
417
|
+ value={0}
|
|
418
|
+ onChange={PickerChange.bind(this, "realtyConsultant")}
|
|
419
|
+ >
|
|
420
|
+ {CurrnetConsultant.name || "请选择"}
|
|
421
|
+ </Picker>
|
286
|
422
|
</view>
|
287
|
423
|
</view>
|
288
|
424
|
|
289
|
|
- {
|
290
|
|
- (CurrentStatusId === 4 || CurrentStatusId === 5) &&
|
|
425
|
+ {(CurrentStatusId === 4 ||
|
|
426
|
+ CurrentStatusId === 5 ||
|
|
427
|
+ CurrentStatusId === 6) && (
|
291
|
428
|
<Block>
|
292
|
429
|
<text>业绩分成人|占比/%</text>
|
293
|
|
- <view className='FormLine flex-h'>
|
294
|
|
- <view className='flex-item'>
|
295
|
|
- <Input placeholder='请输入业绩分成人' value={FormData.dividendsName} onInput={InputChange.bind(this, 'dividendsName')}></Input>
|
|
430
|
+ <view className="FormLine flex-h">
|
|
431
|
+ <view className="flex-item">
|
|
432
|
+ <Input
|
|
433
|
+ placeholder="请输入业绩分成人"
|
|
434
|
+ value={FormData.dividendsName}
|
|
435
|
+ onInput={InputChange.bind(this, "dividendsName")}
|
|
436
|
+ ></Input>
|
296
|
437
|
</view>
|
297
|
|
- <view className='flex-item'>
|
298
|
|
- <Input placeholder='请输入占比%' value={FormData.dividendsPer} type='number' onInput={InputChange.bind(this, 'dividendsPer')}></Input>
|
|
438
|
+ <view className="flex-item">
|
|
439
|
+ <Input
|
|
440
|
+ placeholder="请输入占比%"
|
|
441
|
+ value={FormData.dividendsPer}
|
|
442
|
+ type="number"
|
|
443
|
+ onInput={InputChange.bind(this, "dividendsPer")}
|
|
444
|
+ ></Input>
|
299
|
445
|
</view>
|
300
|
446
|
</view>
|
301
|
447
|
</Block>
|
302
|
|
- }
|
|
448
|
+ )}
|
303
|
449
|
|
304
|
|
- {
|
305
|
|
- (CurrentStatusId === 4 || CurrentStatusId === 5) &&
|
|
450
|
+ {(CurrentStatusId === 4 ||
|
|
451
|
+ CurrentStatusId === 5 ||
|
|
452
|
+ CurrentStatusId === 6) && (
|
306
|
453
|
<Block>
|
307
|
454
|
<text>户型</text>
|
308
|
|
- <view className='FormLine flex-h'>
|
309
|
|
- <view className='flex-item'>
|
310
|
|
- <view className='CheckBoxList'>
|
311
|
|
- {
|
312
|
|
- HouseTypeList.map((item, index) => (
|
313
|
|
- <view key={`RoomTypeItem-${index}`} onClick={CutRoomType(item)}>
|
314
|
|
- <text>{item.apartmentName}</text>
|
315
|
|
- {
|
316
|
|
- CurrentRoomTypeId === item.apartmentId &&
|
317
|
|
- <Image mode='widthFix' src={require('@/assets/findHouse-icon1.png')}></Image>
|
318
|
|
- }
|
319
|
|
- </view>
|
320
|
|
- ))
|
321
|
|
- }
|
|
455
|
+ <view className="FormLine flex-h">
|
|
456
|
+ <view className="flex-item">
|
|
457
|
+ <view className="CheckBoxList">
|
|
458
|
+ {HouseTypeList.map((item, index) => (
|
|
459
|
+ <view
|
|
460
|
+ key={`RoomTypeItem-${index}`}
|
|
461
|
+ onClick={CutRoomType(item)}
|
|
462
|
+ >
|
|
463
|
+ <text>{item.apartmentName}</text>
|
|
464
|
+ {CurrentRoomTypeId === item.apartmentId && (
|
|
465
|
+ <Image
|
|
466
|
+ mode="widthFix"
|
|
467
|
+ src={require("@/assets/findHouse-icon1.png")}
|
|
468
|
+ ></Image>
|
|
469
|
+ )}
|
|
470
|
+ </view>
|
|
471
|
+ ))}
|
322
|
472
|
</view>
|
323
|
473
|
</view>
|
324
|
474
|
</view>
|
325
|
475
|
</Block>
|
326
|
|
- }
|
|
476
|
+ )}
|
327
|
477
|
|
328
|
|
- {
|
329
|
|
- (CurrentStatusId === 4 || CurrentStatusId === 5) &&
|
|
478
|
+ {(CurrentStatusId === 4 ||
|
|
479
|
+ CurrentStatusId === 5 ||
|
|
480
|
+ CurrentStatusId === 6) && (
|
330
|
481
|
<Block>
|
331
|
482
|
<text>房号</text>
|
332
|
|
- <view className='FormLine flex-h'>
|
333
|
|
- <view className='flex-item'>
|
334
|
|
- <Input placeholder='请输入房号' value={FormData.houseInfo} onInput={InputChange.bind(this, 'houseInfo')}></Input>
|
|
483
|
+ <view className="FormLine flex-h">
|
|
484
|
+ <view className="flex-item">
|
|
485
|
+ <Input
|
|
486
|
+ placeholder="请输入房号"
|
|
487
|
+ value={FormData.houseInfo}
|
|
488
|
+ onInput={InputChange.bind(this, "houseInfo")}
|
|
489
|
+ ></Input>
|
335
|
490
|
</view>
|
336
|
491
|
</view>
|
337
|
492
|
</Block>
|
338
|
|
- }
|
|
493
|
+ )}
|
339
|
494
|
|
340
|
|
- {
|
341
|
|
- (CurrentStatusId === 4 || CurrentStatusId === 5) &&
|
|
495
|
+ {(CurrentStatusId === 4 ||
|
|
496
|
+ CurrentStatusId === 5 ||
|
|
497
|
+ CurrentStatusId === 6) && (
|
342
|
498
|
<Block>
|
343
|
499
|
<text>签约日期</text>
|
344
|
|
- <view className='FormLine flex-h'>
|
345
|
|
- <view className='flex-item'>
|
346
|
|
- <Picker mode='date' value={FormData.successDate} onChange={SuccessDateChange}>{SuccessDate || '请选择开始日期'}</Picker>
|
|
500
|
+ <view className="FormLine flex-h">
|
|
501
|
+ <view className="flex-item">
|
|
502
|
+ <Picker
|
|
503
|
+ mode="date"
|
|
504
|
+ value={FormData.successDate}
|
|
505
|
+ onChange={SuccessDateChange}
|
|
506
|
+ >
|
|
507
|
+ {SuccessDate || "请选择开始日期"}
|
|
508
|
+ </Picker>
|
347
|
509
|
</view>
|
348
|
|
- <text className='iconfont icon-jiantoudown'></text>
|
|
510
|
+ <text className="iconfont icon-jiantoudown"></text>
|
349
|
511
|
</view>
|
350
|
512
|
</Block>
|
351
|
|
- }
|
|
513
|
+ )}
|
352
|
514
|
|
353
|
|
- {
|
354
|
|
- (CurrentStatusId === 4 || CurrentStatusId === 5) &&
|
|
515
|
+ {(CurrentStatusId === 4 ||
|
|
516
|
+ CurrentStatusId === 5 ||
|
|
517
|
+ CurrentStatusId === 6) && (
|
355
|
518
|
<Block>
|
356
|
519
|
<text>成交金额</text>
|
357
|
|
- <view className='FormLine flex-h'>
|
358
|
|
- <view className='flex-item'>
|
359
|
|
- <Input placeholder='请输入金额' value={FormData.price} onInput={InputChange.bind(this, 'price')}></Input>
|
|
520
|
+ <view className="FormLine flex-h">
|
|
521
|
+ <view className="flex-item">
|
|
522
|
+ <Input
|
|
523
|
+ placeholder="请输入金额"
|
|
524
|
+ value={FormData.price}
|
|
525
|
+ onInput={InputChange.bind(this, "price")}
|
|
526
|
+ ></Input>
|
360
|
527
|
</view>
|
361
|
528
|
</view>
|
362
|
529
|
</Block>
|
363
|
|
- }
|
|
530
|
+ )}
|
364
|
531
|
|
|
532
|
+{/* {(CurrentStatusId === 4 ||
|
|
533
|
+ CurrentStatusId === 5 ||
|
|
534
|
+ CurrentStatusId === 6) && (
|
|
535
|
+ <Block>
|
|
536
|
+ <text>佣金总额</text>
|
|
537
|
+ <view className="FormLine flex-h">
|
|
538
|
+ <view className="flex-item">
|
|
539
|
+ <Input
|
|
540
|
+ placeholder="请输入金额"
|
|
541
|
+ value={FormData.price}
|
|
542
|
+ onInput={InputChange.bind(this, "price")}
|
|
543
|
+ ></Input>
|
|
544
|
+ </view>
|
|
545
|
+ </view>
|
|
546
|
+ </Block>
|
|
547
|
+ )} */}
|
365
|
548
|
|
366
|
549
|
<text>备注</text>
|
367
|
|
- <view className='FormLine flex-h'>
|
368
|
|
- <view className='flex-item'>
|
369
|
|
- <Input placeholder='补充说明(选填)' value={FormData.remark} onInput={InputChange.bind(this, 'remark')}></Input>
|
|
550
|
+ <view className="FormLine flex-h">
|
|
551
|
+ <view className="flex-item">
|
|
552
|
+ <Input
|
|
553
|
+ placeholder="补充说明(选填)"
|
|
554
|
+ value={FormData.remark}
|
|
555
|
+ onInput={InputChange.bind(this, "remark")}
|
|
556
|
+ ></Input>
|
370
|
557
|
</view>
|
371
|
558
|
</view>
|
372
|
559
|
|
373
|
|
- <view className='Btn'>
|
|
560
|
+ <view className="Btn">
|
374
|
561
|
<text onClick={ToSubmit}>提交</text>
|
375
|
562
|
</view>
|
376
|
|
-
|
377
|
563
|
</view>
|
378
|
564
|
</ScrollView>
|
379
|
|
-
|
380
|
565
|
</view>
|
381
|
|
- )
|
382
|
|
-})
|
|
566
|
+ );
|
|
567
|
+});
|