From 6a471bc62a8567abd74dcef733fcddf9911b6a16 Mon Sep 17 00:00:00 2001 From: denny chen <chenbangcai@prec-tech.com> Date: 星期三, 29 三月 2023 15:47:48 +0800 Subject: [PATCH] Merge branch 'master' of http://47.92.229.245:8089/r/OlyMEBG --- force-app/main/default/pages/StraightBackAddress.page | 400 ++++++++++++++++++++++++++++++++------------------------- 1 files changed, 224 insertions(+), 176 deletions(-) diff --git a/force-app/main/default/pages/StraightBackAddress.page b/force-app/main/default/pages/StraightBackAddress.page index 64926a3..7c49578 100644 --- a/force-app/main/default/pages/StraightBackAddress.page +++ b/force-app/main/default/pages/StraightBackAddress.page @@ -11,7 +11,8 @@ <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/> <apex:includeScript value="{!URLFOR($Resource.CommonUtilJs)}"/> <apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }" /> - <apex:includeScript value="/soap/ajax/40.0/connection.js"/> + <apex:includeScript value="{!URLFOR($Resource.connection20)}"/> + <apex:includeScript value="{!URLFOR($Resource.apex20)}"/> <script type="text/javascript"> var checkedTrue; var tableDataStr = ''; @@ -31,6 +32,11 @@ var addressAwsData = {}; var isBlocking = false; + + var contactNamePlaintext = ''; + var telePhonePlaintext = ''; + var zipCodePlaintext = ''; + var detailedAddressPlaintext = ''; function b(){ if (!isBlocking) { blockme(); @@ -70,10 +76,12 @@ function Trans(){ let b = HasError(); if(b){ - //娓呯┖鐢佃瘽鍦板潃閭紪 - 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='' + //杩樺師鑱旂郴浜虹數璇濆湴鍧�閭紪 + 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)}; @@ -81,7 +89,10 @@ let b2= false; let Foo = function(){ - if (b1 && b2 && !b) { + // if (b1 && b2 && !b) { + // window.location.reload(); + // } + if (b1 && !b) { window.location.reload(); } } @@ -94,18 +105,19 @@ Foo(); }, staticResource.token); - 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(); - } + //涓嶄細鍐嶆柊寤鸿仈绯讳汉鏃犻渶纭浜嬪姟 + // 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(); + // } } @@ -138,13 +150,15 @@ //瑙e瘑 function decrypt(){ if(PIData[ObjIdDecrypt] == null){ - document.getElementById('allPage:allForm:oppBlock2:UpdAddressId:Contacts__c').value = ''; + // 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: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; @@ -164,45 +178,49 @@ console.log(JSON.stringify(leadPayloadList)); return JSON.stringify(leadPayloadList); } + //WLIG-CCX4BB 銆愬鎵樸�戜慨鐞嗙洿杩旀敹璐у湴鍧�鍔熻兘鏀归�� thh 20220513 start //淇濆瓨鏂规硶 function savaJs(){ //b(); - if(document.getElementById('allPage:allForm:oppBlock2:UpdAddressId:Create_Contacts__c').value != ''){ - isAddCon = true; - } + //涓嶄細鏂板缓鑱旂郴浜猴紝鎵�浠ヨ繖閲屼笉闇�瑕佸皢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:Contacts__c").value&&!document.getElementById("allPage:allForm:oppBlock2:UpdAddressId:Create_Contacts__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> '; + 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(); - }); - } + // 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 == 'contact'){ + // sr = staticResourceContact + // } if(type == 'address'){ sr = staticResource } @@ -211,9 +229,10 @@ url = sr.updateUrl }*/ AWSService.post(url, payloadForNewPI, function(result){ - if(type == 'contact'){ - con_aws_result = result - }if(type == 'address'){ + // if(type == 'contact'){ + // con_aws_result = result + // } + if(type == 'address'){ add_aws_result = result } SetEditObj(type); @@ -225,29 +244,32 @@ function SetEditObj(type){ let obj = GetAWSResultObj(type); if(obj){ - if(type=='contact'){ - document.getElementById("allPage:allForm:oppBlock2:UpdAddressId:Con_AWS_Data_Id__c").value = obj.dataId; - document.getElementById("allPage:allForm:oppBlock2:UpdAddressId:Create_Contacts__c").value = obj.lastName; - document.getElementById("allPage:allForm:oppBlock2:UpdAddressId:LastName_Encrypted__c").value = obj.lastNameEncrypt; - } + // 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:UpdAddressId:Add_AWS_Data_Id__c").value = obj.dataId; + 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:UpdAddressId:Telephone_Encrypted__c").value = obj.telephoneEncrypt; + //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:UpdAddressId:ZipCode_Encrypted__c").value = obj.zipCodeEncrypt; + //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:UpdAddressId:Detailed_Address_Encrypted__c").value = obj.detailedAddressEncrypt; + //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 == '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]; @@ -255,18 +277,24 @@ } return null; } + function GetEditObj(type){ - if(type=='contact'){ - //new contact - return JSON.stringify([{ - lastName : document.getElementById("allPage:allForm:oppBlock2:UpdAddressId:Create_Contacts__c").value, - dataId : document.getElementById("allPage:allForm:oppBlock2:UpdAddressId:Con_AWS_Data_Id__c").value, - }]); - } + // 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:UpdAddressId:Add_AWS_Data_Id__c").value, + 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, @@ -389,12 +417,17 @@ } //鑱旂郴浜� let contactsName = ''; - if(address.Contacts__c){ - contactsName = address.Contacts__r.Name; + // 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 (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; } //瀹㈡埛 @@ -407,6 +440,7 @@ 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; @@ -449,7 +483,7 @@ } let UpdateRepair = function(callback){ - AWSService.post(staticResourceRepair.updateUrl,[{ + AWSService.post(staticResourceRepair.updateUrl+'V2',[{ dataId:'{!pc.AWS_Data_Id__c}', addressContactsName:rc.address_Contacts_Name__c, addressContacts:rc.address_Contacts__c, @@ -460,15 +494,15 @@ 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; + //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; + //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; + //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; + //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; + //rc.Detailed_Address_Encrypt__c = data.object[0].detailedAddressEncrypt; //zhj 鏂版柟妗堟敼閫� 2022-12-29 //UpdateSobject(staticResourceRepair,rc,data.txId,callback); Visualforce.remoting.Manager.invokeAction( @@ -612,6 +646,7 @@ //queryPI(); function q1(){ + debugger var index = 0; var correct = 0; var p = new Promise(function(resolve, reject){ @@ -627,7 +662,8 @@ temp.telephone = result.object.telephone; temp.zipCode = result.object.zipCode; temp.detailedAddress = result.object.detailedAddress; - temp.awsDataId = awsDataId; + //temp.awsDataId = awsDataId; + temp.lastName = result.object.contactName; PIData[Id] = temp; }; for(var i=0;i<tableDataStr.length;i++){ @@ -636,7 +672,8 @@ AWSService.queryRepair(staticResource.queryUrl, tableDataStr[i].address.AWS_Data_Id__c, tableDataStr[i].address.Id, - tableDataStr[i].address.Contacts__r.AWS_Data_Id__c, + //tableDataStr[i].address.Contacts__r.AWS_Data_Id__c, + null, searchCallBack, staticResource.token); } @@ -653,45 +690,50 @@ 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); - }); + // 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(); @@ -734,7 +776,7 @@ createDiv.style.left=x; createDiv.style.top=y; createDiv.style.height='100px'; - createDiv.style.width='100px'; + createDiv.style.width='120px'; createDiv.style.background="#dddddd"; createDiv.style.position = "absolute"; parentNode.appendChild(createDiv); @@ -748,22 +790,22 @@ document.getElementById(awsDataId+'_PI').remove(); } - 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 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 htmlToElement(html) { var template = document.createElement('template'); @@ -773,27 +815,27 @@ } //鑷畾涔塴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 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) { @@ -811,6 +853,7 @@ <script type="text/javascript"> function DecryptAddress(){ + debugger let arr1 = [];let a1=false; let arr2 = [];let a2=false; j$('td.oraddress').each(function(i,e){ @@ -969,7 +1012,8 @@ </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}"> <!-- <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.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> </td> <td align="left" style="vertical-align: inherit;border-width: 0px 1px 1px 0px;"> <apex:outputText value="{!or.address.Telephone__c}" /> @@ -1011,18 +1055,29 @@ </div> <div id="tab03"> <apex:pageBlock id="oppBlock2" tabStyle="Report"> - <apex:pageblocksection title="缂栬緫鍦板潃" id="UpdAddressId" rendered="true" columns="4"> - <apex:inputfield value="{!insUpdData.Address_Classification__c}" id="Address_Classification__c" /> + <!-- <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}"/> + <!-- 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" /> <!-- Before PIPL 20220308 --> <!-- <apex:inputfield value="{!insUpdData.Contacts__c}" id="Contacts__c" required="false"/> --> + <!-- WLIG-CCX4BB 銆愬鎵樸�戜慨鐞嗙洿杩旀敹璐у湴鍧�鍔熻兘鏀归�� thh 20220513 start --> <!-- Add By Li Jun for PIPL 20220308 Start --> - <apex:inputText label="鑱旂郴浜�" disabled="true" value="{!contactNameValue}" id="Contacts__c"> + <!-- <apex:inputText label="鑱旂郴浜�" disabled="true" value="{!contactNameValue}" id="Contacts__c"> </apex:inputText> - <apex:inputHidden id="contactIdValue" value="{!contactIdValue}"/> - <!-- Add By Li Jun for PIPL 20220308 End --> - <apex:inputfield value="{!insUpdData.Create_Contacts__c}" id="Create_Contacts__c" required="false"/> - + <apex:inputHidden id="contactIdValue" value="{!contactIdValue}"/> --> + <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" /> @@ -1032,22 +1087,14 @@ <apex:inputfield value="{!insUpdData.Detailed_Address__c}" id="Detailed_Address__c" style="resize:vertical;width: 98%"/> <div id="errorMsg" class="errorMsg"></div> - - <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="Telephone_Encrypted__c" value="{!insUpdData.Telephone_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}"/> </apex:pageblocksection> <div style="text-align: center;"> <apex:commandButton immediate="true" value="淇濆瓨" onclick="savaJs();" rerender="dummy" /> </div> - <script> + <!-- <script> replaceSearchContactLookup(); - </script> + </script> --> </apex:pageBlock> </div> @@ -1057,6 +1104,7 @@ j$("select option[value='鍔炰簨澶�']")[1].remove(); + DecryptAddress(); </script> -- Gitblit v1.9.1