| | |
| | | <!-- |
| | | @description : |
| | | @author : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | @group : |
| | | @last modified on : 03-23-2022 |
| | | @last modified by : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | --> |
| | | <apex:page standardController="Address__c" extensions="NewAndEditAddressController" id="page"> |
| | | <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/> |
| | | <apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }" /> |
| | |
| | | var VLookUpFields = new Set(['Contacts__c', 'Province__c', 'City__c', 'Customer__c']); |
| | | function ProcessPI(addressJson, payloadForNewPI) { |
| | | blockme(); |
| | | if ({!isNewMode}) { |
| | | if ({!isNewMode} || {!isCloneMode}) { |
| | | NewPIToAWS(addressJson, payloadForNewPI) |
| | | }else { |
| | | UpdatePIToAWS(addressJson, payloadForNewPI) |
| | |
| | | if(phone ){ |
| | | if(phone.value){ |
| | | if(!/^1[3|5|8|7][0-9]\d{4,8}$/.test(phone.value)){ |
| | | error_msg += ';电话号码错误'; |
| | | error_msg += ';电话号码错误'; |
| | | } |
| | | }else{ |
| | | if(phone.previousSibling && phone.previousSibling.className.indexOf('requiredBlock')>-1){ |
| | |
| | | |
| | | let nodelist = document.querySelectorAll("[data-id]"); |
| | | let result = {} |
| | | result.RecordTypeId = '{!rtTypeId}'; |
| | | //result.RecordTypeId = '{!rtTypeId}'; |
| | | for (let index = 0; index < nodelist.length; index++) { |
| | | if (VLookUpFields.has(nodelist[index].getAttribute("data-id"))) { |
| | | console.log(nodelist[index].id.indexOf('lkwgt')); |
| | |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | function EditButton(isDisabled){ |
| | | var topele = document.getElementById('topButtonRow'); |
| | | var bottomele = document.getElementById('bottomButtonRow'); |
| | | |
| | | if (isDisabled) { |
| | | topele.classList.add("disabledbutton"); |
| | | bottomele.classList.add("disabledbutton"); |
| | | }else { |
| | | topele.classList.remove("disabledbutton"); |
| | | bottomele.classList.remove("disabledbutton"); |
| | | } |
| | | } |
| | | function QueryAddressFromAWS() { |
| | | AWSService.query(staticResources.queryUrl, '{!AWSDataId}', queryBack, staticResources.token); |
| | | } |
| | |
| | | payloadJson.Detailed_Address_Encrypted__c = r.object[0].detailedAddressEncrypt; |
| | | //payloadJson.AWS_Data_Id__c = r.object[0].dataId; |
| | | payloadJson.AWS_Data_Id__c = '{!AWSDataId}'; |
| | | if (isNewMode) { |
| | | if (isNewMode || {!isCloneMode}) { |
| | | payloadJson.AWS_Data_Id__c = r.object[0].dataId; |
| | | delete payloadJson.OwnerId; |
| | | } else { |
| | | payloadJson.AWS_Data_Id__c = '{!AWSDataId}'; |
| | | } |
| | | if('{!rtTypeId}'){ |
| | | payloadJson.RecordTypeId = '{!rtTypeId}';//Add by zhj for Record Type Issue 20220421 |
| | | } |
| | | return payloadJson; |
| | | } |
| | |
| | | return blankRequiredFields; |
| | | } |
| | | function saveAddressProcess(saveMode) { |
| | | EditButton(true); |
| | | |
| | | disableButtonStatus(); |
| | | redirectMode = saveMode; |
| | |
| | | errorMsgNode.innerText = errorMsg; |
| | | errorMsgNode.className = 'pbError'; |
| | | unblockUI(); |
| | | EditButton(false); |
| | | } |
| | | function hiddenErrorMsgNode() { |
| | | let errorMsgNode = document.getElementById("page:form:block:msgContent"); |
| | |
| | | //1. Check account value |
| | | let accountNodeId = document.querySelector("[data-id='Customer__c']").id + '_lkid'; |
| | | let accountValue = document.getElementById(accountNodeId).value; |
| | | let searchContactKeyWord = document.querySelector("[data-id='Customer__c']").value; |
| | | let searchContactKeyWord = document.querySelector("[data-id='Contacts__c']").value; |
| | | console.log(accountValue); |
| | | if (accountValue != '000000000000000') { |
| | | let baseUrl = "/apex/SearchContactPage"; |
| | |
| | | <img src="/img/s.gif" alt="" class="minWidth" title="" width="1" height="1" /> |
| | | <h2 class="mainTitle">收货地址编辑</h2> |
| | | </td> |
| | | <td class="pbButton" id="topButtonRow"> |
| | | <td class="pbButton" id="topButtonRow" style="pointer-events: none; opacity: 0.4;"> |
| | | <input class="btn" type="Button" value="保存" onclick="saveAddressProcess('Save')" /> |
| | | <input class="btn" type="Button" value="保存并新建" onclick="saveAddressProcess('SaveAndNew')" /> |
| | | <apex:commandButton action="{!cancel}" value="取消" /> |
| | |
| | | |
| | | <!--Each section has layoutFields, let's iterate them as well--> |
| | | <apex:repeat value="{!layoutSection.layoutFields}" var="layoutField"> |
| | | <apex:inputField html-data-id="{!layoutField.fieldAPI}" value="{!Address__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)}" |
| | | <apex:inputField styleClass="PIBackApi PIBackApi_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!Address__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)&&isNewMode}" |
| | | required="{!layoutField.isRequired}" /> |
| | | <apex:inputField styleClass="PIBackApi PIBackApi_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!Address__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="{!Address__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)&¬(isNewMode)&&layoutField.fieldAPI=='RecordTypeId'}" |
| | | /> |
| | | <apex:pageblocksectionitem rendered="{!layoutField.isPlaceHolder}"> |
| | | </apex:pageblocksectionitem> |
| | | </apex:repeat> |
| | |
| | | replaceSearchContactLookup(); |
| | | //3. Set Readonly Attribute |
| | | // document.querySelector("[data-id='OwnerId']").classList.add("disabledbutton"); |
| | | document.getElementById('topButtonRow').style = ''; |
| | | document.getElementById('bottomButtonRow').style = ''; |
| | | /* |
| | | jQuery(".lookupInput").each(function(i,e){ |
| | | let je =jQuery(e).find('input'); |
| | |
| | | <tr> |
| | | <td class="pbTitle"> |
| | | <img src="/img/s.gif" alt="" class="minWidth" title="" width="1" height="1" /> </td> |
| | | <td class="pbButtonb" id="bottomButtonRow"> |
| | | <td class="pbButtonb" id="bottomButtonRow" style="pointer-events: none; opacity: 0.4;"> |
| | | <input class="btn" type="Button" value="保存" onclick="saveAddressProcess('Save')" /> |
| | | <input class="btn" type="Button" value="保存并新建" onclick="saveAddressProcess('SaveAndNew')" /> |
| | | <apex:commandButton action="{!cancel}" value="取消" /> |