Browse Source

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

fangmingyue 1 year ago
parent
commit
6d2e7ae0bc
1 changed files with 19 additions and 7 deletions
  1. 19
    7
      src/pages/authentication/components/EveryoneInfo.jsx

+ 19
- 7
src/pages/authentication/components/EveryoneInfo.jsx View File

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