From 84b24801b8e0e071589ea57b29e64f73e13b1c0c Mon Sep 17 00:00:00 2001
From: 付煜 <fuyu3103346691@163.com>
Date: 星期一, 21 三月 2022 14:54:15 +0800
Subject: [PATCH] SWAG-CCEB67【委托】【重要】保有设备所属变更审批报错
---
force-app/main/default/pages/NewAndEditInquiryForm.page | 92 +++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 82 insertions(+), 10 deletions(-)
diff --git a/force-app/main/default/pages/NewAndEditInquiryForm.page b/force-app/main/default/pages/NewAndEditInquiryForm.page
index f505ce3..794606e 100644
--- a/force-app/main/default/pages/NewAndEditInquiryForm.page
+++ b/force-app/main/default/pages/NewAndEditInquiryForm.page
@@ -425,15 +425,7 @@
function queryContactName() {
let sfId = document.getElementById(document.querySelector("[data-id='Contact_Name__c']").id + '_lkid').value;
let contactsInfo = JSON.parse('{!LookUpOverrideFieldsMapJson}');
- // if (contactsInfo == null){
- // contactsInfo = JSON.parse('{!urlCheckContactAWSid}');
- // }
let dataId = contactsInfo[sfId];
- // let dataId = JSON.parse('{!urlCheckContactAWSid}')
- // if (dataId == '') {
- // let contactsInfo = JSON.parse('{!LookUpOverrideFieldsMapJson}');
- // dataId = contactsInfo[sfId];
- // }
let queryContactBack = function(data){
//To Do later
console.log('ContactData = ' + data.object);
@@ -518,7 +510,6 @@
// document.querySelector("[data-id='Lead_link__c']").value = result.object.lastName;
// })
}
-
</script>
<div class="bPageTitle">
<div class="ptBody">
@@ -630,7 +621,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;">');
})
@@ -653,7 +644,88 @@
}
}
});
+
+ let eleHospitalName = document.querySelector("[data-id='Hospital_Name__c']");
+ let vlook_HospitalName = document.getElementById(eleHospitalName.id + '_lkid');
+
+ // let eleInput = eleHospitalName.parentNode.childNodes[0];
+ // let eleImg = eleHospitalName.parentNode.childNodes[1];
+ // let eleBlank = eleHospitalName.parentNode.childNodes[2];
+
+
+ if("\v"=="v"){//true涓篒E娴忚鍣�
+ vlook_ele.attachEvent("onporpertychange",function(e){
+ console.log("inputting!!");
+ });
+ }else{
+ eleHospitalName.parentNode.addEventListener("click",function(e){
+ console.log("inputting!!");
+ var hospitalNameValue = vlook_HospitalName.value;
+ if (hospitalNameValue != "000000000000000" && hospitalNameValue != '') {
+ console.log("hospitalNameValue = " + hospitalNameValue);
+
+ var ls = ['Department_Class__c','Hospital__c'];
+ setVlookup(ls,hospitalNameValue);
+ }else{
+ clearVlookup('Department_Class__c');
+ clearVlookup('Hospital__c');
+ }
+ });
+ }
});
+
+ function setVlookup(lookups, lookup_id){
+ let controllerSaveMethod = '{!$RemoteAction.NewAndEditInquiryFormController.queryAccount}';
+ Visualforce.remoting.Manager.invokeAction(
+ controllerSaveMethod,
+ JSON.stringify(lookups), lookup_id,
+ function (result, event) {
+ console.log("result = " + result);
+ if (result != null ){
+ var obj = JSON.parse(result.replaceAll('&'+'quot;','"'));
+ for (let i = 0; i < lookups.length; i++) {
+ let lookup = lookups[i];
+ if (!obj[lookup]) {
+ continue;
+ }
+ let ele = document.querySelector("[data-id='"+lookup+"']");
+ let elei1 = document.getElementById(ele.id + '_lkid');
+ let elei2 = document.getElementById(ele.id + '_lkold');
+
+ ele.value=obj[lookup].Name;
+ elei1.value = obj[lookup].Id;
+ elei2.value = obj[lookup].Name;
+
+ let inputele = document.querySelector("[data-id='"+lookup+"']").parentNode;
+ if (inputele.childNodes.length > 4){
+ inputele.childNodes[0].style = "";
+ inputele.childNodes[1].style = "display: inline-block;";
+ inputele.childNodes[2].style = "display: none;";
+ }
+
+ }
+ }
+ },
+ { escape: true }
+ );
+ }
+
+ function clearVlookup(lookup){
+ let ele = document.querySelector("[data-id='"+lookup+"']");
+ let elei1 = document.getElementById(ele.id + '_lkid');
+ let elei2 = document.getElementById(ele.id + '_lkold');
+
+ ele.value='';
+ elei1.value = '';
+ elei2.value = '';
+
+ let inputele = document.querySelector("[data-id='"+lookup+"']").parentNode;
+ if (inputele.childNodes.length > 4){
+ inputele.childNodes[0].style = "display: none;";
+ inputele.childNodes[1].style = "display: none;";
+ inputele.childNodes[2].style = "";
+ }
+ }
</script>
<div class="pbBottomButtons">
<table cellspacing="0" cellpadding="0" border="0">
--
Gitblit v1.9.1