From 8bea49ffae069f49e30126975bbd299e4742ca5e Mon Sep 17 00:00:00 2001
From: buli <137736985@qq.com>
Date: 星期四, 14 四月 2022 15:28:03 +0800
Subject: [PATCH] stage trigger backup
---
force-app/main/default/pages/TSRepair.page | 146 +++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 142 insertions(+), 4 deletions(-)
diff --git a/force-app/main/default/pages/TSRepair.page b/force-app/main/default/pages/TSRepair.page
index 0c54e4a..82b343c 100644
--- a/force-app/main/default/pages/TSRepair.page
+++ b/force-app/main/default/pages/TSRepair.page
@@ -8,6 +8,7 @@
<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;
@@ -103,6 +104,11 @@
<!-- 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}';
@@ -344,16 +350,137 @@
}
+ //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){
+ closeField = field1;
+ closePhone = field2;
+ contactIdValue = field3;
+ let baseUrl = "/apex/SearchContactPage";
+ let suffixUrl = "?contactId="+contactNodeId;
+ 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;
+ }
+
+ var currentLastName = '';
+ var currentPhoneId = '';
+ function replaceSearchContactLookup() {
+ blockme();
+ 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<3;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\')" 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();">
<apex:param name="status" assignTo="{!status}" value="" />
</apex:actionFunction>
<!-- 鐜嬮箯浼� 鐐瑰嚮鎸夐挳鏇存柊鐘舵�佺粨鏉� -->
- <apex:actionFunction name="updateServiceCategory" action="{!updateServiceCategory}" rerender="Activities" onComplete="unblockUI();">
+ <apex:actionFunction name="updateServiceCategory" action="{!updateServiceCategory}" rerender="Activities" onComplete="replaceSearchContactLookup();unblockUI();">
<apex:param name="num" assignTo="{!num}" value="" />
</apex:actionFunction>
@@ -545,7 +672,13 @@
<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%"/></td>
+ <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>
<th style="text-align: center;">鑱旂郴鐢佃瘽</th>
<td align="left" ><apex:outputField value="{!repairInfo.ba.BusinessAPhone_F__c}"/></td>
</tr>
@@ -998,9 +1131,14 @@
<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();" 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:form>
</apex:page>
\ No newline at end of file
--
Gitblit v1.9.1