|
|
|
|
61
|
}
|
61
|
}
|
62
|
getCardList(params).then((res) => {
|
62
|
getCardList(params).then((res) => {
|
63
|
const { records } = res
|
63
|
const { records } = res
|
64
|
- console.log("🚀 ~ file: index.jsx ~ line 64 ~ getCardList ~ records", records)
|
|
|
65
|
setConsultantList(records || [])
|
64
|
setConsultantList(records || [])
|
66
|
})
|
65
|
})
|
67
|
}
|
66
|
}
|
|
|
|
|
86
|
setAgentsInfo({ name: res.name, channelName: ganentsList[0].channelName })
|
85
|
setAgentsInfo({ name: res.name, channelName: ganentsList[0].channelName })
|
87
|
}
|
86
|
}
|
88
|
})
|
87
|
})
|
|
|
88
|
+
|
89
|
if (CurrentStatusId - 0 === 3) {
|
89
|
if (CurrentStatusId - 0 === 3) {
|
90
|
- setFormData({ ...FormData, ...res?.customerPreparatory, realtyConsultant: res.customerPreparatory?.realtyConsultant })
|
|
|
|
|
90
|
+ setFormData({ ...FormData, ...res?.customerPreparatory, realtyConsultant: res?.realtyConsultant })
|
|
|
91
|
+ } else {
|
|
|
92
|
+ setFormData({ ...FormData, ...res?.customerPreparatory, realtyConsultant: res?.realtyConsultant })
|
|
|
93
|
+
|
91
|
}
|
94
|
}
|
|
|
95
|
+
|
92
|
setChannelCustomerId(res?.channelCustomer?.channelCustomerId)
|
96
|
setChannelCustomerId(res?.channelCustomer?.channelCustomerId)
|
93
|
- setRenChouData({ ...RenChouData, ...res?.customerPreparatory, realtyConsultant: res.customerPreparatory?.realtyConsultant })
|
|
|
|
|
97
|
+ setRenChouData({ ...RenChouData, ...res?.customerPreparatory, realtyConsultant: res?.realtyConsultant })
|
94
|
if ((res.customerSignatory || []).length) {
|
98
|
if ((res.customerSignatory || []).length) {
|
95
|
let customerSignatory = res.customerSignatory[0]
|
99
|
let customerSignatory = res.customerSignatory[0]
|
96
|
customerSignatory.dividendsPer = customerSignatory.dividendsName.substring(customerSignatory.dividendsName.indexOf('|') + 1, customerSignatory.dividendsName.indexOf('%'))
|
100
|
customerSignatory.dividendsPer = customerSignatory.dividendsName.substring(customerSignatory.dividendsName.indexOf('|') + 1, customerSignatory.dividendsName.indexOf('%'))
|
97
|
customerSignatory.dividendsName = customerSignatory.dividendsName.substring(0, customerSignatory.dividendsName.indexOf('|'))
|
101
|
customerSignatory.dividendsName = customerSignatory.dividendsName.substring(0, customerSignatory.dividendsName.indexOf('|'))
|
98
|
- setQianYueData({ ...QianYueData, ...customerSignatory, realtyConsultant: (res.customerSignatory || []).length ? res.customerSignatory[0].realtyConsultant : null })
|
|
|
|
|
102
|
+ setQianYueData({ ...QianYueData, ...customerSignatory, realtyConsultant: res?.realtyConsultant })
|
|
|
103
|
+ // setQianYueData({ ...QianYueData, ...customerSignatory, realtyConsultant: (res.customerSignatory || []).length ? res.customerSignatory[0].realtyConsultant : null })
|
99
|
|
104
|
|
100
|
HouseTypeList.map((item) => {
|
105
|
HouseTypeList.map((item) => {
|
101
|
if (item.apartmentId === res.customerSignatory[0].houseType) {
|
106
|
if (item.apartmentId === res.customerSignatory[0].houseType) {
|
102
|
setCurrentRoomTypeId(item.apartmentId)
|
107
|
setCurrentRoomTypeId(item.apartmentId)
|
103
|
}
|
108
|
}
|
104
|
})
|
109
|
})
|
105
|
- setSuccessDate(res.customerSignatory[0].successDate.substring(0, 10))
|
|
|
|
|
110
|
+ setSuccessDate(res.customerSignatory[0].successDate?.substring(0, 10))
|
106
|
}
|
111
|
}
|
107
|
// const ConsultantId = CurrentStatusId === 3 ? res.customerPreparatory?.realtyConsultant : (res.customerSignatory || []).length ? res.customerSignatory[0].realtyConsultant : null
|
112
|
// const ConsultantId = CurrentStatusId === 3 ? res.customerPreparatory?.realtyConsultant : (res.customerSignatory || []).length ? res.customerSignatory[0].realtyConsultant : null
|
108
|
const ConsultantId = CurrentStatusId === 3 ? res?.realtyConsultant : (res.customerSignatory || []).length ? res.customerSignatory[0].realtyConsultant : null
|
113
|
const ConsultantId = CurrentStatusId === 3 ? res?.realtyConsultant : (res.customerSignatory || []).length ? res.customerSignatory[0].realtyConsultant : null
|
109
|
-
|
|
|
|
|
114
|
+ // setRenChouData({ realtyConsultant: res?.realtyConsultant })
|
110
|
console.log(`ConsultantId is`, ConsultantId, id)
|
115
|
console.log(`ConsultantId is`, ConsultantId, id)
|
111
|
|
116
|
|
112
|
|
117
|
|
113
|
- ConsultantList.map((item) => {
|
|
|
|
|
118
|
+ return ConsultantList.map((item) => {
|
114
|
if (item.id === ConsultantId) {
|
119
|
if (item.id === ConsultantId) {
|
115
|
setCurrnetConsultant(item)
|
120
|
setCurrnetConsultant(item)
|
116
|
}
|
121
|
}
|
117
|
})
|
122
|
})
|
118
|
})
|
123
|
})
|
119
|
- }, [ConsultantList, HouseTypeList, CurrentStatusId])
|
|
|
|
|
124
|
+ }, [ConsultantList, HouseTypeList, CurrentStatusId,])
|
120
|
|
125
|
|
121
|
useEffect(() => {
|
126
|
useEffect(() => {
|
122
|
if (CurrentStatusId - 0 !== 3 && buildingId) {
|
127
|
if (CurrentStatusId - 0 !== 3 && buildingId) {
|
|
|
|
|
199
|
for (let key in FormData) {
|
204
|
for (let key in FormData) {
|
200
|
if (key !== 'dividendsName' && key !== 'dividendsPer') {
|
205
|
if (key !== 'dividendsName' && key !== 'dividendsPer') {
|
201
|
params[key] = { ...FormData }[key]
|
206
|
params[key] = { ...FormData }[key]
|
|
|
207
|
+ console.log("🚀 ~ file: index.jsx ~ line 202 ~ ToSubmit ~ FormData", FormData)
|
202
|
}
|
208
|
}
|
203
|
}
|
209
|
}
|
204
|
params.dividendsName = `${FormData.dividendsName}|${FormData.dividendsPer}%`
|
210
|
params.dividendsName = `${FormData.dividendsName}|${FormData.dividendsPer}%`
|