From 2f4492ee18f90274582fcc2bb06f5e9bf64136e8 Mon Sep 17 00:00:00 2001 From: buli <137736985@qq.com> Date: 星期五, 13 五月 2022 17:32:14 +0800 Subject: [PATCH] ProdBackup0513 --- force-app/main/default/pages/TSRepair.page | 160 ++--------------------------------------------------- 1 files changed, 6 insertions(+), 154 deletions(-) diff --git a/force-app/main/default/pages/TSRepair.page b/force-app/main/default/pages/TSRepair.page index 6c2bf36..0c54e4a 100644 --- a/force-app/main/default/pages/TSRepair.page +++ b/force-app/main/default/pages/TSRepair.page @@ -8,7 +8,6 @@ <apex:includeScript value="{!URLFOR($Resource.jquerysuggestjs)}"/> <apex:includeScript value="{!URLFOR($Resource.connection20)}"/> <apex:includeScript value="{!URLFOR($Resource.apex20)}"/> - <apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }" /> <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no"/> <style type="text/css"> /*.sfdcBody {position: absolute; @@ -104,11 +103,6 @@ <!-- JS 鏂规硶 --> <script> var j$ = jQuery.noConflict(); - var closeField = ''; - var closePhone = ''; - var newSearchContactWindow = null; - var staticResourceContact = JSON.parse('{!staticResourceContact}') - j$(document).ready(function() { var status = '{!tsr.TSReportStatus__c}'; @@ -350,144 +344,16 @@ } - //20220310 zhj PIPL start - function isError(){ - let h = HasError() - if(h){ - unblockUI(); - } - } - 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 of divs[i].classList){ - if (cls.indexOf('error')>-1) { - return true; - } - } - - } - - } - return false; - } - - function alertErrorMessage(errorMsg) { - let errorMsgNode = document.getElementById("allPage:allForm:message"); - errorMsgNode.innerText = errorMsg; - errorMsgNode.className = 'pbError'; - } - - 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; - } - - var contactIdValue = ''; - function searchContact(contactNodeId,field1,field2,field3,accountValueId){ - closeField = field1; - closePhone = field2; - contactIdValue = field3; - var accountValueLkid = document.getElementById(accountValueId+'_lkid').value; - var searchContactKeyWord = document.getElementById(field1).value; - if (accountValueLkid != '000000000000000') { - let baseUrl = "/apex/SearchContactPage"; - let suffixUrl = "?contactId="+contactNodeId+ "&accountId=" + accountValueLkid; - 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 { - alert('璇峰厛閫夋嫨瀹㈡埛鍗曚綅'); - } - } - - var currentLastName = ''; - var currentPhoneId = ''; - function replaceSearchContactLookup() { - blockme(); - var RepairInfoListStr = JSON.parse('{!RepairInfoListStr}'); - sforce.connection.sessionId = '{!GETSESSIONID()}'; - let queryContactBack = function(data,number){ - document.getElementById(currentLastName).value = data.object.lastName; - document.getElementById(currentPhoneId).innerText = data.object.phone; - number++; - if(document.getElementById('allPage:allForm:RepairInfoList:'+number+':contactIdValue') != null && document.getElementById('allPage:allForm:RepairInfoList:'+number+':contactIdValue').value != ''){ - currentLastName = 'allPage:allForm:RepairInfoList:'+number+':Contacts__c'; - currentPhoneId = 'allPage:allForm:RepairInfoList:'+number+':j_id91'; - let sfId = document.getElementById('allPage:allForm:RepairInfoList:'+number+':contactIdValue').value; - var queryStr = 'Select Id, AWS_Data_Id__c' - +' from Contact where id = \'' - + sfId +'\' '; - var reports = sforce.connection.query(queryStr); - var records = reports.getArray("records"); - var awsDataId = records[0].AWS_Data_Id__c; - AWSService.queryTSRepair(staticResourceContact.queryUrl, awsDataId, queryContactBack, staticResourceContact.token,number); - } - } - for(var i = 0;i<RepairInfoListStr.length;i++){ - let contactHtmlString = '<img src="/img/s.gif" onclick="searchContact(\'allPage:allForm:contactId\',\'allPage:allForm:RepairInfoList:'+i+':Contacts__c\',\'allPage:allForm:RepairInfoList:'+i+':j_id91\',\'allPage:allForm:RepairInfoList:'+i+':contactIdValue\',\'allPage:allForm:RepairInfoList:'+i+':BusinessACustomerUnit\')" 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:RepairInfoList:'+i+':contactIdValue').parentNode; - parentNode.appendChild(lookUpNode); - } - if(document.getElementById('allPage:allForm:RepairInfoList:0:contactIdValue').value != ''){ - currentLastName = 'allPage:allForm:RepairInfoList:0:Contacts__c'; - currentPhoneId = 'allPage:allForm:RepairInfoList:0:j_id91'; - //瑙e瘑 - let sfId = document.getElementById('allPage:allForm:RepairInfoList:0:contactIdValue').value; - var queryStr = 'Select Id, AWS_Data_Id__c' - +' from Contact where id = \'' - + sfId +'\' '; - var reports = sforce.connection.query(queryStr); - var records = reports.getArray("records"); - var awsDataId = records[0].AWS_Data_Id__c; - AWSService.queryTSRepair(staticResourceContact.queryUrl, awsDataId, queryContactBack, staticResourceContact.token,0); - } - unblockUI(); - } - - - function closePopupWindow() { - console.log('closePopupWindow()') - if (null != newSearchContactWindow) { - newSearchContactWindow.close(); - } - let contactInfoStr = document.getElementById('allPage:allForm:contactId').value; - console.log('closePopup:'+contactInfoStr); - let contactInfo = JSON.parse(contactInfoStr); - - document.getElementById(contactIdValue).value = contactInfo.ContactId; - document.getElementById(''+closeField).value = contactInfo.Name; - document.getElementById(''+closePhone).value = contactInfo.Phone; - document.getElementById(''+closePhone).innerText = contactInfo.Phone; - } - //20220310 zhj PIPL end </script> <apex:form id="allForm"> - <apex:inputHidden value="{!contactId}" id="contactId"/> <!-- 鐜嬮箯浼� 鐐瑰嚮鎸夐挳鏇存柊鐘舵�佸紑濮� --> - <apex:actionFunction name="setStatus" action="{!setStatus}" reRender="Activities,message,Activities1" oncomplete="unblockUI();replaceSearchContactLookup();"> + <apex:actionFunction name="setStatus" action="{!setStatus}" reRender="Activities,message,Activities1" oncomplete="unblockUI();"> <apex:param name="status" assignTo="{!status}" value="" /> </apex:actionFunction> <!-- 鐜嬮箯浼� 鐐瑰嚮鎸夐挳鏇存柊鐘舵�佺粨鏉� --> - <apex:actionFunction name="updateServiceCategory" action="{!updateServiceCategory}" rerender="Activities" onComplete="replaceSearchContactLookup();unblockUI();"> + <apex:actionFunction name="updateServiceCategory" action="{!updateServiceCategory}" rerender="Activities" onComplete="unblockUI();"> <apex:param name="num" assignTo="{!num}" value="" /> </apex:actionFunction> @@ -679,13 +545,7 @@ <apex:inputField id="BusinessACustomerUnit" value="{!repairInfo.ba.BusinessAAccount__c}" /> </td> <th style="text-align: center;">鑱旂郴浜�</th> - <td align="left" > - <!-- <apex:inputField value="{!repairInfo.ba.BusinessAContact__c}" style="width: 80%"/> --> - <!-- Add By zhj for PIPL 20220309 Start --> - <apex:inputText value="{!contactNameValue}" id="Contacts__c" style="width: 80%"/> - <apex:inputHidden id="contactIdValue" value="{!repairInfo.ba.BusinessAContact__c}"/> - <!-- Add By zhj for PIPL 20220309 end --> - </td> + <td align="left" ><apex:inputField value="{!repairInfo.ba.BusinessAContact__c}" style="width: 80%"/></td> <th style="text-align: center;">鑱旂郴鐢佃瘽</th> <td align="left" ><apex:outputField value="{!repairInfo.ba.BusinessAPhone_F__c}"/></td> </tr> @@ -953,10 +813,7 @@ <th style="text-align: center;" >瀹㈡埛鍗曚綅</th> <td style="text-align: left;"><apex:outputField value="{!repairInfo.ba.BusinessAAccount__c}" style="width: 80%"/></td> <th style="text-align: center;">鑱旂郴浜�</th> - <td align="left" > - <apex:outputField value="{!repairInfo.ba.BusinessAContact__c}" style="width: 80%"/> - <apex:inputHidden id="contactIdValue" value="{!repairInfo.ba.BusinessAContact__c}"/> - </td> + <td align="left" ><apex:outputField value="{!repairInfo.ba.BusinessAContact__c}" style="width: 80%"/></td> <th style="text-align: center;">鑱旂郴鐢佃瘽</th> <td align="left" ><apex:outputField value="{!repairInfo.ba.BusinessAPhone_F__c}"/></td> </tr> @@ -1141,14 +998,9 @@ <br/> <br/> </apex:repeat> + </apex:outputPanel> - <script> - console.log('appendToOnloadQueue') - sfdcPage.appendToOnloadQueue(function () { - replaceSearchContactLookup(); - }); - </script> <apex:commandButton id="test" onclick="blockme();" action="{!addBusinessActivity}" reRender="Activities" value="娣诲姞涓氬姟娲诲姩" oncomplete="unblockUI();" disabled="{!If(tsr.TSReportStatus__c = '鐢宠涓�' || tsr.TSReportStatus__c = '纭' ,true , If((tsr.TSReportStatus__c = '鑽夋涓�' || tsr.TSReportStatus__c = '椹冲洖') && onclickType != '0',true,false))}"></apex:commandButton> - <apex:commandButton id="save" onclick="blockme();" action="{!save}" reRender="message,allPanel,allForm" value="淇濆瓨" style="width: 70px;" oncomplete="unblockUI();isError();" disabled="{!If(tsr.TSReportStatus__c = '鐢宠涓�' || tsr.TSReportStatus__c = '纭',true , If((tsr.TSReportStatus__c = '鑽夋涓�' || tsr.TSReportStatus__c = '椹冲洖') && onclickType != '0',true,false))}"></apex:commandButton> + <apex:commandButton id="save" onclick="blockme();" action="{!save}" reRender="message,allPanel,allForm" value="淇濆瓨" style="width: 70px;" oncomplete="unblockUI();" disabled="{!If(tsr.TSReportStatus__c = '鐢宠涓�' || tsr.TSReportStatus__c = '纭',true , If((tsr.TSReportStatus__c = '鑽夋涓�' || tsr.TSReportStatus__c = '椹冲洖') && onclickType != '0',true,false))}"></apex:commandButton> </apex:form> </apex:page> \ No newline at end of file -- Gitblit v1.9.1