Li Jun
2022-03-24 f127c76b19f5316032d4bed127a1dde710c48d74
force-app/main/default/pages/NewAndEditCase.page
@@ -103,6 +103,19 @@
            let nodelist = document.querySelectorAll("[data-id]");
            let result = {}
            result.RecordTypeId = '{!rtTypeId}'
            //富文本
            var describedbyAll = document.querySelectorAll("[aria-describedby = 'cke_34']");
            if(describedbyAll){
                for (let idx = 0; idx < describedbyAll.length; idx++) {
                    let describedby = describedbyAll[idx];
                    if (describedby.title.indexOf('Text_attachement__c') > 0){
                       result.Text_attachement__c = describedby.contentWindow.document.getElementsByTagName('body')[0].innerHTML;
                        if (result.Text_attachement__c == '<br>') {
                            result.Text_attachement__c = '';
                        }
                    }
                }
            }
            for (let index = 0; index < nodelist.length; index++) {
                if (VLookUpFields.has(nodelist[index].getAttribute("data-id"))) {
                    console.log(nodelist[index].id.indexOf('lkwgt'));
@@ -279,7 +292,8 @@
            console.log(accountValue);
            if(accountValue !='000000000000000'){
                let baseUrl = "/apex/SearchContactPage";
                let suffixUrl = "?contactId="+contactNodeId+"&accountId="+accountValue;
                let searchContactKeyWord = document.querySelector("[data-id='ContactId']").value;
                let suffixUrl = "?contactId=" + contactNodeId + "&accountId=" + accountValue+"&searchContactKeyWord=" + searchContactKeyWord;
                let newSearchContactParam = 'height=600,width=800,left=100,top=100,dialogHide=true,resizable=no,scrollbars=yes,toolbar=no,status=no';
                newSearchContactWindow = window.open(baseUrl+suffixUrl, 'Popup', newSearchContactParam);
                if (window.focus) {
@@ -432,35 +446,52 @@
                    
                    jQuery('a[data-id="OwnerId"]').remove();
                    
                    jQuery(".lookupInput").each(function(i,e){
                        let je =jQuery(e).find('input');
                        je.attr("readonly","");
                        je.css("background","unset");
                    let previous_value = {};
                    jQuery(".lookupInput input").each(function(i,e){
                        let je =jQuery(e);
                        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 = '';
                        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 = '';
                            }
                        }
                    });
                        })
                    })
                    // 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">