lisenzhou 2 years ago
parent
commit
6d2eb9816d
1 changed files with 58 additions and 26 deletions
  1. 58
    26
      src/subpackages/pages/marketing/changeVisit/index.jsx

+ 58
- 26
src/subpackages/pages/marketing/changeVisit/index.jsx View File

@@ -36,6 +36,8 @@ export default withLayout((props) => {
36 36
     houseType: "",
37 37
     price: "",
38 38
     successDate: "",
39
+    totalCommission: "", //佣金总额
40
+    currentCommission: 0, //本次结佣
39 41
   });
40 42
 
41 43
   const [FormData, setFormData] = useState({ ...RenChouData });
@@ -103,6 +105,7 @@ export default withLayout((props) => {
103 105
           setFormData({
104 106
             ...FormData,
105 107
             ...res?.customerPreparatory,
108
+            totalCommission:res.channelCustomer.totalCommission /100, //佣金总额
106 109
             realtyConsultant: res?.realtyConsultant,
107 110
           });
108 111
         }
@@ -128,6 +131,8 @@ export default withLayout((props) => {
128 131
           setQianYueData({
129 132
             ...QianYueData,
130 133
             ...customerSignatory,
134
+            totalCommission:res.channelCustomer.totalCommission, //佣金总额
135
+            
131 136
             realtyConsultant: res?.realtyConsultant,
132 137
           });
133 138
           // setQianYueData({ ...QianYueData, ...customerSignatory, realtyConsultant:   (res.customerSignatory || []).length ? res.customerSignatory[0].realtyConsultant : null })
@@ -262,6 +267,18 @@ export default withLayout((props) => {
262 267
         }
263 268
       }
264 269
       params.dividendsName = `${FormData.dividendsName}|${FormData.dividendsPer}%`;
270
+
271
+      console.log({
272
+        customerId: id,
273
+        customerSignatory: {
274
+          ...params,
275
+          channelId:
276
+            channelId === "null" || channelId === null ? "" : channelId,
277
+          channelCustomerId,
278
+        },
279
+        totalCommission:Number(params.totalCommission) * 100,
280
+        currentCommission:Number(params.currentCommission) * 100
281
+      },']]]]');
265 282
       fetch({
266 283
         url: API_SURE_SIGN,
267 284
         method: "put",
@@ -273,6 +290,8 @@ export default withLayout((props) => {
273 290
               channelId === "null" || channelId === null ? "" : channelId,
274 291
             channelCustomerId,
275 292
           },
293
+          totalCommission:Number(params.totalCommission) * 100,
294
+          currentCommission:Number(params.currentCommission) * 100
276 295
         },
277 296
       }).then(() => {
278 297
         Taro.showToast({ title: "修改成功", icon: "none", duration: 2000 });
@@ -355,28 +374,6 @@ export default withLayout((props) => {
355 374
             </view>
356 375
           </view>
357 376
 
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 377
           {channelCustomerInfo?.channelCustomer?.recommendPersonType ===
381 378
           ROLE_CODE.BROKER ? (
382 379
             <>
@@ -529,7 +526,7 @@ export default withLayout((props) => {
529 526
             </Block>
530 527
           )}
531 528
 
532
-{/* {(CurrentStatusId === 4 ||
529
+          {(CurrentStatusId === 4 ||
533 530
             CurrentStatusId === 5 ||
534 531
             CurrentStatusId === 6) && (
535 532
             <Block>
@@ -537,14 +534,49 @@ export default withLayout((props) => {
537 534
               <view className="FormLine flex-h">
538 535
                 <view className="flex-item">
539 536
                   <Input
537
+                  type='number'
540 538
                     placeholder="请输入金额"
541
-                    value={FormData.price}
542
-                    onInput={InputChange.bind(this, "price")}
539
+                    value={FormData.totalCommission}
540
+                    onInput={InputChange.bind(this, "totalCommission")}
541
+                  ></Input>
542
+                </view>
543
+              </view>
544
+            </Block>
545
+          )}
546
+
547
+          {(CurrentStatusId === 4 ||
548
+            CurrentStatusId === 5 ||
549
+            CurrentStatusId === 6) && (
550
+            <Block>
551
+              <text>已结佣金</text>
552
+              <view className="FormLine flex-h">
553
+                <view className="flex-item">
554
+                  <text>
555
+                    {(channelCustomerInfo?.channelCustomer?.settledCommission ||
556
+                      0) / 100}
557
+                  </text>
558
+                </view>
559
+              </view>
560
+            </Block>
561
+          )}
562
+
563
+          {(CurrentStatusId === 4 ||
564
+            CurrentStatusId === 5 ||
565
+            CurrentStatusId === 6) && (
566
+            <Block>
567
+              <text style={{ display: "none" }}>本次结佣</text>
568
+              <view className="FormLine flex-h" style={{ display: "none" }}>
569
+                <view className="flex-item">
570
+                  <Input
571
+                   type='number'
572
+                    placeholder="请输入金额"
573
+                    value={FormData.currentCommission}
574
+                    onInput={InputChange.bind(this, "currentCommission")}
543 575
                   ></Input>
544 576
                 </view>
545 577
               </view>
546 578
             </Block>
547
-          )} */}
579
+          )}
548 580
 
549 581
           <text>备注</text>
550 582
           <view className="FormLine flex-h">