From 7a6bde159e19c304b3a512ed21171b7ce09055d9 Mon Sep 17 00:00:00 2001
From: 涂煌豪 <tuhuanghao@prec-tech.com>
Date: 星期四, 24 三月 2022 17:50:20 +0800
Subject: [PATCH] 【委托】【优先】用户中的课的信息与人事信息通过规则修改
---
force-app/main/default/pages/NewAndEditRepairSubOrder.page | 53 ++++++++++++++++++++++++++++++++++++++++-------------
1 files changed, 40 insertions(+), 13 deletions(-)
diff --git a/force-app/main/default/pages/NewAndEditRepairSubOrder.page b/force-app/main/default/pages/NewAndEditRepairSubOrder.page
index 7c931e4..cd7ff61 100644
--- a/force-app/main/default/pages/NewAndEditRepairSubOrder.page
+++ b/force-app/main/default/pages/NewAndEditRepairSubOrder.page
@@ -2,7 +2,7 @@
@description :
@author : ChangeMeIn@UserSettingsUnder.SFDoc
@group :
- @last modified on : 03-17-2022
+ @last modified on : 03-23-2022
@last modified by : ChangeMeIn@UserSettingsUnder.SFDoc
-->
<apex:page standardController="RepairSubOrder__c" extensions="NewAndEditRepairSubOrderController" id="page">
@@ -168,11 +168,14 @@
}
function IsFormTag(tag_name){
+ if (!tag_name) {
+ return false;
+ }
return ['input','select','textarea'].indexOf(tag_name.toLowerCase())>-1;
}
- function IsFormElement(tag_name){
- return ['input','select','textarea'].indexOf(tag_name)>-1;
+ function IsFormElement(e){
+ return IsFormTag(e.tagName);
}
function getPIPayload(sobjJson) {
@@ -225,11 +228,12 @@
let nodelist = document.getElementsByClassName(config.ApiPrefix);
let result = {}
- for (let index = 0; index < nodelist.length; index++) {
- let ele = nodelist[index];
- let field_api_name = GetEleApiName(ele);
+ for (let index in api_id_map) {
+ let ele = document.getElementById(api_id_map[index]);
+
+ let field_api_name = index;
let tag_name = ele.tagName.toLowerCase();
- if(!IsFormElement(tag_name)){
+ if(!IsFormTag(tag_name)){
console.log('tag_name='+tag_name+',field_api_name'+field_api_name+' is not a form element');
continue;
}
@@ -564,12 +568,16 @@
<script>
var init_nodes = document.getElementsByClassName("PIBackApi");
var api_id_map={};
- for(let e in init_nodes){
- if(IsFormElement(e)){
- api_id_map[GetEleApiName(e)] = e.id;
- }
- }
- console.log(api_id_map);
+ for(let ei in init_nodes){
+ let e = init_nodes[ei];
+ if(IsFormElement(e)){
+ if(e.getAttribute("multiple") != 'multiple' || e.style.display == 'none' && e.id.indexOf('selected') < 0){
+ api_id_map[GetEleApiName(e)] = e.id;
+ }
+
+ }
+ }
+ console.log(api_id_map);
sfdcPage.appendToOnloadQueue(function () {
var layoutSections = JSON.parse('{!layoutSectionsStr}');
@@ -596,6 +604,7 @@
document.querySelectorAll("[data-id='OwnerId']")[0].classList.add("disabledbutton");
jQuery('a[data-id="OwnerId"]').remove();
+ /*
jQuery(".lookupInput").each(function(i,e){
let je =jQuery(e).find('input');
je.attr("readonly","");
@@ -625,6 +634,24 @@
}
}
});
+ */
+ let previous_value = {};
+ jQuery(".lookupInput input").each(function(i,e){
+ let je =jQuery(e);
+
+ let dataid = je.attr('data-id');
+ if(['ContactId'].indexOf(dataid) < 0) return;
+
+ jQuery(e).focus(function(){
+ previous_value[this.id] = this.value;
+ })
+
+ jQuery(e).change(function(){
+ if (previous_value[this.id] != jQuery(this).val()) {
+ document.getElementById(this.id+'_lkid').value = '';
+ }
+ })
+ })
});
</script>
<div class="pbBottomButtons">
--
Gitblit v1.9.1