From 1dc5060a88c703639d76847f12e5a4d56d4e142d Mon Sep 17 00:00:00 2001
From: 彭锟 <pengkun@prec-tech.com>
Date: 星期一, 21 三月 2022 18:11:41 +0800
Subject: [PATCH] LogAutoSendBatch修复

---
 force-app/main/default/pages/StraightBackAddress.page |   29 ++++++++++++++++++++++++-----
 1 files changed, 24 insertions(+), 5 deletions(-)

diff --git a/force-app/main/default/pages/StraightBackAddress.page b/force-app/main/default/pages/StraightBackAddress.page
index e62de6b..b7b6bd1 100644
--- a/force-app/main/default/pages/StraightBackAddress.page
+++ b/force-app/main/default/pages/StraightBackAddress.page
@@ -21,7 +21,7 @@
 
         //鏇挎崲vlookup
         var newSearchContactWindow = null;
-        window.onload = () => {
+        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';
@@ -81,7 +81,7 @@
             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 of divs[i].classList){
+                    for(let cls in divs[i].classList){
                         if (cls.indexOf('error')>-1) {
                             return true;
                         }
@@ -140,7 +140,10 @@
             }
             blockme();
             console.log('{!insUpdData}')
-            if(document.getElementById("allPage:allForm:oppBlock2:UpdAddressId:Create_Contacts__c").value){
+            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  璨╁2搴�
+                &&document.getElementById("allPage:allForm:oppBlock2:UpdAddressId:CustomerRecordType").value!='{!accAgencyContactTypeId}'){//璁板綍绫诲瀷id  缁忛攢鍟嗚仈绯讳汉
                 //new contact
                 ProcessPI({},GetEditObj('contact'),'contact',function(){
                     //new address
@@ -357,7 +360,12 @@
                 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);
+                        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 (){
@@ -452,9 +460,12 @@
             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){
@@ -522,6 +533,11 @@
             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">
@@ -542,6 +558,8 @@
             </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,insUpdDataStr" onComplete="decrypt();unblockUI();">
                 <apex:param name="UpdId" assignTo="{!UpdId}" value="" />
@@ -677,7 +695,7 @@
             <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.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 -->
@@ -704,6 +722,7 @@
                     <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;">

--
Gitblit v1.9.1