Kaynağa Gözat

Merge branch 'master' of http://git.ycjcjy.com/kypay/global_funding-pc-merchant

fangmingyue 1 yıl önce
ebeveyn
işleme
6d2e7ae0bc

+ 19
- 7
src/pages/authentication/components/EveryoneInfo.jsx Dosyayı Görüntüle

@@ -22,6 +22,11 @@ export default (props) => {
22 22
   const onFinish = (values) => {
23 23
     console.log("----------->", values);
24 24
     const authorizedPersonId = "authorizedPerson-beneficiaryId";
25
+
26
+    const conpanyDirectorId = "conpanyDirector-beneficiaryId";
27
+
28
+    const id = values[authorizedPersonId] || values[conpanyDirectorId];
29
+
25 30
     // 被授权人
26 31
     let authorizedPerson = {},
27 32
       //企业董事
@@ -45,14 +50,21 @@ export default (props) => {
45 50
         otherBeneficiary[parseInt(prefix) - 1][prefix1] = values[key];
46 51
       }
47 52
     }
48
-    // const data = [, otherBeneficiary];
53
+    let beneficiaryInfoList = [];
54
+    if ((authorizedPerson = {})) {
55
+      beneficiaryInfoList = [conpanyDirector];
56
+    } else if ((conpanyDirector = {})) {
57
+      beneficiaryInfoList = [authorizedPerson];
58
+    } else {
59
+      beneficiaryInfoList = [authorizedPerson, conpanyDirector];
60
+    }
61
+
49 62
     const data = {
50
-      beneficiaryInfoList: [authorizedPerson, conpanyDirector],
63
+      beneficiaryInfoList: beneficiaryInfoList,
51 64
       beneficiaryItemList: otherBeneficiary,
52 65
     };
53
-    console.log(data);
54 66
 
55
-    putTaCompanyBeneficiaryInfo(values[authorizedPersonId], data).then(
67
+    putTaCompanyBeneficiaryInfo(id, data).then(
56 68
       (res) => {
57 69
         setIndex(index + 1);
58 70
       }
@@ -73,7 +85,7 @@ export default (props) => {
73 85
         if (res) {
74 86
           const BeneficiaryNum = res[1]?.length || 0;
75 87
 
76
-          setOtherBeneficiaryNum(BeneficiaryNum || 1)
88
+          setOtherBeneficiaryNum(BeneficiaryNum || 1);
77 89
           const isOtherBeneficiary = BeneficiaryNum > 0 ? "1" : "0";
78 90
 
79 91
           const data = (res[0] || [])
@@ -142,9 +154,9 @@ export default (props) => {
142 154
               );
143 155
               return (
144 156
                 <>
145
-                  {authorizedPerson ? (
157
+                  {authorizedPerson && (
146 158
                     <RadioTitle identity="authorizedPerson" />
147
-                  ) : null}
159
+                  )}
148 160
                   {conpanyDirector ? (
149 161
                     <RadioTitle identity="conpanyDirector" />
150 162
                   ) : null}