From db4e75dabb6c61be6c3a09e9f11707f6018c2ef2 Mon Sep 17 00:00:00 2001
From: Li Jun <buli@deloitte.com.cn>
Date: 星期日, 20 三月 2022 15:21:18 +0800
Subject: [PATCH] PIPLDeploy0320

---
 force-app/main/default/pages/NewRentalApply.page |   28 +++++++++++++---------------
 1 files changed, 13 insertions(+), 15 deletions(-)

diff --git a/force-app/main/default/pages/NewRentalApply.page b/force-app/main/default/pages/NewRentalApply.page
index 0ea7e9f..8b2c50f 100644
--- a/force-app/main/default/pages/NewRentalApply.page
+++ b/force-app/main/default/pages/NewRentalApply.page
@@ -2,7 +2,7 @@
   @description       : 
   @author            : ChangeMeIn@UserSettingsUnder.SFDoc
   @group             : 
-  @last modified on  : 03-17-2022
+  @last modified on  : 03-18-2022
   @last modified by  : ChangeMeIn@UserSettingsUnder.SFDoc
 -->
 <apex:page standardController="Rental_Apply__c" extensions="RentalApplyController" id="page">
@@ -251,22 +251,20 @@
             return template.content.firstChild;
         }
         function queryContactName() {
-            // let sfId = document.getElementById(document.querySelector("[data-id='Loaner_medical_Staff__c']").id + '_lkid').value;
+            function queryContactName() {
             let sfId = document.getElementById(document.querySelector("[data-id='Account__c']").id + '_lkid').value;
-            let contactsInfo = JSON.parse('{!contactsInfo}');
-            let dataId = contactsInfo[sfId];
-            let url = staticResourcesContact.queryUrl + '?dataId=' + dataId;
-            fetch(url, {
-                method: 'GET',
-                headers: {
-                    'Content-Type': 'application/json',
-                    'pi-token': staticResources.token
-                }
-            }).then((data) => {
-                return data.json();
-            }).then((result) => {
+            let dataId = '';
+            if ('{!contactsInfo}' != '') {
+                let contactsInfo = JSON.parse('{!contactsInfo}');
+                dataId = contactsInfo[sfId];
+            } else if ('{!AWSDataId}' != '') {
+                dataId = '{!AWSDataId}';
+            }
+            let queryBackContactName = function queryBackContactName(result){
                 document.querySelector("[data-id='Loaner_medical_Staff__c']").value = result.object.lastName;
-            })
+            };
+            AWSService.query(staticResourcesContact.queryUrl, dataId, queryBackContactName, staticResourcesContact.token);
+        }
         }
         //鑷畾涔塴ookup鏌ヨ
         function searchContact(contactNodeId){

--
Gitblit v1.9.1