| | |
| | | <apex:page standardController="Report__c" extensions="NewAndEditReportController" id="page" lightningStylesheets="true"> |
| | | <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/> |
| | | <apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }" /> |
| | | <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.connection20)}"/> |
| | | <apex:page |
| | | standardController="Report__c" |
| | | extensions="NewAndEditReportController" |
| | | id="page" |
| | | > |
| | | <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}" /> |
| | | <apex:includeScript |
| | | value="{! URLFOR($Resource.AWSService, 'AWSService.js') }" |
| | | /> |
| | | <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}" /> |
| | | <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}" /> |
| | | <apex:includeScript value="{!URLFOR($Resource.connection20)}" /> |
| | | |
| | | <style> |
| | | .disabledbutton { |
| | |
| | | let t = jQuery("label[for$='textAreaDelegate_"+api_name+"']").parent().next().find("textarea")[0]; |
| | | if(t && t.id){ |
| | | return CKEDITOR.instances[t.id] |
| | | |
| | | |
| | | } |
| | | return null; |
| | | } |
| | |
| | | // if(phone1 && !/^1[3|5|8|7][0-9]\d{4,8}$/.test(phone1.value)){ |
| | | // error_msg += ';信息提供人联系方式(电话)号码错误'; |
| | | // } |
| | | |
| | | |
| | | // let phone2 = document.querySelector(textPhone2); |
| | | // if(phone2 && !/^1[3|5|8|7][0-9]\d{4,8}$/.test(phone2.value)){ |
| | | // error_msg += ';联系电话号码错误'; |
| | |
| | | }else{ |
| | | blankRequiredFields =blankRequiredFields+',' + fieldAPIToLabelMap[requiredFieldAPIList[i]]; |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | return blankRequiredFields; |
| | |
| | | } |
| | | return ['input','select','textarea','div'].indexOf(tag_name.toLowerCase())>-1; |
| | | } |
| | | |
| | | |
| | | function IsFormElement(e){ |
| | | return IsFormTag(e.tagName); |
| | | } |
| | |
| | | return JSON.stringify(reportPayloadList); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | //5.新建或编辑 |
| | | function ProcessPI(reportJson, payloadForNewPI) { |
| | |
| | | function replaceSearchContactLookup() { |
| | | if (!{!isNewMode}) { |
| | | queryContactName(); |
| | | } |
| | | } |
| | | if(document.querySelector("[data-id='Practitioner1__c']") != null){ |
| | | let contactHtmlString = '<img src="/img/s.gif" onclick="searchContact(\'page:form:contactId\',\'Practitioner1__c\')" alt="Reference Document Number Lookup" class="lookupIcon" title="Reference Document Number Lookup (New Window)"/>'; |
| | | let lookUpNode = htmlToElement(contactHtmlString); |
| | |
| | | parentNode.replaceChild(lookUpNode, document.querySelector("[data-id='Person_In_Charge__c']").parentNode.children[2]); |
| | | } |
| | | } |
| | | var newSearchContactWindow = null; |
| | | |
| | | var newSearchContactWindow = null; |
| | | |
| | | function htmlToElement(html) { |
| | | var template = document.createElement('template'); |
| | | html = html.trim(); // Never return a text node of whitespace as the result |
| | |
| | | let accountValue = ""; |
| | | if (document.querySelector("[data-id='Hospital_Department__c']")) { |
| | | let accountNodeId = document.querySelector("[data-id='Hospital_Department__c']").id + '_lkid'; |
| | | accountValue = document.getElementById(accountNodeId).value; |
| | | } |
| | | accountValue = document.getElementById(accountNodeId).value; |
| | | } |
| | | console.log(accountValue); |
| | | if(accountValue !='000000000000000'){ |
| | | let baseUrl = "/apex/SearchContactPage"; |
| | |
| | | let payloadForNewPI = getPIPayload(reportJson); |
| | | console.log('加密字段:'+payloadForNewPI); |
| | | |
| | | //5. report to AWS |
| | | //5. report to AWS |
| | | ProcessPI(reportJson, payloadForNewPI); |
| | | } |
| | | </script> |
| | |
| | | <div class="bPageTitle"> |
| | | <div class="ptBody"> |
| | | <div class="content"> |
| | | <img src="/img/s.gif" alt="报告书" class="pageTitleIcon" title="报告书" /> |
| | | <h1 class="pageType">报告书 |
| | | <img |
| | | src="/img/s.gif" |
| | | alt="报告书" |
| | | class="pageTitleIcon" |
| | | title="报告书" |
| | | /> |
| | | <h1 class="pageType"> |
| | | 报告书 |
| | | <span class="titleSeparatingColon">:</span> |
| | | </h1> |
| | | <h2 class="pageDescription"> 新建报告书</h2> |
| | | <h2 class="pageDescription">新建报告书</h2> |
| | | <div class="blank"> </div> |
| | | </div> |
| | | <div class="links"> |
| | | <a href="javascript:openPopupFocusEscapePounds(%27https://help.salesforce.com/apex/htdoor?loc=help&target=leads_edit.htm&section=Leads&language=zh_CN&release=234.18.8&instance=CS117&showSplash=true%27, %27Help%27, 700, 600, %27width=700,height=600,resizable=yes,toolbar=yes,status=no,scrollbars=yes,menubar=yes,directories=no,location=no,dependant=no%27, false, false);" |
| | | title="此页面的帮助 (新窗口)"> |
| | | <a |
| | | href="javascript:openPopupFocusEscapePounds(%27https://help.salesforce.com/apex/htdoor?loc=help&target=leads_edit.htm&section=Leads&language=zh_CN&release=234.18.8&instance=CS117&showSplash=true%27, %27Help%27, 700, 600, %27width=700,height=600,resizable=yes,toolbar=yes,status=no,scrollbars=yes,menubar=yes,directories=no,location=no,dependant=no%27, false, false);" |
| | | title="此页面的帮助 (新窗口)" |
| | | > |
| | | <span class="helpLink">此页面的帮助</span> |
| | | <img src="/img/s.gif" alt="" class="helpIcon" /> |
| | | </a> |
| | |
| | | <tbody> |
| | | <tr> |
| | | <td class="pbTitle"> |
| | | <img src="/img/s.gif" alt="" class="minWidth" title="" width="1" height="1" /> |
| | | <img |
| | | src="/img/s.gif" |
| | | alt="" |
| | | class="minWidth" |
| | | title="" |
| | | width="1" |
| | | height="1" |
| | | /> |
| | | <h2 class="mainTitle">报告书编辑</h2> |
| | | </td> |
| | | <td class="pbButton" id="topButtonRow" style="pointer-events: none; opacity: 0.4;"> |
| | | <input class="btn" type="Button" value="保存" onclick="saveReportProcess('Save')" /> |
| | | <input class="btn" type="Button" value="保存并新建" onclick="saveReportProcess('SaveAndNew')" /> |
| | | <apex:commandButton action="{!cancel}" value="取消" /> |
| | | <td |
| | | class="pbButton" |
| | | id="topButtonRow" |
| | | style="pointer-events: none; opacity: 0.4" |
| | | > |
| | | <input |
| | | class="btn" |
| | | type="Button" |
| | | value="保存" |
| | | onclick="saveReportProcess('Save')" |
| | | /> |
| | | <input |
| | | class="btn" |
| | | type="Button" |
| | | value="保存并新建" |
| | | onclick="saveReportProcess('SaveAndNew')" |
| | | /> |
| | | <apex:commandButton |
| | | action="{!cancel}" |
| | | value="取消" |
| | | /> |
| | | </td> |
| | | </tr> |
| | | </tbody> |
| | | </table> |
| | | </div> |
| | | <!-- Error Msg--> |
| | | <div style="text-align: center;"> |
| | | <div style="text-align: center"> |
| | | <apex:outputPanel id="errorMsg"> |
| | | <apex:pageMessages id="msgContent" escape="false" /> |
| | | </apex:outputPanel> |
| | | </div> |
| | | <br/> |
| | | </div> |
| | | <br /> |
| | | <!-- Iterate the layoutSections, which is a list of sections --> |
| | | <apex:repeat value="{!layoutSections}" var="layoutSection"> |
| | | <apex:pageBlockSection title="{!layoutSection.name}" showHeader="{!layoutSection.useHeader}" collapsible="{!layoutSection.allowCollapse}" |
| | | columns="{!layoutSection.columns}"> |
| | | |
| | | <apex:pageBlockSection |
| | | title="{!layoutSection.name}" |
| | | showHeader="{!layoutSection.useHeader}" |
| | | collapsible="{!layoutSection.allowCollapse}" |
| | | columns="{!layoutSection.columns}" |
| | | > |
| | | <!--Each section has layoutFields, let's iterate them as well--> |
| | | <apex:repeat value="{!layoutSection.layoutFields}" var="layoutField"> |
| | | <apex:repeat |
| | | value="{!layoutSection.layoutFields}" |
| | | var="layoutField" |
| | | > |
| | | <!-- <apex:inputField html-title="{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" styleClass="{!ApiPrefix} {!ApiPrefix}_{!layoutField.fieldAPI}" value="{!Report__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)}" |
| | | required="{!layoutField.isRequired}" /> --> |
| | | <apex:inputField styleClass="PIBackApi PIBackApi_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!Report__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)&&isNewMode}" |
| | | required="{!layoutField.isRequired}" /> |
| | | <apex:inputField styleClass="PIBackApi PIBackApi_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!Report__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)&¬(isNewMode)&&layoutField.fieldAPI!='RecordTypeId'}" |
| | | required="{!layoutField.isRequired}" /> |
| | | <apex:outputField styleClass="PIBackApi PIBackApi_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!Report__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)&¬(isNewMode)&&layoutField.fieldAPI=='RecordTypeId'}" |
| | | <apex:inputField |
| | | styleClass="PIBackApi PIBackApi_{!layoutField.fieldAPI}" |
| | | html-data-id="{!layoutField.fieldAPI}" |
| | | value="{!Report__c[layoutField.fieldAPI]}" |
| | | rendered="{!not(layoutField.isPlaceHOlder)&&isNewMode}" |
| | | required="{!layoutField.isRequired}" |
| | | /> |
| | | <apex:pageblocksectionitem rendered="{!layoutField.isPlaceHolder}"> |
| | | <apex:inputField |
| | | styleClass="PIBackApi PIBackApi_{!layoutField.fieldAPI}" |
| | | html-data-id="{!layoutField.fieldAPI}" |
| | | value="{!Report__c[layoutField.fieldAPI]}" |
| | | rendered="{!not(layoutField.isPlaceHOlder)&¬(isNewMode)&&layoutField.fieldAPI!='RecordTypeId'}" |
| | | required="{!layoutField.isRequired}" |
| | | /> |
| | | <apex:outputField |
| | | styleClass="PIBackApi PIBackApi_{!layoutField.fieldAPI}" |
| | | html-data-id="{!layoutField.fieldAPI}" |
| | | value="{!Report__c[layoutField.fieldAPI]}" |
| | | rendered="{!not(layoutField.isPlaceHOlder)&¬(isNewMode)&&layoutField.fieldAPI=='RecordTypeId'}" |
| | | /> |
| | | <apex:pageblocksectionitem |
| | | rendered="{!layoutField.isPlaceHolder}" |
| | | > |
| | | </apex:pageblocksectionitem> |
| | | </apex:repeat> |
| | | |
| | | </apex:pageBlockSection> |
| | | </apex:repeat> |
| | | <script> |
| | |
| | | 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 () { |
| | | debugger |
| | | //判断是否为只读选项 |
| | | var layoutSections = JSON.parse('{!layoutSectionsStr}'); |
| | | for (let m = 0; m < layoutSections.length; m++) { |
| | |
| | | |
| | | //1. Set Last Name label |
| | | //document.querySelector("[data-id='LastName']").parentNode.parentNode.parentNode.children[2].children[0].innerText = '姓名'; |
| | | //2. Query AWS Data by dataId |
| | | //2. Query AWS Data by dataId |
| | | console.log('Mode for Lead Page:' + {!isNewMode}); |
| | | if (!{!isNewMode}) { |
| | | QueryLeadFromAWS(); |
| | |
| | | document.getElementById(document.querySelector("[data-id='Loaner_request_no1__c']").id + '_lkid').value = '{!no1Id}' |
| | | } |
| | | } |
| | | |
| | | |
| | | document.getElementById('topButtonRow').style = ''; |
| | | document.getElementById('bottomButtonRow').style = ''; |
| | | |
| | | |
| | | let previous_value = {}; |
| | | jQuery(".lookupInput input").each(function(i,e){ |
| | | let je =jQuery(e); |
| | |
| | | <tbody> |
| | | <tr> |
| | | <td class="pbTitle"> |
| | | <img src="/img/s.gif" alt="" class="minWidth" title="" width="1" height="1" /> </td> |
| | | <td class="pbButtonb" id="bottomButtonRow" style="pointer-events: none; opacity: 0.4;"> |
| | | <input class="btn" type="Button" value="保存" onclick="saveReportProcess('Save')" /> |
| | | <input class="btn" type="Button" value="保存并新建" onclick="saveReportProcess('SaveAndNew')" /> |
| | | <apex:commandButton action="{!cancel}" value="取消" /> |
| | | <img |
| | | src="/img/s.gif" |
| | | alt="" |
| | | class="minWidth" |
| | | title="" |
| | | width="1" |
| | | height="1" |
| | | /> |
| | | </td> |
| | | <td |
| | | class="pbButtonb" |
| | | id="bottomButtonRow" |
| | | style="pointer-events: none; opacity: 0.4" |
| | | > |
| | | <input |
| | | class="btn" |
| | | type="Button" |
| | | value="保存" |
| | | onclick="saveReportProcess('Save')" |
| | | /> |
| | | <input |
| | | class="btn" |
| | | type="Button" |
| | | value="保存并新建" |
| | | onclick="saveReportProcess('SaveAndNew')" |
| | | /> |
| | | <apex:commandButton |
| | | action="{!cancel}" |
| | | value="取消" |
| | | /> |
| | | </td> |
| | | </tr> |
| | | </tbody> |
| | | </table> |
| | | </div> |
| | | </apex:pageblock> |
| | | |
| | | </apex:form> |
| | | </apex:page> |
| | | </apex:page> |