From 31cdc8c58cbdb9c4a54086be8d781af40dc4df7f Mon Sep 17 00:00:00 2001
From: Li Jun <buli@deloitte.com.cn>
Date: 星期五, 08 四月 2022 23:01:33 +0800
Subject: [PATCH] Fix Weekly Report0408
---
force-app/main/default/pages/NewAndEditQIS.page | 42 ++++++++++++++++++++++++++++++------------
1 files changed, 30 insertions(+), 12 deletions(-)
diff --git a/force-app/main/default/pages/NewAndEditQIS.page b/force-app/main/default/pages/NewAndEditQIS.page
index 05bef34..b27fcc6 100644
--- a/force-app/main/default/pages/NewAndEditQIS.page
+++ b/force-app/main/default/pages/NewAndEditQIS.page
@@ -4,8 +4,13 @@
<apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/>
<apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/>
<apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/>
+ <style>
+ .disabledbutton {
+ pointer-events: none;
+ opacity: 0.4;
+ }
+ </style>
<script>
-
var config = {};
config = {
SobjectName : "{!SobjectName}",
@@ -126,7 +131,7 @@
function ProcessPI(sobjJson, payloadForNewPI) {
blockme();
if ({!isNewMode}) {
- NewPIToAWS(sobjJson, payloadForNewPI)
+ NewPIToAWS(sobjJson, payloadForNewPI)
}else {
UpdatePIToAWS(sobjJson, payloadForNewPI)
}
@@ -154,8 +159,8 @@
}
return ['input','select','textarea'].indexOf(tag_name.toLowerCase())>-1;
}
-
- function IsFormElement(e){
+
+ function IsFormElement(e){
return IsFormTag(e.tagName);
}
@@ -166,17 +171,17 @@
function validateFieldValueFormate() {
let error_msg = '';
//let textEmail = "[data-id='Email']";
- let textPhone = "[data-id='Caller_phone__c']";
+ //let textPhone = "[data-id='Caller_phone__c']";
//Email
// let email = document.querySelector(textEmail);
// if(email && !/^[\w-]{3,12}@[\da-zA-Z]{2,16}\.[a-zA-Z]+$/.test(email.value)){
// error_msg += ';閭欢鏍煎紡閿欒';
// }
- let phone = document.querySelector(textPhone);
+ //let phone = document.querySelector(textPhone);
- if(phone && !/^1[3|5|8|7][0-9]\d{4,8}$/.test(phone.value)){
- error_msg += ';鑱旂郴鐢佃瘽鏍煎紡閿欒';
- }
+ //if(phone && !/^1[3|5|8|7][0-9]\d{4,8}$/.test(phone.value)){
+ // error_msg += ';鑱旂郴鐢佃瘽鏍煎紡閿欒';
+ //}
let es = document.getElementsByTagName('select')
for(let ei in es){
@@ -238,11 +243,15 @@
result[field_api_name] = targets;
} else {
result[field_api_name] = ele.value;
+ //鍏抽棴QIS鐞嗙敱涓烘棤鏃�
+ if(field_api_name == 'Cancel_QIS_Reason__c' && ele.value == '_\x01_'){
+ result[field_api_name] = '';
+ }
}
// let e1 = document.getElementById(api_id_map[field_api_name]);
// if(!result[field_api_name] && e1 && e1.value){
- // result[field_api_name] = e1.value;
+ // result[field_api_name] = e1.value;
// }
}
//璧嬪�煎瘜鏂囨湰鍖哄煙
@@ -531,7 +540,7 @@
var api_id_map={};
for(let ei in init_nodes){
let e = init_nodes[ei];
- if(IsFormElement(e)){
+ if(IsFormElement(e)){
if(e.getAttribute("multiple") != 'multiple' || e.style.display == 'none' && e.id.indexOf('selected') < 0){
api_id_map[GetEleApiName(e)] = e.id;
}
@@ -546,7 +555,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");
+ }
+ }
}
}
}
--
Gitblit v1.9.1