| | |
| | | document.querySelector("[data-id='Phone_number__c']").value = data.object.phoneNumber; |
| | | document.querySelector("[data-id='direct_shippment_address__c']").value = data.object.directShippmentAddress; |
| | | unblockUI(); |
| | | enableButtonStatus();//Add by Li Jun 20220418 |
| | | }; |
| | | |
| | | //Check If Insert Or Update |
| | |
| | | debugger |
| | | return payloadJson; |
| | | } |
| | | //Add Button status start 20220418 |
| | | function enableButton(obj) { |
| | | obj.classList.remove("btnDisabled"); |
| | | } |
| | | |
| | | function disableButton(obj) { |
| | | obj.classList.add("btnDisabled"); |
| | | } |
| | | |
| | | function disableButtonStatus() { |
| | | let btnList = document.getElementsByClassName('btn'); |
| | | for (let i = 0; i < btnList.length; i++) { |
| | | disableButton(btnList[i]); |
| | | } |
| | | } |
| | | |
| | | function enableButtonStatus() { |
| | | let btnList = document.getElementsByClassName('btn'); |
| | | for (let i = 0; i < btnList.length; i++) { |
| | | enableButton(btnList[i]); |
| | | } |
| | | } |
| | | disableButtonStatus(); |
| | | //Add Button status end 20220418 |
| | | // New Or Edit |
| | | function ProcessPI(rentalApplyJson, payloadForNewPI) { |
| | | blockme(); |
| | |
| | | } |
| | | return ['input','select','textarea'].indexOf(tag_name.toLowerCase())>-1; |
| | | } |
| | | |
| | | function IsFormElement(e){ |
| | | |
| | | function IsFormElement(e){ |
| | | return IsFormTag(e.tagName); |
| | | } |
| | | |
| | |
| | | // } |
| | | // result.HP_received_sign_rich__c = CKEDITOR.instances["page:form:block:j_id34:12:j_id35:j_id36:1:j_id37:textAreaDelegate_HP_received_sign_rich__c"].getData(); |
| | | // if(document.querySelector("[aria-describedby = 'cke_71']")){ |
| | | // result. Extension_List_RentalApply__c = document.querySelector("[aria-describedby = 'cke_71']").contentWindow.document.getElementsByTagName('body')[0].innerHTML |
| | | // result. Extension_List_RentalApply__c = document.querySelector("[aria-describedby = 'cke_71']").contentWindow.document.getElementsByTagName('body')[0].innerHTML |
| | | // } |
| | | for (let index = 0; index < nodelist.length; index++) { |
| | | if (VLookUpFields.has(nodelist[index].getAttribute("data-id"))) { |
| | | console.log(nodelist[index].id.indexOf('lkwgt')); |
| | | if (nodelist[index].id.indexOf('lkwgt') == -1) { |
| | | let vlookUpNodeId = nodelist[index].id + '_lkid'; |
| | | let vlookUpNodeValue = document.getElementById(vlookUpNodeId).value; |
| | | result[nodelist[index].getAttribute("data-id")] = vlookUpNodeValue; |
| | | if(document.getElementById(vlookUpNodeId)){ |
| | | let vlookUpNodeValue = document.getElementById(vlookUpNodeId).value; |
| | | result[nodelist[index].getAttribute("data-id")] = vlookUpNodeValue; |
| | | } |
| | | } |
| | | } else if (nodelist[index].type == 'checkbox') { |
| | | result[nodelist[index].getAttribute("data-id")] = nodelist[index].checked; |
| | |
| | | } |
| | | } |
| | | } |
| | | if(document.querySelector("[id='page:form:block:j_id34:2:j_id35:j_id36:2:j_id37']")!=null){ |
| | | result.demo_purpose2__c = document.querySelector("[id='page:form:block:j_id34:2:j_id35:j_id36:2:j_id37']").value; |
| | | if(api_id_map['demo_purpose2__c']){ |
| | | result.demo_purpose2__c = document.getElementById(api_id_map['demo_purpose2__c']).value!='_\x01_'?document.getElementById(api_id_map['demo_purpose2__c']).value:''; |
| | | } |
| | | if(document.querySelector("[id='page:form:block:j_id34:0:j_id35:j_id36:18:j_id37']")!=null){ |
| | | result.ToAgency__c = document.querySelector("[id='page:form:block:j_id34:0:j_id35:j_id36:18:j_id37']").value; |
| | | if(api_id_map['ToAgency__c']){ |
| | | result.ToAgency__c = document.getElementById(api_id_map['ToAgency__c']).value!='_\x01_'?document.getElementById(api_id_map['ToAgency__c']).value:''; |
| | | } |
| | | //document.querySelector("[id='page:form:block:j_id34:0:j_id35:j_id36:18:j_id37']").disabled =true; // Commented By Li Jun 20220304 |
| | | if(document.querySelector("[id='page:form:block:j_id34:13:j_id35:j_id36:1:j_id37']")!=null){ |
| | | result.Loaner_cancel_reason__c = document.querySelector("[id='page:form:block:j_id34:13:j_id35:j_id36:1:j_id37']").value; |
| | | }else{ |
| | | if(document.querySelector("[id='page:form:block:j_id34:11:j_id35:j_id36:1:j_id37']")!=null){ |
| | | result.Loaner_cancel_reason__c = document.querySelector("[id='page:form:block:j_id34:11:j_id35:j_id36:1:j_id37']").value; |
| | | } |
| | | if(api_id_map['Loaner_cancel_reason__c']){ |
| | | result.Loaner_cancel_reason__c = document.getElementById(api_id_map['Loaner_cancel_reason__c']).value!='_\x01_'?document.getElementById(api_id_map['Loaner_cancel_reason__c']).value:''; |
| | | } |
| | | // else{ |
| | | // if(document.querySelector("[id='page:form:block:j_id34:11:j_id35:j_id36:1:j_id37']")!=null){ |
| | | // result.Loaner_cancel_reason__c = document.querySelector("[id='page:form:block:j_id34:11:j_id35:j_id36:1:j_id37']").value; |
| | | // } |
| | | // } |
| | | // //格式化时间 |
| | | // if(result.HP_received_sign_day__c){ |
| | | // result.HP_received_sign_day__c = result.HP_received_sign_day__c.replace(/\//g, '-')+':00'; |
| | |
| | | if(e){ |
| | | result.Extension_List_RentalApply__c = e.getData(); |
| | | } |
| | | if(document.getElementById('page:form:block:j_id34:0:j_id35:j_id36:13:j_id37' + '_lkid')!=null){ |
| | | if(document.getElementById(api_id_map['Office_Assistant1__c'] + '_lkid')!=null){ |
| | | // result.ToAgency__c = document.getElementById('page:form:block:j_id34:0:j_id35:j_id36:18:j_id37').value; |
| | | result.Office_Assistant1__c = document.getElementById('page:form:block:j_id34:0:j_id35:j_id36:13:j_id37' + '_lkid').value; |
| | | result.Office_Assistant1__c = document.getElementById(api_id_map['Office_Assistant1__c'] + '_lkid').value; |
| | | } |
| | | if(document.getElementById(api_id_map['Office_Assistant2__c'] + '_lkid')!=null){ |
| | | // result.ToAgency__c = document.getElementById('page:form:block:j_id34:0:j_id35:j_id36:18:j_id37').value; |
| | | result.Office_Assistant2__c = document.getElementById(api_id_map['Office_Assistant2__c'] + '_lkid').value; |
| | | } |
| | | console.log(JSON.stringify(result)); |
| | | return result; |
| | |
| | | <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="saveRentalApplyProcess('Save')" /> |
| | | <input class="btn" type="Button" value="保存并新建" onclick="saveRentalApplyProcess('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 styleClass="PIBackApi PIBackApi_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!Rental_Apply__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)}" |
| | | <apex:inputField styleClass="PIBackApi PIBackApi_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!Rental_Apply__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)&&isNewMode}" |
| | | required="{!layoutField.isRequired}" /> |
| | | <apex:inputField styleClass="PIBackApi PIBackApi_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!Rental_Apply__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="{!Rental_Apply__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)&¬(isNewMode)&&layoutField.fieldAPI=='RecordTypeId'}" |
| | | /> |
| | | <apex:pageblocksectionitem rendered="{!layoutField.isPlaceHolder}"> |
| | | </apex:pageblocksectionitem> |
| | | </apex:repeat> |
| | |
| | | if(e.getAttribute("multiple") != 'multiple' || e.style.display == 'none' && e.id.indexOf('selected') < 0){ |
| | | api_id_map[GetEleApiName(e)] = e.id; |
| | | } |
| | | |
| | | }else{ |
| | | let eid = jQuery(e).find(".lookupInput input").attr("id") |
| | | if(eid){ |
| | | eid += '_lkid'; |
| | | if(document.getElementById(eid)){ |
| | | api_id_map[GetEleApiName(e)] = eid; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | console.log(api_id_map); |
| | |
| | | var onlyReadFields = ['ExtensionStatus__c','ExtensionApplicationTime_Initial__c','ExtensionApprovalTime_Initial__c','ExtensionApplicationTime_Final__c','ExtensionApprovalTime_Final__c','ExtensionSuccessTimes__c','ZongjianApprovalManager__c','BuchangApprovalManager__c','JingliApprovalManager__c','BuchangApprovalManagerSales__c','SalesManager__c']; |
| | | console.log(onlyReadFields); |
| | | for(let i=0;i<onlyReadFields.length;i++){ |
| | | document.querySelector('[data-id='+onlyReadFields[i]+']').parentNode.remove(); |
| | | if(document.querySelector('[data-id='+onlyReadFields[i]+']')){ |
| | | document.querySelector('[data-id='+onlyReadFields[i]+']').parentNode.remove(); |
| | | } |
| | | } |
| | | |
| | | //2. Query AWS Data by dataId |
| | |
| | | if (!{!isNewMode}) { |
| | | blockme(); |
| | | QueryRentalApplyFromAWS(); |
| | | }else{ |
| | | enableButtonStatus();//Add by Li Jun 20220418 |
| | | }; |
| | | //Replace Vlookup Field |
| | | replaceSearchContactLookup(); |
| | | document.querySelector("[data-id='OwnerId']").classList.add("disabledbutton"); |
| | | |
| | | |
| | | document.getElementById('topButtonRow').style = ''; |
| | | document.getElementById('bottomButtonRow').style = ''; |
| | | |
| | | let previous_value = {}; |
| | | jQuery(".lookupInput input").each(function(i,e){ |
| | | let je =jQuery(e); |
| | |
| | | <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="saveRentalApplyProcess('Save')" /> |
| | | <input class="btn" type="Button" value="保存并新建" onclick="saveRentalApplyProcess('SaveAndNew')" /> |
| | | <apex:commandButton action="{!cancel}" value="取消" /> |