| | |
| | | <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 = ''; |
| | |
| | | var addressAwsData = {}; |
| | | |
| | | var isBlocking = false; |
| | | |
| | | var contactNamePlaintext = ''; |
| | | var telePhonePlaintext = ''; |
| | | var zipCodePlaintext = ''; |
| | | var detailedAddressPlaintext = ''; |
| | | function b(){ |
| | | if (!isBlocking) { |
| | | blockme(); |
| | |
| | | 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)}; |
| | |
| | | let b2= false; |
| | | |
| | | let Foo = function(){ |
| | | if (b1 && b2 && !b) { |
| | | // if (b1 && b2 && !b) { |
| | | // window.location.reload(); |
| | | // } |
| | | if (b1 && !b) { |
| | | window.location.reload(); |
| | | } |
| | | } |
| | |
| | | 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(); |
| | | // } |
| | | |
| | | |
| | | } |
| | |
| | | //解密 |
| | | 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; |
| | |
| | | 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设置为true |
| | | // 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 |
| | | } |
| | |
| | | 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); |
| | |
| | | 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]; |
| | |
| | | } |
| | | 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, |
| | |
| | | } |
| | | //联系人 |
| | | 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; |
| | | } |
| | | |
| | | //客户 |
| | |
| | | } |
| | | |
| | | 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, |
| | |
| | | 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( |
| | |
| | | |
| | | //queryPI(); |
| | | function q1(){ |
| | | debugger |
| | | var index = 0; |
| | | var correct = 0; |
| | | var p = new Promise(function(resolve, reject){ |
| | |
| | | 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++){ |
| | |
| | | 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); |
| | | } |
| | |
| | | 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(); |
| | |
| | | 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); |
| | |
| | | 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'); |
| | |
| | | } |
| | | |
| | | //自定义lookup查询 |
| | | 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) { |
| | |
| | | <script type="text/javascript"> |
| | | |
| | | function DecryptAddress(){ |
| | | debugger |
| | | let arr1 = [];let a1=false; |
| | | let arr2 = [];let a2=false; |
| | | j$('td.oraddress').each(function(i,e){ |
| | |
| | | </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}" /> |
| | |
| | | </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" /> |
| | |
| | | <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> |
| | | |
| | |
| | | |
| | | |
| | | j$("select option[value='办事处']")[1].remove(); |
| | | |
| | | DecryptAddress(); |
| | | |
| | | </script> |