From 80a3f59e2d3df07805bc67e329300b8de90a5b3a Mon Sep 17 00:00:00 2001
From: buli <137736985@qq.com>
Date: 星期二, 11 七月 2023 14:13:08 +0800
Subject: [PATCH] Merge branch 'LEXCommunityLiJun' into LEXUpgrade2023-Deloitte

---
 force-app/main/default/pages/StraightBackAddress.page | 2143 +++++++++++++++++++++++++++++++++--------------------------
 1 files changed, 1,207 insertions(+), 936 deletions(-)

diff --git a/force-app/main/default/pages/StraightBackAddress.page b/force-app/main/default/pages/StraightBackAddress.page
index 7c49578..ab1eba9 100644
--- a/force-app/main/default/pages/StraightBackAddress.page
+++ b/force-app/main/default/pages/StraightBackAddress.page
@@ -5,914 +5,948 @@
   @last modified on  : 03-30-2022
   @last modified by  : ChangeMeIn@UserSettingsUnder.SFDoc
 -->
-<apex:page controller="StraightBackAddressController"  action="{!init}"  showHeader="false"   sidebar="true" id="allPage"  title="鐩磋繑鏀惰揣鍦板潃">
-    <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/>
-    <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/>
-    <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/>
-    <apex:includeScript value="{!URLFOR($Resource.CommonUtilJs)}"/>
-    <apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }" />
-    <apex:includeScript value="{!URLFOR($Resource.connection20)}"/>
-    <apex:includeScript value="{!URLFOR($Resource.apex20)}"/>
+<apex:page
+    controller="StraightBackAddressController"
+    action="{!init}"
+    showHeader="false"
+    sidebar="true"
+    id="allPage"
+    title="鐩磋繑鏀惰揣鍦板潃"
+    lightningStylesheets="true"
+>
+    <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}" />
+    <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}" />
+    <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}" />
+    <apex:includeScript value="{!URLFOR($Resource.CommonUtilJs)}" />
+    <apex:includeScript
+        value="{! URLFOR($Resource.AWSService, 'AWSService.js') }"
+    />
+    <apex:includeScript value="{!URLFOR($Resource.connection20)}" />
+    <apex:includeScript value="{!URLFOR($Resource.apex20)}" />
     <script type="text/javascript">
-        var checkedTrue;
-        var tableDataStr = '';
-        var staticResource = JSON.parse('{!staticResource}');
-        var staticResourceContact = JSON.parse('{!staticResourceContact}');
-        var staticResourceRepair = JSON.parse('{!staticResourceRepair}');
-        
-        var PIData = {};
-        var contactDataIds = [];
-        var ObjIdDecrypt = '';
-        var closeField = '';
-        var add_aws_result = '';
-        var con_aws_result = '';
-        var isAddCon = false;
-        var contactInfoStr = '';
+         var checkedTrue;
+         var tableDataStr = '';
+         var staticResource = JSON.parse('{!staticResource}');
+         var staticResourceContact = JSON.parse('{!staticResourceContact}');
+         var staticResourceRepair = JSON.parse('{!staticResourceRepair}');
 
-        var addressAwsData = {};
+         var PIData = {};
+         var contactDataIds = [];
+         var ObjIdDecrypt = '';
+         var closeField = '';
+         var add_aws_result = '';
+         var con_aws_result = '';
+         var isAddCon = false;
+         var contactInfoStr = '';
 
-        var isBlocking = false;
+         var addressAwsData = {};
 
-        var contactNamePlaintext = '';
-        var telePhonePlaintext = '';
-        var zipCodePlaintext = '';
-        var detailedAddressPlaintext = '';
-        function b(){
-            if (!isBlocking) {
-                blockme();
-                isBlocking = true;
-            }
-        }
+         var isBlocking = false;
 
