| | |
| | | <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="/soap/ajax/40.0/connection.js"/> |
| | | <script type="text/javascript"> |
| | | var checkedTrue; |
| | | window.onload = () => { |
| | | var tableDataStr = ''; |
| | | var staticResource = JSON.parse('{!staticResource}'); |
| | | var staticResourceContact = JSON.parse('{!staticResourceContact}'); |
| | | var PIData = {}; |
| | | var contactDataIds = []; |
| | | var ObjIdDecrypt = ''; |
| | | var closeField = ''; |
| | | var add_aws_result = ''; |
| | | var con_aws_result = ''; |
| | | var isAddCon = false; |
| | | var contactInfoStr = ''; |
| | | |
| | | //替换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:Telephone__c').value='' |
| | | document.getElementById('allPage:allForm:oppBlock2:UpdAddressId:ZipCode__c').value='' |
| | | document.getElementById('allPage:allForm:oppBlock2:UpdAddressId:Detailed_Address__c').value='' |
| | | } |
| | | AWSService.post(staticResource.transactionUrl, JSON.stringify({ |
| | | "txId":add_aws_result.txId, |
| | | "isSuccess":b ? 0 : 1 |
| | | }), function(result){ |
| | | if(isAddCon){ |
| | | AWSService.post(staticResourceContact.transactionUrl, JSON.stringify({ |
| | | "txId":con_aws_result.txId, |
| | | "isSuccess":b ? 0 : 1 |
| | | }), function(result){ |
| | | if(!b) |
| | | window.location.reload(); |
| | | }, staticResourceContact.token); |
| | | }else{ |
| | | if(!b) |
| | | window.location.reload(); |
| | | } |
| | | }, staticResource.token); |
| | | |
| | | } |
| | | |
| | | function HasError(){ |
| | | // if (IsAddmessage) { |
| | | // return true; |
| | | // } |
| | | let e = document.getElementById("allPage:allForm:message"); |
| | | if (!e) { |
| | | return false; |
| | | } |
| | | |
| | | 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; |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | return false; |
| | | } |
| | | //解密 |
| | | 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: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: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); |
| | | } |
| | | //保存方法 |
| | | function savaJs(){ |
| | | //blockme(); |
| | | if(document.getElementById('allPage:allForm:oppBlock2:UpdAddressId:Create_Contacts__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> '; |
| | | return; |
| | | } |
| | | blockme(); |
| | | save(); |
| | | console.log('{!insUpdData}') |
| | | if(document.getElementById("allPage:allForm:oppBlock2:UpdAddressId:Create_Contacts__c").value //【联系人(新建)】不为空 |
| | | &&document.getElementById("allPage:allForm:oppBlock2:UpdAddressId:CustomerRecordType").value!='{!accOfficeTypeId}'////记录类型id 办事处 |
| | | &&document.getElementById("allPage:allForm:oppBlock2:UpdAddressId:CustomerRecordType").value!='{!accAgencyTypeId}'//记录类型id 販売店 |
| | | &&document.getElementById("allPage:allForm:oppBlock2:UpdAddressId:CustomerRecordType").value!='{!accAgencyContactTypeId}'){//记录类型id 经销商联系人 |
| | | //new contact |
| | | ProcessPI({},GetEditObj('contact'),'contact',function(){ |
| | | //new address |
| | | ProcessPI({}, |
| | | GetEditObj('address'),'address',function(){ |
| | | save(); |
| | | }); |
| | | }); |
| | | }else{ |
| | | //new address |
| | | ProcessPI({},GetEditObj('address'),'address',function(){ |
| | | save(); |
| | | }); |
| | | } |
| | | } |
| | | |
| | | 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: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=='address'){ |
| | | document.getElementById("allPage:allForm:oppBlock2:UpdAddressId:Add_AWS_Data_Id__c").value = obj.dataId; |
| | | 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:UpdAddressId:ZipCode__c").value = obj.zipCode; |
| | | document.getElementById("allPage:allForm:oppBlock2:UpdAddressId:ZipCode_Encrypted__c").value = obj.zipCodeEncrypt; |
| | | 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; |
| | | } |
| | | } |
| | | |
| | | } |
| | | 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:Create_Contacts__c").value, |
| | | dataId : document.getElementById("allPage:allForm:oppBlock2:UpdAddressId:Con_AWS_Data_Id__c").value, |
| | | }]); |
| | | } |
| | | if(type == 'address'){ |
| | | //new address |
| | | return JSON.stringify([{ |
| | | dataId : document.getElementById("allPage:allForm:oppBlock2:UpdAddressId:Add_AWS_Data_Id__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, |
| | | }]); |
| | | } |
| | | |
| | | } |
| | | |
| | | //复选框选中触发事件 |
| | |
| | | } |
| | | function searchBtnJs(){ |
| | | blockme(); |
| | | searchBtn(); |
| | | var addressDataIds = ''; |
| | | //查询地址 |
| | | if(document.getElementById('allPage:allForm:searchBlock:txtAddressId').value != ''){ |
| | | //发送aws请求,然后再发送给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 + '\''; |
| | | } |
| | | addressDataIds = addressDataIds.substring(1); |
| | | resolve('success'); |
| | | } |
| | | }; |
| | | var addressName = document.getElementById('allPage:allForm:searchBlock:txtAddressId').value; |
| | | AWSService.queryAddress('https://sfpi-mebg-test.olympuschina.com/api/address/search',addressName.trim(),queryBack,staticResource.token); |
| | | }).then(function(data){ |
| | | console.log('data = '+data) |
| | | console.log('addressDataIds = '+addressDataIds) |
| | | searchBtn(addressDataIds); |
| | | }); |
| | | }else{ |
| | | searchBtn(addressDataIds); |
| | | } |
| | | } |
| | | //采用按钮 |
| | | function onAdoptJs(objId){ |
| | |
| | | function refreshJs(){ |
| | | window.location.reload(); |
| | | } |
| | | |
| | | //2022 02 28 张华建 display PI Data start |
| | | |
| | | //queryPI(); |
| | | function q1(){ |
| | | var index = 0; |
| | | var correct = 0; |
| | | var p = new Promise(function(resolve, reject){ |
| | | //查询地址的PI数据 |
| | | 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; |
| | | 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, |
| | | 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; |
| | | } |
| | | |
| | | 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); |
| | | }); |
| | | } |
| | | //查询敏感字段 |
| | | function queryPI(){ |
| | | //blockme(); |
| | | tableDataStr = JSON.parse(document.getElementById('allPage:allForm:tableValueFrontEnd').value); |
| | | PIData = {}; |
| | | contactDataIds = []; |
| | | console.log(tableDataStr) |
| | | q1().then(function(data){ |
| | | return q2(data); |
| | | }) |
| | | //unblockUI(); |
| | | } |
| | | |
| | | |
| | | 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='100px'; |
| | | 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 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'); |
| | | html = html.trim(); // Never return a text node of whitespace as the result |
| | | template.innerHTML = html; |
| | | return template.content.firstChild; |
| | | } |
| | | |
| | | //自定义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 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; |
| | | } |
| | | function queryRecordType(){ |
| | | if(document.getElementById('allPage:allForm:oppBlock2:UpdAddressId:Customer__r_Name').value){ |
| | | queryRecordType(); |
| | | } |
| | | } |
| | | //2022 02 28 张华建 display PI Data end |
| | | </script> |
| | | <apex:form id="allForm"> |
| | | <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="unblockUI();"></apex:actionFunction> |
| | | <!-- 检索数据查询方法 --> |
| | | <apex:actionFunction name="searchBtn" action="{!searchBtn}" rerender="oppBlock1,message,checEventFrame" onComplete="unblockUI();"></apex:actionFunction> |
| | | <apex:actionFunction name="searchBtn" action="{!searchBtn}" rerender="oppBlock1,message,checEventFrame,tableValueFrontEnd" onComplete="unblockUI();"> |
| | | <apex:param name="addressDataIds" assignTo="{!addressDataIds}" value=""></apex:param> |
| | | </apex:actionFunction> |
| | | <!-- 采用方法 --> |
| | | <apex:actionFunction name="adoptSave" action="{!adoptSave}" rerender="oppBlock2,message" onComplete="unblockUI();"> |
| | | <apex:param name="adoptId" assignTo="{!adoptId}" value="" /> |
| | | <apex:param name="isUpload" assignTo="{!isUpload}" value="" /> |
| | | </apex:actionFunction> |
| | | <!-- 保存和修改方法 --> |
| | | <apex:actionFunction name="save" action="{!save}" rerender="oppBlock2,message" onComplete="unblockUI();{!IF(isSearchBtn,'searchBtnJs()',false)}"></apex:actionFunction> |
| | | <apex:actionFunction name="save" action="{!save}" rerender="oppBlock2,message" onComplete="unblockUI();{!IF(isSearchBtn,'searchBtnJs()',false)};Trans()"></apex:actionFunction> |
| | | <!-- 查询客户记录类型方法 --> |
| | | <apex:actionFunction name="queryRecordType" action="{!queryRecordType}" rerender="oppBlock2,message" onComplete="unblockUI();"></apex:actionFunction> |
| | | <!-- 点击修改按钮获取修改数据方法 --> |
| | | <apex:actionFunction name="onEditor" action="{!onEditor}" rerender="oppBlock2,checEventFrame" onComplete="unblockUI();"> |
| | | <apex:actionFunction name="onEditor" action="{!onEditor}" rerender="oppBlock2,checEventFrame,insUpdDataStr" onComplete="decrypt();unblockUI();"> |
| | | <apex:param name="UpdId" assignTo="{!UpdId}" value="" /> |
| | | </apex:actionFunction> |
| | | <!-- 复制方法 --> |
| | | <apex:actionFunction name="onCopy" action="{!onCopy}" rerender="oppBlock2,checEventFrame" onComplete="unblockUI();"> |
| | | <apex:actionFunction name="onCopy" action="{!onCopy}" rerender="oppBlock2,checEventFrame," onComplete="decrypt();unblockUI();"> |
| | | <apex:param name="UpdId" assignTo="{!UpdId}" value="" /> |
| | | </apex:actionFunction> |
| | | <!-- 返回父页面 --> |
| | |
| | | </a> |
| | | </td> |
| | | <td style="width: 20%"> |
| | | <apex:commandButton onclick="searchBtnJs();return false;" rendered="true" value="检索" style="width:60px;"/> |
| | | <apex:commandButton onclick="searchBtnJs();return false;" rendered="true" value="检索" style="width:60px;" onComplete="unblockUI();"/> |
| | | |
| | | <!-- <apex:commandButton onclick="onAdoptJs();return false;" rendered="true" value="采用" style="width:60px;background:#98c1fbf7"/> |
| | | --> |
| | |
| | | <td align="left" style="vertical-align: inherit;border-width: 0px 1px 1px 0px;"> |
| | | <apex:outputfield value="{!or.address.Customer__c}" /> |
| | | </td> |
| | | <td align="left" style="vertical-align: inherit;border-width: 0px 1px 1px 0px;"> |
| | | <apex:outputfield value="{!or.address.Contacts__c}" /> |
| | | <td align="left" style="vertical-align: inherit;border-width: 0px 1px 1px 0px;" aws-data-id="{!or.address.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> |
| | | </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.Detailed_Address__c}" /> |
| | | </td> |
| | | <td align="center" style="vertical-align: inherit;width:30px;"> |
| | | <!-- <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> --> |
| | | <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> |
| | |
| | | <apex:variable value="{!cnt + 1}" var="cnt" /> |
| | | </apex:repeat> |
| | | </tbody> |
| | | <script> |
| | | console.log('queryPI();') |
| | | queryPI(); |
| | | </script> |
| | | </table> |
| | | </apex:outputPanel> |
| | | </apex:pageblocksection> |
| | | </apex:pageBlock> |
| | | |
| | | </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:inputfield value="{!insUpdData.Customer__c}" id="Customer__r_Name" required="false" /> |
| | | <apex:inputfield value="{!insUpdData.Contacts__c}" id="Contacts__c" required="false"/> |
| | | <apex:inputfield value="{!insUpdData.Customer__c}" id="Customer__r_Name" required="false" onchange="queryRecordType();" /> |
| | | <!-- Before PIPL 20220308 --> |
| | | <!-- <apex:inputfield value="{!insUpdData.Contacts__c}" id="Contacts__c" required="false"/> --> |
| | | <!-- Add By Li Jun for PIPL 20220308 Start --> |
| | | <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:inputfield value="{!insUpdData.Province__c}" id="Province__r_Name" style="" /> |
| | |
| | | <!-- <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%"/> |
| | | |
| | | <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:inputHidden id="CustomerRecordType" value="{!accRecordTypeId}"/> |
| | | </apex:pageblocksection> |
| | | |
| | | <div style="text-align: center;"> |
| | | <apex:commandButton value="保存" onclick="savaJs();return false;" rendered="true" /> |
| | | <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"> |