lisenzhou 2 år sedan
förälder
incheckning
ff3bc53473
1 ändrade filer med 21 tillägg och 9 borttagningar
  1. 21
    9
      src/subpackages/pages/marketing/changeVisit/index.jsx

+ 21
- 9
src/subpackages/pages/marketing/changeVisit/index.jsx Visa fil

@@ -45,8 +45,8 @@ export default withLayout((props) => {
45 45
 
46 46
   const [FormData, setFormData] = useState({ ...RenChouData });
47 47
 
48
-  const [ConsultantList, setConsultantList] = useState([]);
49
-  const [HouseTypeList, setHouseTypeList] = useState([]);
48
+  const [ConsultantList, setConsultantList] = useState();
49
+  const [HouseTypeList, setHouseTypeList] = useState();
50 50
   const [CurrnetConsultant, setCurrnetConsultant] = useState({});
51 51
 
52 52
   const [SuccessDate, setSuccessDate] = useState(null);
@@ -103,13 +103,17 @@ export default withLayout((props) => {
103 103
   });
104 104
 
105 105
   useEffect(() => {
106
+
107
+    if(!HouseTypeList) return
108
+    if(!ConsultantList) return
109
+
106 110
     fetch({ url: `${API_CUSTOMER_DETAILINFO}/${id}`, method: "get" }).then(
107 111
       (res) => {
108 112
         if (res?.channelCustomer?.recommendPersonType === ROLE_CODE.BROKER) {
109 113
           setIsBroker(true);
110 114
         }
111 115
         //获取经纪人信息
112
-        setChannelCustomerIdInfo(res);
116
+       
113 117
         setAgentsInfo({ name: res.name });
114 118
         getAgents({ personId: res?.recommendPerson }).then((e) => {
115 119
           let ganentsList = e.records;
@@ -155,6 +159,11 @@ export default withLayout((props) => {
155 159
               0,
156 160
               customerSignatory.dividendsName.indexOf("|")
157 161
             );
162
+            console.log({ ...QianYueData,
163
+              ...customerSignatory,
164
+              totalCommission: res.channelCustomer.totalCommission, //佣金总额
165
+  
166
+              realtyConsultant: res?.realtyConsultant,},'========-------')
158 167
           setQianYueData({
159 168
             ...QianYueData,
160 169
             ...customerSignatory,
@@ -182,7 +191,7 @@ export default withLayout((props) => {
182 191
             : null;
183 192
         // setRenChouData({ realtyConsultant: res?.realtyConsultant })
184 193
         console.log(`ConsultantId is`, ConsultantId, id);
185
-
194
+        setChannelCustomerIdInfo(res);
186 195
         return ConsultantList.map((item) => {
187 196
           if (item.id === ConsultantId || `${item.userId}` === ConsultantId) {
188 197
             setCurrnetConsultant(item);
@@ -193,7 +202,7 @@ export default withLayout((props) => {
193 202
   }, [ConsultantList, HouseTypeList, CurrentStatusId]);
194 203
 
195 204
   useEffect(() => {
196
-    if (CurrentStatusId - 0 !== 3 && buildingId) {
205
+    if (buildingId) {
197 206
       fetch({
198 207
         url: `${API_BUILDING_HOUSE_TYPE}?buildingId=${buildingId}&pageSize=${500}`,
199 208
         method: "get",
@@ -201,10 +210,11 @@ export default withLayout((props) => {
201 210
         setHouseTypeList(res.records || []);
202 211
       });
203 212
     }
204
-  }, [CurrentStatusId, buildingId]);
213
+  }, [ buildingId]);
205 214
 
206 215
   // 进入页面带入当前客户的节点状态
207 216
   useEffect(() => {
217
+    console.log(channelCustomerInfo,'channelCustomerInfochannelCustomerInfo')
208 218
     if (channelCustomerInfo?.status && isFirst.current === 1) {
209 219
       isFirst.current++;
210 220
       if (channelCustomerInfo?.status == 2) return;
@@ -213,6 +223,7 @@ export default withLayout((props) => {
213 223
         StatusList.filter((x) => x.id === channelCustomerInfo.status)[0]
214 224
       )();
215 225
     }
226
+   
216 227
   }, [channelCustomerInfo]);
217 228
 
218 229
   useEffect(() => {
@@ -222,7 +233,7 @@ export default withLayout((props) => {
222 233
   const CutStatus = (item) => {
223 234
     return () => {
224 235
       if (!item.id) return;
225
-
236
+console.log(QianYueData,item,'QianYueDataQianYueData')
226 237
       setCurrentStatusId(item.id);
227 238
       if (item.id - 0 === 3) {
228 239
         setFormData({ ...RenChouData });
@@ -368,6 +379,7 @@ export default withLayout((props) => {
368 379
           params[key] = { ...FormData }[key];
369 380
         }
370 381
       }
382
+      console.log(FormData,params,'paramsparams')
371 383
       params.dividendsName = `${FormData.dividendsName||''}|${FormData.dividendsPer||''}%`;
372 384
       if (
373 385
         Number(params.totalCommission || 0) -
@@ -537,7 +549,7 @@ export default withLayout((props) => {
537 549
             <view className="flex-item">
538 550
               <Picker
539 551
                 range-key="name"
540
-                range={ConsultantList}
552
+                range={ConsultantList||[]}
541 553
                 value={0}
542 554
                 onChange={PickerChange.bind(this, "realtyConsultant")}
543 555
               >
@@ -579,7 +591,7 @@ export default withLayout((props) => {
579 591
               <view className="FormLine flex-h">
580 592
                 <view className="flex-item">
581 593
                   <view className="CheckBoxList">
582
-                    {HouseTypeList.map((item, index) => (
594
+                    {HouseTypeList?.map((item, index) => (
583 595
                       <view
584 596
                         key={`RoomTypeItem-${index}`}
585 597
                         onClick={CutRoomType(item)}