From 1b214a96d371ce90578fb7d6c14eecfcba5f87f0 Mon Sep 17 00:00:00 2001
From: 涂煌豪 <tuhuanghao@prec-tech.com>
Date: 星期一, 11 四月 2022 18:52:32 +0800
Subject: [PATCH] Sfdc2PoContactBatch修改
---
force-app/main/default/pages/NewConsumApplyEquipmentSetDetail.page | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 54 insertions(+), 3 deletions(-)
diff --git a/force-app/main/default/pages/NewConsumApplyEquipmentSetDetail.page b/force-app/main/default/pages/NewConsumApplyEquipmentSetDetail.page
index 044e42b..dbbb072 100644
--- a/force-app/main/default/pages/NewConsumApplyEquipmentSetDetail.page
+++ b/force-app/main/default/pages/NewConsumApplyEquipmentSetDetail.page
@@ -1,3 +1,10 @@
+<!--
+ @description :
+ @author : ChangeMeIn@UserSettingsUnder.SFDoc
+ @group :
+ @last modified on : 04-02-2022
+ @last modified by : ChangeMeIn@UserSettingsUnder.SFDoc
+-->
<apex:page standardController="Consum_Apply_Equipment_Set_Detail__c" extensions="NewConsumApplyEquipSetDetailController" id="page">
<apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }" />
<apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/>
@@ -48,7 +55,7 @@
console.log('Result from AWS' + JSON.stringify(r));
console.log('payloadJson=' + JSON.stringify(payloadJson));
payloadJson.Trial_User__c = r.object[0].trialUser;
- payloadJson.Trail_User_Encrypt__c = r.object[0].trialUserEncrypt;
+ payloadJson.Trial_User_Encrypt__c = r.object[0].trialUserEncrypt;
payloadJson.AWS_Data_Id__c = '{!AWSDataId}';
if (isNewMode) {
payloadJson.AWS_Data_Id__c = r.object[0].dataId;
@@ -97,8 +104,10 @@
console.log(nodelist[index].id.indexOf('lkwgt'));
if (nodelist[index].id.indexOf('lkwgt') == -1) {
let vlookUpNodeId = nodelist[index].id + '_lkid';
- let vlookUpNodeValue = document.getElementById(vlookUpNodeId).value;
- result[nodelist[index].getAttribute("data-id")] = vlookUpNodeValue;
+ if(document.getElementById(vlookUpNodeId)!=null){
+ let vlookUpNodeValue = document.getElementById(vlookUpNodeId).value;
+ result[nodelist[index].getAttribute("data-id")] = vlookUpNodeValue;
+ }
}
} else if (nodelist[index].type == 'checkbox') {
result[nodelist[index].getAttribute("data-id")] = nodelist[index].checked;
@@ -124,6 +133,7 @@
result[userVLookUpFields[i]] = userVlookUpNodeValue;
}
}
+ result.Consum_Apply_Equipment_Set__c = document.querySelector('[data-id=Consum_Apply_Equipment_Set__c]').textContent;
console.log(JSON.stringify(result));
return result;
}
@@ -270,6 +280,16 @@
<script>
//Append Page
sfdcPage.appendToOnloadQueue(function () {
+ var layoutSections = JSON.parse('{!layoutSectionsStr}');
+ for (let m = 0; m < layoutSections.length; m++) {
+ let layoutSection = layoutSections[m].layoutFields;
+ for (let n = 0; n < layoutSection.length; n++) {
+ let layoutField = layoutSection[n];
+ if (layoutField.fieldAPI != '' && document.querySelector("[data-id='"+layoutField.fieldAPI+"']") != null) {
+ document.querySelector("[data-id='"+layoutField.fieldAPI+"']").disabled = !(layoutField.editableField);
+ }
+ }
+ }
//2. Query AWS Data by dataId
console.log('Mode for consumApply Page:' + {!isNewMode});
if (!{!isNewMode}) {
@@ -277,6 +297,37 @@
QueryConsumApplyFromAWS();
};
document.querySelector("[data-id='OwnerId']").classList.add("disabledbutton");
+
+ jQuery(".lookupInput").each(function(i,e){
+ let je =jQuery(e).find('input');
+ je.attr("readonly","");
+ je.css("background","unset");
+
+ let dataid = je.attr('data-id');
+ if(['Hospital_Name__c','Department_Class__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;">');
+ })
+
+ jQuery(".lookupInput").on("mouseenter","img[generate]",function(e){
+ this.className = "closeIconOn";
+ });
+
+ jQuery(".lookupInput").on("mouseleave","img[generate]",function(e){
+ this.className = "closeIcon"
+ });
+
+ jQuery(".lookupInput").on("click","img[generate]",function(e){
+ let id = jQuery("input[data-id='"+jQuery(this).attr("data-id")+ "']").attr("id");
+ let input = document.getElementById(id);
+ if(input){
+ input.value = '';
+ let hidden = document.getElementById(id+'_lkid');
+ if(hidden){
+ hidden.value = '';
+ }
+ }
+ });
+
});
</script>
<div class="pbBottomButtons">
--
Gitblit v1.9.1