| | |
| | | function queryContactName() { |
| | | let sfId = document.getElementById(document.querySelector("[data-id='Contact_Name__c']").id + '_lkid').value; |
| | | let contactsInfo = JSON.parse('{!LookUpOverrideFieldsMapJson}'); |
| | | // if (contactsInfo == null){ |
| | | // contactsInfo = JSON.parse('{!urlCheckContactAWSid}'); |
| | | // } |
| | | let dataId = contactsInfo[sfId]; |
| | | // let dataId = JSON.parse('{!urlCheckContactAWSid}') |
| | | // if (dataId == '') { |
| | | // let contactsInfo = JSON.parse('{!LookUpOverrideFieldsMapJson}'); |
| | | // dataId = contactsInfo[sfId]; |
| | | // } |
| | | let queryContactBack = function(data){ |
| | | //To Do later |
| | | console.log('ContactData = ' + data.object); |
| | |
| | | // document.querySelector("[data-id='Lead_link__c']").value = result.object.lastName; |
| | | // }) |
| | | } |
| | | |
| | | </script> |
| | | <div class="bPageTitle"> |
| | | <div class="ptBody"> |
| | |
| | | je.css("background","unset"); |
| | | |
| | | let dataid = je.attr('data-id'); |
| | | if(['Hospital_Name__c','Department_Class__c','OwnerId'].indexOf(dataid) > -1) return; |
| | | if(['Hospital_Name__c','Hospital__c','OwnerId'].indexOf(dataid) > -1) return; |
| | | jQuery(e).children(":last-child").before('<img class="closeIcon" data-id="'+dataid+'" generate="" alt="Clear" src="/s.gif" style="display: inline-block;">'); |
| | | }) |
| | | |
| | |
| | | } |
| | | } |
| | | }); |
| | | |
| | | let eleHospitalName = document.querySelector("[data-id='Hospital_Name__c']"); |
| | | let vlook_HospitalName = document.getElementById(eleHospitalName.id + '_lkid'); |
| | | |
| | | // let eleInput = eleHospitalName.parentNode.childNodes[0]; |
| | | // let eleImg = eleHospitalName.parentNode.childNodes[1]; |
| | | // let eleBlank = eleHospitalName.parentNode.childNodes[2]; |
| | | |
| | | |
| | | if("\v"=="v"){//true为IE浏览器 |
| | | vlook_ele.attachEvent("onporpertychange",function(e){ |
| | | console.log("inputting!!"); |
| | | }); |
| | | }else{ |
| | | eleHospitalName.parentNode.addEventListener("click",function(e){ |
| | | console.log("inputting!!"); |
| | | var hospitalNameValue = vlook_HospitalName.value; |
| | | if (hospitalNameValue != "000000000000000" && hospitalNameValue != '') { |
| | | console.log("hospitalNameValue = " + hospitalNameValue); |
| | | |
| | | var ls = ['Department_Class__c','Hospital__c']; |
| | | setVlookup(ls,hospitalNameValue); |
| | | }else{ |
| | | clearVlookup('Department_Class__c'); |
| | | clearVlookup('Hospital__c'); |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | function setVlookup(lookups, lookup_id){ |
| | | let controllerSaveMethod = '{!$RemoteAction.NewAndEditInquiryFormController.queryAccount}'; |
| | | Visualforce.remoting.Manager.invokeAction( |
| | | controllerSaveMethod, |
| | | JSON.stringify(lookups), lookup_id, |
| | | function (result, event) { |
| | | console.log("result = " + result); |
| | | if (result != null ){ |
| | | var obj = JSON.parse(result.replaceAll('&'+'quot;','"')); |
| | | for (let i = 0; i < lookups.length; i++) { |
| | | let lookup = lookups[i]; |
| | | if (!obj[lookup]) { |
| | | continue; |
| | | } |
| | | let ele = document.querySelector("[data-id='"+lookup+"']"); |
| | | let elei1 = document.getElementById(ele.id + '_lkid'); |
| | | let elei2 = document.getElementById(ele.id + '_lkold'); |
| | | |
| | | ele.value=obj[lookup].Name; |
| | | elei1.value = obj[lookup].Id; |
| | | elei2.value = obj[lookup].Name; |
| | | |
| | | let inputele = document.querySelector("[data-id='"+lookup+"']").parentNode; |
| | | if (inputele.childNodes.length > 4){ |
| | | inputele.childNodes[0].style = ""; |
| | | inputele.childNodes[1].style = "display: inline-block;"; |
| | | inputele.childNodes[2].style = "display: none;"; |
| | | } |
| | | |
| | | } |
| | | } |
| | | }, |
| | | { escape: true } |
| | | ); |
| | | } |
| | | |
| | | function clearVlookup(lookup){ |
| | | let ele = document.querySelector("[data-id='"+lookup+"']"); |
| | | let elei1 = document.getElementById(ele.id + '_lkid'); |
| | | let elei2 = document.getElementById(ele.id + '_lkold'); |
| | | |
| | | ele.value=''; |
| | | elei1.value = ''; |
| | | elei2.value = ''; |
| | | |
| | | let inputele = document.querySelector("[data-id='"+lookup+"']").parentNode; |
| | | if (inputele.childNodes.length > 4){ |
| | | inputele.childNodes[0].style = "display: none;"; |
| | | inputele.childNodes[1].style = "display: none;"; |
| | | inputele.childNodes[2].style = ""; |
| | | } |
| | | } |
| | | </script> |
| | | <div class="pbBottomButtons"> |
| | | <table cellspacing="0" cellpadding="0" border="0"> |