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