From fded535904cc3afbff02db835b9691728413f0d6 Mon Sep 17 00:00:00 2001
From: 涂煌豪 <tuhuanghao@prec-tech.com>
Date: 星期五, 08 四月 2022 15:49:55 +0800
Subject: [PATCH] 先款后修-服务合同报价页面修改
---
force-app/main/default/pages/NewAndEditQIS.page | 56 +++++++++++++++++++++++++++++++++++++++++++-------------
1 files changed, 43 insertions(+), 13 deletions(-)
diff --git a/force-app/main/default/pages/NewAndEditQIS.page b/force-app/main/default/pages/NewAndEditQIS.page
index 1f2a6ee..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");
+ }
+ }
}
}
}
@@ -557,7 +575,19 @@
if (!{!isNewMode}) {
blockme();
QuerySobjectFromAWS();
- }
+ }else{
+ let ot = jQuery('input[data-id="OwnerId"]');
+ let oi = document.getElementById(ot.attr("id")+'_lkid');
+ ot.val('{!CurrentUserName}');
+ ot.attr("readonly","");
+ ot.css("background","unset");
+ ot.css("border","0");
+ ot.css( "outline","0");
+ jQuery('a[data-id="OwnerId"]').remove();
+ if(oi){
+ oi.value = '{!CurrentUserId}'
+ }
+ }
});
</script>
<div class="pbBottomButtons">
--
Gitblit v1.9.1