From af0cf4a4c55406b80584acfa0a126af7e826d124 Mon Sep 17 00:00:00 2001
From: 李彤 <litong@prec-tech.com>
Date: 星期六, 02 四月 2022 17:56:46 +0800
Subject: [PATCH] 目标录入相关判断修改_1
---
force-app/main/default/pages/NewOnCall.page | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++---------
1 files changed, 50 insertions(+), 9 deletions(-)
diff --git a/force-app/main/default/pages/NewOnCall.page b/force-app/main/default/pages/NewOnCall.page
index 6eac16b..73b64c5 100644
--- a/force-app/main/default/pages/NewOnCall.page
+++ b/force-app/main/default/pages/NewOnCall.page
@@ -2,7 +2,7 @@
@description :
@author : ChangeMeIn@UserSettingsUnder.SFDoc
@group :
- @last modified on : 03-17-2022
+ @last modified on : 03-24-2022
@last modified by : ChangeMeIn@UserSettingsUnder.SFDoc
-->
<apex:page standardController="On_Call__c" extensions="OnCallController" id="page">
@@ -201,7 +201,7 @@
//Alert Error Message
function alertErrorMessage(errorMsg) {
- let errorMsgNode = document.getElementById("page:form:msgContent");
+ let errorMsgNode = document.getElementById("page:form:block:msgContent");
errorMsg = '閿欒锛氭棤鏁堟暟鎹��' + '\n' + errorMsg;
errorMsgNode.innerText = errorMsg;
errorMsgNode.className = 'pbError';
@@ -210,7 +210,7 @@
//Hide Error Message
function hiddenErrorMsgNode() {
- let errorMsgNode = document.getElementById("page:form:msgContent");
+ let errorMsgNode = document.getElementById("page:form:block:msgContent");
errorMsgNode.innerText = '';
errorMsgNode.className = '';
}
@@ -236,11 +236,7 @@
<div class="ptBreadcrumb"></div>
</div>
<apex:form id="form">
- <!-- Error Msg-->
- <apex:outputPanel id="errorMsg">
- <apex:pageMessages id="msgContent" escape="false" />
- </apex:outputPanel>
- <apex:pageblock >
+ <apex:pageblock id="block" >
<div class="pbHeader">
<table cellspacing="0" cellpadding="0" border="0">
<tbody>
@@ -257,6 +253,12 @@
</tr>
</tbody>
</table>
+ </div>
+ <!-- Error Msg-->
+ <div style="text-align: center;">
+ <apex:outputPanel id="errorMsg">
+ <apex:pageMessages id="msgContent" escape="false" />
+ </apex:outputPanel>
</div>
<!-- Iterate the layoutSections, which is a list of sections -->
<apex:repeat value="{!layoutSections}" var="layoutSection">
@@ -281,7 +283,16 @@
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);
+ let e = document.querySelector("[data-id='"+layoutField.fieldAPI+"']");
+ e.disabled = !(layoutField.editableField);
+ if (!(layoutField.editableField)) {
+ if (e.getAttribute("multiple") && e.getAttribute("multiple") == 'multiple') {
+ e.parentNode.classList.add("disabledbutton");
+ }
+ if (e.tagName == 'DIV') {
+ e.classList.add("disabledbutton");
+ }
+ }
}
}
}
@@ -292,6 +303,36 @@
QueryOnCallFromAWS();
};
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