-        function ub(){
-            if (isBlocking) {
-                unblockUI();
-                isBlocking = false;
-            }
-        }
-        
-        //鏇挎崲vlookup
-        var newSearchContactWindow = null;
-        window.onload = function () {
-            document.getElementById("tab01").style.height  =  screen.availHeight*0.07+'px';
-            document.getElementById("tab02").style.height  =  screen.availHeight*0.53+'px';
-            document.getElementById("tab03").style.height  =  screen.availHeight*0.25+'px';
-        }
-         //缂栬緫鎸夐挳
-         function onEditorJs(ObjId){
-            ObjIdDecrypt = ObjId;
-            onEditor(ObjId); 
+         var contactNamePlaintext = '';
+         var telePhonePlaintext = '';
+         var zipCodePlaintext = '';
+         var detailedAddressPlaintext = '';
+         function b(){
+             if (!isBlocking) {
+                 blockme();
+                 isBlocking = true;
+             }
          }
-        //澶嶅埗鎸夐挳
-        function onCopyJs(ObjId){
-            ObjIdDecrypt = ObjId;
-            if(ObjId == ''){
-                onCopy('绌�');//璁剧疆涓虹┖锛屼究浜庡悗绔仛鏁版嵁澶勭悊
-            }else{
-                onCopy(ObjId);
-            }
-        }
-        //aws 纭
-        function Trans(){
-            let b = HasError();
-            if(b){
-                //杩樺師鑱旂郴浜虹數璇濆湴鍧�閭紪
-                document.getElementById('allPage:allForm:oppBlock2:UpdAddressId:ContactName__c').value = contactNamePlaintext;
-                document.getElementById('allPage:allForm:oppBlock2:UpdAddressId:Telephone__c').value = telePhonePlaintext;
-                document.getElementById('allPage:allForm:oppBlock2:UpdAddressId:ZipCode__c').value = zipCodePlaintext
-                document.getElementById('allPage:allForm:oppBlock2:UpdAddressId:Detailed_Address__c').value = detailedAddressPlaintext
-                return
-            }
 
-            //{!IF(isSearchBtn,'searchBtnJs()',false)};
-            let b1= false;
-            let b2= false;
+         function ub(){
+             if (isBlocking) {
+                 unblockUI();
+                 isBlocking = false;
+             }
+         }
 
-            let Foo = function(){
-                // if (b1 && b2 && !b) {
-                //     window.location.reload();
-                // }
-                if (b1 && !b) {
-                    window.location.reload();
-                }
-            }
+         //鏇挎崲vlookup
+         var newSearchContactWindow = null;
+         window.onload = function () {
+             document.getElementById("tab01").style.height  =  screen.availHeight*0.07+'px';
+             document.getElementById("tab02").style.height  =  screen.availHeight*0.53+'px';
+             document.getElementById("tab03").style.height  =  screen.availHeight*0.25+'px';
+         }
+          //缂栬緫鎸夐挳
+          function onEditorJs(ObjId){
+             ObjIdDecrypt = ObjId;
+             onEditor(ObjId);
+          }
+         //澶嶅埗鎸夐挳
+         function onCopyJs(ObjId){
+             ObjIdDecrypt = ObjId;
+             if(ObjId == ''){
+                 onCopy('绌�');//璁剧疆涓虹┖锛屼究浜庡悗绔仛鏁版嵁澶勭悊
+             }else{
+                 onCopy(ObjId);
+             }
+         }
+         //aws 纭
+         function Trans(){
+             let b = HasError();
+             if(b){
+                 //杩樺師鑱旂郴浜虹數璇濆湴鍧�閭紪
+                 document.getElementById('allPage:allForm:oppBlock2:UpdAddressId:ContactName__c').value = contactNamePlaintext;
+                 document.getElementById('allPage:allForm:oppBlock2:UpdAddressId:Telephone__c').value = telePhonePlaintext;
+                 document.getElementById('allPage:allForm:oppBlock2:UpdAddressId:ZipCode__c').value = zipCodePlaintext
+                 document.getElementById('allPage:allForm:oppBlock2:UpdAddressId:Detailed_Address__c').value = detailedAddressPlaintext
+                 return
+             }
 
-            AWSService.post(staticResource.transactionUrl, JSON.stringify({
-                "txId":add_aws_result.txId,
-                "isSuccess":b ? 0 : 1
-            }), function(result){
-                b1 = true;
-                Foo();
-            }, staticResource.token);
+             //{!IF(isSearchBtn,'searchBtnJs()',false)};
+             let b1= false;
+             let b2= false;
 
-            //涓嶄細鍐嶆柊寤鸿仈绯讳汉鏃犻渶纭浜嬪姟
-            // if(isAddCon){
-            //     AWSService.post(staticResourceContact.transactionUrl, JSON.stringify({
-            //         "txId":con_aws_result.txId,
-            //         "isSuccess":b ? 0 : 1
-            //     }), function(result){
-            //         b2 = true;
-            //         Foo();
-            //     }, staticResourceContact.token);
-            // }else{
-            //     b2 = true;
-            //     Foo();
-            // }
-                
-            
-        }
+             let Foo = function(){
+                 // if (b1 && b2 && !b) {
+                 //     window.location.reload();
+                 // }
+                 if (b1 && !b) {
+                     window.location.reload();
+                 }
+             }
 
-        function HasError(){
-            // if (IsAddmessage) {
-            //     return true;
-            // }
-            let e = document.getElementById("allPage:allForm:message");
-            if (!e) {
-                return false;
-            }
+             AWSService.post(staticResource.transactionUrl, JSON.stringify({
+                 "txId":add_aws_result.txId,
+                 "isSuccess":b ? 0 : 1
+             }), function(result){
+                 b1 = true;
+                 Foo();
+             }, staticResource.token);
 
-            let divs = j$(e).find("div.message");
-            for (let i = 0; i < divs.length; i++) {
-                for (let j = 0; j < divs[i].classList.length; j++) {
-                    for(let cls in divs[i].classList){
-                        if (cls.indexOf('error')>-1) {
-                            return true;
-                        }
-                    }
-                    
-                }
-                
-            }
+             //涓嶄細鍐嶆柊寤鸿仈绯讳汉鏃犻渶纭浜嬪姟
+             // if(isAddCon){
+             //     AWSService.post(staticResourceContact.transactionUrl, JSON.stringify({
+             //         "txId":con_aws_result.txId,
+             //         "isSuccess":b ? 0 : 1
+             //     }), function(result){
+             //         b2 = true;
+             //         Foo();
+             //     }, staticResourceContact.token);
+             // }else{
+             //     b2 = true;
+             //     Foo();
+             // }
 
 
-            return false;
-        }
-        //瑙e瘑
-        function decrypt(){
-            if(PIData[ObjIdDecrypt] == null){
-                // document.getElementById('allPage:allForm:oppBlock2:UpdAddressId:Contacts__c').value = '';
-                //document.getElementById('allPage:allForm:oppBlock2:UpdAddressId:contactIdValue').value = '000000000000000';
-                document.getElementById('allPage:allForm:oppBlock2:UpdAddressId:ContactName__c').value = '';
-                document.getElementById('allPage:allForm:oppBlock2:UpdAddressId:Telephone__c').value = '';
-                document.getElementById('allPage:allForm:oppBlock2:UpdAddressId:ZipCode__c').value = '';
-                document.getElementById('allPage:allForm:oppBlock2:UpdAddressId:Detailed_Address__c').value = '';
-            }else{
-                // document.getElementById('allPage:allForm:oppBlock2:UpdAddressId:Contacts__c').value = PIData[ObjIdDecrypt].lastName!=null?PIData[ObjIdDecrypt].lastName:'';
-                document.getElementById('allPage:allForm:oppBlock2:UpdAddressId:ContactName__c').value = PIData[ObjIdDecrypt].lastName;
-                document.getElementById('allPage:allForm:oppBlock2:UpdAddressId:Telephone__c').value = PIData[ObjIdDecrypt].telephone;
-                document.getElementById('allPage:allForm:oppBlock2:UpdAddressId:ZipCode__c').value = PIData[ObjIdDecrypt].zipCode;
-                document.getElementById('allPage:allForm:oppBlock2:UpdAddressId:Detailed_Address__c').value = PIData[ObjIdDecrypt].detailedAddress;
-            }
-        }
-        function getPIPayload() {
-            let leadPayloadList = [];
-            var telePhone = document.getElementById('allPage:allForm:oppBlock2:UpdAddressId:Telephone__c').value;
-            var zipCode = document.getElementById('allPage:allForm:oppBlock2:UpdAddressId:ZipCode__c').value;
-            var detailedAddress = document.getElementById('allPage:allForm:oppBlock2:UpdAddressId:Detailed_Address__c').value;
-            let leadPIData = new Object();
-            leadPIData.telePhone = telePhone;
-            leadPIData.zipCode = zipCode;
-            leadPIData.detailedAddress = detailedAddress;
-            leadPIData.sfRecordId = '';
-            leadPayloadList.push(leadPIData);
-            console.log(JSON.stringify(leadPayloadList));
-            return JSON.stringify(leadPayloadList);
-        }
-        //WLIG-CCX4BB 銆愬鎵樸�戜慨鐞嗙洿杩旀敹璐у湴鍧�鍔熻兘鏀归�� thh 20220513 start
-        //淇濆瓨鏂规硶
-        function savaJs(){
-            //b();
-            //涓嶄細鏂板缓鑱旂郴浜猴紝鎵�浠ヨ繖閲屼笉闇�瑕佸皢isAddCon璁剧疆涓簍rue
-            // if(document.getElementById('allPage:allForm:oppBlock2:UpdAddressId:ContactName__c').value != ''){
-            //     isAddCon = true;
-            // }
-            document.getElementById("errorMsg").innerHTML = '';
-            
-            if(!document.getElementById("allPage:allForm:oppBlock2:UpdAddressId:ContactName__c").value){
-                document.getElementById("errorMsg").innerHTML = '<strong>銆愯仈绯讳汉銆戜笉鑳戒负绌猴紒</strong> ';
-                return;
-            }
-            // else if(document.getElementById("allPage:allForm:oppBlock2:UpdAddressId:Contacts__c").value&&document.getElementById("allPage:allForm:oppBlock2:UpdAddressId:Create_Contacts__c").value){
-            //     document.getElementById("errorMsg").innerHTML = '<strong>銆愯仈绯讳汉銆戝拰銆愯仈绯讳汉锛堟柊寤猴級銆戜笉鑳藉悓鏃舵湁鍊硷紒</strong> ';
-            //     return;
-            // }
-            b();
-            console.log('{!insUpdData}')
-            // if(document.getElementById("allPage:allForm:oppBlock2:UpdAddressId:Create_Contacts__c").value){
-            //     //new contact
-            //     ProcessPI({},GetEditObj('contact'),'contact',function(){
-            //         //new address
-            //         ProcessPI({},
-            //         GetEditObj('address'),'address',function(){
-            //             save();
-            //         });
-            //     });
-            // }else{
-            //new address
-            ProcessPI({},GetEditObj('address'),'address',function(){
-                save();
-            });
-            // }
-        }
-        //WLIG-CCX4BB 銆愬鎵樸�戜慨鐞嗙洿杩旀敹璐у湴鍧�鍔熻兘鏀归�� thh 20220513 end
+         }
 
-        function ProcessPI(sobjJson, payloadForNewPI,type,callback) {
-            var sr = ''
-            // if(type == 'contact'){
-            //     sr = staticResourceContact
-            // }
-            if(type == 'address'){
-                sr = staticResource
-            }
-            let url = sr.newUrl
-            /*if (now_edit_id) {
-                url = sr.updateUrl
-            }*/
-            AWSService.post(url, payloadForNewPI, function(result){
-                // if(type == 'contact'){
-                //     con_aws_result = result
-                // }
-                if(type == 'address'){
-                    add_aws_result = result
-                }
-                SetEditObj(type);
-                if(callback){
-                    callback();
-                }
-            }, sr.token);
-        }
-        function SetEditObj(type){
-            let obj = GetAWSResultObj(type);
-            if(obj){
-                // if(type=='contact'){
-                //     document.getElementById("allPage:allForm:oppBlock2:Con_AWS_Data_Id__c").value      = obj.dataId;
-                //     document.getElementById("allPage:allForm:oppBlock2:UpdAddressId:ContactName__c").value      = obj.lastName;
-                //     document.getElementById("allPage:allForm:oppBlock2:LastName_Encrypted__c").value   = obj.lastNameEncrypt;
-                // }
-                if(type=='address'){
-                    document.getElementById("allPage:allForm:oppBlock2:Add_AWS_Data_Id__c").value              = obj.dataId;
-                    document.getElementById('allPage:allForm:oppBlock2:UpdAddressId:ContactName__c').value = obj.contactName;
-                    //document.getElementById('allPage:allForm:oppBlock2:ContactName_Encrypted__c').value = obj.contactNameEncrypt;   //zhj 鏂版柟妗堟敼閫� 2022-12-05
-                    document.getElementById("allPage:allForm:oppBlock2:UpdAddressId:Telephone__c").value                    = obj.telephone;
-                    //document.getElementById("allPage:allForm:oppBlock2:Telephone_Encrypted__c").value          = obj.telephoneEncrypt;    //zhj 鏂版柟妗堟敼閫� 2022-12-05
-                    document.getElementById("allPage:allForm:oppBlock2:UpdAddressId:ZipCode__c").value                      = obj.zipCode;
-                    //document.getElementById("allPage:allForm:oppBlock2:ZipCode_Encrypted__c").value            = obj.zipCodeEncrypt;  //zhj 鏂版柟妗堟敼閫� 2022-12-05
-                    document.getElementById("allPage:allForm:oppBlock2:UpdAddressId:Detailed_Address__c").value             = obj.detailedAddress;
-                    //document.getElementById("allPage:allForm:oppBlock2:Detailed_Address_Encrypted__c").value   = obj.detailedAddressEncrypt;  //zhj 鏂版柟妗堟敼閫� 2022-12-05
+         function HasError(){
+             // if (IsAddmessage) {
+             //     return true;
+             // }
+             let e = document.getElementById("allPage:allForm:message");
+             if (!e) {
+                 return false;
+             }
 
-                }
-            }
-            
-        }
-        function GetAWSResultObj(type){
-            // if(type == 'contact'){
-            //     if(con_aws_result && con_aws_result.object && con_aws_result.object.length > 0){
-            //         return con_aws_result.object[0];
-            //     }
-            // }
-            if(type == 'address'){
-                if(add_aws_result && add_aws_result.object && add_aws_result.object.length > 0){
-                    return add_aws_result.object[0];
-                }
-            }
-            return null;
-        }
+             let divs = j$(e).find("div.message");
+             for (let i = 0; i < divs.length; i++) {
+                 for (let j = 0; j < divs[i].classList.length; j++) {
+                     for(let cls in divs[i].classList){
+                         if (cls.indexOf('error')>-1) {
+                             return true;
+                         }
+                     }
 
-        function GetEditObj(type){
-            // if(type=='contact'){
-            //     //new contact
-            //     return JSON.stringify([{
-            //         lastName : document.getElementById("allPage:allForm:oppBlock2:UpdAddressId:ContactName__c").value,
-            //         dataId : document.getElementById("allPage:allForm:oppBlock2:Con_AWS_Data_Id__c").value,
-            //     }]);
-            // }
-            contactNamePlaintext = document.getElementById("allPage:allForm:oppBlock2:UpdAddressId:ContactName__c").value;
-            telePhonePlaintext = document.getElementById("allPage:allForm:oppBlock2:UpdAddressId:Telephone__c").value;
-            zipCodePlaintext = document.getElementById("allPage:allForm:oppBlock2:UpdAddressId:ZipCode__c").value
-            detailedAddressPlaintext = document.getElementById("allPage:allForm:oppBlock2:UpdAddressId:Detailed_Address__c").value;
-            if(type == 'address'){
-                //new address
-                return JSON.stringify([{
-                    dataId : document.getElementById("allPage:allForm:oppBlock2:Add_AWS_Data_Id__c").value,
-                    contactName : document.getElementById("allPage:allForm:oppBlock2:UpdAddressId:ContactName__c").value,
-                    telephone : document.getElementById("allPage:allForm:oppBlock2:UpdAddressId:Telephone__c").value,
-                    zipCode : document.getElementById("allPage:allForm:oppBlock2:UpdAddressId:ZipCode__c").value,
-                    detailedAddress : document.getElementById("allPage:allForm:oppBlock2:UpdAddressId:Detailed_Address__c").value,
-                }]);
-            }
-            
-        }
+                 }
 
-        //澶嶉�夋閫変腑瑙﹀彂浜嬩欢
-        //obj  褰撳墠瀵硅薄   checkIndex  褰撳墠鐐瑰嚮鐨勭鍑犺
-        function onCheckBoxJd(obj,checkIndex){
-            //濡傛灉涓簍rue,閭d箞鍏朵粬鐨勬墍鏈夊閫夋蹇呴』涓轰笉閫夋嫨鐘舵��
-            if(obj.checked){
-                checkedTrue = checkIndex;
-                var lawtable = document.getElementById("tableHeader_L");//鑾峰彇id涓簍ableHeader_L鐨則able
-                var rows = lawtable.rows;//鑾峰彇鎵�鏈夎 
-                for(var i=1; i < rows.length; i++){ 
-                    var InputObj = rows[i].cells[0].getElementsByTagName("input")[0];
-                    if(obj != InputObj){
-                        InputObj.checked = false;
-                    }
-                }
-            }else{
-                checkedTrue = null;
-            }
-        }
-        function searchBtnJs(){
-            b();
-            var addressDataIds = '';
-            //鏌ヨ鍦板潃
-            if(document.getElementById('allPage:allForm:searchBlock:txtAddressId').value != ''){
-                //鍙戦�乤ws璇锋眰锛岀劧鍚庡啀鍙戦�佺粰controller
-                new Promise(function(resolve, reject){
-                    let queryBack = function queryBack(result){
-                        if(result.object==null || result.object.length==0){
-                            searchBtn('\''+addressName+'\'');
-                            return
-                        }else{
-                             
-                            for(var i=0;i<result.object.length;i++){
-                                addressDataIds += ',\''+ result.object[i].dataId + '\'';
-                                addressAwsData[result.object[i].dataId] = result.object[i];
+             }
+
+
+             return false;
+         }
+         //瑙e瘑
+         function decrypt(){
+             if(PIData[ObjIdDecrypt] == null){
+                 // document.getElementById('allPage:allForm:oppBlock2:UpdAddressId:Contacts__c').value = '';
+                 //document.getElementById('allPage:allForm:oppBlock2:UpdAddressId:contactIdValue').value = '000000000000000';
+                 document.getElementById('allPage:allForm:oppBlock2:UpdAddressId:ContactName__c').value = '';
+                 document.getElementById('allPage:allForm:oppBlock2:UpdAddressId:Telephone__c').value = '';
+                 document.getElementById('allPage:allForm:oppBlock2:UpdAddressId:ZipCode__c').value = '';
+                 document.getElementById('allPage:allForm:oppBlock2:UpdAddressId:Detailed_Address__c').value = '';
+             }else{
+                 // document.getElementById('allPage:allForm:oppBlock2:UpdAddressId:Contacts__c').value = PIData[ObjIdDecrypt].lastName!=null?PIData[ObjIdDecrypt].lastName:'';
+                 document.getElementById('allPage:allForm:oppBlock2:UpdAddressId:ContactName__c').value = PIData[ObjIdDecrypt].lastName;
+                 document.getElementById('allPage:allForm:oppBlock2:UpdAddressId:Telephone__c').value = PIData[ObjIdDecrypt].telephone;
+                 document.getElementById('allPage:allForm:oppBlock2:UpdAddressId:ZipCode__c').value = PIData[ObjIdDecrypt].zipCode;
+                 document.getElementById('allPage:allForm:oppBlock2:UpdAddressId:Detailed_Address__c').value = PIData[ObjIdDecrypt].detailedAddress;
+             }
+         }
+         function getPIPayload() {
+             let leadPayloadList = [];
+             var telePhone = document.getElementById('allPage:allForm:oppBlock2:UpdAddressId:Telephone__c').value;
+             var zipCode = document.getElementById('allPage:allForm:oppBlock2:UpdAddressId:ZipCode__c').value;
+             var detailedAddress = document.getElementById('allPage:allForm:oppBlock2:UpdAddressId:Detailed_Address__c').value;
+             let leadPIData = new Object();
+             leadPIData.telePhone = telePhone;
+             leadPIData.zipCode = zipCode;
+             leadPIData.detailedAddress = detailedAddress;
+             leadPIData.sfRecordId = '';
+             leadPayloadList.push(leadPIData);
+             console.log(JSON.stringify(leadPayloadList));
+             return JSON.stringify(leadPayloadList);
+         }
+         //WLIG-CCX4BB 銆愬鎵樸�戜慨鐞嗙洿杩旀敹璐у湴鍧�鍔熻兘鏀归�� thh 20220513 start
+         //淇濆瓨鏂规硶
+         function savaJs(){
+             //b();
+             //涓嶄細鏂板缓鑱旂郴浜猴紝鎵�浠ヨ繖閲屼笉闇�瑕佸皢isAddCon璁剧疆涓簍rue
+             // if(document.getElementById('allPage:allForm:oppBlock2:UpdAddressId:ContactName__c').value != ''){
+             //     isAddCon = true;
+             // }
+             document.getElementById("errorMsg").innerHTML = '';
+
+             if(!document.getElementById("allPage:allForm:oppBlock2:UpdAddressId:ContactName__c").value){
+                 document.getElementById("errorMsg").innerHTML = '<strong>銆愯仈绯讳汉銆戜笉鑳戒负绌猴紒</strong> ';
+                 return;
+             }
+             // else if(document.getElementById("allPage:allForm:oppBlock2:UpdAddressId:Contacts__c").value&&document.getElementById("allPage:allForm:oppBlock2:UpdAddressId:Create_Contacts__c").value){
+             //     document.getElementById("errorMsg").innerHTML = '<strong>銆愯仈绯讳汉銆戝拰銆愯仈绯讳汉锛堟柊寤猴級銆戜笉鑳藉悓鏃舵湁鍊硷紒</strong> ';
+             //     return;
+             // }
+             b();
+             console.log('{!insUpdData}')
+             // if(document.getElementById("allPage:allForm:oppBlock2:UpdAddressId:Create_Contacts__c").value){
+             //     //new contact
+             //     ProcessPI({},GetEditObj('contact'),'contact',function(){
+             //         //new address
+             //         ProcessPI({},
+             //         GetEditObj('address'),'address',function(){
+             //             save();
+             //         });
+             //     });
+             // }else{
+             //new address
+             ProcessPI({},GetEditObj('address'),'address',function(){
+                 save();
+             });
+             // }
+         }
+         //WLIG-CCX4BB 銆愬鎵樸�戜慨鐞嗙洿杩旀敹璐у湴鍧�鍔熻兘鏀归�� thh 20220513 end
+
+         function ProcessPI(sobjJson, payloadForNewPI,type,callback) {
+             var sr = ''
+             // if(type == 'contact'){
+             //     sr = staticResourceContact
+             // }
+             if(type == 'address'){
+                 sr = staticResource
+             }
+             let url = sr.newUrl
+             /*if (now_edit_id) {
+                 url = sr.updateUrl
+             }*/
+             AWSService.post(url, payloadForNewPI, function(result){
+                 // if(type == 'contact'){
+                 //     con_aws_result = result
+                 // }
+                 if(type == 'address'){
+                     add_aws_result = result
+                 }
+                 SetEditObj(type);
+                 if(callback){
+                     callback();
+                 }
+             }, sr.token);
+         }
+         function SetEditObj(type){
+             let obj = GetAWSResultObj(type);
+             if(obj){
+                 // if(type=='contact'){
+                 //     document.getElementById("allPage:allForm:oppBlock2:Con_AWS_Data_Id__c").value      = obj.dataId;
+                 //     document.getElementById("allPage:allForm:oppBlock2:UpdAddressId:ContactName__c").value      = obj.lastName;
+                 //     document.getElementById("allPage:allForm:oppBlock2:LastName_Encrypted__c").value   = obj.lastNameEncrypt;
+                 // }
+                 if(type=='address'){
+                     document.getElementById("allPage:allForm:oppBlock2:Add_AWS_Data_Id__c").value              = obj.dataId;
+                     document.getElementById('allPage:allForm:oppBlock2:UpdAddressId:ContactName__c').value = obj.contactName;
+                     //document.getElementById('allPage:allForm:oppBlock2:ContactName_Encrypted__c').value = obj.contactNameEncrypt;   //zhj 鏂版柟妗堟敼閫� 2022-12-05
+                     document.getElementById("allPage:allForm:oppBlock2:UpdAddressId:Telephone__c").value                    = obj.telephone;
+                     //document.getElementById("allPage:allForm:oppBlock2:Telephone_Encrypted__c").value          = obj.telephoneEncrypt;    //zhj 鏂版柟妗堟敼閫� 2022-12-05
+                     document.getElementById("allPage:allForm:oppBlock2:UpdAddressId:ZipCode__c").value                      = obj.zipCode;
+                     //document.getElementById("allPage:allForm:oppBlock2:ZipCode_Encrypted__c").value            = obj.zipCodeEncrypt;  //zhj 鏂版柟妗堟敼閫� 2022-12-05
+                     document.getElementById("allPage:allForm:oppBlock2:UpdAddressId:Detailed_Address__c").value             = obj.detailedAddress;
+                     //document.getElementById("allPage:allForm:oppBlock2:Detailed_Address_Encrypted__c").value   = obj.detailedAddressEncrypt;  //zhj 鏂版柟妗堟敼閫� 2022-12-05
+
+                 }
+             }
+
+         }
+         function GetAWSResultObj(type){
+             // if(type == 'contact'){
+             //     if(con_aws_result && con_aws_result.object && con_aws_result.object.length > 0){
+             //         return con_aws_result.object[0];
+             //     }
+             // }
+             if(type == 'address'){
+                 if(add_aws_result && add_aws_result.object && add_aws_result.object.length > 0){
+                     return add_aws_result.object[0];
+                 }
+             }
+             return null;
+         }
+
+         function GetEditObj(type){
+             // if(type=='contact'){
+             //     //new contact
+             //     return JSON.stringify([{
+             //         lastName : document.getElementById("allPage:allForm:oppBlock2:UpdAddressId:ContactName__c").value,
+             //         dataId : document.getElementById("allPage:allForm:oppBlock2:Con_AWS_Data_Id__c").value,
+             //     }]);
+             // }
+             contactNamePlaintext = document.getElementById("allPage:allForm:oppBlock2:UpdAddressId:ContactName__c").value;
+             telePhonePlaintext = document.getElementById("allPage:allForm:oppBlock2:UpdAddressId:Telephone__c").value;
+             zipCodePlaintext = document.getElementById("allPage:allForm:oppBlock2:UpdAddressId:ZipCode__c").value
+             detailedAddressPlaintext = document.getElementById("allPage:allForm:oppBlock2:UpdAddressId:Detailed_Address__c").value;
+             if(type == 'address'){
+                 //new address
+                 return JSON.stringify([{
+                     dataId : document.getElementById("allPage:allForm:oppBlock2:Add_AWS_Data_Id__c").value,
+                     contactName : document.getElementById("allPage:allForm:oppBlock2:UpdAddressId:ContactName__c").value,
+                     telephone : document.getElementById("allPage:allForm:oppBlock2:UpdAddressId:Telephone__c").value,
+                     zipCode : document.getElementById("allPage:allForm:oppBlock2:UpdAddressId:ZipCode__c").value,
+                     detailedAddress : document.getElementById("allPage:allForm:oppBlock2:UpdAddressId:Detailed_Address__c").value,
+                 }]);
+             }
+
+         }
+
+         //澶嶉�夋閫変腑瑙﹀彂浜嬩欢
+         //obj  褰撳墠瀵硅薄   checkIndex  褰撳墠鐐瑰嚮鐨勭鍑犺
+         function onCheckBoxJd(obj,checkIndex){
+             //濡傛灉涓簍rue,閭d箞鍏朵粬鐨勬墍鏈夊閫夋蹇呴』涓轰笉閫夋嫨鐘舵��
+             if(obj.checked){
+                 checkedTrue = checkIndex;
+                 var lawtable = document.getElementById("tableHeader_L");//鑾峰彇id涓簍ableHeader_L鐨則able
+                 var rows = lawtable.rows;//鑾峰彇鎵�鏈夎
+                 for(var i=1; i < rows.length; i++){
+                     var InputObj = rows[i].cells[0].getElementsByTagName("input")[0];
+                     if(obj != InputObj){
+                         InputObj.checked = false;
+                     }
+                 }
+             }else{
+                 checkedTrue = null;
+             }
+         }
+         function searchBtnJs(){
+             b();
+             var addressDataIds = '';
+             //鏌ヨ鍦板潃
+             if(document.getElementById('allPage:allForm:searchBlock:txtAddressId').value != ''){
+                 //鍙戦�乤ws璇锋眰锛岀劧鍚庡啀鍙戦�佺粰controller
+                 new Promise(function(resolve, reject){
+                     let queryBack = function queryBack(result){
+                         if(result.object==null || result.object.length==0){
+                             searchBtn('\''+addressName+'\'');
+                             return
+                         }else{
+
+                             for(var i=0;i<result.object.length;i++){
+                                 addressDataIds += ',\''+ result.object[i].dataId + '\'';
+                                 addressAwsData[result.object[i].dataId] = result.object[i];
+                             }
+                             addressDataIds = addressDataIds.substring(1);
+                             resolve('success');
+                         }
+                     };
+                     var addressName = document.getElementById('allPage:allForm:searchBlock:txtAddressId').value;
+                     AWSService.post(staticResource.searchUrl,{
+                         detailedAddress:addressName.trim()
+                     },queryBack,staticResource.token);
+                 }).then(function(data){
+                     console.log('data = '+data)
+                     console.log('addressDataIds = '+addressDataIds)
+                     searchBtn(addressDataIds);
+                 });
+             }else{
+                 searchBtn(addressDataIds);
+             }
+         }
+         //鍔犲瘑瀹㈡埛鍚嶅瓧娈�
+         // function encryptCustomer(e){
+         //     let obj = JSON.parse(payloadForNewPI);
+         //     let payloadForNewPIJson = JSON.stringify(obj);
+         //     let payloadForNewPI = jQuery(e.target).closest("tr").find("a.cusmer__c");
+         //     AWSService.update(staticResources.updateUrl, '', payloadForNewPI, updateMethod, staticResources.token, staticResources.transactionUrl, false, insertOrUpdateBack, redirectCallBack);
+         // },
+
+         sforce.connection.sessionId = '{!GETSESSIONID()}';
+         function UpdateSobject(staticResource,sobj,transId,callback){
+
+             let result = sforce.connection.update([sobj]);
+             let tobj = {
+                 txId: transId
+             };
+             let b = result[0].getBoolean('success');
+             if(b) {
+                 console.log('call sf Log Id: ' + result[0].id);
+                 tobj.sfRecordId = result[0].id;
+                 tobj.isSuccess = 1;
+
+                 //return result[0].id;
+             }else {
+                 console.log('call sf to insert log');
+                 tobj.isSuccess = 0;
+                 //return '';
+             }
+
+             AWSService.post(staticResource.transactionUrl,tobj,function(data){
+                 if (callback) {
+                     data.isSuccess = b;
+                     callback(data)
+                 }
+             },staticResource.token);
+         }
+
+
+
+         function adoptSaveJs(address,isUpload){
+             //鐢变簬瑕佹妸閲囩敤鏃堕棿璁板綍鍒板湴鍧�琛ㄤ腑锛屾墍浠ユ柊寤轰竴涓湴鍧�瀵硅薄
+             // Address__c DatetimeUpdate = new Address__c();
+             // DatetimeUpdate = tableData[i].address;
+             //璇︾粏鍦板潃
+             let address_str = address.Detailed_Address__c.trim();
+             if (addressAwsData.hasOwnProperty(address.AWS_Data_Id__c)) {
+                 address_str = addressAwsData[address.AWS_Data_Id__c].detailedAddress;
+             }
+             let cityName = '';//甯�
+             //甯備笉涓虹┖锛屽洜涓鸿浣跨敤 __r.Name  濡傛灉涓虹┖锛屼細鎶ラ敊
+             if(address.City__c){
+                 cityName = address.City__r.Name.trim();
+                 //鐪� 鍚屼笂
+                 if(address.Province__c){
+                     let ProvinceCity = address.Province__r.Name.trim()+cityName;
+                     //闃叉璇︾粏鍦板潃閲岄潰甯︾潃鐪佷唤鍜屽競
+                     if(address_str.indexOf(ProvinceCity) < 0){
+                         address_str = ProvinceCity + address_str;
+                     }
+                 }
+             }
+             //鑱旂郴浜�
+             let contactsName = '';
+             // WLIG-CCX4BB 銆愬鎵樸�戜慨鐞嗙洿杩旀敹璐у湴鍧�鍔熻兘鏀归�� thh 20220513 start
+             if(address.ContactName__c){
+                 contactsName = address.ContactName__c;
+             }
+             // WLIG-CCX4BB 銆愬鎵樸�戜慨鐞嗙洿杩旀敹璐у湴鍧�鍔熻兘鏀归�� thh 20220513 end
+
+             // if (addressAwsData.hasOwnProperty(address.Contacts__r.AWS_Data_Id__c)) {
+             //     contactsName = addressAwsData[address.Contacts__r.AWS_Data_Id__c].lastName;
+             // }
+             if(PIData[address.Id]){
+                 contactsName = PIData[address.Id].lastName;
+             }
+
+             //瀹㈡埛
+             let ContactPerson = '';
+             if(address.Customer__c){
+                 ContactPerson = address.Customer__r.Name;
+             }
+             try{
+                 //淇濆瓨鏁版嵁鍒颁慨鐞嗚〃涓�
+                 let rc = new sforce.SObject('Repair__c');
+                 rc.Id='{!RepairId}';
+                 rc.address_Contacts__c=contactsName;
+                 rc.address_ZipCode__c = address.ZipCode__c;
+                 rc.address_City__c = cityName;
+                 rc.address_Contacts_Name__c = ContactPerson;
+                 let AddressTypeIndex = {!AddressTypeIndex};
+                 //isUpload锛氭槸鍚︿笂浼燬AP  FSEApplyForRepairTime锛歋AP淇悊鐢宠鏃堕棿
+                 if(isUpload && '{!pc.SAP_Transfer_time__c}'){
+                     rc.Address_type__c = 'X';
+                     rc.Address_Type_Index__c = AddressTypeIndex+1;
+                 }
+                 rc.address_Telephone__c=address.Telephone__c;
+                 rc.Detailed_Address__c=address_str;
+
+                 if (addressAwsData.hasOwnProperty(address.AWS_Data_Id__c)) {
+                     rc.address_Telephone__c=addressAwsData[address.AWS_Data_Id__c].telephone;
+                     rc.address_ZipCode__c=addressAwsData[address.AWS_Data_Id__c].zipCode;
+                 }
+
+                 let GetAsset = function(){
+                     let ast = new sforce.SObject('Asset');
+                     ast.Id = '{!pc.Delivered_Product__c}',
+                     ast.address_Contacts__c= contactsName,
+                     ast.address_ZipCode__c = address.ZipCode__c,
+                     ast.address_City__c = cityName,
+                     ast.address_Telephone__c = address.Telephone__c,
+                     ast.address_Contacts_Name__c = ContactPerson,
+                     ast.Detailed_Address__c= address_str
+                     if (addressAwsData.hasOwnProperty(address.AWS_Data_Id__c)) {
+                         ast.address_ZipCode__c=addressAwsData[address.AWS_Data_Id__c].zipCode;
+                         ast.address_Telephone__c=addressAwsData[address.AWS_Data_Id__c].telephone;
+                     }
+                     return ast;
+                 }
+
+                 //淇濆瓨鏁版嵁鍒颁繚鏈夎澶囪〃涓�
+                 let UpdateAsset = function(){
+                     let ast = GetAsset();
+                     let result = sforce.connection.update([ast]);
+                     let b = result[0].getBoolean('success');
+                     return b;
+                 }
+
+                 let UpdateRepair = function(callback){
+                     AWSService.post(staticResourceRepair.updateUrl+'V2',[{
+                         dataId:'{!pc.AWS_Data_Id__c}',
+                         addressContactsName:rc.address_Contacts_Name__c,
+                         addressContacts:rc.address_Contacts__c,
+                         addressTelephone:rc.address_Telephone__c,
+                         addressZipCode:rc.address_ZipCode__c,
+                         detailedAddress:rc.Detailed_Address__c
+                     }],function(data){
+                         if(data && data.object){
+                             console.log(data);
+                             rc.address_Contacts_Name__c = data.object[0].addressContactsName;
+                             //rc.Address_Contacts_Name_Encrypt__c = data.object[0].addressContactsNameEncrypt;  //zhj 鏂版柟妗堟敼閫� 2022-12-29
+                             rc.address_Contacts__c = data.object[0].addressContacts;
+                             //rc.Address_Contacts_Encrypt__c = data.object[0].addressContactsEncrypt;           //zhj 鏂版柟妗堟敼閫� 2022-12-29
+                             rc.address_Telephone__c = data.object[0].addressTelephone;
+                             //rc.Address_Telephone_Encrypt__c = data.object[0].addressTelephoneEncrypt;         //zhj 鏂版柟妗堟敼閫� 2022-12-29
+                             rc.address_ZipCode__c = data.object[0].addressZipCode;
+                             //rc.Address_ZipCode_Encrypt__c = data.object[0].addressZipCodeEncrypt;             //zhj 鏂版柟妗堟敼閫� 2022-12-29
+                             rc.Detailed_Address__c = data.object[0].detailedAddress;
+                             //rc.Detailed_Address_Encrypt__c = data.object[0].detailedAddressEncrypt;           //zhj 鏂版柟妗堟敼閫� 2022-12-29
+
+                             //UpdateSobject(staticResourceRepair,rc,data.txId,callback);
+                             Visualforce.remoting.Manager.invokeAction(
+                                 'StraightBackAddressController.SaveEx',
+                                 JSON.stringify(rc), JSON.stringify(GetAsset()), address.Id,
+                                 function (result, event) {
+
+                                     let message = '';
+                                     if (event.status) {
+                                         if (result) {
+                                             message = result;
+                                         }else{
+                                         }
+                                     }else{
+                                     }
+                                     let tobj = {
+                                         txId: data.txId
+                                     };
+                                     if(message) {
+                                         console.log('call sf to insert log');
+                                         tobj.isSuccess = 0;
+                                     }else {
+                                         console.log('call sf Log Id: ' + rc.id);
+                                         tobj.sfRecordId = rc.id;
+                                         tobj.isSuccess = 1;
+                                     }
+
+                                     AWSService.post(staticResource.transactionUrl,tobj,function(data){
+                                         if (message) {
+                                             ub();
+                                             alert(message);
+                                         }else{
+                                             window.location.href = '/{!RepairId}';
+                                         }
+                                     },staticResource.token);
+                                 },
+                                 { escape: true }
+                             );
+                         }else{
+                             alert('AWS鏇存柊淇悊澶辫触');
+                             ub();
+                         }
+                     },staticResourceRepair.token)
+                 }
+
+
+
+
+                 let UpdateAddress = function(){
+                     let add = new sforce.SObject('Address__c');
+                     add.Id = address.Id;
+                     //鏈�鍚庢妸褰撳墠鏃堕棿淇濆瓨鍒板湴鍧�琛ㄤ腑锛屼綔涓洪噰鐢ㄦ椂闂�
+                     add.Using_Datetime__c = new Date();
+                     let result = sforce.connection.update([add]);
+                     let b = result[0].getBoolean('success');
+                     return b;
+                 }
+
+                 b();
+                 UpdateRepair();
+                 /*
+                 UpdateRepair(function(data){
+                     if (data.isSuccess) {
+                        let b = UpdateAsset();
+                        if (b) {
+                            b = UpdateAddress();
+                            if (b) {
+                                window.location.href = '/{!RepairId}';
+                            }else{
+                                 ub();
+                                 alert('閲囩敤澶辫触');
                             }
-                            addressDataIds = addressDataIds.substring(1);
-                            resolve('success');
-                        }
-                    };
-                    var addressName = document.getElementById('allPage:allForm:searchBlock:txtAddressId').value;
-                    AWSService.post(staticResource.searchUrl,{
-                        detailedAddress:addressName.trim()
-                    },queryBack,staticResource.token);
-                }).then(function(data){
-                    console.log('data = '+data)
-                    console.log('addressDataIds = '+addressDataIds)
-                    searchBtn(addressDataIds);
-                });
-            }else{
-                searchBtn(addressDataIds);
-            }
-        }
-        //鍔犲瘑瀹㈡埛鍚嶅瓧娈�
-        // function encryptCustomer(e){
-        //     let obj = JSON.parse(payloadForNewPI);
-        //     let payloadForNewPIJson = JSON.stringify(obj);
-        //     let payloadForNewPI = jQuery(e.target).closest("tr").find("a.cusmer__c");
-        //     AWSService.update(staticResources.updateUrl, '', payloadForNewPI, updateMethod, staticResources.token, staticResources.transactionUrl, false, insertOrUpdateBack, redirectCallBack);
-        // },
-
-        sforce.connection.sessionId = '{!GETSESSIONID()}';
-        function UpdateSobject(staticResource,sobj,transId,callback){
-            
-            let result = sforce.connection.update([sobj]);
-            let tobj = {
-                txId: transId
-            };
-            let b = result[0].getBoolean('success');
-            if(b) {
-                console.log('call sf Log Id: ' + result[0].id);
-                tobj.sfRecordId = result[0].id;
-                tobj.isSuccess = 1;
-                
-                //return result[0].id;
-            }else {
-                console.log('call sf to insert log');
-                tobj.isSuccess = 0;
-                //return '';
-            }
-
-            AWSService.post(staticResource.transactionUrl,tobj,function(data){
-                if (callback) {
-                    data.isSuccess = b;
-                    callback(data)
-                }
-            },staticResource.token);
-        }
-
-        
-
-        function adoptSaveJs(address,isUpload){
-            //鐢变簬瑕佹妸閲囩敤鏃堕棿璁板綍鍒板湴鍧�琛ㄤ腑锛屾墍浠ユ柊寤轰竴涓湴鍧�瀵硅薄
-            // Address__c DatetimeUpdate = new Address__c();
-            // DatetimeUpdate = tableData[i].address;
-            //璇︾粏鍦板潃
-            let address_str = address.Detailed_Address__c.trim();
-            if (addressAwsData.hasOwnProperty(address.AWS_Data_Id__c)) {
-                address_str = addressAwsData[address.AWS_Data_Id__c].detailedAddress;
-            }
-            let cityName = '';//甯�
-            //甯備笉涓虹┖锛屽洜涓鸿浣跨敤 __r.Name  濡傛灉涓虹┖锛屼細鎶ラ敊
-            if(address.City__c){
-                cityName = address.City__r.Name.trim();
-                //鐪� 鍚屼笂
-                if(address.Province__c){
-                    let ProvinceCity = address.Province__r.Name.trim()+cityName;
-                    //闃叉璇︾粏鍦板潃閲岄潰甯︾潃鐪佷唤鍜屽競
-                    if(address_str.indexOf(ProvinceCity) < 0){
-                        address_str = ProvinceCity + address_str;
-                    }
-                }
-            }
-            //鑱旂郴浜�
-            let contactsName = '';
-            // WLIG-CCX4BB 銆愬鎵樸�戜慨鐞嗙洿杩旀敹璐у湴鍧�鍔熻兘鏀归�� thh 20220513 start
-            if(address.ContactName__c){
-                contactsName = address.ContactName__c;
-            }
-            // WLIG-CCX4BB 銆愬鎵樸�戜慨鐞嗙洿杩旀敹璐у湴鍧�鍔熻兘鏀归�� thh 20220513 end
-
-            // if (addressAwsData.hasOwnProperty(address.Contacts__r.AWS_Data_Id__c)) {
-            //     contactsName = addressAwsData[address.Contacts__r.AWS_Data_Id__c].lastName;
-            // }
-            if(PIData[address.Id]){
-                contactsName = PIData[address.Id].lastName;
-            }
-
-            //瀹㈡埛
-            let ContactPerson = '';
-            if(address.Customer__c){
-                ContactPerson = address.Customer__r.Name;
-            }
-            try{
-                //淇濆瓨鏁版嵁鍒颁慨鐞嗚〃涓�
-                let rc = new sforce.SObject('Repair__c');
-                rc.Id='{!RepairId}';
-                rc.address_Contacts__c=contactsName;
-                debugger
-                rc.address_ZipCode__c = address.ZipCode__c;
-                rc.address_City__c = cityName;
-                rc.address_Contacts_Name__c = ContactPerson;
-                let AddressTypeIndex = {!AddressTypeIndex};
-                //isUpload锛氭槸鍚︿笂浼燬AP  FSEApplyForRepairTime锛歋AP淇悊鐢宠鏃堕棿
-                if(isUpload && '{!pc.SAP_Transfer_time__c}'){
-                    rc.Address_type__c = 'X';
-                    rc.Address_Type_Index__c = AddressTypeIndex+1;
-                }
-                rc.address_Telephone__c=address.Telephone__c;
-                rc.Detailed_Address__c=address_str;
-                
-                if (addressAwsData.hasOwnProperty(address.AWS_Data_Id__c)) {
-                    rc.address_Telephone__c=addressAwsData[address.AWS_Data_Id__c].telephone;
-                    rc.address_ZipCode__c=addressAwsData[address.AWS_Data_Id__c].zipCode;
-                }
-
-                let GetAsset = function(){
-                    let ast = new sforce.SObject('Asset');
-                    ast.Id = '{!pc.Delivered_Product__c}',
-                    ast.address_Contacts__c= contactsName,
-                    ast.address_ZipCode__c = address.ZipCode__c,
-                    ast.address_City__c = cityName,
-                    ast.address_Telephone__c = address.Telephone__c,
-                    ast.address_Contacts_Name__c = ContactPerson,
-                    ast.Detailed_Address__c= address_str
-                    if (addressAwsData.hasOwnProperty(address.AWS_Data_Id__c)) {
-                        ast.address_ZipCode__c=addressAwsData[address.AWS_Data_Id__c].zipCode;
-                        ast.address_Telephone__c=addressAwsData[address.AWS_Data_Id__c].telephone;
-                    }
-                    return ast;
-                }
-
-                //淇濆瓨鏁版嵁鍒颁繚鏈夎澶囪〃涓�
-                let UpdateAsset = function(){
-                    let ast = GetAsset();
-                    let result = sforce.connection.update([ast]);
-                    let b = result[0].getBoolean('success');
-                    return b;
-                }
-
-                let UpdateRepair = function(callback){
-                    AWSService.post(staticResourceRepair.updateUrl+'V2',[{
-                        dataId:'{!pc.AWS_Data_Id__c}',
-                        addressContactsName:rc.address_Contacts_Name__c,
-                        addressContacts:rc.address_Contacts__c,
-                        addressTelephone:rc.address_Telephone__c,
-                        addressZipCode:rc.address_ZipCode__c,
-                        detailedAddress:rc.Detailed_Address__c
-                    }],function(data){
-                        if(data && data.object){
-                            console.log(data);
-                            rc.address_Contacts_Name__c = data.object[0].addressContactsName;
-                            //rc.Address_Contacts_Name_Encrypt__c = data.object[0].addressContactsNameEncrypt;  //zhj 鏂版柟妗堟敼閫� 2022-12-29
-                            rc.address_Contacts__c = data.object[0].addressContacts;
-                            //rc.Address_Contacts_Encrypt__c = data.object[0].addressContactsEncrypt;           //zhj 鏂版柟妗堟敼閫� 2022-12-29
-                            rc.address_Telephone__c = data.object[0].addressTelephone;
-                            //rc.Address_Telephone_Encrypt__c = data.object[0].addressTelephoneEncrypt;         //zhj 鏂版柟妗堟敼閫� 2022-12-29
-                            rc.address_ZipCode__c = data.object[0].addressZipCode;
-                            //rc.Address_ZipCode_Encrypt__c = data.object[0].addressZipCodeEncrypt;             //zhj 鏂版柟妗堟敼閫� 2022-12-29
-                            rc.Detailed_Address__c = data.object[0].detailedAddress;
-                            //rc.Detailed_Address_Encrypt__c = data.object[0].detailedAddressEncrypt;           //zhj 鏂版柟妗堟敼閫� 2022-12-29
-
-                            //UpdateSobject(staticResourceRepair,rc,data.txId,callback);
-                            Visualforce.remoting.Manager.invokeAction(
-                                'StraightBackAddressController.SaveEx',
-                                JSON.stringify(rc), JSON.stringify(GetAsset()), address.Id,
-                                function (result, event) {
-
-                                    let message = '';
-                                    if (event.status) {
-                                        if (result) {
-                                            message = result;
-                                        }else{
-                                        }
-                                    }else{
-                                    }
-                                    let tobj = {
-                                        txId: data.txId
-                                    };
-                                    if(message) {
-                                        console.log('call sf to insert log');
-                                        tobj.isSuccess = 0;
-                                    }else {
-                                        console.log('call sf Log Id: ' + rc.id);
-                                        tobj.sfRecordId = rc.id;
-                                        tobj.isSuccess = 1;
-                                    }
-
-                                    AWSService.post(staticResource.transactionUrl,tobj,function(data){
-                                        if (message) {
-                                            ub();
-                                            alert(message);
-                                        }else{
-                                            window.location.href = '/{!RepairId}';
-                                        }
-                                    },staticResource.token);
-                                },
-                                { escape: true }
-                            );
                         }else{
-                            alert('AWS鏇存柊淇悊澶辫触');
-                            ub();
-                        }
-                    },staticResourceRepair.token)
-                }
-                
-                
-                
-                
-                let UpdateAddress = function(){
-                    let add = new sforce.SObject('Address__c');
-                    add.Id = address.Id;
-                    //鏈�鍚庢妸褰撳墠鏃堕棿淇濆瓨鍒板湴鍧�琛ㄤ腑锛屼綔涓洪噰鐢ㄦ椂闂�
-                    add.Using_Datetime__c = new Date();
-                    let result = sforce.connection.update([add]);
-                    let b = result[0].getBoolean('success');
-                    return b;
-                }
-                
-                b();
-                UpdateRepair();
-                /*
-                UpdateRepair(function(data){
-                    if (data.isSuccess) {
-                       let b = UpdateAsset();
-                       if (b) {
-                           b = UpdateAddress();
-                           if (b) {
-                               window.location.href = '/{!RepairId}';
-                           }else{
-                                ub();
-                                alert('閲囩敤澶辫触');
-                           }
-                       }else{
-                                ub();
-                                alert('閲囩敤澶辫触');
-                           }
-                    }else{
-                                
-                        ub();
-                        alert('SF鏇存柊淇悊澶辫触');
-                    }
-                })*/
-                
-                //椤甸潰閲嶅畾鍚�
-                //return redirectPag();
-            }catch( e){
-                //澶辫触鎻愮ず
-                //ApexPages.addMessages(e);
-            }
-        }
-        //閲囩敤鎸夐挳
-        function onAdoptJs(e, address){
-            
-            //鍒ゆ柇褰撳墠淇悊鍗曟槸鍚﹀凡缁忕敵璇蜂慨鐞�
-            var uploadTime = '{!FSEApplyForRepairTime}';
-            if(uploadTime != 'null' && uploadTime){
-                var prompt  = '鐢变簬褰撳墠淇悊鍗曞凡鐢宠淇悊锛岃闂槸鍚﹂噰鐢ㄥ苟涓婁紶鏁版嵁鍒癝AP锛�';
-                if(confirm(prompt)){
-                    adoptSaveJs(address,true);
-                }
-            }else{
-                adoptSaveJs(address,false);
-            }
+                                 ub();
+                                 alert('閲囩敤澶辫触');
+                            }
+                     }else{
 
-        }
-       /* function onAdoptJs(){
-            if(checkedTrue != null){
-                b();
-                var lawtable = document.getElementById("tableHeader_L");//鑾峰彇id涓簍ableHeader_L鐨則able
-                var rows = lawtable.rows;//鑾峰彇鎵�鏈夎 
-                var InputObj = rows[checkedTrue].cells[0].getElementsByTagName("input")[0];
-                if(InputObj.checked){
-                    //鍒ゆ柇褰撳墠淇悊鍗曟槸鍚﹀凡缁忕敵璇蜂慨鐞�
-                    var uploadTime = '{!FSEApplyForRepairTime}';
-                    if(uploadTime != null){
-                        var prompt  = '鐢变簬褰撳墠淇悊鍗曞凡鐢宠淇悊锛岃闂槸鍚﹂噰鐢ㄥ苟涓婁紶鏁版嵁鍒癝AP锛�';
-                        if(confirm(prompt)){
-                            adoptSave(InputObj.value+"",true);
-                        }else{
-                            adoptSave(InputObj.value+"",false);
-                        }
-                    }else{
-                        adoptSave(InputObj.value+"",false);
-                    }
-                }
-            }else{
-                alert('璇烽�変腑浣犺閲囩敤鐨勫湴鍧�锛�');
-                return false;
-            }
-        }*/
-        //杩斿洖鐖堕〉闈�
-        function sendBackJs(){
-            redirectPag();
-        }
-        //鍒锋柊褰撳墠椤甸潰
-        function refreshJs(){
-            window.location.reload();
-        }
+                         ub();
+                         alert('SF鏇存柊淇悊澶辫触');
+                     }
+                 })*/
 
-        //2022 02 28 寮犲崕寤� display PI Data start
-        
-        //queryPI();
-        function q1(){
-            debugger
-            var index = 0;
-            var correct = 0;
-            var p = new Promise(function(resolve, reject){
-                //鏌ヨ鍦板潃鐨凱I鏁版嵁
-                let searchCallBack = function searchCallBack(result,Id,awsDataId){
-                    index++;
-                    let contacts = result.object;
-                    if(contacts == null){
-                        console.log('contacts == null')
-                        return;
-                    }
-                    let temp = {}
-                    temp.telephone = result.object.telephone;
-                    temp.zipCode = result.object.zipCode;
-                    temp.detailedAddress = result.object.detailedAddress;
-                    //temp.awsDataId = awsDataId;
-                    temp.lastName = result.object.contactName;
-                    PIData[Id] = temp;
-                };
-                for(var i=0;i<tableDataStr.length;i++){
-                    if(tableDataStr[i].address.AWS_Data_Id__c){
-                        correct++;
-                        AWSService.queryRepair(staticResource.queryUrl,
-                                                tableDataStr[i].address.AWS_Data_Id__c,
-                                                tableDataStr[i].address.Id,
-                                                //tableDataStr[i].address.Contacts__r.AWS_Data_Id__c,
-                                                null,
-                                                searchCallBack,
-                                                staticResource.token);
-                    } 
-                }
-                var interval=self.setInterval(function (){
-                    console.log('setInterval index= ' + index);
-                    if(index == correct){
-                        console.log('PIDATA = ' + JSON.stringify(PIData))
-                        resolve('success')
-                        clearInterval(interval)
-                    }
-                },1000);
-            });
-            return p;
-        }
+                 //椤甸潰閲嶅畾鍚�
+                 //return redirectPag();
+             }catch( e){
+                 //澶辫触鎻愮ず
+                 //ApexPages.addMessages(e);
+             }
+         }
+         //閲囩敤鎸夐挳
+         function onAdoptJs(e, address){
 
-        //zhj PIPL 2022-06-08 start
-        function q2(){
-            // sforce.connection.sessionId = '{!GETSESSIONID()}';
-            // var p = new Promise(function(resolve, reject){
-            //     //鏌ヨ鑱旂郴浜虹殑鏁版嵁
-            //     let queryBack = function queryBack(result) {
-            //         let contacts = result.object;
-            //         if(contacts == null){
-            //             return;
-            //         }
-            //         for(var i=0;i<result.object.length;i++){
-            //             for(let key in PIData){
-            //                 if(result.object[i].dataId == PIData[key].awsDataId){
-            //                     PIData[key].lastName = result.object[i].lastName;
-            //                 }
-            //             }
-            //         }
-            //     }
-            //     var condition = ''
-            //     for(var i=0;i<tableDataStr.length;i++){
-            //         if(tableDataStr[i].address.Contacts__c){
-            //             condition += "," + "\'"+tableDataStr[i].address.Contacts__c+"\'";
-            //         }
-            //     }
-            //     condition = condition.substr(1);
-            //     console.log('condition = ' + condition);
-            //     var record = sforce.connection.query("select AWS_Data_Id__c from Contact where id in("+condition+")");
-            //     var records = record.getArray("records");
-            //     for(var i =0;i<records.length;i++){
-            //         if(records[i].AWS_Data_Id__c){
-            //             contactDataIds.push(records[i].AWS_Data_Id__c);
-            //         }
-            //     }
-            //     let searchPayload = new Object();
-            //     searchPayload.dataIds = contactDataIds;
-            //     searchPayload.contactName = '';
-            //     console.log('contactDataIds = ' + contactDataIds);
-            //     AWSService.search(staticResourceContact.searchUrl, JSON.stringify(searchPayload), queryBack, staticResourceContact.token);
-            // });
-        }
+             //鍒ゆ柇褰撳墠淇悊鍗曟槸鍚﹀凡缁忕敵璇蜂慨鐞�
+             var uploadTime = '{!FSEApplyForRepairTime}';
+             if(uploadTime != 'null' && uploadTime){
+                 var prompt  = '鐢变簬褰撳墠淇悊鍗曞凡鐢宠淇悊锛岃闂槸鍚﹂噰鐢ㄥ苟涓婁紶鏁版嵁鍒癝AP锛�';
+                 if(confirm(prompt)){
+                     adoptSaveJs(address,true);
+                 }
+             }else{
+                 adoptSaveJs(address,false);
+             }
 
-        //zhj PIPL 2022-06-08 end
+         }
+        /* function onAdoptJs(){
+             if(checkedTrue != null){
+                 b();
+                 var lawtable = document.getElementById("tableHeader_L");//鑾峰彇id涓簍ableHeader_L鐨則able
+                 var rows = lawtable.rows;//鑾峰彇鎵�鏈夎
+                 var InputObj = rows[checkedTrue].cells[0].getElementsByTagName("input")[0];
+                 if(InputObj.checked){
+                     //鍒ゆ柇褰撳墠淇悊鍗曟槸鍚﹀凡缁忕敵璇蜂慨鐞�
+                     var uploadTime = '{!FSEApplyForRepairTime}';
+                     if(uploadTime != null){
+                         var prompt  = '鐢变簬褰撳墠淇悊鍗曞凡鐢宠淇悊锛岃闂槸鍚﹂噰鐢ㄥ苟涓婁紶鏁版嵁鍒癝AP锛�';
+                         if(confirm(prompt)){
+                             adoptSave(InputObj.value+"",true);
+                         }else{
+                             adoptSave(InputObj.value+"",false);
+                         }
+                     }else{
+                         adoptSave(InputObj.value+"",false);
+                     }
+                 }
+             }else{
+                 alert('璇烽�変腑浣犺閲囩敤鐨勫湴鍧�锛�');
+                 return false;
+             }
+         }*/
+         //杩斿洖鐖堕〉闈�
+         function sendBackJs(){
+             redirectPag();
+         }
+         //鍒锋柊褰撳墠椤甸潰
+         function refreshJs(){
+             window.location.reload();
+         }
+
+         //2022 02 28 寮犲崕寤� display PI Data start
+
+         //queryPI();
+         function q1(){
+             debugger
+             var index = 0;
+             var correct = 0;
+             var p = new Promise(function(resolve, reject){
+                 //鏌ヨ鍦板潃鐨凱I鏁版嵁
+                 let searchCallBack = function searchCallBack(result,Id,awsDataId){
+                     index++;
+                     let contacts = result.object;
+                     if(contacts == null){
+                         console.log('contacts == null')
+                         return;
+                     }
+                     let temp = {}
+                     temp.telephone = result.object.telephone;
+                     temp.zipCode = result.object.zipCode;
+                     temp.detailedAddress = result.object.detailedAddress;
+                     //temp.awsDataId = awsDataId;
+                     temp.lastName = result.object.contactName;
+                     PIData[Id] = temp;
+                 };
+                 for(var i=0;i<tableDataStr.length;i++){
+                     if(tableDataStr[i].address.AWS_Data_Id__c){
+                         correct++;
+                         AWSService.queryRepair(staticResource.queryUrl,
+                                                 tableDataStr[i].address.AWS_Data_Id__c,
+                                                 tableDataStr[i].address.Id,
+                                                 //tableDataStr[i].address.Contacts__r.AWS_Data_Id__c,
+                                                 null,
+                                                 searchCallBack,
+                                                 staticResource.token);
+                     }
+                 }
+                 var interval=self.setInterval(function (){
+                     console.log('setInterval index= ' + index);
+                     if(index == correct){
+                         console.log('PIDATA = ' + JSON.stringify(PIData))
+                         resolve('success')
+                         clearInterval(interval)
+                     }
+                 },1000);
+             });
+             return p;
+         }
+
+         //zhj PIPL 2022-06-08 start
+         function q2(){
+             // sforce.connection.sessionId = '{!GETSESSIONID()}';
+             // var p = new Promise(function(resolve, reject){
+             //     //鏌ヨ鑱旂郴浜虹殑鏁版嵁
+             //     let queryBack = function queryBack(result) {
+             //         let contacts = result.object;
+             //         if(contacts == null){
+             //             return;
+             //         }
+             //         for(var i=0;i<result.object.length;i++){
+             //             for(let key in PIData){
+             //                 if(result.object[i].dataId == PIData[key].awsDataId){
+             //                     PIData[key].lastName = result.object[i].lastName;
+             //                 }
+             //             }
+             //         }
+             //     }
+             //     var condition = ''
+             //     for(var i=0;i<tableDataStr.length;i++){
+             //         if(tableDataStr[i].address.Contacts__c){
+             //             condition += "," + "\'"+tableDataStr[i].address.Contacts__c+"\'";
+             //         }
+             //     }
+             //     condition = condition.substr(1);
+             //     console.log('condition = ' + condition);
+             //     var record = sforce.connection.query("select AWS_Data_Id__c from Contact where id in("+condition+")");
+             //     var records = record.getArray("records");
+             //     for(var i =0;i<records.length;i++){
+             //         if(records[i].AWS_Data_Id__c){
+             //             contactDataIds.push(records[i].AWS_Data_Id__c);
+             //         }
+             //     }
+             //     let searchPayload = new Object();
+             //     searchPayload.dataIds = contactDataIds;
+             //     searchPayload.contactName = '';
+             //     console.log('contactDataIds = ' + contactDataIds);
+             //     AWSService.search(staticResourceContact.searchUrl, JSON.stringify(searchPayload), queryBack, staticResourceContact.token);
+             // });
+         }
+
+         //zhj PIPL 2022-06-08 end
 
 
-        //鏌ヨ鏁忔劅瀛楁
-        function queryPI(){
-            //b();
-            tableDataStr = JSON.parse(document.getElementById('allPage:allForm:tableValueFrontEnd').value);
-            PIData = {};
-            contactDataIds = [];
-            console.log(tableDataStr)
-            q1().then(function(data){
-                        return q2(data);
-                    })
-            //ub();
-        }
-        
+         //鏌ヨ鏁忔劅瀛楁
+         function queryPI(){
+             //b();
+             tableDataStr = JSON.parse(document.getElementById('allPage:allForm:tableValueFrontEnd').value);
+             PIData = {};
+             contactDataIds = [];
+             console.log(tableDataStr)
+             q1().then(function(data){
+                         return q2(data);
+                     })
+             //ub();
+         }
 
-        function showPIDiv(awsDataId){
-            if(awsDataId.length == 0 || PIData[awsDataId]==null){
-                return
-            }
-            console.log('awsDataId Value:'+awsDataId);
-            let parentNode = document.getElementById(awsDataId);
-            let createDiv = document.createElement("div");  
-            createDiv.id = awsDataId+"_PI";  
-            let piInformation = '';
-            
-            if(PIData[awsDataId].lastName){
-                piInformation = '鑱旂郴浜�: '+PIData[awsDataId].lastName+
-                '\n鐢佃瘽: '+PIData[awsDataId].telephone+
-                '\n閭紪: '+PIData[awsDataId].zipCode+
-                '\n璇︾粏鍦板潃: '+PIData[awsDataId].detailedAddress
-            }else{
-                piInformation = '鑱旂郴浜�: null'+
-                '\n鐢佃瘽: '+PIData[awsDataId].telephone+
-                '\n閭紪: '+PIData[awsDataId].zipCode+
-                '\n璇︾粏鍦板潃: '+PIData[awsDataId].detailedAddress
-            }
-            //let piInformation = 'Name:'+contact['943114607025717249'].lastName +'\n' +'Phone:'+contact['943114607025717249'].phone
-            createDiv.innerText = piInformation;
-            let x=window.event.x;
-            let y=window.event.y; 
-            createDiv.style.left=x;  
-            createDiv.style.top=y;  
-            createDiv.style.height='100px';  
-            createDiv.style.width='120px'; 
-            createDiv.style.background="#dddddd";
-            createDiv.style.position = "absolute";
-            parentNode.appendChild(createDiv);  
-            parentNode.style.position = "relative";  
-        }
 
-        function hidePIDiv(awsDataId){
-            if(awsDataId.length == 0 || PIData[awsDataId]==null){
-                return
-            }
-            document.getElementById(awsDataId+'_PI').remove();
-        }
+         function showPIDiv(awsDataId){
+             if(awsDataId.length == 0 || PIData[awsDataId]==null){
+                 return
+             }
+             console.log('awsDataId Value:'+awsDataId);
+             let parentNode = document.getElementById(awsDataId);
+             let createDiv = document.createElement("div");
+             createDiv.id = awsDataId+"_PI";
+             let piInformation = '';
 
-        // function replaceSearchContactLookup() {
-        //     if(document.getElementById('allPage:allForm:oppBlock2:UpdAddressId:Contacts__c') != null){
-        //         let contactHtmlString = '<img src="/img/s.gif" onclick="searchContact(\'allPage:allForm:contactId\',\'allPage:allForm:oppBlock2:UpdAddressId:Contacts__c\')" alt="Reference Document Number Lookup" class="lookupIcon"  title="Reference Document Number Lookup (New Window)"/>';
-        //         let lookUpNode = htmlToElement(contactHtmlString);
-        //         console.log(lookUpNode);
-        //         let parentNode = document.getElementById('allPage:allForm:oppBlock2:UpdAddressId:Contacts__c').parentNode;
-        //         parentNode.appendChild(lookUpNode);
-        //         if(contactInfoStr){
-        //             console.log('closePopup:'+contactInfoStr);
-        //             let contactInfo = JSON.parse(contactInfoStr);
-        //             let contactNodeId = 'allPage:allForm:oppBlock2:UpdAddressId:contactIdValue';
-        //             document.getElementById(contactNodeId).value = contactInfo.ContactId;
-        //             document.getElementById(closeField).value = contactInfo.Name; 
-        //         }                 
-        //     }
-        // }
+             if(PIData[awsDataId].lastName){
+                 piInformation = '鑱旂郴浜�: '+PIData[awsDataId].lastName+
+                 '\n鐢佃瘽: '+PIData[awsDataId].telephone+
+                 '\n閭紪: '+PIData[awsDataId].zipCode+
+                 '\n璇︾粏鍦板潃: '+PIData[awsDataId].detailedAddress
+             }else{
+                 piInformation = '鑱旂郴浜�: null'+
+                 '\n鐢佃瘽: '+PIData[awsDataId].telephone+
+                 '\n閭紪: '+PIData[awsDataId].zipCode+
+                 '\n璇︾粏鍦板潃: '+PIData[awsDataId].detailedAddress
+             }
+             //let piInformation = 'Name:'+contact['943114607025717249'].lastName +'\n' +'Phone:'+contact['943114607025717249'].phone
+             createDiv.innerText = piInformation;
+             let x=window.event.x;
+             let y=window.event.y;
+             createDiv.style.left=x;
+             createDiv.style.top=y;
+             createDiv.style.height='100px';
+             createDiv.style.width='120px';
+             createDiv.style.background="#dddddd";
+             createDiv.style.position = "absolute";
+             parentNode.appendChild(createDiv);
+             parentNode.style.position = "relative";
+         }
 
-        function htmlToElement(html) {
-            var template = document.createElement('template');
-            html = html.trim(); // Never return a text node of whitespace as the result
-            template.innerHTML = html;
-            return template.content.firstChild;
-        }
+         function hidePIDiv(awsDataId){
+             if(awsDataId.length == 0 || PIData[awsDataId]==null){
+                 return
+             }
+             document.getElementById(awsDataId+'_PI').remove();
+         }
 
-        //鑷畾涔塴ookup鏌ヨ
-        // function searchContact(contactNodeId,field){
-        //     closeField = field;
-        //     let accountValue = "";
-        //     if (document.getElementById('allPage:allForm:oppBlock2:UpdAddressId:Customer__r_Name')!=null) {
-        //         let accountNodeId = document.getElementById('allPage:allForm:oppBlock2:UpdAddressId:Customer__r_Name').id + '_lkid';
-        //         accountValue = document.getElementById(accountNodeId).value;   
-        //     } 
-        //     console.log(accountValue);
-        //     if(accountValue !='000000000000000'){
-        //         let baseUrl = "/apex/SearchContactPage";
-        //         let suffixUrl = "?contactId="+contactNodeId+"&accountId="+accountValue;
-        //         let newSearchContactParam = 'height=600,width=800,left=100,top=100,dialogHide=true,resizable=no,scrollbars=yes,toolbar=no,status=no';
-        //         newSearchContactWindow = window.open(baseUrl+suffixUrl, 'Popup', newSearchContactParam);
-        //         if (window.focus) {
-        //             newSearchContactWindow.focus();
-        //         }
-        //         return false;
-        //     }else{
-        //         console.log('璇峰厛閫夋嫨瀹㈡埛鍐嶉�夋嫨鑱旂郴浜�')
-        //     }
-        // }
+         // function replaceSearchContactLookup() {
+         //     if(document.getElementById('allPage:allForm:oppBlock2:UpdAddressId:Contacts__c') != null){
+         //         let contactHtmlString = '<img src="/img/s.gif" onclick="searchContact(\'allPage:allForm:contactId\',\'allPage:allForm:oppBlock2:UpdAddressId:Contacts__c\')" alt="Reference Document Number Lookup" class="lookupIcon"  title="Reference Document Number Lookup (New Window)"/>';
+         //         let lookUpNode = htmlToElement(contactHtmlString);
+         //         console.log(lookUpNode);
+         //         let parentNode = document.getElementById('allPage:allForm:oppBlock2:UpdAddressId:Contacts__c').parentNode;
+         //         parentNode.appendChild(lookUpNode);
+         //         if(contactInfoStr){
+         //             console.log('closePopup:'+contactInfoStr);
+         //             let contactInfo = JSON.parse(contactInfoStr);
+         //             let contactNodeId = 'allPage:allForm:oppBlock2:UpdAddressId:contactIdValue';
+         //             document.getElementById(contactNodeId).value = contactInfo.ContactId;
+         //             document.getElementById(closeField).value = contactInfo.Name;
+         //         }
+         //     }
+         // }
 
-        function closePopupWindow() {
-            if (null != newSearchContactWindow) {
-                newSearchContactWindow.close();
-            }
-            contactInfoStr = document.getElementById('allPage:allForm:contactId').value;
-            console.log('closePopup:'+contactInfoStr);
-            let contactInfo = JSON.parse(contactInfoStr);
-            let contactNodeId = 'allPage:allForm:oppBlock2:UpdAddressId:contactIdValue';
-            document.getElementById(contactNodeId).value = contactInfo.ContactId;
-            document.getElementById(closeField).value = contactInfo.Name;     
-        }
-        //2022 02 28 寮犲崕寤� display PI Data end
+         function htmlToElement(html) {
+             var template = document.createElement('template');
+             html = html.trim(); // Never return a text node of whitespace as the result
+             template.innerHTML = html;
+             return template.content.firstChild;
+         }
+
+         //鑷畾涔塴ookup鏌ヨ
+         // function searchContact(contactNodeId,field){
+         //     closeField = field;
+         //     let accountValue = "";
+         //     if (document.getElementById('allPage:allForm:oppBlock2:UpdAddressId:Customer__r_Name')!=null) {
+         //         let accountNodeId = document.getElementById('allPage:allForm:oppBlock2:UpdAddressId:Customer__r_Name').id + '_lkid';
+         //         accountValue = document.getElementById(accountNodeId).value;
+         //     }
+         //     console.log(accountValue);
+         //     if(accountValue !='000000000000000'){
+         //         let baseUrl = "/apex/SearchContactPage";
+         //         let suffixUrl = "?contactId="+contactNodeId+"&accountId="+accountValue;
+         //         let newSearchContactParam = 'height=600,width=800,left=100,top=100,dialogHide=true,resizable=no,scrollbars=yes,toolbar=no,status=no';
+         //         newSearchContactWindow = window.open(baseUrl+suffixUrl, 'Popup', newSearchContactParam);
+         //         if (window.focus) {
+         //             newSearchContactWindow.focus();
+         //         }
+         //         return false;
+         //     }else{
+         //         console.log('璇峰厛閫夋嫨瀹㈡埛鍐嶉�夋嫨鑱旂郴浜�')
+         //     }
+         // }
+
+         function closePopupWindow() {
+             if (null != newSearchContactWindow) {
+                 newSearchContactWindow.close();
+             }
+             contactInfoStr = document.getElementById('allPage:allForm:contactId').value;
+             console.log('closePopup:'+contactInfoStr);
+             let contactInfo = JSON.parse(contactInfoStr);
+             let contactNodeId = 'allPage:allForm:oppBlock2:UpdAddressId:contactIdValue';
+             document.getElementById(contactNodeId).value = contactInfo.ContactId;
+             document.getElementById(closeField).value = contactInfo.Name;
+         }
+         //2022 02 28 寮犲崕寤� display PI Data end
     </script>
     <script type="text/javascript">
-        
-        function DecryptAddress(){
-            debugger
-            let arr1 = [];let a1=false;
-            let arr2 = [];let a2=false;
-            j$('td.oraddress').each(function(i,e){
-               let did = j$(e).attr('address-data-id');
-               if (did) {
-                   arr1.push(did);
-               }
+        function DecryptAddress() {
+            debugger;
+            let arr1 = [];
+            let a1 = false;
+            let arr2 = [];
+            let a2 = false;
+            j$('td.oraddress').each(function (i, e) {
+                let did = j$(e).attr('address-data-id');
+                if (did) {
+                    arr1.push(did);
+                }
 
-               did = j$(e).attr('contact-data-id');
-               if (did) {
-                   arr2.push(did);
-               }
-            })
-            
+                did = j$(e).attr('contact-data-id');
+                if (did) {
+                    arr2.push(did);
+                }
+            });
+
             if (arr1.length) {
                 b();
-                AWSService.post(staticResource.searchUrl,{
-                    dataIds:arr1
-                },function(data){
-                    ub();
-                    if(data && data.object && data.object.length > 0){
-                        for (let di in data.object) {
-                            if (data.object[di] && data.object[di].dataId) {
-                                addressAwsData[data.object[di].dataId] = data.object[di];
+                AWSService.post(
+                    staticResource.searchUrl,
+                    {
+                        dataIds: arr1
+                    },
+                    function (data) {
+                        ub();
+                        if (data && data.object && data.object.length > 0) {
+                            for (let di in data.object) {
+                                if (data.object[di] && data.object[di].dataId) {
+                                    addressAwsData[data.object[di].dataId] =
+                                        data.object[di];
+                                }
                             }
                         }
-                        
-                    }
-                },staticResource.token)
+                    },
+                    staticResource.token
+                );
             }
 
             if (arr2.length) {
                 b();
-                AWSService.post(staticResourceContact.searchUrl,{
-                    dataIds:arr2
-                },function(data){
-                    ub();
-                    if(data && data.object && data.object.length > 0){
-                        for (let di in data.object) {
-                            if (data.object[di] && data.object[di].dataId) {
-                                addressAwsData[data.object[di].dataId] = data.object[di];
+                AWSService.post(
+                    staticResourceContact.searchUrl,
+                    {
+                        dataIds: arr2
+                    },
+                    function (data) {
+                        ub();
+                        if (data && data.object && data.object.length > 0) {
+                            for (let di in data.object) {
+                                if (data.object[di] && data.object[di].dataId) {
+                                    addressAwsData[data.object[di].dataId] =
+                                        data.object[di];
+                                }
                             }
                         }
-                        
-                    }
-                },staticResourceContact.token)
+                    },
+                    staticResourceContact.token
+                );
             }
         }
     </script>
     <apex:form id="allForm">
-        <apex:inputHidden id="tableValueFrontEnd" value="{!tableDataStr}"/>
-        <apex:inputHidden value="{!contactId}" id="contactId"/>
-        <apex:inputHidden value="{!insUpdDataStr}" id="insUpdDataStr"/>
-        <div id="tab01">            
+        <apex:inputHidden id="tableValueFrontEnd" value="{!tableDataStr}" />
+        <apex:inputHidden value="{!contactId}" id="contactId" />
+        <apex:inputHidden value="{!insUpdDataStr}" id="insUpdDataStr" />
+        <div id="tab01">
             <!-- 椤甸潰鏁版嵁鍒濆鍖栨柟娉� -->
-            <apex:actionFunction name="init" action="{!init}" rerender="oppBlock1,message,checEventFrame" onComplete="ub();"></apex:actionFunction>
+            <apex:actionFunction
+                name="init"
+                action="{!init}"
+                rerender="oppBlock1,message,checEventFrame"
+                onComplete="ub();"
+            ></apex:actionFunction>
             <!-- 妫�绱㈡暟鎹煡璇㈡柟娉� -->
-            <apex:actionFunction name="searchBtn" action="{!searchBtn}" rerender="oppBlock1,message,checEventFrame,tableValueFrontEnd" onComplete="ub();DecryptAddress();">
-                <apex:param name="addressDataIds" assignTo="{!addressDataIds}" value=""></apex:param>
+            <apex:actionFunction
+                name="searchBtn"
+                action="{!searchBtn}"
+                rerender="oppBlock1,message,checEventFrame,tableValueFrontEnd"
+                onComplete="ub();DecryptAddress();"
+            >
+                <apex:param
+                    name="addressDataIds"
+                    assignTo="{!addressDataIds}"
+                    value=""
+                ></apex:param>
             </apex:actionFunction>
             <!-- 閲囩敤鏂规硶 -->
             <!--<actionFunction name="adoptSave" action="{!adoptSave}" rerender="oppBlock2,message" onComplete="ub();">
@@ -920,68 +954,150 @@
                 <apex:param name="isUpload" assignTo="{!isUpload}" value="" />
             </actionFunction>-->
             <!-- 淇濆瓨鍜屼慨鏀规柟娉� -->
-            <apex:actionFunction name="save" action="{!save}" rerender="oppBlock2,message" onComplete="ub();Trans()"></apex:actionFunction>
+            <apex:actionFunction
+                name="save"
+                action="{!save}"
+                rerender="oppBlock2,message"
+                onComplete="ub();Trans()"
+            ></apex:actionFunction>
             <!-- 鐐瑰嚮淇敼鎸夐挳鑾峰彇淇敼鏁版嵁鏂规硶 -->
-            <apex:actionFunction name="onEditor" action="{!onEditor}" rerender="oppBlock2,checEventFrame,insUpdDataStr" onComplete="decrypt();ub();">
+            <apex:actionFunction
+                name="onEditor"
+                action="{!onEditor}"
+                rerender="oppBlock2,checEventFrame,insUpdDataStr"
+                onComplete="decrypt();ub();"
+            >
                 <apex:param name="UpdId" assignTo="{!UpdId}" value="" />
             </apex:actionFunction>
             <!-- 澶嶅埗鏂规硶 -->
-            <apex:actionFunction name="onCopy" action="{!onCopy}" rerender="oppBlock2,checEventFrame," onComplete="decrypt();ub();">
+            <apex:actionFunction
+                name="onCopy"
+                action="{!onCopy}"
+                rerender="oppBlock2,checEventFrame,"
+                onComplete="decrypt();ub();"
+            >
                 <apex:param name="UpdId" assignTo="{!UpdId}" value="" />
             </apex:actionFunction>
             <!-- 杩斿洖鐖堕〉闈� -->
-            <apex:actionFunction name="redirectPag" action="{!redirectPag}" rerender="true" onComplete="ub();"></apex:actionFunction>
-        <apex:pageBlock id="searchBlock" tabStyle="Report">
-            <table style="border-bottom-width: 0px; font-size:12px;width:100%">
-                <tr>
-                    <td style="width: 15%">
-                        <font>绫�&nbsp;鍨�&nbsp;</font>&nbsp;
+            <apex:actionFunction
+                name="redirectPag"
+                action="{!redirectPag}"
+                rerender="true"
+                onComplete="ub();"
+            ></apex:actionFunction>
+            <apex:pageBlock id="searchBlock" tabStyle="Report">
+                <table
+                    style="
+                        border-bottom-width: 0px;
+                        font-size: 12px;
+                        width: 100%;
+                    "
+                >
+                    <tr>
+                        <td style="width: 15%">
+                            <font>绫�&nbsp;鍨�&nbsp;</font>&nbsp;
                             <!-- <apex:selectList id="numtextA1Id" value="{!numtextA1}" size="1" style="width:110px">
                                 <apex:selectOptions value="{!optionType}"/>
                             </apex:selectList> -->
-                            <apex:inputField value="{!optionAddressClassification.Address_Classification__c}" id="AddressClassificationId"/>
+                            <apex:inputField
+                                value="{!optionAddressClassification.Address_Classification__c}"
+                                id="AddressClassificationId"
+                            />
                         </td>
                         <td style="width: 20%">
                             <font>瀹�&nbsp;鎴�&nbsp;鍚�&nbsp;</font>&nbsp;
-                            <apex:inputText id="txtNameId" value="{!txtName}"/>
-                            <a class="inlineEditUndoLink" title="娓呯┖" href="#" onclick="document.getElementById('allPage:allForm:searchBlock:txtNameId').value = '';document.getElementById('allPage:allForm:searchBlock:txtNameId').focus();" style="display: inline;">
-                                <img width="16px" height="16px" src="/img/s.gif" alt="娓呯┖" class="inlineEditUndo"/>
+                            <apex:inputText id="txtNameId" value="{!txtName}" />
+                            <a
+                                class="inlineEditUndoLink"
+                                title="娓呯┖"
+                                href="#"
+                                onclick="document.getElementById('allPage:allForm:searchBlock:txtNameId').value = '';document.getElementById('allPage:allForm:searchBlock:txtNameId').focus();"
+                                style="display: inline"
+                            >
+                                <img
+                                    width="16px"
+                                    height="16px"
+                                    src="/img/s.gif"
+                                    alt="娓呯┖"
+                                    class="inlineEditUndo"
+                                />
                             </a>
                         </td>
                         <td style="width: 20%">
                             <font>鍦�&nbsp;鍧�&nbsp;</font>&nbsp;
-                            <apex:inputText id="txtAddressId" value="{!txtAddress}"/>
-                            <a class="inlineEditUndoLink" title="娓呯┖" href="#" onclick="document.getElementById('allPage:allForm:searchBlock:txtAddressId').value = '';document.getElementById('allPage:allForm:searchBlock:txtAddressId').focus(); " style="display: inline;">
-                                <img width="16px" height="16px" src="/s.gif" alt="娓呯┖" class="inlineEditUndo"/>
+                            <apex:inputText
+                                id="txtAddressId"
+                                value="{!txtAddress}"
+                            />
+                            <a
+                                class="inlineEditUndoLink"
+                                title="娓呯┖"
+                                href="#"
+                                onclick="document.getElementById('allPage:allForm:searchBlock:txtAddressId').value = '';document.getElementById('allPage:allForm:searchBlock:txtAddressId').focus(); "
+                                style="display: inline"
+                            >
+                                <img
+                                    width="16px"
+                                    height="16px"
+                                    src="/s.gif"
+                                    alt="娓呯┖"
+                                    class="inlineEditUndo"
+                                />
                             </a>
                         </td>
                         <td style="width: 20%">
-                            <apex:commandButton onclick="searchBtnJs();return false;"  rendered="true" value="妫�绱�" style="width:60px;"  onComplete=""/>
+                            <apex:commandButton
+                                onclick="searchBtnJs();return false;"
+                                rendered="true"
+                                value="妫�绱�"
+                                style="width: 60px"
+                                onComplete=""
+                            />
                             &nbsp;&nbsp;
                             <!-- <apex:commandButton onclick="onAdoptJs();return false;"  rendered="true" value="閲囩敤" style="width:60px;background:#98c1fbf7"/>
                             &nbsp;&nbsp; -->
-                            <apex:commandButton onclick="sendBackJs();return false;"  rendered="true" value="杩斿洖" style="width:60px;"/>
+                            <apex:commandButton
+                                onclick="sendBackJs();return false;"
+                                rendered="true"
+                                value="杩斿洖"
+                                style="width: 60px"
+                            />
                         </td>
-                        <td style="width: 25%">
-                            &nbsp;
-                        </td>
+                        <td style="width: 25%">&nbsp;</td>
                     </tr>
                 </table>
             </apex:pageBlock>
-            
         </div>
         <div>
             <apex:outputPanel id="message">
                 <apex:pageMessages />
             </apex:outputPanel>
         </div>
-        <div id="tab02" style="overflow-x: auto; overflow-y: auto;">
+        <div id="tab02" style="overflow-x: auto; overflow-y: auto">
             <apex:pageBlock id="oppBlock1" tabStyle="Report">
-                <apex:pageblocksection title="鍦板潃鍒楄〃" id="edmpdDetails" rendered="true" columns="1" >
-                    <apex:outputPanel >
-                        <table class="list" style="border-bottom-width: 0px; font-size:11px; border-spacing:0;" border="" id="tableHeader_L" >
+                <apex:pageblocksection
+                    title="鍦板潃鍒楄〃"
+                    id="edmpdDetails"
+                    rendered="true"
+                    columns="1"
+                >
+                    <apex:outputPanel>
+                        <table
+                            class="list"
+                            style="
+                                border-bottom-width: 0px;
+                                font-size: 11px;
+                                border-spacing: 0;
+                            "
+                            border=""
+                            id="tableHeader_L"
+                        >
                             <thead>
-                                <tr class="headerRow" height="30px"  align="center">
+                                <tr
+                                    class="headerRow"
+                                    height="30px"
+                                    align="center"
+                                >
                                     <!--鏍囬 -->
                                     <td style="">搴忓彿</td>
                                     <td style="">绫诲瀷</td>
@@ -992,81 +1108,216 @@
                                     <td style="">鐪�</td>
                                     <td style="">甯�</td>
                                     <td style="">璇︾粏鍦板潃</td>
-                                    <td style="" colspan="3">
-                                        鎿嶄綔
-                                    </td>
+                                    <td style="" colspan="3">鎿嶄綔</td>
                                 </tr>
                             </thead>
                             <tbody>
                                 <apex:variable value="{!0}" var="cnt" />
-                                <apex:repeat value="{!tableData}" var="or" id="oppTable">
-                                    <tr class="dataRow {!IF(MOD(cnt, 2)==0, 'odd', 'even')} {!IF(cnt==1, 'first', '')}" onmouseover="if (window.hiOn){hiOn(this);} " onmouseout="if (window.hiOff){hiOff(this);} "  onblur="if (window.hiOff){hiOff(this);}" onfocus="if (window.hiOn){hiOn(this);}">
-                                        <td align="center" style="vertical-align: inherit;width:25px;border-width: 0px 1px 1px 0px;">
+                                <apex:repeat
+                                    value="{!tableData}"
+                                    var="or"
+                                    id="oppTable"
+                                >
+                                    <tr
+                                        class="dataRow {!IF(MOD(cnt, 2)==0, 'odd', 'even')} {!IF(cnt==1, 'first', '')}"
+                                        onmouseover="if (window.hiOn){hiOn(this);} "
+                                        onmouseout="if (window.hiOff){hiOff(this);} "
+                                        onblur="if (window.hiOff){hiOff(this);}"
+                                        onfocus="if (window.hiOn){hiOn(this);}"
+                                    >
+                                        <td
+                                            align="center"
+                                            style="
+                                                vertical-align: inherit;
+                                                width: 25px;
+                                                border-width: 0px 1px 1px 0px;
+                                            "
+                                        >
                                             {!cnt+1}
                                         </td>
-                                        <td  align="center"  style="vertical-align: inherit;border-width: 0px 1px 1px 0px;">
-                                            <apex:outputText value="{!or.address.Address_Classification__c}" />
+                                        <td
+                                            align="center"
+                                            style="
+                                                vertical-align: inherit;
+                                                border-width: 0px 1px 1px 0px;
+                                            "
+                                        >
+                                            <apex:outputText
+                                                value="{!or.address.Address_Classification__c}"
+                                            />
                                         </td>
-                                        <td align="left" class="Customer__c" style="vertical-align: inherit;border-width: 0px 1px 1px 0px;">
-                                            <apex:outputfield value="{!or.address.Customer__c}" />
+                                        <td
+                                            align="left"
+                                            class="Customer__c"
+                                            style="
+                                                vertical-align: inherit;
+                                                border-width: 0px 1px 1px 0px;
+                                            "
+                                        >
+                                            <apex:outputfield
+                                                value="{!or.address.Customer__c}"
+                                            />
                                         </td>
-                                        <td align="left" class="oraddress" style="vertical-align: inherit;border-width: 0px 1px 1px 0px;" address-data-id="{!or.address.AWS_Data_Id__c}" contact-data-id="{!or.address.Contacts__r.AWS_Data_Id__c}">
+                                        <td
+                                            align="left"
+                                            class="oraddress"
+                                            style="
+                                                vertical-align: inherit;
+                                                border-width: 0px 1px 1px 0px;
+                                            "
+                                            address-data-id="{!or.address.AWS_Data_Id__c}"
+                                            contact-data-id="{!or.address.Contacts__r.AWS_Data_Id__c}"
+                                        >
                                             <!-- <apex:outputfield value="{!or.address.Contacts__c}" id="{!or.address.Contacts__c}_{!or.address.Id}"/> -->
                                             <!-- <a href="#" id="{!or.address.Id}" onmouseover="showPIDiv('{!or.address.Id}')" onmouseout="hidePIDiv('{!or.address.Id}')"  aws-data-id="{!or.address.Contacts__r.AWS_Data_Id__c}">{!or.address.Contacts__r.Name}</a> -->
-                                            <a href="#" id="{!or.address.Id}" onmouseover="showPIDiv('{!or.address.Id}')" onmouseout="hidePIDiv('{!or.address.Id}')"  aws-data-id="{!or.address.AWS_Data_Id__c}">{!or.address.ContactName__c}</a>
+                                            <a
+                                                href="#"
+                                                id="{!or.address.Id}"
+                                                onmouseover="showPIDiv('{!or.address.Id}')"
+                                                onmouseout="hidePIDiv('{!or.address.Id}')"
+                                                aws-data-id="{!or.address.AWS_Data_Id__c}"
+                                                >{!or.address.ContactName__c}</a
+                                            >
                                         </td>
-                                        <td align="left" style="vertical-align: inherit;border-width: 0px 1px 1px 0px;">
-                                            <apex:outputText value="{!or.address.Telephone__c}" />
+                                        <td
+                                            align="left"
+                                            style="
+                                                vertical-align: inherit;
+                                                border-width: 0px 1px 1px 0px;
+                                            "
+                                        >
+                                            <apex:outputText
+                                                value="{!or.address.Telephone__c}"
+                                            />
                                         </td>
-                                        <td align="left" style="vertical-align: inherit;border-width: 0px 1px 1px 0px;">
-                                            <apex:outputText value="{!or.address.ZipCode__c}" />
+                                        <td
+                                            align="left"
+                                            style="
+                                                vertical-align: inherit;
+                                                border-width: 0px 1px 1px 0px;
+                                            "
+                                        >
+                                            <apex:outputText
+                                                value="{!or.address.ZipCode__c}"
+                                            />
                                         </td>
-                                        <td align="center" style="vertical-align: inherit;border-width: 0px 1px 1px 0px;">
-                                            <apex:outputfield value="{!or.address.Province__c}" />
+                                        <td
+                                            align="center"
+                                            style="
+                                                vertical-align: inherit;
+                                                border-width: 0px 1px 1px 0px;
+                                            "
+                                        >
+                                            <apex:outputfield
+                                                value="{!or.address.Province__c}"
+                                            />
                                         </td>
-                                        <td align="center" style="vertical-align: inherit;border-width: 0px 1px 1px 0px;">
-                                            <apex:outputfield value="{!or.address.City__c}" />
+                                        <td
+                                            align="center"
+                                            style="
+                                                vertical-align: inherit;
+                                                border-width: 0px 1px 1px 0px;
+                                            "
+                                        >
+                                            <apex:outputfield
+                                                value="{!or.address.City__c}"
+                                            />
                                         </td>
-                                        <td align="left" style="vertical-align: inherit;border-width: 0px 1px 1px 0px;">
-                                            <apex:outputText value="{!or.address.Detailed_Address__c}" />
+                                        <td
+                                            align="left"
+                                            style="
+                                                vertical-align: inherit;
+                                                border-width: 0px 1px 1px 0px;
+                                            "
+                                        >
+                                            <apex:outputText
+                                                value="{!or.address.Detailed_Address__c}"
+                                            />
                                         </td>
-                                        <td align="center" style="vertical-align: inherit;width:30px;">
-                                            <apex:commandButton value=" 缂栬緫 " onclick="onEditorJs('{!or.address.id}');return false;" style="background:#98c1fbf7;display:{!or.canEdit};"/>
+                                        <td
+                                            align="center"
+                                            style="
+                                                vertical-align: inherit;
+                                                width: 30px;
+                                            "
+                                        >
+                                            <apex:commandButton
+                                                value=" 缂栬緫 "
+                                                onclick="onEditorJs('{!or.address.id}');return false;"
+                                                style="background:#98c1fbf7;display:{!or.canEdit};"
+                                            />
                                         </td>
-                                        <td align="center" style="vertical-align: inherit;width:30px;">
-                                            <apex:commandButton value=" 澶嶅埗 " onclick="onCopyJs('{!or.address.id}');return false;" style="background: #98c1fbf7;display:{!or.canCopy};"/>
+                                        <td
+                                            align="center"
+                                            style="
+                                                vertical-align: inherit;
+                                                width: 30px;
+                                            "
+                                        >
+                                            <apex:commandButton
+                                                value=" 澶嶅埗 "
+                                                onclick="onCopyJs('{!or.address.id}');return false;"
+                                                style="background: #98c1fbf7;display:{!or.canCopy};"
+                                            />
                                         </td>
-                                        <td align="center" style="vertical-align: inherit;width:30px;">
-                                            <apex:commandButton value=" 閲囩敤 " onclick="onAdoptJs(event,JSON.parse('{!or.addressJson}'));return false;" style="background: #98c1fbf7;display:{!or.canAdopt};"/>
+                                        <td
+                                            align="center"
+                                            style="
+                                                vertical-align: inherit;
+                                                width: 30px;
+                                            "
+                                        >
+                                            <apex:commandButton
+                                                value=" 閲囩敤 "
+                                                onclick="onAdoptJs(event,JSON.parse('{!or.addressJson}'));return false;"
+                                                style="background: #98c1fbf7;display:{!or.canAdopt};"
+                                            />
                                         </td>
                                     </tr>
-                                    <apex:variable value="{!cnt + 1}" var="cnt" />
+                                    <apex:variable
+                                        value="{!cnt + 1}"
+                                        var="cnt"
+                                    />
                                 </apex:repeat>
                             </tbody>
                             <script>
-                                console.log('queryPI();')
+                                console.log('queryPI();');
                                 queryPI();
                             </script>
                         </table>
                     </apex:outputPanel>
                 </apex:pageblocksection>
             </apex:pageBlock>
-            
         </div>
         <div id="tab03">
             <apex:pageBlock id="oppBlock2" tabStyle="Report">
                 <!-- <apex:inputHidden id="LastName_Encrypted__c"         value="{!newCon.LastName_Encrypted__c}"/>
                 <apex:inputHidden id="Con_AWS_Data_Id__c"            value="{!newCon.AWS_Data_Id__c}"/> -->
-                <apex:inputHidden id="Add_AWS_Data_Id__c"            value="{!insUpdData.AWS_Data_Id__c}"/>
+                <apex:inputHidden
+                    id="Add_AWS_Data_Id__c"
+                    value="{!insUpdData.AWS_Data_Id__c}"
+                />
                 <!-- zhj 鏂版柟妗堟敼閫� 2022-12-05 start -->
                 <!-- <apex:inputHidden id="Telephone_Encrypted__c"        value="{!insUpdData.Telephone_Encrypted__c}"/>
                 <apex:inputHidden id="ContactName_Encrypted__c"        value="{!insUpdData.ContactName_Encrypted__c}"/>
                 <apex:inputHidden id="ZipCode_Encrypted__c"          value="{!insUpdData.ZipCode_Encrypted__c}"/>
                 <apex:inputHidden id="Detailed_Address_Encrypted__c" value="{!insUpdData.Detailed_Address_Encrypted__c}"/> -->
                 <!-- zhj 鏂版柟妗堟敼閫� 2022-12-05 end -->
-                <apex:pageblocksection title="缂栬緫鍦板潃" id="UpdAddressId" rendered="true" columns="3">
-                    <apex:inputfield value="{!insUpdData.Address_Classification__c}" id="Address_Classification__c"/>
-                    <apex:inputfield value="{!insUpdData.Customer__c}" id="Customer__r_Name" required="false" />
+                <apex:pageblocksection
+                    title="缂栬緫鍦板潃"
+                    id="UpdAddressId"
+                    rendered="true"
+                    columns="3"
+                >
+                    <apex:inputfield
+                        value="{!insUpdData.Address_Classification__c}"
+                        id="Address_Classification__c"
+                    />
+                    <apex:inputfield
+                        value="{!insUpdData.Customer__c}"
+                        id="Customer__r_Name"
+                        required="false"
+                    />
                     <!-- Before PIPL 20220308 -->
                     <!-- <apex:inputfield value="{!insUpdData.Contacts__c}" id="Contacts__c" required="false"/> -->
                     <!-- WLIG-CCX4BB 銆愬鎵樸�戜慨鐞嗙洿杩旀敹璐у湴鍧�鍔熻兘鏀归�� thh 20220513 start -->
@@ -1074,40 +1325,60 @@
                     <!-- <apex:inputText label="鑱旂郴浜�" disabled="true" value="{!contactNameValue}" id="Contacts__c">                       
                     </apex:inputText>
                     <apex:inputHidden id="contactIdValue" value="{!contactIdValue}"/> -->
-                    <apex:inputfield value="{!insUpdData.ContactName__c}" id="ContactName__c"/>
+                    <apex:inputfield
+                        value="{!insUpdData.ContactName__c}"
+                        id="ContactName__c"
+                    />
                     <!-- Add By Li Jun for PIPL 20220308 End -->
                     <!-- <apex:inputfield value="{!insUpdData.Create_Contacts__c}" id="Create_Contacts__c" required="false"/> -->
                     <!-- WLIG-CCX4BB 銆愬鎵樸�戜慨鐞嗙洿杩旀敹璐у湴鍧�鍔熻兘鏀归�� thh 20220513 end -->
-                    <apex:inputfield value="{!insUpdData.Province__c}" id="Province__r_Name" style="" />
-                    <apex:inputfield value="{!insUpdData.City__c}" id="City__r_name" />
-                    <apex:inputfield value="{!insUpdData.Telephone__c}" id="Telephone__c" />
-                    <apex:inputfield value="{!insUpdData.ZipCode__c}" id="ZipCode__c" />
+                    <apex:inputfield
+                        value="{!insUpdData.Province__c}"
+                        id="Province__r_Name"
+                        style=""
+                    />
+                    <apex:inputfield
+                        value="{!insUpdData.City__c}"
+                        id="City__r_name"
+                    />
+                    <apex:inputfield
+                        value="{!insUpdData.Telephone__c}"
+                        id="Telephone__c"
+                    />
+                    <apex:inputfield
+                        value="{!insUpdData.ZipCode__c}"
+                        id="ZipCode__c"
+                    />
                     <!-- <apex:pageblockSectionItem /> -->
                     <!-- <apex:inputTextarea value="{!insUpdData.Detailed_Address__c}" id="Detailed_Address__c" style="resize:vertical;width: 90%" rows="3" cols="3"/> -->
-                    <apex:inputfield value="{!insUpdData.Detailed_Address__c}" id="Detailed_Address__c" style="resize:vertical;width: 98%"/>
+                    <apex:inputfield
+                        value="{!insUpdData.Detailed_Address__c}"
+                        id="Detailed_Address__c"
+                        style="resize: vertical; width: 98%"
+                    />
 
                     <div id="errorMsg" class="errorMsg"></div>
                 </apex:pageblocksection>
 
-                <div style="text-align: center;">
-                    <apex:commandButton immediate="true" value="淇濆瓨" onclick="savaJs();" rerender="dummy"  />
+                <div style="text-align: center">
+                    <apex:commandButton
+                        immediate="true"
+                        value="淇濆瓨"
+                        onclick="savaJs();"
+                        rerender="dummy"
+                    />
                 </div>
                 <!-- <script>
                     replaceSearchContactLookup();
                 </script> -->
             </apex:pageBlock>
-        </div>        
-        
+        </div>
     </apex:form>
     <apex:outputPanel id="checEventFrame">
-      <script type="text/javascript">
-            
-        
+        <script type="text/javascript">
             j$("select option[value='鍔炰簨澶�']")[1].remove();
-            
+
             DecryptAddress();
-            
         </script>
     </apex:outputPanel>
-    
-</apex:page>
\ No newline at end of file
+</apex:page>

--
Gitblit v1.9.1