From 8ce78fa756a8c2af76d02858d09058beabe18161 Mon Sep 17 00:00:00 2001 From: Li Jun <buli@deloitte.com.cn> Date: 星期四, 17 三月 2022 22:07:16 +0800 Subject: [PATCH] PIPLFunctionDeployV4 --- force-app/main/default/pages/NewOnCall.page | 30 ++++++++++ force-app/main/default/pages/ViewRentalApplyDecrypt.page | 2 force-app/main/default/classes/NewAndEditLeadController.cls | 6 +- force-app/main/default/pages/NewRepair.page | 30 ++++++++++ force-app/main/default/pages/ViewDecryptConsumApply.page | 2 force-app/main/default/pages/NewConsumApply.page | 31 ++++++++++ force-app/main/default/pages/SearchVisitor.page | 2 force-app/main/default/pages/ViewEventDecryptInfo.page | 3 force-app/main/default/pages/NewConsumApplyEquipmentSetDetail.page | 31 ++++++++++ force-app/main/default/pages/ViewOnCallDecrypt.page | 2 force-app/main/default/pages/NewAndEditInquiryForm.page | 2 force-app/main/default/pages/ViewCaseDecryptInfo.page | 2 force-app/main/default/pages/NewRentalApply.page | 31 ++++++++++ 13 files changed, 164 insertions(+), 10 deletions(-) diff --git a/force-app/main/default/classes/NewAndEditLeadController.cls b/force-app/main/default/classes/NewAndEditLeadController.cls index e5f9865..aad9534 100644 --- a/force-app/main/default/classes/NewAndEditLeadController.cls +++ b/force-app/main/default/classes/NewAndEditLeadController.cls @@ -74,10 +74,10 @@ //鑱旂郴浜鸿繃鏉ョ殑鐐瑰嚮鏂板缓鎰忓悜 isQueryContact = '1'; String contactId = ApexPages.currentPage().getParameters().get('CF00N10000006ps6f_lkid'); - Lead leadData = [select Id,RecordTypeId,AWS_Data_Id__c,Contact_Name__r.Id,Contact_Name__r.AWS_Data_Id__c from Lead where id =:contactId]; + Contact contactTemp = [select Id,RecordTypeId,AWS_Data_Id__c from Contact where id =:contactId]; Map<String,String> sfIdToAWSIdMap = new Map<String,String>(); - if(leadData.Contact_Name__r.Id != null){ - sfIdToAWSIdMap.put(String.valueof(leadData.Contact_Name__r.Id).subString(0,15),leadData.Contact_Name__r.AWS_Data_Id__c); + if(contactTemp.Id != null){ + sfIdToAWSIdMap.put(String.valueof(contactTemp.Id).subString(0,15),contactTemp.AWS_Data_Id__c); } contactsInfo = JSON.serialize(sfIdToAWSIdMap); rtTypeId = ApexPages.currentPage().getParameters().get('RecordType'); diff --git a/force-app/main/default/pages/NewAndEditInquiryForm.page b/force-app/main/default/pages/NewAndEditInquiryForm.page index f505ce3..d4208cc 100644 --- a/force-app/main/default/pages/NewAndEditInquiryForm.page +++ b/force-app/main/default/pages/NewAndEditInquiryForm.page @@ -630,7 +630,7 @@ 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;">'); }) diff --git a/force-app/main/default/pages/NewConsumApply.page b/force-app/main/default/pages/NewConsumApply.page index 2f89fdf..74ff635 100644 --- a/force-app/main/default/pages/NewConsumApply.page +++ b/force-app/main/default/pages/NewConsumApply.page @@ -394,6 +394,37 @@ //Replace Vlookup Field replaceSearchContactLookup(); document.querySelector("[data-id='OwnerId']").classList.add("disabledbutton"); + + jQuery(".lookupInput").each(function(i,e){ + let je =jQuery(e).find('input'); + je.attr("readonly",""); + je.css("background","unset"); + + let dataid = je.attr('data-id'); + if(['Hospital_Name__c','Department_Class__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;">'); + }) + + jQuery(".lookupInput").on("mouseenter","img[generate]",function(e){ + this.className = "closeIconOn"; + }); + + jQuery(".lookupInput").on("mouseleave","img[generate]",function(e){ + this.className = "closeIcon" + }); + + jQuery(".lookupInput").on("click","img[generate]",function(e){ + let id = jQuery("input[data-id='"+jQuery(this).attr("data-id")+ "']").attr("id"); + let input = document.getElementById(id); + if(input){ + input.value = ''; + let hidden = document.getElementById(id+'_lkid'); + if(hidden){ + hidden.value = ''; + } + } + }); + }); </script> <div class="pbBottomButtons"> diff --git a/force-app/main/default/pages/NewConsumApplyEquipmentSetDetail.page b/force-app/main/default/pages/NewConsumApplyEquipmentSetDetail.page index 6f234b4..fd1e7f5 100644 --- a/force-app/main/default/pages/NewConsumApplyEquipmentSetDetail.page +++ b/force-app/main/default/pages/NewConsumApplyEquipmentSetDetail.page @@ -294,6 +294,37 @@ QueryConsumApplyFromAWS(); }; document.querySelector("[data-id='OwnerId']").classList.add("disabledbutton"); + + jQuery(".lookupInput").each(function(i,e){ + let je =jQuery(e).find('input'); + je.attr("readonly",""); + je.css("background","unset"); + + let dataid = je.attr('data-id'); + if(['Hospital_Name__c','Department_Class__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;">'); + }) + + jQuery(".lookupInput").on("mouseenter","img[generate]",function(e){ + this.className = "closeIconOn"; + }); + + jQuery(".lookupInput").on("mouseleave","img[generate]",function(e){ + this.className = "closeIcon" + }); + + jQuery(".lookupInput").on("click","img[generate]",function(e){ + let id = jQuery("input[data-id='"+jQuery(this).attr("data-id")+ "']").attr("id"); + let input = document.getElementById(id); + if(input){ + input.value = ''; + let hidden = document.getElementById(id+'_lkid'); + if(hidden){ + hidden.value = ''; + } + } + }); + }); </script> <div class="pbBottomButtons"> diff --git a/force-app/main/default/pages/NewOnCall.page b/force-app/main/default/pages/NewOnCall.page index 6eac16b..2af6cb8 100644 --- a/force-app/main/default/pages/NewOnCall.page +++ b/force-app/main/default/pages/NewOnCall.page @@ -292,6 +292,36 @@ QueryOnCallFromAWS(); }; document.querySelector("[data-id='OwnerId']").classList.add("disabledbutton"); + + jQuery(".lookupInput").each(function(i,e){ + let je =jQuery(e).find('input'); + je.attr("readonly",""); + je.css("background","unset"); + + let dataid = je.attr('data-id'); + if(['Hospital_Name__c','Department_Class__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;">'); + }) + + jQuery(".lookupInput").on("mouseenter","img[generate]",function(e){ + this.className = "closeIconOn"; + }); + + jQuery(".lookupInput").on("mouseleave","img[generate]",function(e){ + this.className = "closeIcon" + }); + + jQuery(".lookupInput").on("click","img[generate]",function(e){ + let id = jQuery("input[data-id='"+jQuery(this).attr("data-id")+ "']").attr("id"); + let input = document.getElementById(id); + if(input){ + input.value = ''; + let hidden = document.getElementById(id+'_lkid'); + if(hidden){ + hidden.value = ''; + } + } + }); }); </script> <div class="pbBottomButtons"> diff --git a/force-app/main/default/pages/NewRentalApply.page b/force-app/main/default/pages/NewRentalApply.page index a9ba68d..0ea7e9f 100644 --- a/force-app/main/default/pages/NewRentalApply.page +++ b/force-app/main/default/pages/NewRentalApply.page @@ -382,6 +382,37 @@ //Replace Vlookup Field replaceSearchContactLookup(); document.querySelector("[data-id='OwnerId']").classList.add("disabledbutton"); + + jQuery(".lookupInput").each(function(i,e){ + let je =jQuery(e).find('input'); + je.attr("readonly",""); + je.css("background","unset"); + + let dataid = je.attr('data-id'); + if(['Hospital_Name__c','Department_Class__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;">'); + }) + + jQuery(".lookupInput").on("mouseenter","img[generate]",function(e){ + this.className = "closeIconOn"; + }); + + jQuery(".lookupInput").on("mouseleave","img[generate]",function(e){ + this.className = "closeIcon" + }); + + jQuery(".lookupInput").on("click","img[generate]",function(e){ + let id = jQuery("input[data-id='"+jQuery(this).attr("data-id")+ "']").attr("id"); + let input = document.getElementById(id); + if(input){ + input.value = ''; + let hidden = document.getElementById(id+'_lkid'); + if(hidden){ + hidden.value = ''; + } + } + }); + }); </script> <div class="pbBottomButtons"> diff --git a/force-app/main/default/pages/NewRepair.page b/force-app/main/default/pages/NewRepair.page index eefaed7..e3f4b2a 100644 --- a/force-app/main/default/pages/NewRepair.page +++ b/force-app/main/default/pages/NewRepair.page @@ -321,6 +321,36 @@ QueryRepairFromAWS(); }; document.querySelector("[data-id='OwnerId']").classList.add("disabledbutton"); + + jQuery(".lookupInput").each(function(i,e){ + let je =jQuery(e).find('input'); + je.attr("readonly",""); + je.css("background","unset"); + + let dataid = je.attr('data-id'); + if(['Hospital_Name__c','Department_Class__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;">'); + }) + + jQuery(".lookupInput").on("mouseenter","img[generate]",function(e){ + this.className = "closeIconOn"; + }); + + jQuery(".lookupInput").on("mouseleave","img[generate]",function(e){ + this.className = "closeIcon" + }); + + jQuery(".lookupInput").on("click","img[generate]",function(e){ + let id = jQuery("input[data-id='"+jQuery(this).attr("data-id")+ "']").attr("id"); + let input = document.getElementById(id); + if(input){ + input.value = ''; + let hidden = document.getElementById(id+'_lkid'); + if(hidden){ + hidden.value = ''; + } + } + }); }); </script> <div class="pbBottomButtons"> diff --git a/force-app/main/default/pages/SearchVisitor.page b/force-app/main/default/pages/SearchVisitor.page index 4544db5..533f902 100644 --- a/force-app/main/default/pages/SearchVisitor.page +++ b/force-app/main/default/pages/SearchVisitor.page @@ -155,7 +155,7 @@ //2. inovke aws service let contactAwsIds = new Set(); for(var key in contactInfo){ - if(contactInfo[key].lastName.includes(searchByLastName)){ + if(contactInfo[key].lastName.indexOf(searchByLastName) != -1){ contactAwsIds.add(key); } } diff --git a/force-app/main/default/pages/ViewCaseDecryptInfo.page b/force-app/main/default/pages/ViewCaseDecryptInfo.page index edfac31..bdcb5fa 100644 --- a/force-app/main/default/pages/ViewCaseDecryptInfo.page +++ b/force-app/main/default/pages/ViewCaseDecryptInfo.page @@ -15,7 +15,7 @@ AWSService.query(staticResources.queryUrl, '{!AWSDataId}', queryBack, staticResources.token); } var queryBack = function queryBack(data) { - document.querySelector("[id='page:form:pageBlock:pageBlockSection:j_id1:0:j_id2']").innerHTML = data.object.cicTelephone; + document.querySelector("[id='page:form:pageBlock:pageBlockSection:j_id2:0:j_id3']").innerHTML = data.object.cicTelephone; document.querySelector("[data-id='CASE_CUSTOMER__c']").innerHTML = data.object.caseCustomer; document.querySelector("[data-id='Customer_manual__c']").innerHTML = data.object.customerManual; diff --git a/force-app/main/default/pages/ViewDecryptConsumApply.page b/force-app/main/default/pages/ViewDecryptConsumApply.page index 951d945..1e8b19c 100644 --- a/force-app/main/default/pages/ViewDecryptConsumApply.page +++ b/force-app/main/default/pages/ViewDecryptConsumApply.page @@ -22,7 +22,7 @@ AWSService.query(staticResources.queryUrl, '{!AWSDataId}', queryBack, staticResources.token); } var queryBack = function queryBack(data) { - document.querySelector("[id='page:form:pageBlock:pageBlockSection:j_id2:1:j_id3']").innerHTML = data.object.phoneNumber; + document.querySelector("[id='page:form:pageBlock:pageBlockSection:j_id2:0:j_id3']").innerHTML = data.object.phoneNumber; document.querySelector("[data-id='direct_shippment_address__c']").innerHTML = data.object.directShippmentAddress; }; sfdcPage.appendToOnloadQueue(function () { diff --git a/force-app/main/default/pages/ViewEventDecryptInfo.page b/force-app/main/default/pages/ViewEventDecryptInfo.page index 043e210..b2b5c2c 100644 --- a/force-app/main/default/pages/ViewEventDecryptInfo.page +++ b/force-app/main/default/pages/ViewEventDecryptInfo.page @@ -1,6 +1,7 @@ <apex:page standardController="Event" extensions="NewAndEditEventController" id="page"> <apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }"/> - <script src="../../soap/ajax/53.0/connection.js" type="text/javascript"></script> + <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/> + <!-- <script src="../../soap/ajax/53.0/connection.js" type="text/javascript"></script> --> <apex:form id="form"> <apex:pageblock id="pageBlock"> <apex:pageBlockSection showHeader="false" title="" collapsible="true" columns="2" id="pageBlockSection"> diff --git a/force-app/main/default/pages/ViewOnCallDecrypt.page b/force-app/main/default/pages/ViewOnCallDecrypt.page index 2ddae3a..77b9a62 100644 --- a/force-app/main/default/pages/ViewOnCallDecrypt.page +++ b/force-app/main/default/pages/ViewOnCallDecrypt.page @@ -22,7 +22,7 @@ AWSService.query(staticResources.queryUrl, '{!AWSDataId}', queryBack, staticResources.token); } var queryBack = function queryBack(data) { - document.querySelector("[id='page:form:pageBlock:pageBlockSection:j_id2:1:j_id3']").innerHTML = data.object.callerPhone; + document.querySelector("[id='page:form:pageBlock:pageBlockSection:j_id2:0:j_id3']").innerHTML = data.object.callerPhone; document.querySelector("[data-id='Responsible_Person_HP__c']").innerHTML = data.object.responsiblePersonHP; }; sfdcPage.appendToOnloadQueue(function () { diff --git a/force-app/main/default/pages/ViewRentalApplyDecrypt.page b/force-app/main/default/pages/ViewRentalApplyDecrypt.page index 128290d..bbb06d8 100644 --- a/force-app/main/default/pages/ViewRentalApplyDecrypt.page +++ b/force-app/main/default/pages/ViewRentalApplyDecrypt.page @@ -22,7 +22,7 @@ AWSService.query(staticResources.queryUrl, '{!AWSDataId}', queryBack, staticResources.token); } var queryBack = function queryBack(data) { - document.querySelector("[id='page:form:pageBlock:pageBlockSection:j_id1:0:j_id2']").innerHTML = data.object.phoneNumber; + document.querySelector("[id='page:form:pageBlock:pageBlockSection:j_id2:1:j_id3']").innerHTML = data.object.phoneNumber; document.querySelector("[data-id='direct_shippment_address__c']").innerHTML = data.object.directShippmentAddress; }; sfdcPage.appendToOnloadQueue(function () { -- Gitblit v1.9.1