| | |
| | | <aura:attribute name="showSpinner" type="Boolean" default = "False"/> |
| | | <aura:attribute name="staticResource" type="Map"/> |
| | | <aura:attribute name="pi_fields_map" type="Map"/> |
| | | |
| | | |
| | | <ltng:require scripts="{! $Resource.AWSService+'/AWSService.js' }" /> |
| | | <ltng:require scripts="{! $Resource.jquery183minjs }" /> |
| | | |
| | | <div class="{! v.container_class}"> |
| | | <!-- header --> |
| | |
| | | if(rv.Data && fields.hasOwnProperty(item.field) && fields[item.field].References && fields[item.field].References.map(m=>m.value).indexOf(rv.Data.pidType) > -1){ |
| | | item.value = pid; |
| | | } |
| | | |
| | | if(fields.hasOwnProperty(item.field)){ |
| | | item.fi = fields[item.field]; |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | payloadForNewPI = JSON.stringify(data); |
| | | } |
| | | |
| | | fetch(postURL, { |
| | | method: 'POST', |
| | | body: payloadForNewPI, |
| | | headers: { |
| | | 'Content-Type': 'application/json', |
| | | 'pi-token': token |
| | | } |
| | | }).then((data) => { |
| | | console.log('data=' + JSON.stringify(data)); |
| | | return data.json(); |
| | | }).then((result) => { |
| | | AWSService.post(postURL,payloadForNewPI,function(result) { |
| | | //this.insertCalloutLog(this.insertModule,postURL,JSON.stringify(payloadForNewPI),JSON.stringify(result),this.successStatus); |
| | | if(callback) callback(result); |
| | | }).catch(error => { |
| | | console.log('error'); |
| | | //this.insertCalloutLog(this.insertModule,postURL,JSON.stringify(payloadForNewPI),JSON.stringify(error),this.failStatus); |
| | | console.log(error); |
| | | }); |
| | | },token); |
| | | }, |
| | | AwsGet : function(url, data ,callback,token){ |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | fetch(url, { |
| | | method: 'GET', |
| | | headers: { |
| | | 'Content-Type': 'application/json', |
| | | 'pi-token': token |
| | | } |
| | | }).then((data) => { |
| | | console.log('data=' + JSON.stringify(data)); |
| | | return data.json(); |
| | | }).then((result) => { |
| | | AWSService.get(url,function(result){ |
| | | //this.insertCalloutLog(this.insertModule,postURL,JSON.stringify(payloadForNewPI),JSON.stringify(result),this.successStatus); |
| | | if(callback) callback(result); |
| | | }).catch(error => { |
| | | console.log('error'); |
| | | //this.insertCalloutLog(this.insertModule,postURL,JSON.stringify(payloadForNewPI),JSON.stringify(error),this.failStatus); |
| | | console.log(error); |
| | | }); |
| | | },token); |
| | | } |
| | | }) |
| | |
| | | if(!System.Test.isRunningTest()){ |
| | | // NFM606Controller.executeNotFuture('', contactIdList); |
| | | if (contactIdList.size() > 0) { |
| | | NFM606Controller.callout('', contactIdList); |
| | | // NFM606Controller.callout('', contactIdList); |
| | | //添加future 判断 add for pipl sushanhu 20220317 start |
| | | if (!(System.isFuture()||System.isBatch())) { |
| | | NFM606Controller.callout('', contactIdList); |
| | | } |
| | | //添加future 判断 add for pipl sushanhu 20220317 end |
| | | } |
| | | if (interfaceUserUpsertContact.size() > 0) { |
| | | NFM606Controller.executeNotFuture('', interfaceUserUpsertContact); |
| | | // NFM606Controller.executeNotFuture('', interfaceUserUpsertContact); |
| | | //添加future 判断 add for pipl sushanhu 20220316 start |
| | | if (!(System.isFuture()||System.isBatch())) { |
| | | NFM606Controller.executeNotFuture('', interfaceUserUpsertContact); |
| | | } |
| | | //添加future 判断 add for pipl sushanhu 20220316 end |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | system.debug(mso); |
| | | mso.remove('sfdc.override'); |
| | | PageReference pg = new PageReference('/003/e'); |
| | | mso.putAll(mso); |
| | | //pg.getParameters().putAll(mso); |
| | | pg.getParameters().put('RecordType',mso.get('RecordType')); |
| | | pg.getParameters().put('accid',mso.get('accid')); |
| | | pg.getParameters().put('nooverride','1'); |
| | | pg.setRedirect(true); |
| | | return pg; |
| | |
| | | Sobject sobj = Database.query(soql); |
| | | |
| | | Map<String, String> m = new Map<String, String>(); |
| | | |
| | | sobjId = sobjId.substring(0,sobjId.length()-3); |
| | | m.put((String)sobjId, (String)sobj.get('AWS_Data_Id__c')); |
| | | |
| | | LookUpOverrideFieldsMapJson = JSON.serialize(m); |
| | |
| | | * @description : |
| | | * @author : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | * @group : |
| | | * @last modified on : 03-10-2022 |
| | | * @last modified on : 03-17-2022 |
| | | * @last modified by : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | **/ |
| | | global without sharing class NewConsumApplyController { |
| | | public String layoutSectionsStr {get; set;}//for dynamic add readonly attribute |
| | | public List <LayoutDescriberHelper.LayoutSection > layoutSections{set;get;} |
| | | public String awsToken{set;get;} |
| | | public static Map<String, Schema.SObjectType> schemaMap = Schema.getGlobalDescribe(); |
| | |
| | | } |
| | | LayoutDescriberHelper.LayoutWrapper LayoutWrapperValue = LayoutDescriberHelper.describeSectionWithFieldsWrapper(rtTypeId, 'Consum_Apply__c','classic'); |
| | | layoutSections = LayoutWrapperValue.layoutSections; |
| | | layoutSectionsStr = JSON.serialize(layoutSections); //for dynamic add readonly attribute |
| | | List<String> requiredFieldAPIList = LayoutWrapperValue.requiredFieldAPIList; |
| | | Map<String,String> fieldAPIToLabelMap = LayoutWrapperValue.fieldAPIToLabelMap; |
| | | requiredFieldAPIListStr = JSON.serialize(requiredFieldAPIList); |
| | |
| | | /** |
| | | * @description : |
| | | * @author : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | * @group : |
| | | * @last modified on : 03-17-2022 |
| | | * @last modified by : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | **/ |
| | | global without sharing class NewConsumApplyEquipSetDetailController { |
| | | public String layoutSectionsStr {get; set;}//for dynamic add readonly attribute |
| | | public List <LayoutDescriberHelper.LayoutSection > layoutSections{set;get;} |
| | | public String awsToken{set;get;} |
| | | public static Map<String, Schema.SObjectType> schemaMap = Schema.getGlobalDescribe(); |
| | |
| | | } |
| | | LayoutDescriberHelper.LayoutWrapper LayoutWrapperValue = LayoutDescriberHelper.describeSectionWithFieldsWrapper(rtTypeId, 'Consum_Apply_Equipment_Set_Detail__c','classic'); |
| | | layoutSections = LayoutWrapperValue.layoutSections; |
| | | layoutSectionsStr = JSON.serialize(layoutSections); //for dynamic add readonly attribute |
| | | List<String> requiredFieldAPIList = LayoutWrapperValue.requiredFieldAPIList; |
| | | Map<String,String> fieldAPIToLabelMap = LayoutWrapperValue.fieldAPIToLabelMap; |
| | | requiredFieldAPIListStr = JSON.serialize(requiredFieldAPIList); |
| | |
| | | *@Date: 2022-03-10 10:26:47 |
| | | */ |
| | | global without sharing class NewRepairController { |
| | | public String layoutSectionsStr {get; set;}//for dynamic add readonly attribute |
| | | public List <LayoutDescriberHelper.LayoutSection > layoutSections{set;get;} |
| | | public String awsToken{set;get;} |
| | | public static Map<String, Schema.SObjectType> schemaMap = Schema.getGlobalDescribe(); |
| | |
| | | } |
| | | LayoutDescriberHelper.LayoutWrapper LayoutWrapperValue = LayoutDescriberHelper.describeSectionWithFieldsWrapper(rtTypeId, 'Repair__c','classic'); |
| | | layoutSections = LayoutWrapperValue.layoutSections; |
| | | layoutSectionsStr = JSON.serialize(layoutSections); //for dynamic add readonly attribute |
| | | List<String> requiredFieldAPIList = LayoutWrapperValue.requiredFieldAPIList; |
| | | Map<String,String> fieldAPIToLabelMap = LayoutWrapperValue.fieldAPIToLabelMap; |
| | | requiredFieldAPIListStr = JSON.serialize(requiredFieldAPIList); |
| | |
| | | /** |
| | | * @description : |
| | | * @author : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | * @group : |
| | | * @last modified on : 03-17-2022 |
| | | * @last modified by : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | **/ |
| | | global without sharing class OnCallController { |
| | | public String layoutSectionsStr {get; set;}//for dynamic add readonly attribute |
| | | public List <LayoutDescriberHelper.LayoutSection > layoutSections{set;get;} |
| | | public String awsToken{set;get;} |
| | | public static Map<String, Schema.SObjectType> schemaMap = Schema.getGlobalDescribe(); |
| | |
| | | }else{ |
| | | //新建 |
| | | rtTypeId = null; |
| | | obj.put('OwnerId',UserInfo.getUserId()); |
| | | } |
| | | LayoutDescriberHelper.LayoutWrapper LayoutWrapperValue = LayoutDescriberHelper.describeSectionWithFieldsWrapper(rtTypeId, 'On_Call__c','classic'); |
| | | layoutSections = LayoutWrapperValue.layoutSections; |
| | | layoutSectionsStr = JSON.serialize(layoutSections); //for dynamic add readonly attribute |
| | | List<String> requiredFieldAPIList = LayoutWrapperValue.requiredFieldAPIList; |
| | | Map<String,String> fieldAPIToLabelMap = LayoutWrapperValue.fieldAPIToLabelMap; |
| | | requiredFieldAPIListStr = JSON.serialize(requiredFieldAPIList); |
| | |
| | | On_Call__c onCallInfo = new On_Call__c(); |
| | | //自定义格式转换 |
| | | for (String fieldAPI: fieldValueMap.keySet()) { |
| | | system.debug('field API'+fieldAPI); |
| | | system.debug('field API='+fieldAPI); |
| | | Schema.DisplayType fielddataType = fieldAPIToTypeMap.get(fieldAPI).getDescribe().getType(); |
| | | String fieldValue = String.valueOf(fieldValueMap.get(fieldAPI)); |
| | | if(String.isBlank(fieldValue)){ |
| | | continue; |
| | | } |
| | | system.debug('Field Type:'+fielddataType+' field Value='+fieldValue); |
| | | if(String.valueOf(fielddataType)=='DATE'){ |
| | | onCallInfo.put(fieldAPI, Date.valueOf(String.valueOf(fieldValueMap.get(fieldAPI)).replace('/', '-'))); |
| | | onCallInfo.put(fieldAPI,(String.isBlank(fieldValue)||String.isEmpty(fieldValue))? null:Date.valueOf(fieldValue.replace('/', '-'))); |
| | | }else if(String.valueOf(fielddataType)=='DATETIME'){ |
| | | String dt = String.valueOf(fieldValueMap.get(fieldAPI)); |
| | | if(String.isNotBlank(dt)&&dt.contains('T')){ |
| | | dt = dt.replace('T',' '); |
| | | onCallInfo.put(fieldAPI, Datetime.valueOfGmt(dt)); |
| | | } |
| | | }else if(String.valueOf(fielddataType)=='Number'||String.valueOf(fielddataType)=='DOUBLE' ){ |
| | | onCallInfo.put(fieldAPI, Decimal.valueOf(String.valueOf(fieldValueMap.get(fieldAPI)))); |
| | | if(String.isNotBlank(fieldValue)&&fieldValue.contains('T')){ |
| | | fieldValue = fieldValue.replace('T',' '); |
| | | onCallInfo.put(fieldAPI, Datetime.valueOfGmt(fieldValue)); |
| | | }else{ |
| | | onCallInfo.put(fieldAPI, null); |
| | | } |
| | | }else if(String.valueof(fielddataType)=='CURRENCY'|| String.valueof(fielddataType)=='PERCENT'||String.valueOf(fielddataType)=='Number'||String.valueOf(fielddataType)=='DOUBLE' ){ |
| | | onCallInfo.put(fieldAPI, (String.isBlank(fieldValue)||String.isEmpty(fieldValue))?0:Decimal.valueOf(fieldValue)); |
| | | } else if(String.valueof(fielddataType)=='BOOLEAN'){ |
| | | onCallInfo.put(fieldAPI, fieldValueMap.get(fieldAPI)); |
| | | }else { |
| | | onCallInfo.put(fieldAPI, String.valueOf(fieldValueMap.get(fieldAPI))); |
| | | } |
| | | onCallInfo.put(fieldAPI,fieldValue); |
| | | } |
| | | } |
| | | |
| | | //2. Save Record Process |
| | |
| | | * @description : |
| | | * @author : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | * @group : |
| | | * @last modified on : 03-11-2022 |
| | | * @last modified on : 03-17-2022 |
| | | * @last modified by : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | **/ |
| | | global without sharing class RentalApplyController { |
| | | public String layoutSectionsStr {get; set;}//for dynamic add readonly attribute |
| | | public List <LayoutDescriberHelper.LayoutSection > layoutSections{set;get;} |
| | | public String awsToken{set;get;} |
| | | public static Map<String, Schema.SObjectType> schemaMap = Schema.getGlobalDescribe(); |
| | |
| | | }else{ |
| | | //新建 |
| | | rtTypeId = ApexPages.currentPage().getParameters().get('RecordType'); |
| | | obj.put('OwnerId',UserInfo.getUserId()); |
| | | } |
| | | LayoutDescriberHelper.LayoutWrapper LayoutWrapperValue = LayoutDescriberHelper.describeSectionWithFieldsWrapper(rtTypeId, 'Rental_Apply__c','classic'); |
| | | layoutSections = LayoutWrapperValue.layoutSections; |
| | | layoutSectionsStr = JSON.serialize(layoutSections); //for dynamic add readonly attribute |
| | | List<String> requiredFieldAPIList = LayoutWrapperValue.requiredFieldAPIList; |
| | | Map<String,String> fieldAPIToLabelMap = LayoutWrapperValue.fieldAPIToLabelMap; |
| | | requiredFieldAPIListStr = JSON.serialize(requiredFieldAPIList); |
| | |
| | | return resp; |
| | | } |
| | | |
| | | @RemoteAction |
| | | public static Response searchContactsNoPI(String contactName) { |
| | | Response resp = new Response(); |
| | | resp.status = 'fail'; |
| | | List<Contact> conListTemp = new List<Contact>([select Id,Name,Account.Name,Phone,Email from Contact where Name like :contactName]); |
| | | if(conListTemp.size() > 0){ |
| | | resp.status = 'success'; |
| | | resp.message = JSON.serialize(conListTemp); |
| | | } |
| | | return resp; |
| | | } |
| | | |
| | | public class Response{ |
| | | public String message{set;get;} |
| | | public String status{set;get;} |
| | |
| | | * 开始方法 |
| | | */ |
| | | public PageReference init(){ |
| | | System.debug('RepairId-----'+RepairId); |
| | | String RepairSql = makeTextRepairSql(RepairId); |
| | | System.debug('RepairSql-----'+RepairSql); |
| | | try{ |
| | | pc = Database.query(RepairSql); |
| | | system.debug('pc = ' + pc); |
| | |
| | | }catch(exception e){ |
| | | //失败提示 |
| | | ApexPages.addMessages(e); |
| | | System.debug(e.getMessage()); |
| | | System.debug(e.getlineNumber()); |
| | | } |
| | | insUpdData = new Address__c(); |
| | | newCon = new Contact(); |
| | |
| | | try{ |
| | | //保存数据到修理表中 |
| | | Repair__c rc = new Repair__c(); |
| | | rc.id=RepairId; |
| | | rc.id = RepairId; |
| | | rc.Address_AWS_Data_Id__c = tableData[i].address.AWS_Data_Id__c; |
| | | rc.Contact_AWS_Data_Id__c = contactawsDataId; |
| | | rc.address_Contacts__c = contactsName; |
| | |
| | | List<Address__c> dataList = Database.query(AddressSql); |
| | | if(dataList != null && dataList.size()> 0){ |
| | | indexCou += dataList.size(); |
| | | System.debug('dataList-----'+dataList); |
| | | for(Integer i = 0;i<dataList.size();i++){ |
| | | String createID = dataList[i].CreatedByid; |
| | | createId = createId.substring(0,15); |
| | | //办事处的地址不可修改 |
| | | |
| | | if(dataList[i].Address_Classification__c == '办事处'){ |
| | | tableData.add(new AddressData(dataList[i],'none','none','inline')); |
| | | tableData.add(new AddressData(dataList[i],'none','none','inline')); |
| | | }else{ |
| | | //只能改自己创建的地址数据,系统管理员、GPI_系统管理员New 没限制 |
| | | if(loginPerson == createId ||loginPerson == '00e10000000dzzG' ||loginPerson == '00e10000000Y3o5'){ |
| | |
| | | } |
| | | } |
| | | //判断联系人是否都为空 |
| | | |
| | | if(insUpdData.Contacts__c == null || String.isBlank(insUpdData.Contacts__c)){ |
| | | //判断新建联系人是否为空 |
| | | if(insUpdData.Create_Contacts__c == null || String.isBlank(insUpdData.Create_Contacts__c)){ |
| | |
| | | <!-- |
| | | @description : |
| | | @author : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | @group : |
| | | @last modified on : 03-17-2022 |
| | | @last modified by : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | --> |
| | | <apex:page standardController="ASEActivity__c" extensions="NewAndEditASEActivityController" id="page"> |
| | | <apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }" /> |
| | | <script src="../../soap/ajax/53.0/connection.js" type="text/javascript"></script> |
| | |
| | | queryBack:function (data) { |
| | | console.log('data = ' + data); |
| | | if(data.object){ |
| | | for(let f in config.AWSToSobjectNonEncryptedMap){ |
| | | let ele = GetEleByClass(config.ApiPrefix + "_"+ config.AWSToSobjectNonEncryptedMap[f]); |
| | | for(let fi in config.AWSToSobjectNonEncryptedMapKeySet){ |
| | | let f = config.AWSToSobjectNonEncryptedMapKeySet[fi]; |
| | | let ele = document.getElementById(api_id_map[config.AWSToSobjectNonEncryptedMap[f]]) |
| | | if(data.object.hasOwnProperty(f) && ele){ |
| | | |
| | | // 多选特殊处理 |
| | | if(ele.type == 'select-multiple'){ |
| | | //let me = GetEleByClass(config.ApiPrefix+'_'+field_api_name); |
| | | if(ele && data.object[f]){ |
| | | let arr = data.object[f].split(';'); |
| | | |
| | | // 给隐藏的select赋值 |
| | | for(let op of ele.options){ |
| | | op.selected = arr.indexOf(op.value)>-1; |
| | | } |
| | | |
| | | // 利用按钮给显示的select赋值 |
| | | let ra = document.getElementById(ele.id + '_right_arrow'); |
| | | if(ra){ |
| | | ra.click(); |
| | | } |
| | | |
| | | } |
| | | if(ele ){ |
| | | //_unselected |
| | | let v = ''; |
| | | if(data.object[f]){ |
| | | v = data.object[f]; |
| | | } |
| | | |
| | | let arr = v.split(';'); |
| | | |
| | | for(let opi in ele.options){ |
| | | let op = ele.options[opi]; |
| | | if(!op)continue; |
| | | op.selected = arr.indexOf(op.value)>-1; |
| | | } |
| | | let ra = document.getElementById(ele.id + '_right_arrow'); |
| | | if(ra){ |
| | | ra.click(); |
| | | } |
| | | |
| | | } |
| | | }else{ |
| | | ele.value = data.object[f]; |
| | | } |
| | | |
| | | if(ele.type.indexOf("select")>-1 && ele.value){ |
| | | jQuery(ele).change() |
| | | } |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | var GetEleApiName = function(ele){ |
| | | for(let c of ele.classList){ |
| | | for(let ci in ele.classList){ |
| | | let c = ele.classList[ci]; |
| | | if(c.indexOf(config.ApiPrefix+'_')>-1){ |
| | | return c.replace(config.ApiPrefix+'_',''); |
| | | } |
| | |
| | | // } |
| | | let phone = document.querySelector(textPhone); |
| | | |
| | | if(phone && !/^1[3|5|8|7][0-9]\d{4,8}$/.test(phone.value)){ |
| | | error_msg += ';电话号码错误'; |
| | | if(phone ){ |
| | | if(phone.value){ |
| | | if(!/^1[3|5|8|7][0-9]\d{4,8}$/.test(phone.value)){ |
| | | error_msg += ';电话号码错误'; |
| | | } |
| | | }else{ |
| | | if(phone.previousSibling && phone.previousSibling.className.indexOf('requiredBlock')>-1){ |
| | | error_msg += ';电话号码错误'; |
| | | } |
| | | } |
| | | } |
| | | |
| | | for(let e of document.getElementsByTagName('select')){ |
| | | for(let op of e.options){ |
| | | let es = document.getElementsByTagName('select') |
| | | for(let ei in es){ |
| | | let e = es[ei]; |
| | | for(let opi in e.options){ |
| | | let op = e.options[opi]; |
| | | if(!op)continue; |
| | | if(op.value == "*****" && op.selected){ |
| | | error_msg += ';下拉框不能主动选择密文选项'; |
| | | } |
| | |
| | | v = ele.value; |
| | | } |
| | | |
| | | if(v && v != "000000000000000"){ |
| | | // if(v && v != "000000000000000"){ |
| | | result[field_api_name] = v; |
| | | } |
| | | // } |
| | | |
| | | } |
| | | } else if (ele.type == 'checkbox') { |
| | |
| | | // Check Required Field |
| | | let checkRequiredFieldMsgResult = checkRequiredFieldMsg(sobjJson); |
| | | if (checkRequiredFieldMsgResult) { |
| | | alertErrorMessage('requiredErrorMsg' + checkRequiredFieldMsgResult); |
| | | alertErrorMessage('{!$Label.Input_Required_Field_Msg}' + checkRequiredFieldMsgResult); |
| | | return |
| | | } |
| | | // //3. Prepare the payload for New PI API To AWS - To Do |
| | |
| | | function replaceSearchContactLookup() { |
| | | let lookUpNode = htmlToElement(contactHtmlString); |
| | | console.log(lookUpNode); |
| | | if (!{!isNewMode}) { |
| | | let eleContactValue = document.querySelector("[data-id='ReporterASE__c']").parentNode.parentNode.children[0].value; |
| | | if (!{!isNewMode} || (eleContactValue != '000000000000000')) { |
| | | //1. Query Contact from AWS by AWSDataId |
| | | queryContactName() |
| | | } |
| | |
| | | </apex:repeat> |
| | | <script> |
| | | sfdcPage.appendToOnloadQueue(function () { |
| | | var layoutSections = JSON.parse('{!layoutSectionsStr}'); |
| | | for (let m = 0; m < layoutSections.length; m++) { |
| | | let layoutSection = layoutSections[m].layoutFields; |
| | | for (let n = 0; n < layoutSection.length; n++) { |
| | | let layoutField = layoutSection[n]; |
| | | if (layoutField.fieldAPI != '' && document.querySelector("[data-id='"+layoutField.fieldAPI+"']") != null) { |
| | | document.querySelector("[data-id='"+layoutField.fieldAPI+"']").disabled = !(layoutField.editableField); |
| | | } |
| | | } |
| | | } |
| | | //1. Set Last Name label |
| | | //document.querySelector("[data-id='LastName']").parentNode.parentNode.parentNode.children[2].children[0].innerText = '姓名'; |
| | | //2. Query AWS Data by dataId |
| | |
| | | //Replace Vlookup Field |
| | | replaceSearchContactLookup(); |
| | | document.querySelectorAll("[data-id='OwnerId']")[0].classList.add("disabledbutton"); |
| | | document.querySelectorAll("[data-id='OwnerId']")[1].classList.add("disabledbutton"); |
| | | 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 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"> |
| | |
| | | je.css("background","unset"); |
| | | |
| | | let dataid = je.attr('data-id'); |
| | | if(['OwnerId'].indexOf(dataid) > -1) return; |
| | | if(['Province__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;">'); |
| | | }) |
| | | |
| | |
| | | let sfId = document.getElementById(document.querySelector("[data-id='ContactId']").id + '_lkid').value; |
| | | let contactsInfo = JSON.parse('{!contactsInfo}'); |
| | | let dataId = contactsInfo[sfId]; |
| | | // let queryContactBack = function(data){ |
| | | // //To Do later |
| | | // console.log('ContactData = ' + data.object); |
| | | let queryContactBack = function(data){ |
| | | //To Do later |
| | | console.log('ContactData = ' + data.object); |
| | | |
| | | // document.querySelector("[data-id='ContactId']").value = data.object.lastName; |
| | | // } |
| | | // AWSService.query(staticResourcesContact.queryUrl, dataId, queryContactBack, staticResources.token); |
| | | let url = staticResourcesContact.queryUrl + '?dataId=' + dataId; |
| | | fetch(url, { |
| | | method: 'GET', |
| | | headers: { |
| | | 'Content-Type': 'application/json', |
| | | 'pi-token': staticResources.token |
| | | } |
| | | }).then((data) => { |
| | | return data.json(); |
| | | }).then((result) => { |
| | | document.querySelector("[data-id='ContactId']").value = result.object.lastName; |
| | | }) |
| | | document.querySelector("[data-id='ContactId']").value = data.object.lastName; |
| | | } |
| | | AWSService.query(staticResourcesContact.queryUrl, dataId, queryContactBack, staticResources.token); |
| | | // let url = staticResourcesContact.queryUrl + '?dataId=' + dataId; |
| | | // fetch(url, { |
| | | // method: 'GET', |
| | | // headers: { |
| | | // 'Content-Type': 'application/json', |
| | | // 'pi-token': staticResources.token |
| | | // } |
| | | // }).then((data) => { |
| | | // return data.json(); |
| | | // }).then((result) => { |
| | | // document.querySelector("[data-id='ContactId']").value = result.object.lastName; |
| | | // }) |
| | | } |
| | | </script> |
| | | <div class="bPageTitle"> |
| | |
| | | </apex:repeat> |
| | | <script> |
| | | sfdcPage.appendToOnloadQueue(function () { |
| | | var layoutSections = JSON.parse('{!layoutSectionsStr}'); |
| | | for (let m = 0; m < layoutSections.length; m++) { |
| | | let layoutSection = layoutSections[m].layoutFields; |
| | | for (let n = 0; n < layoutSection.length; n++) { |
| | | let layoutField = layoutSection[n]; |
| | | if (layoutField.fieldAPI != '' && document.querySelector("[data-id='"+layoutField.fieldAPI+"']") != null) { |
| | | document.querySelector("[data-id='"+layoutField.fieldAPI+"']").disabled = !(layoutField.editableField); |
| | | } |
| | | } |
| | | } |
| | | //1. Set Last Name label |
| | | //document.querySelector("[data-id='LastName']").parentNode.parentNode.parentNode.children[2].children[0].innerText = '姓名'; |
| | | //2. Query AWS Data by dataId |
| | |
| | | document.querySelector("[data-id='RecordTypeId']").classList.add("disabledbutton"); |
| | | //需要隐藏 |
| | | // document.querySelector("[data-id='SuppliedEmail']").classList.add("displayblock"); |
| | | |
| | | 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 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"> |
| | |
| | | <apex:page standardController="Contact" extensions="NewAndEditContactController" id="page"> |
| | | <apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }" /> |
| | | <apex:page standardController="Contact" extensions="NewAndEditContactController" id="page" action="{!PageLoad}"> |
| | | <script src="../../soap/ajax/53.0/connection.js" type="text/javascript"></script> |
| | | <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/> |
| | | <apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }" /> |
| | | <script> |
| | | |
| | | var config = {}; |
| | |
| | | queryBack:function (data) { |
| | | console.log('data = ' + data); |
| | | if(data.object){ |
| | | for(let f of config.AWSToSobjectNonEncryptedMapKeySet){ |
| | | for(let fi in config.AWSToSobjectNonEncryptedMapKeySet){ |
| | | let f = config.AWSToSobjectNonEncryptedMapKeySet[fi]; |
| | | let ele = document.getElementById(api_id_map[config.AWSToSobjectNonEncryptedMap[f]]) |
| | | if(data.object.hasOwnProperty(f) && ele){ |
| | | |
| | |
| | | } |
| | | |
| | | let arr = v.split(';'); |
| | | |
| | | // 清空已有选项 |
| | | /* |
| | | let sl = document.getElementById(ele.id + '_selected'); |
| | | if(sl){ |
| | | for(let op of sl.options){ |
| | | op.selected = true; |
| | | } |
| | | let la = document.getElementById(ele.id + '_left_arrow'); |
| | | if(la){ |
| | | la.click(); |
| | | } |
| | | } |
| | | |
| | | // 赋值新选项 |
| | | let us = document.getElementById(ele.id + '_unselected'); |
| | | if(us){ |
| | | for(let op of us.options){ |
| | | op.selected = arr.indexOf(op.value)>-1; |
| | | } |
| | | let ra = document.getElementById(ele.id + '_right_arrow'); |
| | | if(ra){ |
| | | ra.click(); |
| | | } |
| | | }*/ |
| | | for(let op of ele.options){ |
| | | for(let opi in ele.options){ |
| | | let op = ele.options[opi]; |
| | | if(!op)continue; |
| | | op.selected = arr.indexOf(op.value)>-1; |
| | | } |
| | | let ra = document.getElementById(ele.id + '_right_arrow'); |
| | |
| | | } |
| | | |
| | | var GetEleApiName = function(ele){ |
| | | for(let c of ele.classList){ |
| | | for(let ci in ele.classList){ |
| | | let c = ele.classList[ci]; |
| | | if(c.indexOf(config.ApiPrefix+'_')>-1){ |
| | | return c.replace(config.ApiPrefix+'_',''); |
| | | } |
| | |
| | | } |
| | | |
| | | function IsFormTag(tag_name){ |
| | | if (!tag_name) { |
| | | return false; |
| | | } |
| | | return ['input','select','textarea'].indexOf(tag_name.toLowerCase())>-1; |
| | | } |
| | | |
| | |
| | | let textPhone = "[data-id='Phone']"; |
| | | //Email |
| | | let email = document.querySelector(textEmail); |
| | | if(email && email.previousSibling && email.previousSibling.className.indexOf('requiredBlock')>-1 && !/^[\w-]{3,12}@[\da-zA-Z]{2,16}\.[a-zA-Z]+$/.test(email.value)){ |
| | | error_msg += ';邮件格式错误'; |
| | | if(email ){ |
| | | if(email.value){ |
| | | if(!/^[\w-]{3,12}@[\da-zA-Z]{2,16}\.[a-zA-Z]+$/.test(email.value)){ |
| | | error_msg += ';邮件格式错误'; |
| | | } |
| | | }else{ |
| | | if(email.previousSibling && email.previousSibling.className.indexOf('requiredBlock')>-1){ |
| | | error_msg += ';邮件格式错误'; |
| | | } |
| | | } |
| | | } |
| | | let phone = document.querySelector(textPhone); |
| | | |
| | | if(phone && phone.previousSibling && phone.previousSibling.className.indexOf('requiredBlock')>-1 && !/^1[3|5|8|7][0-9]\d{4,8}$/.test(phone.value)){ |
| | | error_msg += ';电话号码错误'; |
| | | if(phone ){ |
| | | if(phone.value){ |
| | | if(!/^1[3|5|8|7][0-9]\d{4,8}$/.test(phone.value)){ |
| | | error_msg += ';电话号码错误'; |
| | | } |
| | | }else{ |
| | | if(phone.previousSibling && phone.previousSibling.className.indexOf('requiredBlock')>-1){ |
| | | error_msg += ';电话号码错误'; |
| | | } |
| | | } |
| | | } |
| | | |
| | | for(let e of document.getElementsByTagName('select')){ |
| | | for(let op of e.options){ |
| | | let es = document.getElementsByTagName('select') |
| | | for(let ei in es){ |
| | | let e = es[ei]; |
| | | for(let opi in e.options){ |
| | | let op = e.options[opi]; |
| | | if(!op)continue; |
| | | if(op.value == "*****" && op.selected){ |
| | | error_msg += ';下拉框不能主动选择密文选项'; |
| | | } |
| | |
| | | v = ele.value; |
| | | } |
| | | |
| | | if(v && v != "000000000000000"){ |
| | | // if(v && v != "000000000000000"){ |
| | | result[field_api_name] = v; |
| | | } |
| | | // } |
| | | |
| | | } |
| | | } else if (ele.type == 'checkbox') { |
| | |
| | | // Check Required Field |
| | | let checkRequiredFieldMsgResult = checkRequiredFieldMsg(sobjJson); |
| | | if (checkRequiredFieldMsgResult) { |
| | | alertErrorMessage('requiredErrorMsg' + checkRequiredFieldMsgResult); |
| | | alertErrorMessage('{! $Label.Input_Required_Field_Msg}' + checkRequiredFieldMsgResult); |
| | | return |
| | | } |
| | | // //3. Prepare the payload for New PI API To AWS - To Do |
| | |
| | | <script> |
| | | var init_nodes = document.getElementsByClassName("PIBackApi"); |
| | | var api_id_map={}; |
| | | for(let e of init_nodes){ |
| | | 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 () { |
| | | |
| | | jQuery('option').each(function(i,e){ |
| | | if(e.value == '_\x01_'){ |
| | | e.value = ''; |
| | | } |
| | | }) |
| | | |
| | | //1. Set Last Name label |
| | | //document.querySelector("[data-id='LastName']").parentNode.parentNode.parentNode.children[2].children[0].innerText = '姓名'; |
| | | //2. Query AWS Data by dataId |
| | |
| | | if (!{!isNewMode}) { |
| | | blockme(); |
| | | QuerySobjectFromAWS(); |
| | | }else{ |
| | | let ot = jQuery('input[data-id="OwnerId"]'); |
| | | let oi = document.getElementById(ot.attr("id")+'_lkid'); |
| | | ot.val('{!CurrentUserName}'); |
| | | ot.attr("readonly",""); |
| | | ot.css("background","unset"); |
| | | ot.css("border","0"); |
| | | ot.css("outline","0"); |
| | | |
| | | if(oi){ |
| | | oi.value = '{!CurrentUserId}' |
| | | } |
| | | } |
| | | 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 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 = ''; |
| | | } |
| | | } |
| | | }); |
| | | |
| | | var layoutSections = JSON.parse('{!layoutSectionsStr}'); |
| | | for (let m = 0; m < layoutSections.length; m++) { |
| | | let layoutSection = layoutSections[m].layoutFields; |
| | | for (let n = 0; n < layoutSection.length; n++) { |
| | | let layoutField = layoutSection[n]; |
| | | if (layoutField.fieldAPI != '' && document.querySelector("[data-id='"+layoutField.fieldAPI+"']") != null) { |
| | | document.querySelector("[data-id='"+layoutField.fieldAPI+"']").disabled = !(layoutField.editableField); |
| | | } |
| | | } |
| | | } |
| | | |
| | | }); |
| | | </script> |
| | | <div class="pbBottomButtons"> |
| | |
| | | let arr = data.object[f].split(';'); |
| | | |
| | | // 给隐藏的select赋值 |
| | | for(let op of ele.options){ |
| | | for(let opi in ele.options){ |
| | | let op = ele.options[opi] |
| | | op.selected = arr.indexOf(op.value)>-1; |
| | | } |
| | | |
| | |
| | | v = ele.value; |
| | | } |
| | | |
| | | if(v && v != "000000000000000"){ |
| | | //if(v && v != "000000000000000"){ |
| | | result[field_api_name] = v; |
| | | } |
| | | //} |
| | | |
| | | } |
| | | } else if (ele.type == 'checkbox') { |
| | |
| | | console.log('sobjJson:'+sobjJson); |
| | | console.log('check:'+checkRequiredFieldMsgResult); |
| | | if (checkRequiredFieldMsgResult) { |
| | | alertErrorMessage('requiredErrorMsg' + checkRequiredFieldMsgResult); |
| | | alertErrorMessage('{!$Label.Input_Required_Field_Msg}' + checkRequiredFieldMsgResult); |
| | | return |
| | | } |
| | | // //3. Prepare the payload for New PI API To AWS - To Do |
| | |
| | | if (!{!isNewMode}) { |
| | | blockme(); |
| | | QuerySobjectFromAWS(); |
| | | } |
| | | }else{ |
| | | let ot = jQuery('input[data-id="OwnerId"]'); |
| | | let oi = document.getElementById(ot.attr("id")+'_lkid'); |
| | | ot.val('{!CurrentUserName}'); |
| | | ot.attr("readonly",""); |
| | | ot.css("background","unset"); |
| | | ot.css("border","0"); |
| | | ot.css( "outline","0"); |
| | | jQuery('a[data-id="OwnerId"]').remove(); |
| | | if(oi){ |
| | | oi.value = '{!CurrentUserId}' |
| | | } |
| | | } |
| | | var layoutSections = JSON.parse('{!layoutSectionsStr}'); |
| | | for (let m = 0; m < layoutSections.length; m++) { |
| | | let layoutSection = layoutSections[m].layoutFields; |
| | | for (let n = 0; n < layoutSection.length; n++) { |
| | | let layoutField = layoutSection[n]; |
| | | if (layoutField.fieldAPI != '' && document.querySelector("[data-id='"+layoutField.fieldAPI+"']") != null) { |
| | | document.querySelector("[data-id='"+layoutField.fieldAPI+"']").disabled = !(layoutField.editableField); |
| | | } |
| | | } |
| | | } |
| | | 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"> |
| | |
| | | <apex:page standardController="Lead" extensions="NewAndEditLeadController" id="page"> |
| | | <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/> |
| | | <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.jquery183minjs)}" /> |
| | | <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}" /> |
| | | <script src="../../soap/ajax/53.0/connection.js" type="text/javascript"></script> |
| | | <style> |
| | | .disabledbutton { |
| | |
| | | var redirectMode = 'Save';//1. Save 2. SaveAndNew |
| | | var requiredAPIToChangedLabelMap = new Map(); |
| | | requiredAPIToChangedLabelMap.set('LastName', '{!PIPL_Name_Label}'); |
| | | console.log('{!contactsInfo}'); |
| | | var VLookUpFields = new Set(['Hospital_Name__c', 'Department_Class__c', 'Contact_Name__c', 'Campaign__c', 'Lead_Inquiry_form__c', 'Opp_Name_Search__c']); |
| | | function ProcessPI(leadJson, payloadForNewPI) { |
| | | blockme(); |
| | | if ({!isNewMode}) { |
| | | if ({!isNewMode |
| | | }) { |
| | | NewPIToAWS(leadJson, payloadForNewPI) |
| | | }else { |
| | | UpdatePIToAWS(leadJson, payloadForNewPI) |
| | |
| | | let textPhone = "[data-id='Phone']"; |
| | | //Email |
| | | let email = document.querySelector(textEmail); |
| | | if(email.value!='' && !/^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.[a-zA-Z0-9]{2,6}$/.test(email.value)){ |
| | | if (email.value != '' && !/^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.[a-zA-Z0-9]{2,6}$/.test(email.value)) { |
| | | error_msg += ';邮件格式错误'; |
| | | } |
| | | let phone = document.querySelector(textPhone); |
| | | |
| | | if(phone.value!='' && !/^1[3|5|8|7][0-9]\d{4,8}$/.test(phone.value)){ |
| | | if (phone.value != '' && !/^1[3|5|8|7][0-9]\d{4,8}$/.test(phone.value)) { |
| | | error_msg += ';电话号码错误'; |
| | | } |
| | | |
| | | for(let e of document.getElementsByTagName('select')){ |
| | | for(let op of e.options){ |
| | | let es = document.getElementsByTagName('select') |
| | | for(let ei in es){ |
| | | let e = es[ei]; |
| | | for(let opi in e.options){ |
| | | let op = e.options[opi]; |
| | | if(!op)continue; |
| | | if(op.value == "*****" && op.selected){ |
| | | error_msg += ';下拉框不能主动选择密文选项'; |
| | | } |
| | | } |
| | | } |
| | | |
| | | if(error_msg.length>0 && error_msg[0]== ';'){ |
| | | if (error_msg.length > 0 && error_msg[0] == ';') { |
| | | error_msg = error_msg.substring(1); |
| | | } |
| | | |
| | |
| | | queryBack:function (data) { |
| | | console.log('data = ' + data); |
| | | if(data.object){ |
| | | for(let f of config.AWSToSobjectNonEncryptedMapKeySet){ |
| | | for(let fi in config.AWSToSobjectNonEncryptedMapKeySet){ |
| | | let f = config.AWSToSobjectNonEncryptedMapKeySet[fi]; |
| | | let ele = document.getElementById(api_id_map[config.AWSToSobjectNonEncryptedMap[f]]) |
| | | if(data.object.hasOwnProperty(f) && ele){ |
| | | |
| | | // 多选特殊处理 |
| | | if(ele.type == 'select-multiple'){ |
| | | //let me = GetEleByClass(config.ApiPrefix+'_'+field_api_name); |
| | | if(ele && data.object[f]){ |
| | | let arr = data.object[f].split(';'); |
| | | |
| | | // 给隐藏的select赋值 |
| | | for(let op of ele.options){ |
| | | op.selected = arr.indexOf(op.value)>-1; |
| | | if(ele ){ |
| | | //_unselected |
| | | let v = ''; |
| | | if(data.object[f]){ |
| | | v = data.object[f]; |
| | | } |
| | | |
| | | // 利用按钮给显示的select赋值 |
| | | let arr = v.split(';'); |
| | | |
| | | for(let opi in ele.options){ |
| | | let op = ele.options[opi]; |
| | | if(!op)continue; |
| | | op.selected = arr.indexOf(op.value)>-1; |
| | | } |
| | | let ra = document.getElementById(ele.id + '_right_arrow'); |
| | | if(ra){ |
| | | ra.click(); |
| | |
| | | else{ |
| | | console.log('data.object = ' + data.object); |
| | | } |
| | | |
| | | |
| | | // document.querySelector("[data-id='LastName']").value = data.object.lastName; |
| | | // document.querySelector("[data-id='Phone']").value = data.object.phone; |
| | | // document.querySelector("[data-id='Email']").value = data.object.email; |
| | | }, |
| | | updateMethod:"NewAndEditQISController.saveQISReport", |
| | | insertMethod:"NewAndEditQISController.saveQISReport" |
| | |
| | | } |
| | | |
| | | var GetEleApiName = function(ele){ |
| | | for(let c of ele.classList){ |
| | | for(let ci in ele.classList){ |
| | | let c = ele.classList[ci]; |
| | | if(c.indexOf(config.ApiPrefix+'_')>-1){ |
| | | return c.replace(config.ApiPrefix+'_',''); |
| | | } |
| | |
| | | } |
| | | |
| | | function IsFormTag(tag_name){ |
| | | if (!tag_name) { |
| | | return false; |
| | | } |
| | | return ['input','select','textarea'].indexOf(tag_name.toLowerCase())>-1; |
| | | } |
| | | |
| | |
| | | error_msg += ';联系电话格式错误'; |
| | | } |
| | | |
| | | for(let e of document.getElementsByTagName('select')){ |
| | | for(let op of e.options){ |
| | | let es = document.getElementsByTagName('select') |
| | | for(let ei in es){ |
| | | let e = es[ei]; |
| | | for(let opi in e.options){ |
| | | let op = e.options[opi]; |
| | | if(!op)continue; |
| | | if(op.value == "*****" && op.selected){ |
| | | error_msg += ';下拉框不能主动选择密文选项'; |
| | | } |
| | |
| | | v = ele.value; |
| | | } |
| | | |
| | | if(v && v != "000000000000000"){ |
| | | //if(v && v != "000000000000000"){ |
| | | result[field_api_name] = v; |
| | | } |
| | | //} |
| | | |
| | | } |
| | | } else if (ele.type == 'checkbox') { |
| | |
| | | <script> |
| | | var init_nodes = document.getElementsByClassName("PIBackApi"); |
| | | var api_id_map={}; |
| | | for(let e of init_nodes){ |
| | | for(let ei in init_nodes){ |
| | | let e = init_nodes[ei]; |
| | | if(IsFormElement(e)){ |
| | | api_id_map[GetEleApiName(e)] = e.id; |
| | | 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); |
| | |
| | | let arr = data.object[f].split(';'); |
| | | |
| | | // 给隐藏的select赋值 |
| | | for(let op of ele.options){ |
| | | for(let opi in ele.options){ |
| | | let op = ele.options[opi] |
| | | op.selected = arr.indexOf(op.value)>-1; |
| | | } |
| | | |
| | |
| | | v = ele.value; |
| | | } |
| | | |
| | | if(v && v != "000000000000000"){ |
| | | //if(v && v != "000000000000000"){ |
| | | result[field_api_name] = v; |
| | | } |
| | | //} |
| | | |
| | | } |
| | | } else if (ele.type == 'checkbox') { |
| | |
| | | // Check Required Field |
| | | let checkRequiredFieldMsgResult = checkRequiredFieldMsg(sobjJson); |
| | | if (checkRequiredFieldMsgResult) { |
| | | alertErrorMessage('requiredErrorMsg' + checkRequiredFieldMsgResult); |
| | | alertErrorMessage('{!$Label.Input_Required_Field_Msg}' + checkRequiredFieldMsgResult); |
| | | return |
| | | } |
| | | // //3. Prepare the payload for New PI API To AWS - To Do |
| | |
| | | if (!{!isNewMode}) { |
| | | bolckme(); |
| | | QuerySobjectFromAWS(); |
| | | } |
| | | }else{ |
| | | let ot = jQuery('input[data-id="OwnerId"]'); |
| | | let oi = document.getElementById(ot.attr("id")+'_lkid'); |
| | | ot.val('{!CurrentUserName}'); |
| | | ot.attr("readonly",""); |
| | | ot.css("background","unset"); |
| | | ot.css("border","0"); |
| | | ot.css( "outline","0"); |
| | | jQuery('a[data-id="OwnerId"]').remove(); |
| | | if(oi){ |
| | | oi.value = '{!CurrentUserId}' |
| | | } |
| | | } |
| | | var layoutSections = JSON.parse('{!layoutSectionsStr}'); |
| | | for (let m = 0; m < layoutSections.length; m++) { |
| | | let layoutSection = layoutSections[m].layoutFields; |
| | | for (let n = 0; n < layoutSection.length; n++) { |
| | | let layoutField = layoutSection[n]; |
| | | if (layoutField.fieldAPI != '' && document.querySelector("[data-id='"+layoutField.fieldAPI+"']") != null) { |
| | | document.querySelector("[data-id='"+layoutField.fieldAPI+"']").disabled = !(layoutField.editableField); |
| | | } |
| | | } |
| | | } |
| | | 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"> |
| | |
| | | @description : |
| | | @author : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | @group : |
| | | @last modified on : 03-11-2022 |
| | | @last modified on : 03-17-2022 |
| | | @last modified by : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | --> |
| | | <apex:page standardController="Consum_Apply__c" extensions="NewConsumApplyController" id="page"> |
| | |
| | | <script> |
| | | //Append Page |
| | | sfdcPage.appendToOnloadQueue(function () { |
| | | var layoutSections = JSON.parse('{!layoutSectionsStr}'); |
| | | for (let m = 0; m < layoutSections.length; m++) { |
| | | let layoutSection = layoutSections[m].layoutFields; |
| | | for (let n = 0; n < layoutSection.length; n++) { |
| | | let layoutField = layoutSection[n]; |
| | | if (layoutField.fieldAPI != '' && document.querySelector("[data-id='"+layoutField.fieldAPI+"']") != null) { |
| | | document.querySelector("[data-id='"+layoutField.fieldAPI+"']").disabled = !(layoutField.editableField); |
| | | } |
| | | } |
| | | } |
| | | //2. Query AWS Data by dataId |
| | | console.log('Mode for consumApply Page:' + {!isNewMode}); |
| | | if (!{!isNewMode}) { |
| | |
| | | <!-- |
| | | @description : |
| | | @author : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | @group : |
| | | @last modified on : 03-17-2022 |
| | | @last modified by : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | --> |
| | | <apex:page standardController="Consum_Apply_Equipment_Set_Detail__c" extensions="NewConsumApplyEquipSetDetailController" id="page"> |
| | | <apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }" /> |
| | | <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/> |
| | |
| | | <script> |
| | | //Append Page |
| | | sfdcPage.appendToOnloadQueue(function () { |
| | | var layoutSections = JSON.parse('{!layoutSectionsStr}'); |
| | | for (let m = 0; m < layoutSections.length; m++) { |
| | | let layoutSection = layoutSections[m].layoutFields; |
| | | for (let n = 0; n < layoutSection.length; n++) { |
| | | let layoutField = layoutSection[n]; |
| | | if (layoutField.fieldAPI != '' && document.querySelector("[data-id='"+layoutField.fieldAPI+"']") != null) { |
| | | document.querySelector("[data-id='"+layoutField.fieldAPI+"']").disabled = !(layoutField.editableField); |
| | | } |
| | | } |
| | | } |
| | | //2. Query AWS Data by dataId |
| | | console.log('Mode for consumApply Page:' + {!isNewMode}); |
| | | if (!{!isNewMode}) { |
| | |
| | | <!-- |
| | | @description : |
| | | @author : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | @group : |
| | | @last modified on : 03-17-2022 |
| | | @last modified by : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | --> |
| | | <apex:page standardController="On_Call__c" extensions="OnCallController" id="page"> |
| | | <apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }" /> |
| | | <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/> |
| | |
| | | <script> |
| | | //Append Page |
| | | sfdcPage.appendToOnloadQueue(function () { |
| | | var layoutSections = JSON.parse('{!layoutSectionsStr}'); |
| | | for (let m = 0; m < layoutSections.length; m++) { |
| | | let layoutSection = layoutSections[m].layoutFields; |
| | | for (let n = 0; n < layoutSection.length; n++) { |
| | | let layoutField = layoutSection[n]; |
| | | if (layoutField.fieldAPI != '' && document.querySelector("[data-id='"+layoutField.fieldAPI+"']") != null) { |
| | | document.querySelector("[data-id='"+layoutField.fieldAPI+"']").disabled = !(layoutField.editableField); |
| | | } |
| | | } |
| | | } |
| | | //2. Query AWS Data by dataId |
| | | console.log('Mode for onCall Page:' + {!isNewMode}); |
| | | if (!{!isNewMode}) { |
| | |
| | | @description : |
| | | @author : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | @group : |
| | | @last modified on : 03-11-2022 |
| | | @last modified on : 03-17-2022 |
| | | @last modified by : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | --> |
| | | <apex:page standardController="Rental_Apply__c" extensions="RentalApplyController" id="page"> |
| | |
| | | <script> |
| | | //Append Page |
| | | sfdcPage.appendToOnloadQueue(function () { |
| | | var layoutSections = JSON.parse('{!layoutSectionsStr}'); |
| | | for (let m = 0; m < layoutSections.length; m++) { |
| | | let layoutSection = layoutSections[m].layoutFields; |
| | | for (let n = 0; n < layoutSection.length; n++) { |
| | | let layoutField = layoutSection[n]; |
| | | if (layoutField.fieldAPI != '' && document.querySelector("[data-id='"+layoutField.fieldAPI+"']") != null) { |
| | | document.querySelector("[data-id='"+layoutField.fieldAPI+"']").disabled = !(layoutField.editableField); |
| | | } |
| | | } |
| | | } |
| | | //2. Query AWS Data by dataId |
| | | console.log('Mode for rentalApply Page:' + {!isNewMode}); |
| | | if (!{!isNewMode}) { |
| | |
| | | <!-- |
| | | @description : |
| | | @author : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | @group : |
| | | @last modified on : 03-17-2022 |
| | | @last modified by : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | --> |
| | | <apex:page standardController="Repair__c" extensions="NewRepairController" id="page"> |
| | | <apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }" /> |
| | | <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/> |
| | |
| | | result[userVLookUpFields[i]] = userVlookUpNodeValue; |
| | | } |
| | | } |
| | | result.work_location_select__c = document.querySelector("[id='page:form:j_id30:j_id34:0:j_id35:j_id36:18:j_id37']").value; |
| | | result.work_location_select__c = document.querySelector("[id='page:form:j_id30:j_id34:1:j_id35:j_id36:18:j_id37']").value; |
| | | // result.ProblemDescription__c = document.querySelector("[aria-describedby = 'cke_34']").contentWindow.document.getElementsByTagName('body')[0].innerHTML |
| | | console.log(JSON.stringify(result)); |
| | | return result; |
| | |
| | | <script> |
| | | //Append Page |
| | | sfdcPage.appendToOnloadQueue(function () { |
| | | var layoutSections = JSON.parse('{!layoutSectionsStr}'); |
| | | for (let m = 0; m < layoutSections.length; m++) { |
| | | let layoutSection = layoutSections[m].layoutFields; |
| | | for (let n = 0; n < layoutSection.length; n++) { |
| | | let layoutField = layoutSection[n]; |
| | | if (layoutField.fieldAPI != '' && document.querySelector("[data-id='"+layoutField.fieldAPI+"']") != null) { |
| | | document.querySelector("[data-id='"+layoutField.fieldAPI+"']").disabled = !(layoutField.editableField); |
| | | } |
| | | } |
| | | } |
| | | //2. Query AWS Data by dataId |
| | | console.log('Mode for repair Page:' + {!isNewMode}); |
| | | if (!{!isNewMode}) { |
| | |
| | | |
| | | //替换vlookup |
| | | var newSearchContactWindow = null; |
| | | window.onload = () => { |
| | | window.onload = function () { |
| | | document.getElementById("tab01").style.height = screen.availHeight*0.07+'px'; |
| | | document.getElementById("tab02").style.height = screen.availHeight*0.53+'px'; |
| | | document.getElementById("tab03").style.height = screen.availHeight*0.25+'px'; |
| | |
| | | let divs = j$(e).find("div.message"); |
| | | for (let i = 0; i < divs.length; i++) { |
| | | for (let j = 0; j < divs[i].classList.length; j++) { |
| | | for(let cls of divs[i].classList){ |
| | | for(let cls in divs[i].classList){ |
| | | if (cls.indexOf('error')>-1) { |
| | | return true; |
| | | } |
| | |
| | | PIData[Id] = temp; |
| | | }; |
| | | for(var i=0;i<tableDataStr.length;i++){ |
| | | if(tableDataStr[i].address.AWS_Data_Id__c){ |
| | | if(tableDataStr[i].address.Contacts__r){ |
| | | correct++; |
| | | AWSService.queryRepair(staticResource.queryUrl,tableDataStr[i].address.AWS_Data_Id__c,tableDataStr[i].address.Id,tableDataStr[i].address.Contacts__r.AWS_Data_Id__c,searchCallBack,staticResource.token); |
| | | AWSService.queryRepair(staticResource.queryUrl, |
| | | tableDataStr[i].address.AWS_Data_Id__c, |
| | | tableDataStr[i].address.Id, |
| | | tableDataStr[i].address.Contacts__r.AWS_Data_Id__c, |
| | | searchCallBack, |
| | | staticResource.token); |
| | | } |
| | | } |
| | | var interval=self.setInterval(function (){ |
| | |
| | | let queryBack = function queryBack(result) { |
| | | let contacts = result.object; |
| | | if(contacts == null){ |
| | | console.log('查询联系人的数据 == null') |
| | | return; |
| | | } |
| | | for(var i=0;i<result.object.length;i++){ |
| | |
| | | '\n邮编: '+PIData[awsDataId].zipCode+ |
| | | '\n详细地址: '+PIData[awsDataId].detailedAddress |
| | | }else{ |
| | | piInformation = '联系人: '+ |
| | | piInformation = '联系人: null'+ |
| | | '\n电话: '+PIData[awsDataId].telephone+ |
| | | '\n邮编: '+PIData[awsDataId].zipCode+ |
| | | '\n详细地址: '+PIData[awsDataId].detailedAddress |
| | |
| | | let y=window.event.y; |
| | | createDiv.style.left=x; |
| | | createDiv.style.top=y; |
| | | createDiv.style.width = '100px'; |
| | | createDiv.style.height = '100px'; |
| | | createDiv.style.background="#dddddd"; |
| | | createDiv.style.position = "absolute"; |
| | | parentNode.appendChild(createDiv); |
| | | parentNode.style.position = "relative"; |
| | | } |
| | | |
| | | function hidePIDiv(awsDataId){ |
| | |
| | | <td align="left" style="vertical-align: inherit;border-width: 0px 1px 1px 0px;"> |
| | | <apex:outputfield value="{!or.address.Customer__c}" /> |
| | | </td> |
| | | <td align="left" style="vertical-align: inherit;border-width: 0px 1px 1px 0px;" aws-data-id="{!or.address.AWS_Data_Id__c}" > |
| | | <td align="left" style="vertical-align: inherit;border-width: 0px 1px 1px 0px;" aws-data-id="{!or.address.AWS_Data_Id__c}"> |
| | | <!-- <apex:outputfield value="{!or.address.Contacts__c}" id="{!or.address.Contacts__c}_{!or.address.Id}"/> --> |
| | | <a href="#" id="{!or.address.Id}" aws-data-id="{!or.address.Contacts__r.AWS_Data_Id__c}" onmouseover="showPIDiv('{!or.address.Id}')" onmouseout="hidePIDiv('{!or.address.Id}')">{!or.address.Contacts__r.Name}</a> |
| | | <a href="#" id="{!or.address.Id}" onmouseover="showPIDiv('{!or.address.Id}')" onmouseout="hidePIDiv('{!or.address.Id}')" aws-data-id="{!or.address.Contacts__r.AWS_Data_Id__c}">{!or.address.Contacts__r.Name}</a> |
| | | </td> |
| | | <td align="left" style="vertical-align: inherit;border-width: 0px 1px 1px 0px;"> |
| | | <apex:outputText value="{!or.address.Telephone__c}" /> |
| | |
| | | 'fileName': fileName }) |
| | | , function(result){ |
| | | console.log("result" + JSON.stringify(result)); |
| | | |
| | | |
| | | if (result.success == true) { |
| | | key = result.object; |
| | | |
| | |
| | | <!-- |
| | | @description : |
| | | @author : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | @group : |
| | | @last modified on : 03-17-2022 |
| | | @last modified by : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | --> |
| | | <apex:page standardController="ASEActivity__c" extensions="NewAndEditASEActivityController" id="page"> |
| | | <apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/> |
| | | <apex:form id="form"> |
| | | <apex:pageblock id="pageBlock"> |
| | | <apex:pageBlockSection showHeader="false" title="" collapsible="true" columns="2" id="pageBlockSection"> |
| | |
| | | AWSToSobjectEncryptedMap:{!AWSToSobjectEncryptedMapJson} |
| | | }; |
| | | var staticResources = JSON.parse('{!staticResource}'); |
| | | console.log(staticResources) |
| | | var staticResourcesContact = JSON.parse('{!staticResourceContact}'); |
| | | function QuerySobjectFromAWS() { |
| | | console.log('AWSDataId:'+'{!AWSDataId}') |
| | | AWSService.query(staticResources.queryUrl, '{!AWSDataId}', queryBack, staticResources.token); |
| | | } |
| | | |
| | | function QueryContactFromAWS() { |
| | | if('{!contactAWS}' != null && '{!contactAWS}' != ''){ |
| | | console.log('staticResourcesContact .queryUrl' + staticResourcesContact .queryUrl); |
| | | AWSService.query(staticResourcesContact .queryUrl, '{!contactAWS}', queryContactBack, staticResources.token); |
| | | } |
| | | } |
| | | |
| | | |
| | | var queryContactBack = function queryContactBack(data){ |
| | | if(!data.object){ |
| | | console.log('data.object is ' + data.object); |
| | |
| | | for(let f in config.AWSToSobjectNonEncryptedMap){ |
| | | let t = "[title='"+config.ApiPrefix+config.AWSToSobjectNonEncryptedMap[f]+"']"; |
| | | let ele = document.querySelector(t); |
| | | console.log(ele); |
| | | if(ele){ |
| | | ele.title = ''; |
| | | if(data.object.hasOwnProperty(f)){ |
| | |
| | | console.log('sfdcPage.appendToOnloadQueue') |
| | | // document.querySelector("[data-id='LastName']").parentNode.parentNode.parentNode.children[0].innerText = '姓名' |
| | | QuerySobjectFromAWS(); |
| | | QueryContactFromAWS(); |
| | | }); |
| | | </script> |
| | | </apex:pageblock> |
| | |
| | | <apex:page standardController="Address__c" extensions="NewAndEditAddressController" id="page"> |
| | | <apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/> |
| | | <script src="../../soap/ajax/53.0/connection.js" type="text/javascript"></script> |
| | | <apex:form id="form"> |
| | | <apex:pageblock id="pageBlock"> |
| | |
| | | <apex:page standardController="Case" extensions="NewAndEditCaseController" id="page"> |
| | | <apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/> |
| | | <apex:form id="form"> |
| | | <apex:pageblock id="pageBlock"> |
| | | <apex:pageBlockSection showHeader="false" title="" collapsible="true" columns="2" id="pageBlockSection"> |
| | |
| | | <!-- |
| | | @description : |
| | | @author : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | @group : |
| | | @last modified on : 03-17-2022 |
| | | @last modified by : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | --> |
| | | <apex:page standardController="Consum_Apply_Equipment_Set_Detail__c" extensions="NewConsumApplyEquipSetDetailController" id="page"> |
| | | <apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/> |
| | | <apex:form id="form"> |
| | | <apex:pageblock id="pageBlock"> |
| | | <apex:pageBlockSection showHeader="false" title="" collapsible="true" columns="2" id="pageBlockSection"> |
| | |
| | | <!-- |
| | | @description : |
| | | @author : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | @group : |
| | | @last modified on : 03-17-2022 |
| | | @last modified by : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | --> |
| | | <apex:page standardController="Consum_Apply__c" extensions="NewConsumApplyController" id="page"> |
| | | <apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/> |
| | | <apex:form id="form"> |
| | | <apex:pageblock id="pageBlock"> |
| | | <apex:pageBlockSection showHeader="false" title="" collapsible="true" columns="2" id="pageBlockSection"> |
| | |
| | | AWSService.query(staticResources.queryUrl, '{!AWSDataId}', queryBack, staticResources.token); |
| | | } |
| | | var queryBack = function queryBack(data) { |
| | | document.querySelector("[id='page:form:pageBlock:pageBlockSection:j_id1:0:j_id2']").innerHTML = data.object.phoneNumber; |
| | | document.querySelector("[id='page:form:pageBlock:pageBlockSection:j_id2:1:j_id3']").innerHTML = data.object.phoneNumber; |
| | | document.querySelector("[data-id='direct_shippment_address__c']").innerHTML = data.object.directShippmentAddress; |
| | | }; |
| | | sfdcPage.appendToOnloadQueue(function () { |
| | |
| | | <apex:page standardController="Inquiry_form__c" extensions="NewAndEditInquiryFormController" id="page"> |
| | | <apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/> |
| | | <apex:form id="form"> |
| | | <apex:pageblock id="pageBlock"> |
| | | <apex:pageBlockSection showHeader="false" title="" collapsible="true" columns="2" id="pageBlockSection"> |
| | |
| | | <!-- |
| | | @description : |
| | | @author : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | @group : |
| | | @last modified on : 03-17-2022 |
| | | @last modified by : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | --> |
| | | <apex:page standardController="On_Call__c" extensions="OnCallController" id="page"> |
| | | <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/> |
| | | <apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }"/> |
| | | <apex:form id="form"> |
| | | <apex:pageblock id="pageBlock"> |
| | |
| | | AWSService.query(staticResources.queryUrl, '{!AWSDataId}', queryBack, staticResources.token); |
| | | } |
| | | var queryBack = function queryBack(data) { |
| | | document.querySelector("[id='page:form:pageBlock:pageBlockSection:j_id1:0:j_id2']").innerHTML = data.object.callerPhone; |
| | | document.querySelector("[id='page:form:pageBlock:pageBlockSection:j_id2:1:j_id3']").innerHTML = data.object.callerPhone; |
| | | document.querySelector("[data-id='Responsible_Person_HP__c']").innerHTML = data.object.responsiblePersonHP; |
| | | }; |
| | | sfdcPage.appendToOnloadQueue(function () { |
| | |
| | | <!-- |
| | | @description : |
| | | @author : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | @group : |
| | | @last modified on : 03-17-2022 |
| | | @last modified by : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | --> |
| | | <apex:page standardController="Rental_Apply__c" extensions="RentalApplyController" id="page"> |
| | | <apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/> |
| | | <apex:form id="form"> |
| | | <apex:pageblock id="pageBlock"> |
| | | <apex:pageBlockSection showHeader="false" title="" collapsible="true" columns="2" id="pageBlockSection"> |
| | |
| | | AWSService.query(staticResources.queryUrl, '{!AWSDataId}', queryBack, staticResources.token); |
| | | } |
| | | var queryBack = function queryBack(data) { |
| | | document.querySelector("[id='page:form:pageBlock:pageBlockSection:j_id1:1:j_id2']").innerHTML = data.object.phoneNumber; |
| | | document.querySelector("[id='page:form:pageBlock:pageBlockSection:j_id1:0:j_id2']").innerHTML = data.object.phoneNumber; |
| | | document.querySelector("[data-id='direct_shippment_address__c']").innerHTML = data.object.directShippmentAddress; |
| | | }; |
| | | sfdcPage.appendToOnloadQueue(function () { |
| | |
| | | <!-- |
| | | @description : |
| | | @author : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | @group : |
| | | @last modified on : 03-17-2022 |
| | | @last modified by : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | --> |
| | | <apex:page standardController="Repair__c" extensions="NewRepairController" id="page"> |
| | | <apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }" /> |
| | | <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/> |
| | | <apex:form id="form"> |
| | | <apex:pageblock id="pageBlock"> |
| | | <apex:pageBlockSection showHeader="false" title="" collapsible="true" columns="2" id="pageBlockSection"> |
| | |
| | | </apex:repeat> |
| | | </apex:pageBlockSection> |
| | | <script> |
| | | debugger; |
| | | var staticResources = JSON.parse('{!staticResource}'); |
| | | var staticResourceContact = JSON.parse('{!staticResourceContact}'); |
| | | var staticResourceAddress = JSON.parse('{!staticResourceAddress}'); |
| | |
| | | } |
| | | sfdcPage.appendToOnloadQueue(function () { |
| | | console.log('sfdcPage.appendToOnloadQueue'); |
| | | debugger; |
| | | QueryConsumApplyFromAWS(); |
| | | }); |
| | | </script> |
| | |
| | | <apex:page standardController="RepairSubOrder__c" extensions="NewAndEditRepairSubOrderController" id="page"> |
| | | <apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/> |
| | | <apex:form id="form"> |
| | | <apex:pageblock id="pageBlock"> |
| | | <apex:pageBlockSection showHeader="false" title="" collapsible="true" columns="2" id="pageBlockSection"> |
| | |
| | | var AWSService = {}; |
| | | let AWSService = {}; |
| | | AWSService = { |
| | | sfSessionId : '', |
| | | insertModule : 'Insert AWS ', |
| | |
| | | |
| | | }, |
| | | |
| | | get:function(queryURL, queryback, token) { |
| | | let para = { |
| | | url:queryURL, |
| | | headers: { |
| | | 'Content-Type': 'application/json', |
| | | 'pi-token': token |
| | | }, |
| | | type: "get", |
| | | success: function (data) { |
| | | AWSService.insertCalloutLog(AWSService.queryModule,queryURL,'',JSON.stringify(data),AWSService.successStatus); |
| | | queryback(data); |
| | | }, |
| | | error: function (error){ |
| | | //错误相关处理 404属于该处理(经测试) |
| | | //还可能是"timeout", "error", "notmodified" 和 "parsererror"。 |
| | | AWSService.insertCalloutLog(AWSService.queryModule,queryURL,'',JSON.stringify(error),AWSService.failStatus); |
| | | console.log(error); |
| | | } |
| | | }; |
| | | jQuery.ajax(para); |
| | | }, |
| | | |
| | | //update |
| | | post:function(postURL, payloadForNewPI, callback, token) { |
| | | console.log('Process New PI Data'); |
| | |
| | | { escape: true } |
| | | ); |
| | | } |
| | | }; |
| | | }; |
| | | window.AWSService = AWSService; |