| | |
| | | <aura:attribute name="allselectlistAgencyPerson" type="Map"/> |
| | | <!-- PIPL update Yin Mingjie 21/02/2022 end --> |
| | | <!-- 批量添加周报 end--> |
| | | |
| | | <ltng:require scripts="{! $Resource.AWSService+'/AWSService.js' }" /> |
| | | <ltng:require scripts="{! $Resource.jquery183minjs }" /> |
| | | |
| | | <!--ロード中...--> |
| | | <aura:renderIf isTrue="{!v.login}"> |
| | |
| | | <span class="slds-truncate" title="Name">{!v.fieldsmap.doctor2__r}</span> |
| | | PIPL update Yin Mingjie 21/02/2022 end--> |
| | | <span class="slds-truncate" title="Name">{!v.fieldsmap.Agency_Contact__c}</span> |
| | | |
| | | </th> |
| | | <th class="table_header slds-text-title--caps"> |
| | | <span class="slds-truncate" title="Name">{!v.fieldsmap.visitor_title__c}</span> |
| | |
| | | // var eventFields = event.getParam("fields"); |
| | | // eventFields["Agency_Hospital__c"] = component.get('v.hospitalLinkId'); |
| | | // component.find('recordEditForm').submit(eventFields); |
| | | // vivek 添加验证 end |
| | | // vivek 添加验证 end |
| | | }, |
| | | |
| | | createCancel : function(component, event, helper) { |
| | |
| | | component.set('v.allselectlist',res.allselectlist); |
| | | component.set('v.doclist',res.doclist); |
| | | // PIPL update Yin Mingjie 21/02/2022 start |
| | | // component.find('select_agency_person').set('v.options', this.conv_selected(res.allselectlist.AgencyPerson__c)); |
| | | this.search_contact(component, event, helper,res.allselectlist.AgencyPerson__c); |
| | | component.find('select_agency_person').set('v.options', this.conv_selected(res.allselectlist.AgencyPerson__c)); |
| | | // this.search_contact(component, event, helper,res.allselectlist.AgencyPerson__c); |
| | | // PIPL update Yin Mingjie 21/02/2022 end |
| | | component.find('select_department').set('v.options', this.conv_selected(res.allselectlist.Department_Cateogy__c)); |
| | | component.find('select_purpose_type').set('v.options', this.conv_selected(res.allselectlist.Purpose_Type__c)); |
| | |
| | | }, |
| | | |
| | | insert_agencycontact : function(component,token,newUrl,payload,agencyHospitalid,helper) { |
| | | |
| | | AWSService.insert(newUrl,payload,function(result){ |
| | | if(result.status == '0'){ |
| | | $A.getCallback(function(){ |
| | | helper.to_agencycontact(component,result,agencyHospitalid); |
| | | })(); |
| | | |
| | | }else{ |
| | | console.log('AWS status error:' + result) |
| | | component.set('v.login',false); |
| | | component.find('OppMessage').setError('AWS insert error.'); |
| | | } |
| | | },token); |
| | | /* |
| | | fetch(newUrl, { |
| | | method: 'POST', |
| | | body: payload, |
| | |
| | | console.log('AWS insert error:' + error) |
| | | component.set('v.login',false); |
| | | component.find('OppMessage').setError('AWS insert error.'); |
| | | }); |
| | | });*/ |
| | | |
| | | }, |
| | | |
| | |
| | | saveRecords : function(component,event){ |
| | | component.set('v.login',true); |
| | | var action = component.get("c.processData"); |
| | | debugger; |
| | | var selectDate = component.find('select_date').get('v.value'); |
| | | var fieldsList=['Name','Phone','AccountNumber']; //Please write your code dynamic fields |
| | | var fieldsList=['Name','Phone','AccountNumber']; //Please write your code dynamic |
| | | var sss=component.get("v.fileContentData"); |
| | | action.setParams({ |
| | | fileData : component.get("v.fileContentData"), |
| | |
| | | var res = response.getReturnValue(); |
| | | console.log('输入的开始日期3'+res); |
| | | component.set('v.login',false); |
| | | this.showExportDate(component,res); |
| | | |
| | | // PI 改造 By Bright 20220328 |
| | | if(true){ |
| | | let awsids = []; |
| | | for (let ri in res) { |
| | | if(res[ri] && res[ri].doctor2__r && res[ri].doctor2__r.AWS_Data_Id__c){ |
| | | awsids.push(res[ri].doctor2__r.AWS_Data_Id__c); |
| | | } |
| | | } |
| | | if(awsids.length > 0){ |
| | | let awsurl = component.get('v.awsurl'); |
| | | |
| | | AWSService.search(awsurl.searchUrl,{ |
| | | dataIds:awsids |
| | | }, function(data){ |
| | | if(data && data.object && data.object.length){ |
| | | let m = {}; |
| | | for(let di in data.object){ |
| | | if(data.object[di] && data.object[di].dataId){ |
| | | m[data.object[di].dataId] = data.object[di]; |
| | | } |
| | | } |
| | | |
| | | for(let ri in res){ |
| | | if(res[ri] && res[ri].doctor2__r && res[ri].doctor2__r.AWS_Data_Id__c && m.hasOwnProperty(res[ri].doctor2__r.AWS_Data_Id__c)){ |
| | | res[ri].doctor2__r.Name = m[res[ri].doctor2__r.AWS_Data_Id__c].name; |
| | | res[ri].visitor_title__c = m[res[ri].doctor2__r.AWS_Data_Id__c].doctorDivision1; |
| | | |
| | | } |
| | | } |
| | | } |
| | | helper.showExportDate(component, res); |
| | | |
| | | component.set('v.login', false); |
| | | }, awsurl.token); |
| | | }else{ |
| | | helper.showExportDate(component, res); |
| | | } |
| | | } |
| | | |
| | | |
| | | component.set('v.reports_date', res); |
| | | |
| | | }else{ |
| | |
| | | system.debug('Account Id from Front-end:'+accountId); |
| | | PIHelper.PIIntegration contactPIIntegration = PIHelper.getPIIntegrationInfo('Contact'); |
| | | if(String.isNotBlank(accountId) && String.isNotEmpty(accountId)){ |
| | | conList = new List<Contact>([select Id,AWS_Data_Id__c from Contact where AccountId=:accountId and AWS_Data_Id__c!='' limit :contactPIIntegration.maxQueryNumber]); |
| | | conList = new List<Contact>([select Id,AWS_Data_Id__c from Contact where AccountId=:accountId and AWS_Data_Id__c!='' order by lastmodifieddate desc limit :contactPIIntegration.maxQueryNumber]); |
| | | } |
| | | //2. Prepare the Contact Info |
| | | Map<String,Contact> awsIdToContactMap = new Map<String,Contact>(); |
| | |
| | | |
| | | system.debug('=====searchStr:' + searchStr); |
| | | |
| | | searchStr += 'limit 500'; |
| | | searchStr += ' order by lastmodifieddate desc limit 500'; |
| | | |
| | | List<Contact> searchResult = Database.query(searchStr); |
| | | |
| | |
| | | public String errorMsg { get; set; } // 错误信息 |
| | | |
| | | public string staticResource { get; private set; } |
| | | public string staticResourceCon { get; private set; } |
| | | public string staticResourceFile { get; private set; } |
| | | public string BRSrc{get;private set;} |
| | | public string QRSrc{get;private set;} |
| | | |
| | |
| | | } |
| | | pdfPageList = new List<PdfPageClass>(); |
| | | staticResource = JSON.serialize(PIHelper.getPIIntegrationInfo('Consum_Apply_Equipment_Set_Detail__c')); |
| | | staticResourceCon = JSON.serialize(PIHelper.getPIIntegrationInfo('Consum_Apply__c')); |
| | | staticResourceFile = JSON.serialize(PIHelper.getPIIntegrationInfo('Document')); |
| | | } |
| | | |
| | | /** |
| | |
| | | , Post_Code__c // 邮编 |
| | | , Loaner_received_staff__c // 接收人姓名 |
| | | , Loaner_received_staff_phone__c // 接收人电话 |
| | | ,AWS_Data_Id__c |
| | | FROM Consum_Apply__c |
| | | WHERE Id = :targetConsumApplyId |
| | | ]; |
| | |
| | | public class DeveloperUtility { |
| | | |
| | | public static List<HTTPResponse> CreateFields(string sobject_name,string [] fields, boolean create_field,boolean create_config){ |
| | | /**public static List<HTTPResponse> CreateFields(string sobject_name,string [] fields, boolean create_field,boolean create_config){ |
| | | |
| | | PI_Policy_Configuration__c ppc = null; |
| | | if(create_config){ |
| | |
| | | return null; |
| | | } |
| | | |
| | | } |
| | | }*/ |
| | | } |
| | |
| | | public Boolean IsMain; //是否是现地分配的主单 20201120 LJH OCSM_BP5-61 add |
| | | |
| | | public string staticResource { get; private set; } |
| | | public string staticResourceFile { get; private set; } |
| | | public Boolean addFlag { get; private set; }//敏感地址使用标记 |
| | | public String qrcode { get; private set; } |
| | | public FixtureRentalPDFController() { |
| | |
| | | // rentalApplyId = ApexPages.currentPage().getParameters().get('raid');//20201120 ljh |
| | | String tempStr = ApexPages.currentPage().getParameters().get('raid'); |
| | | staticResource = JSON.serialize(PIHelper.getPIIntegrationInfo('Rental_Apply__c')); |
| | | staticResourceFile = JSON.serialize(PIHelper.getPIIntegrationInfo('Document')); |
| | | addFlag = false; |
| | | rentalApplyId = new List<String>(); |
| | | if(tempStr != null){ |
| | |
| | | public static List<Agency_Report__c> selectMAgencyReport(Date date1, Date date2 ,List<Contact> conMList) { |
| | | List<Agency_Report__c> reportlist = [Select Id, Name, Report_Date__c, Product_Category1__r.Name, Product_Category2__r.Name, Product_Category3__r.Name, Product_Category1__c, Product_Category2__c, Product_Category3__c,ConsumptionOfConsumables__c,warlocksNumber__c,WorkMark__c,Department_Cateogy__c, DealerPersonnel__c,WorkRecord__c, ProductClassification__c,WarlockClassification__c,ProductCcategory__c,productCategories__c,Purpose_Type__c, Agency_Report_Header__c, Agency_Hospital__r.Name, Agency_Hospital__r.Hospital__c, OppName__c, |
| | | Person_In_Charge2__c,DealerPersonnel__r.Name,Person_In_Charge2__r.Name, doctor2__c, doctor2__r.Name, Submit_date__c,//支援需求SupportNeeds__c |
| | | doctor2__r.AWS_Data_Id__c,// 20220222 PI改造 by Bright |
| | | Product_Category__c, Product_Category__r.Name, Result__c, visitor_title__c, Opportunity__c, Opportunity__r.Name,EffectProgress__c,SupportNeeds__c, |
| | | UseProduct1__c,UseProduct2__c,UseProduct3__c,UseProduct1__r.Name,UseProduct2__r.Name,UseProduct3__r.Name |
| | | From Agency_Report__c |
| | |
| | | for (NFM501Controller.ListItem LI: getQLMData1.data.list1) { |
| | | // 項目転送のセット |
| | | Tender_information__c te1 = new Tender_information__c(); |
| | | |
| | | //add aws dataid sushanhu 20220223 start |
| | | if(String.isEmpty(LI.DataId)){ |
| | | continue; |
| | | } |
| | | te1.AWS_Data_Id__c = LI.DataId; |
| | | //add aws dataid sushanhu 20220223 end |
| | | if (String.isBlank(LI.projectId)) { |
| | |
| | | responseBody=result.responseBody; |
| | | //Map<String, Object> res = (Map<String, Object>)JSON.deserializeUntyped(responseBody); |
| | | //status=(String)res.get(status); |
| | | if ('202'.equals(result.status)) { |
| | | status =result.status; |
| | | system.debug('stadtucode--'+result.status); |
| | | if ('202'.equals(status)) { |
| | | logstr += status+'\n'; |
| | | rowDataSFDC.retry_cnt__c = 0; |
| | | } |
| | | else { |
| | | logstr+=responseBody+'\n'; |
| | | rowDataSFDC = NFMUtil.LogAutoSend(rowDataSFDC, null, status); |
| | | } |
| | | //update to aws 20220228 sushanhu end |
| | |
| | | public NewAndEditASEActivityController(ApexPages.StandardController controller) { |
| | | List<String> fieldList = new List<String>(Schema.getGlobalDescribe().get('ASEActivity__c').getDescribe().fields.getMap().keyset()); |
| | | // Add fields to controller. This is to avoid the SOQL error in visualforce page |
| | | controller.addFields(fieldList); |
| | | if (!Test.isRunningTest()) { |
| | | controller.addFields(fieldList); |
| | | } |
| | | LookUpOverrideFields.add('ReporterASE__c'); |
| | | Init(controller.getRecord()); |
| | | |
| | |
| | | //获取所有字段 |
| | | List<String> fieldList = new List<String>(Schema.getGlobalDescribe().get('Address__c').getDescribe().fields.getMap().keyset()); |
| | | // Add fields to controller. This is to avoid the SOQL error in visualforce page |
| | | controller.addFields(fieldList); |
| | | if (!Test.isRunningTest()) { |
| | | controller.addFields(fieldList);} |
| | | SObject obj = controller.getRecord(); |
| | | if(obj.Id != null){ |
| | | //更新 |
| | |
| | | system.debug('field API'+fieldAPI); |
| | | Schema.DisplayType fielddataType = fieldAPIToTypeMap.get(fieldAPI).getDescribe().getType(); |
| | | String fieldValue = String.valueOf(fieldValueMap.get(fieldAPI)); |
| | | if(String.isBlank(fieldValue)){ |
| | | if(!fieldAPIToTypeMap.containskey(fieldAPI)){ |
| | | continue; |
| | | } |
| | | if(String.valueOf(fielddataType)=='DATE'){ |
| | | addressInfo.put(fieldAPI, Date.valueOf(String.valueOf(fieldValueMap.get(fieldAPI)).replace('/', '-'))); |
| | | addressInfo.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',' '); |
| | | addressInfo.put(fieldAPI, Datetime.valueOfGmt(dt)); |
| | | }else { |
| | | addressInfo.put(fieldAPI,fieldValue); |
| | | } |
| | | }else if(String.valueOf(fielddataType)=='Number'||String.valueOf(fielddataType)=='DOUBLE' ){ |
| | | addressInfo.put(fieldAPI, Decimal.valueOf(String.valueOf(fieldValueMap.get(fieldAPI)))); |
| | | addressInfo.put(fieldAPI, (String.isBlank(fieldValue)||String.isEmpty(fieldValue))?null:Decimal.valueOf(fieldValue.replace(',', ''))); |
| | | } else if(String.valueof(fielddataType)=='BOOLEAN'){ |
| | | addressInfo.put(fieldAPI, fieldValueMap.get(fieldAPI)); |
| | | }else { |
| | |
| | | String status = 'success'; |
| | | Response resp = new Response(); |
| | | Savepoint sp = Database.setSavepoint(); |
| | | String rid = ''; |
| | | // String rid = ''; |
| | | String awsDataId = ''; |
| | | try{ |
| | | System.debug('abcde'); |
| | | if(isNew){ |
| | |
| | | insert addressInfo; |
| | | }else{ |
| | | System.debug('into update'); |
| | | String awsDataId = (String)addressInfo.get('AWS_Data_Id__c'); |
| | | awsDataId = (String)addressInfo.get('AWS_Data_Id__c'); |
| | | System.debug('awsDataId = ' + awsDataId); |
| | | Address__c[] addresses = [select id from Address__c where AWS_Data_Id__c =:awsDataId]; |
| | | System.debug('addresses[0].id = ' + addresses[0].id); |
| | | addressInfo.put('Id',addresses[0].id);//For testing; |
| | | update addressInfo; |
| | | } |
| | | rid=addressInfo.Id; |
| | | PIHelper.saveTransLog(sobjectTypeValue,(String)addressInfo.get('AWS_Data_Id__c'),rid,transId,addressJson ,status,''); |
| | | // rid=addressInfo.Id; |
| | | resp.recordId = addressInfo.Id; |
| | | resp.message = ''; |
| | | // resp.message = 'success saveAddress'; |
| | | resp.status = status; |
| | | PIHelper.saveTransLog(sobjectTypeValue, awsDataId, addressInfo.Id, transId, addressJson , status,''); |
| | | System.debug('resp from sfdx back-end' + resp); |
| | | return resp; |
| | | |
| | | } catch(Exception e) { |
| | | } catch(DmlException e) { |
| | | Integer index = 0; |
| | | System.debug(e.getNumDml()); |
| | | System.debug(e.getDmlFields(index)); |
| | | System.debug(e.getDmlId(index)); |
| | | System.debug(e.getDmlIndex(index)); |
| | | System.debug(e.getDmlMessage(index)); |
| | | System.debug(e.getDmlStatusCode(index)); |
| | | System.debug(e.getDmlType(index)); |
| | | system.debug(e.getMessage()); |
| | | system.debug(e.getStackTraceString()); |
| | | |
| | | System.debug('into catch'+e.getMessage()); |
| | | Database.rollback(sp); |
| | | status = 'fail'; |
| | | PIHelper.saveTransLog(sobjectTypeValue,(String)addressInfo.get('AWS_Data_Id__c'),rid,transId,addressJson,status,e.getMessage()); |
| | | resp.message = e.getMessage(); |
| | | resp.status = status; |
| | | resp.status = 'Exception'; |
| | | resp.message ='保存失败,原因:'+ e.getDmlMessage(index); |
| | | PIHelper.saveTransLog(sobjectTypeValue, awsDataId, addressInfo.Id, transId, addressJson, status, e.getMessage()+e.getStackTraceString()); |
| | | return resp; |
| | | |
| | | }catch(Exception e) { |
| | | System.debug('into catch'+e.getMessage()); |
| | | Database.rollback(sp); |
| | | // status = 'Exception'; |
| | | // resp.status = status; |
| | | resp.status = 'Exception'; |
| | | resp.message = e.getMessage()+e.getStackTraceString(); |
| | | PIHelper.saveTransLog(sobjectTypeValue, awsDataId, addressInfo.Id, transId, addressJson, status, resp.message); |
| | | // PIHelper.saveTransLog(sobjectTypeValue,(String)addressInfo.get('AWS_Data_Id__c'),rid,transId,addressJson,status,e.getMessage()); |
| | | return resp; |
| | | } |
| | | } |
| | |
| | | global without sharing class NewAndEditAgencyContactController extends NewAndEditBaseController |
| | | { |
| | | public string staticResourceContact{get;private set;} |
| | | public string staticResourceAWSContact{get;private set;} |
| | | public String awsContactId{set;get;}//From agency contact's contactId |
| | | global NewAndEditAgencyContactController(ApexPages.StandardController controller) { |
| | | |
| | | List<String> fieldList = new List<String>(Schema.getGlobalDescribe().get('Agency_Contact__c').getDescribe().fields.getMap().keyset()); |
| | | // Add fields to controller. This is to avoid the SOQL error in visualforce page |
| | | controller.addFields(fieldList); |
| | | LookUpOverrideFields.add('Contact__c'); |
| | | Init(controller.getRecord()); |
| | | PIHelper.PIIntegration piIntegration = PIHelper.getPIIntegrationInfo('Contact'); |
| | | if(controller.getRecord()!=null && controller.getRecord().get('Contact__c')!=null){ |
| | | String contactIdValue = (String)controller.getRecord().get('Contact__c'); |
| | | List<Contact> conList = new List<Contact>([select Id,AWS_Data_Id__c from Contact where id =:contactIdValue]); |
| | | if(conList.size()>0){ |
| | | awsContactId = conList[0].AWS_Data_Id__c; |
| | | } |
| | | } |
| | | PIHelper.PIIntegration piIntegration = PIHelper.getPIIntegrationInfo('Agency_Contact__c');//Updated By Lijun 20220326 |
| | | staticResourceContact = JSON.serialize(piIntegration); |
| | | PIHelper.PIIntegration piConIntegration = PIHelper.getPIIntegrationInfo('Contact');//Updated By Lijun 20220326 |
| | | staticResourceAWSContact = JSON.serialize(piConIntegration); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | public String sobjectPrefix{get;private set;} |
| | | public String SaveAndNewButtonUrl{get;private set;} |
| | | @TestVisible |
| | | public List<String> VLookUpFields{get;private set;} |
| | | public String VLookUpFieldsJson{get{return Json.serialize(VLookUpFields);}} |
| | | public List<String> LookUpOverrideFields{get;private set;} |
| | |
| | | Schema.SObjectType leadSchema = schemaMap.get(sobjectTypeValue); |
| | | Map<String, Schema.SObjectField> fieldAPIToTypeMap = leadSchema.getDescribe().fields.getMap(); |
| | | Map<String,Object> fieldValueMap = (Map<String,Object>)JSON.deserializeUntyped(leadJson); |
| | | Sobject leadInfo = sobj; |
| | | for (String fieldAPI: fieldValueMap.keySet()) { |
| | | system.debug('field API='+fieldAPI); |
| | | Schema.DisplayType fielddataType = fieldAPIToTypeMap.get(fieldAPI).getDescribe().getType(); |
| | | String fieldValue = String.valueOf(fieldValueMap.get(fieldAPI)); |
| | | system.debug('Field Type:'+fielddataType+' field Value='+fieldValue); |
| | | if(String.valueOf(fielddataType)=='DATE'){ |
| | | leadInfo.put(fieldAPI,(String.isBlank(fieldValue)||String.isEmpty(fieldValue))? null:Date.valueOf(fieldValue.replace('/', '-'))); |
| | | }else if(String.valueOf(fielddataType)=='DATETIME'){ |
| | | if(String.isNotBlank(fieldValue)&&fieldValue.contains('T')){ |
| | | fieldValue = fieldValue.replace('T',' '); |
| | | leadInfo.put(fieldAPI, Datetime.valueOfGmt(fieldValue)); |
| | | }else{ |
| | | leadInfo.put(fieldAPI, null); |
| | | } |
| | | }else if(String.valueof(fielddataType)=='CURRENCY'|| String.valueof(fielddataType)=='PERCENT'||String.valueOf(fielddataType)=='Number'||String.valueOf(fielddataType)=='DOUBLE' ){ |
| | | leadInfo.put(fieldAPI, (String.isBlank(fieldValue)||String.isEmpty(fieldValue))?0:Decimal.valueOf(fieldValue)); |
| | | } else if(String.valueof(fielddataType)=='BOOLEAN'){ |
| | | leadInfo.put(fieldAPI, fieldValueMap.get(fieldAPI)); |
| | | }else { |
| | | leadInfo.put(fieldAPI,fieldValue); |
| | | } |
| | | } |
| | | |
| | | system.debug('for (String fieldAPI: fieldValueMap.keySet()) end'); |
| | | |
| | | |
| | | |
| | | //2. Save Record Process |
| | |
| | | Response resp = new Response(); |
| | | String awsDataId = ''; |
| | | Savepoint sp = Database.setSavepoint(); |
| | | Sobject leadInfo = sobj; |
| | | try{ |
| | | System.debug('abcde'); |
| | | for (String fieldAPI: fieldValueMap.keySet()) { |
| | | system.debug('field API='+fieldAPI); |
| | | if(!fieldAPIToTypeMap.containskey(fieldAPI)){ |
| | | continue; |
| | | } |
| | | Schema.DisplayType fielddataType = fieldAPIToTypeMap.get(fieldAPI).getDescribe().getType(); |
| | | String fieldValue = String.valueOf(fieldValueMap.get(fieldAPI)); |
| | | system.debug('Field Type:'+fielddataType+' field Value='+fieldValue); |
| | | if(String.valueOf(fielddataType)=='DATE'){ |
| | | leadInfo.put(fieldAPI,(String.isBlank(fieldValue)||String.isEmpty(fieldValue))? null:Date.valueOf(fieldValue.replace('/', '-'))); |
| | | }else if(String.valueOf(fielddataType)=='DATETIME'){ |
| | | if(String.isNotBlank(fieldValue)&&fieldValue.contains('T')){ |
| | | fieldValue = fieldValue.replace('T',' '); |
| | | leadInfo.put(fieldAPI, Datetime.valueOfGmt(fieldValue)); |
| | | }else{ |
| | | leadInfo.put(fieldAPI, null); |
| | | } |
| | | }else if(String.valueof(fielddataType)=='CURRENCY'|| String.valueof(fielddataType)=='PERCENT'||String.valueOf(fielddataType)=='Number'||String.valueOf(fielddataType)=='DOUBLE' ){ |
| | | leadInfo.put(fieldAPI, (String.isBlank(fieldValue)||String.isEmpty(fieldValue))?null:Decimal.valueOf(fieldValue.replace(',', ''))); |
| | | } else if(String.valueof(fielddataType)=='BOOLEAN'){ |
| | | leadInfo.put(fieldAPI, fieldValueMap.get(fieldAPI)); |
| | | }else { |
| | | leadInfo.put(fieldAPI,fieldValue); |
| | | } |
| | | } |
| | | |
| | | system.debug('for (String fieldAPI: fieldValueMap.keySet()) end'); |
| | | |
| | | if(isNew){ |
| | | System.debug('leadInfozhj = ' + leadInfo); |
| | | if(!Test.isRunningTest()){ |
| | |
| | | //获取所有字段 |
| | | List<String> fieldList = new List<String>(Schema.getGlobalDescribe().get('Case').getDescribe().fields.getMap().keyset()); |
| | | // Add fields to controller. This is to avoid the SOQL error in visualforce page |
| | | controller.addFields(fieldList); |
| | | if (!Test.isRunningTest()) { |
| | | controller.addFields(fieldList); |
| | | } |
| | | SObject obj = controller.getRecord(); |
| | | if(obj.Id != null){ |
| | | //更新 |
| | |
| | | //自定义格式转换 |
| | | for (String fieldAPI: fieldValueMap.keySet()) { |
| | | system.debug('field API'+fieldAPI); |
| | | Schema.DisplayType fielddataType = fieldAPIToTypeMap.get(fieldAPI).getDescribe().getType(); |
| | | String fieldValue = String.valueOf(fieldValueMap.get(fieldAPI)); |
| | | if(String.isBlank(fieldValue)){ |
| | | if(!fieldAPIToTypeMap.containskey(fieldAPI)){ |
| | | continue; |
| | | } |
| | | Schema.DisplayType fielddataType = fieldAPIToTypeMap.get(fieldAPI).getDescribe().getType(); |
| | | String fieldValue = String.valueOf(fieldValueMap.get(fieldAPI)); |
| | | if(String.valueOf(fielddataType)=='DATE'){ |
| | | caseInfo.put(fieldAPI, Date.valueOf(String.valueOf(fieldValueMap.get(fieldAPI)).replace('/', '-'))); |
| | | caseInfo.put(fieldAPI,(String.isBlank(fieldValue)||String.isEmpty(fieldValue))? null:Date.valueOf(fieldValue.replace('/', '-'))); |
| | | // caseInfo.put(fieldAPI, Date.valueOf(String.valueOf(fieldValueMap.get(fieldAPI)).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',' '); |
| | | caseInfo.put(fieldAPI, Datetime.valueOfGmt(dt)); |
| | | } |
| | | }else if(String.valueOf(fielddataType)=='Number'||String.valueOf(fielddataType)=='DOUBLE' ){ |
| | | caseInfo.put(fieldAPI, Decimal.valueOf(String.valueOf(fieldValueMap.get(fieldAPI)))); |
| | | if(String.isNotBlank(fieldValue)&&fieldValue.contains('T')){ |
| | | fieldValue = fieldValue.replace('T',' '); |
| | | caseInfo.put(fieldAPI, Datetime.valueOfGmt(fieldValue)); |
| | | }else{ |
| | | caseInfo.put(fieldAPI, null); |
| | | } |
| | | // String dt = String.valueOf(fieldValueMap.get(fieldAPI)); |
| | | // if(String.isNotBlank(dt)&&dt.contains('T')){ |
| | | // dt = dt.replace('T',' '); |
| | | // caseInfo.put(fieldAPI, Datetime.valueOfGmt(dt)); |
| | | // } |
| | | // }else if(String.valueOf(fielddataType)=='Number'||String.valueOf(fielddataType)=='DOUBLE' ){ |
| | | // caseInfo.put(fieldAPI, Decimal.valueOf(String.valueOf(fieldValueMap.get(fieldAPI)))); |
| | | }else if(String.valueof(fielddataType)=='CURRENCY'|| String.valueof(fielddataType)=='PERCENT'||String.valueOf(fielddataType)=='Number'||String.valueOf(fielddataType)=='DOUBLE' ){ |
| | | caseInfo.put(fieldAPI, (String.isBlank(fieldValue)||String.isEmpty(fieldValue))?null:Decimal.valueOf(fieldValue.replace(',', ''))); |
| | | } else if(String.valueof(fielddataType)=='BOOLEAN'){ |
| | | caseInfo.put(fieldAPI, fieldValueMap.get(fieldAPI)); |
| | | }else { |
| | | caseInfo.put(fieldAPI, String.valueOf(fieldValueMap.get(fieldAPI))); |
| | | } |
| | | } |
| | | |
| | | System.debug('caseInfo.Account__c='+caseInfo.Account__c); |
| | | if (!String.isBlank(caseInfo.ContactId) && (String.isBlank(caseInfo.Account__c) || Id.valueOf(caseInfo.Account__c).to15() =='000000000000000')) { |
| | | Contact c = [select id,AccountId from Contact where id = :caseInfo.ContactId]; |
| | | caseInfo.Account__c = c.AccountId; |
| | | } |
| | | |
| | | //2. Save Record Process |
| | |
| | | String awsDataId = (String)caseInfo.get('AWS_Data_Id__c'); |
| | | System.debug('awsDataId = ' + awsDataId); |
| | | Case[] cases = [select id from Case where AWS_Data_Id__c =:awsDataId]; |
| | | System.debug('cases ========================= ' + cases); |
| | | System.debug('Cases[0].id = ' + cases[0].id); |
| | | caseInfo.put('Id',cases[0].id);//For testing; |
| | | update caseInfo; |
| | |
| | | resp.status = status; |
| | | System.debug('resp from sfdx back-end' + resp); |
| | | return resp; |
| | | } catch(Exception e) { |
| | | } catch(DmlException e) { |
| | | Integer index = 0; |
| | | System.debug(e.getNumDml()); |
| | | System.debug(e.getDmlFields(index)); |
| | | System.debug(e.getDmlId(index)); |
| | | System.debug(e.getDmlIndex(index)); |
| | | System.debug(e.getDmlMessage(index)); |
| | | System.debug(e.getDmlStatusCode(index)); |
| | | System.debug(e.getDmlType(index)); |
| | | system.debug(e.getMessage()); |
| | | system.debug(e.getStackTraceString()); |
| | | |
| | | System.debug('into catch'+e.getMessage()); |
| | | Database.rollback(sp); |
| | | resp.status = 'Exception'; |
| | | resp.message ='保存失败,原因:'+ e.getDmlMessage(index); |
| | | PIHelper.saveTransLog(sobjectTypeValue,(String)caseInfo.get('AWS_Data_Id__c'),rid,transId, caseJson ,status,e.getMessage()+e.getStackTraceString()); |
| | | return resp; |
| | | |
| | | }catch(Exception e) { |
| | | System.debug('into catch'+e.getMessage()); |
| | | Database.rollback(sp); |
| | | status = 'fail'; |
| | |
| | | |
| | | List<String> fieldList = new List<String>(Schema.getGlobalDescribe().get('Contact').getDescribe().fields.getMap().keyset()); |
| | | // Add fields to controller. This is to avoid the SOQL error in visualforce page |
| | | controller.addFields(fieldList); |
| | | if (!Test.isRunningTest()) { |
| | | controller.addFields(fieldList); |
| | | } |
| | | Init(controller.getRecord()); |
| | | String contactId = controller.getRecord().Id; |
| | | if(contactId != null){ |
| | |
| | | |
| | | List<String> fieldList = new List<String>(Schema.getGlobalDescribe().get('Event').getDescribe().fields.getMap().keyset()); |
| | | // Add fields to controller. This is to avoid the SOQL error in visualforce page |
| | | controller.addFields(fieldList); |
| | | if (!Test.isRunningTest()) { |
| | | controller.addFields(fieldList); |
| | | } |
| | | Init(controller.getRecord()); |
| | | //1. get 访问对象ID |
| | | //query event by controller.getRecord().Id; |
| | |
| | | public NewAndEditInquiryFormController(ApexPages.StandardController controller) { |
| | | List<String> fieldList = new List<String>(Schema.getGlobalDescribe().get('Inquiry_form__c').getDescribe().fields.getMap().keyset()); |
| | | // Add fields to controller. This is to avoid the SOQL error in visualforce page |
| | | controller.addFields(fieldList); |
| | | if (!Test.isRunningTest()) { |
| | | controller.addFields(fieldList); |
| | | } |
| | | // contact lookup |
| | | LookUpOverrideFields.add('Contact_Name__c'); |
| | | LookUpOverrideFields.add('Lead_link__c'); |
| | |
| | | |
| | | List<String> fieldList = new List<String>(Schema.getGlobalDescribe().get('Inspection_Report__c').getDescribe().fields.getMap().keyset()); |
| | | // Add fields to controller. This is to avoid the SOQL error in visualforce page |
| | | controller.addFields(fieldList); |
| | | if (!Test.isRunningTest()) { |
| | | controller.addFields(fieldList); |
| | | } |
| | | Init(controller.getRecord()); |
| | | |
| | | //AWSToSobjectNonEncryptedMap.put('responsiblePersonHP', 'Responsible_Person__c'); |
| | |
| | | contactDataId = c.AWS_Data_Id__c; |
| | | } |
| | | //查询战略科室分类 |
| | | List<Contact> cs = [select Account.Department_Class__c from Contact where id='0030l00000mldeG']; |
| | | List<Contact> cs = [select Account.Department_Class__c from Contact where id=:contactId]; |
| | | if(cs.size()>0){ |
| | | controller.getRecord().put('Department_Class__c',cs[0].Account.Department_Class__c); |
| | | } |
| | |
| | | //自定义格式转换 |
| | | for (String fieldAPI: fieldValueMap.keySet()) { |
| | | system.debug('field API='+fieldAPI); |
| | | if(!fieldAPIToTypeMap.containskey(fieldAPI)){ |
| | | continue; |
| | | } |
| | | Schema.DisplayType fielddataType = fieldAPIToTypeMap.get(fieldAPI).getDescribe().getType(); |
| | | String fieldValue = String.valueOf(fieldValueMap.get(fieldAPI)); |
| | | system.debug('Field Type:'+fielddataType+' field Value='+fieldValue); |
| | |
| | | leadInfo.put(fieldAPI, null); |
| | | } |
| | | }else if(String.valueof(fielddataType)=='CURRENCY'|| String.valueof(fielddataType)=='PERCENT'||String.valueOf(fielddataType)=='Number'||String.valueOf(fielddataType)=='DOUBLE' ){ |
| | | leadInfo.put(fieldAPI, (String.isBlank(fieldValue)||String.isEmpty(fieldValue))?0:Decimal.valueOf(fieldValue)); |
| | | leadInfo.put(fieldAPI, (String.isBlank(fieldValue)||String.isEmpty(fieldValue))?null:Decimal.valueOf(fieldValue.replace(',', ''))); |
| | | } else if(String.valueof(fielddataType)=='BOOLEAN'){ |
| | | leadInfo.put(fieldAPI, fieldValueMap.get(fieldAPI)); |
| | | }else { |
| | |
| | | public NewAndEditQISController(ApexPages.StandardController controller) { |
| | | Input_Required_Field_Msg = Label.Input_Required_Field_Msg; |
| | | List<String> fieldList = new List<String>(Schema.getGlobalDescribe().get('QIS_Report__c').getDescribe().fields.getMap().keyset()); |
| | | controller.addFields(fieldList); |
| | | if (!Test.isRunningTest()) { |
| | | controller.addFields(fieldList); |
| | | } |
| | | Init(controller.getRecord()); |
| | | |
| | | |
| | |
| | | public NewAndEditRepairSubOrderController(ApexPages.StandardController controller) { |
| | | List<String> fieldList = new List<String>(Schema.getGlobalDescribe().get('RepairSubOrder__c').getDescribe().fields.getMap().keyset()); |
| | | // Add fields to controller. This is to avoid the SOQL error in visualforce page |
| | | controller.addFields(fieldList); |
| | | if (!Test.isRunningTest()) { |
| | | controller.addFields(fieldList); |
| | | } |
| | | LookUpOverrideFields.add('Receiver__c'); |
| | | LookUpOverrideFields.add('Applicanter__c'); |
| | | //contactId = LookUpOverrideFieldsMapJson; |
| | |
| | | //获取所有字段 |
| | | List<String> fieldList = new List<String>(Schema.getGlobalDescribe().get('Report__c').getDescribe().fields.getMap().keyset()); |
| | | // Add fields to controller. This is to avoid the SOQL error in visualforce page |
| | | controller.addFields(fieldList); |
| | | if (!Test.isRunningTest()) { |
| | | controller.addFields(fieldList); |
| | | } |
| | | SObject obj = controller.getRecord(); |
| | | if(obj.Id != null){ |
| | | //更新 |
| | |
| | | obj.put('OwnerId',UserInfo.getUserId()); |
| | | }else{ |
| | | //新建 |
| | | Map<string,string> mso = ApexPages.currentPage().getParameters(); |
| | | //医院/科室/经销商(手写) |
| | | if(mso.containsKey('00N10000002GE3Z')){ |
| | | controller.getRecord().put('Manual_Name__c',mso.get('00N10000002GE3Z')); |
| | | } |
| | | rtTypeId = ApexPages.currentPage().getParameters().get('RecordType'); |
| | | obj.put('OwnerId',UserInfo.getUserId()); |
| | | } |
| | |
| | | @RemoteAction |
| | | global static Response saveReport(String reportJson,String transId,Boolean isNew) { |
| | | System.debug('report Info:' + JSON.serialize(reportJson)); |
| | | System.debug('report Info:' + reportJson); |
| | | //System.debug('rtTypeId: ' + rtTypeId); |
| | | //1. Prepare the payload for report |
| | | Schema.SObjectType reportSchema = schemaMap.get(sobjectTypeValue); |
| | |
| | | System.debug('自定义格式转换开始'); |
| | | //自定义格式转换 |
| | | for (String fieldAPI: fieldValueMap.keySet()) { |
| | | Schema.DisplayType fielddataType = fieldAPIToTypeMap.get(fieldAPI).getDescribe().getType(); |
| | | String fieldValue = String.valueOf(fieldValueMap.get(fieldAPI)); |
| | | if(String.isBlank(fieldValue)){ |
| | | if(!fieldAPIToTypeMap.containskey(fieldAPI)){ |
| | | continue; |
| | | } |
| | | Schema.DisplayType fielddataType = fieldAPIToTypeMap.get(fieldAPI).getDescribe().getType(); |
| | | String fieldValue = String.valueOf(fieldValueMap.get(fieldAPI)); |
| | | if(String.valueOf(fielddataType)=='DATE'){ |
| | | System.debug('DATE fieldAPI = '+fieldAPI+' filedData = '+String.valueOf(fieldValueMap.get(fieldAPI))); |
| | | reportInfo.put(fieldAPI, Date.valueOf(String.valueOf(fieldValueMap.get(fieldAPI)).replace('/', '-'))); |
| | | //reportInfo.put(fieldAPI, Date.valueOf(String.valueOf(fieldValueMap.get(fieldAPI)).replace('/', '-'))); |
| | | reportInfo.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')){ |
| | |
| | | }else if(String.isNotBlank(dt)) { |
| | | reportInfo.put(fieldAPI, Datetime.valueOf(dt)); |
| | | } |
| | | }else if(String.valueOf(fielddataType)=='Number'||String.valueOf(fielddataType)=='DOUBLE' ){ |
| | | reportInfo.put(fieldAPI, Decimal.valueOf(String.valueOf(fieldValueMap.get(fieldAPI)))); |
| | | }else if(String.valueof(fielddataType)=='CURRENCY'|| String.valueof(fielddataType)=='PERCENT'||String.valueOf(fielddataType)=='Number'||String.valueOf(fielddataType)=='DOUBLE' ){ |
| | | reportInfo.put(fieldAPI, (String.isBlank(fieldValue)||String.isEmpty(fieldValue))?null:Decimal.valueOf(fieldValue.replace(',', ''))); |
| | | } else if(String.valueof(fielddataType)=='BOOLEAN'){ |
| | | reportInfo.put(fieldAPI, fieldValueMap.get(fieldAPI)); |
| | | }else { |
| | |
| | | |
| | | List<String> fieldList = new List<String>(Schema.getGlobalDescribe().get('Tender_information__c').getDescribe().fields.getMap().keyset()); |
| | | // Add fields to controller. This is to avoid the SOQL error in visualforce page |
| | | controller.addFields(fieldList); |
| | | if (!Test.isRunningTest()) { |
| | | controller.addFields(fieldList); |
| | | } |
| | | Init(controller.getRecord()); |
| | | |
| | | // AWSToSobjectNonEncryptedMap.put('lastName', 'LastName'); |
| | |
| | | * @description : |
| | | * @author : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | * @group : |
| | | * @last modified on : 03-23-2022 |
| | | * @last modified on : 03-28-2022 |
| | | * @last modified by : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | **/ |
| | | global without sharing class NewConsumApplyController { |
| | |
| | | PIPL_Input_Account_Error_Msg = label.PIPL_Input_Account_Error_Msg; |
| | | //获取所有字段 |
| | | List<String> fieldList = new List<String>(Schema.getGlobalDescribe().get('Consum_Apply__c').getDescribe().fields.getMap().keyset()); |
| | | controller.addFields(fieldList); |
| | | if (!Test.isRunningTest()) { |
| | | controller.addFields(fieldList); |
| | | } |
| | | SObject obj = controller.getRecord(); |
| | | if(obj.Id != null){ |
| | | //更新 |
| | |
| | | //新建 |
| | | rtTypeId = ApexPages.currentPage().getParameters().get('RecordType'); |
| | | obj.put('OwnerId',UserInfo.getUserId()); |
| | | Map<string,string> mso = ApexPages.currentPage().getParameters(); |
| | | system.debug('mso='+mso); |
| | | if(mso.containsKey('00N10000008rdgs')){ |
| | | controller.getRecord().put('demo_purpose2__c',mso.get('00N10000008rdgs')); |
| | | } |
| | | if(mso.containsKey('Name')){ |
| | | controller.getRecord().put('Name',mso.get('Name')); |
| | | } |
| | | |
| | | } |
| | | LayoutDescriberHelper.LayoutWrapper LayoutWrapperValue = LayoutDescriberHelper.describeSectionWithFieldsWrapper(rtTypeId, 'Consum_Apply__c','classic'); |
| | | layoutSections = LayoutWrapperValue.layoutSections; |
| | |
| | | Consum_Apply__c consumApplyInfo = new Consum_Apply__c(); |
| | | //自定义格式转换 |
| | | for (String fieldAPI: fieldValueMap.keySet()) { |
| | | Schema.DisplayType fielddataType = fieldAPIToTypeMap.get(fieldAPI).getDescribe().getType(); |
| | | String fieldValue = String.valueOf(fieldValueMap.get(fieldAPI)); |
| | | if(String.isBlank(fieldValue)){ |
| | | system.debug('field API'+fieldAPI); |
| | | if(!fieldAPIToTypeMap.containskey(fieldAPI)){ |
| | | continue; |
| | | } |
| | | Schema.DisplayType fielddataType = fieldAPIToTypeMap.get(fieldAPI).getDescribe().getType(); |
| | | String fieldValue = String.valueOf(fieldValueMap.get(fieldAPI)); |
| | | if(String.valueOf(fielddataType)=='DATE'){ |
| | | System.debug('DATE fieldAPI = '+fieldAPI+' filedData = '+String.valueOf(fieldValueMap.get(fieldAPI))); |
| | | consumApplyInfo.put(fieldAPI, Date.valueOf(String.valueOf(fieldValueMap.get(fieldAPI)).replace('/', '-'))); |
| | | consumApplyInfo.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',' '); |
| | | consumApplyInfo.put(fieldAPI, Datetime.valueOfGmt(dt)); |
| | | }else if(String.isNotBlank(dt)) { |
| | | consumApplyInfo.put(fieldAPI, Datetime.valueOf(dt)); |
| | | } |
| | | }else if(String.valueOf(fielddataType)=='Number'||String.valueOf(fielddataType)=='DOUBLE' ){ |
| | | consumApplyInfo.put(fieldAPI, Decimal.valueOf(String.valueOf(fieldValueMap.get(fieldAPI)))); |
| | | if(String.isNotBlank(fieldValue)&&fieldValue.contains('T')){ |
| | | fieldValue = fieldValue.replace('T',' '); |
| | | consumApplyInfo.put(fieldAPI, Datetime.valueOfGmt(fieldValue)); |
| | | }else if(String.isNotBlank(fieldValue)) { |
| | | fieldValue = fieldValue.replace('/', '-') + ':00'; |
| | | System.debug('fieldValue = ' + fieldValue); |
| | | consumApplyInfo.put(fieldAPI, Datetime.valueOf(fieldValue)); |
| | | }else{ |
| | | consumApplyInfo.put(fieldAPI, null); |
| | | } |
| | | |
| | | }else if(String.valueOf(fielddataType)=='PERCENT'||String.valueOf(fielddataType)=='CURRENCY'||String.valueOf(fielddataType)=='Number'||String.valueOf(fielddataType)=='DOUBLE' ){ |
| | | consumApplyInfo.put(fieldAPI, (String.isBlank(fieldValue)||String.isEmpty(fieldValue))?null:Decimal.valueOf(fieldValue.replace(',', ''))); |
| | | } else if(String.valueof(fielddataType)=='BOOLEAN'){ |
| | | consumApplyInfo.put(fieldAPI, fieldValueMap.get(fieldAPI)); |
| | | }else { |
| | | consumApplyInfo.put(fieldAPI, String.valueOf(fieldValueMap.get(fieldAPI))); |
| | | } |
| | | } |
| | | } |
| | | |
| | | //2. Save Record Process |
| | |
| | | sobjecttypeForFrontEnd = sobjectTypeValue; |
| | | //获取所有字段 |
| | | List<String> fieldList = new List<String>(Schema.getGlobalDescribe().get('Consum_Apply_Equipment_Set_Detail__c').getDescribe().fields.getMap().keyset()); |
| | | controller.addFields(fieldList); |
| | | if (!Test.isRunningTest()) { |
| | | controller.addFields(fieldList); |
| | | } |
| | | SObject obj = controller.getRecord(); |
| | | if(obj.Id != null){ |
| | | //更新 |
| | |
| | | //获取所有字段 |
| | | List<String> fieldList = new List<String>(Schema.getGlobalDescribe().get('Repair__c').getDescribe().fields.getMap().keyset()); |
| | | // Add fields to controller. This is to avoid the SOQL error in visualforce page |
| | | controller.addFields(fieldList); |
| | | if(!Test.isRunningTest()){ |
| | | controller.addFields(fieldList); |
| | | } |
| | | SObject obj = controller.getRecord(); |
| | | if(obj.Id != null){ |
| | | //更新 |
| | |
| | | ContactAWSDataId = String.valueOf(repairData.Contact_AWS_Data_Id__c); |
| | | }else{ |
| | | //新建 |
| | | Map<string,string> mso = ApexPages.currentPage().getParameters(); |
| | | system.debug('mso='+mso); |
| | | if(mso.containsKey('00N10000006P6SM')){ |
| | | controller.getRecord().put('SalesOfficeCode_selection__c',mso.get('00N10000006P6SM')); |
| | | } |
| | | if(mso.containsKey('00N10000002FH86')){ |
| | | controller.getRecord().put('On_site_repair__c',mso.get('00N10000002FH86')); |
| | | } |
| | | if(mso.containsKey('00N10000006P6Rn')){ |
| | | controller.getRecord().put('work_location_select__c',mso.get('00N10000006P6Rn')); |
| | | } |
| | | rtTypeId = ApexPages.currentPage().getParameters().get('RecordType'); |
| | | if(String.isBlank(rtTypeId)||String.isEmpty(rtTypeId)){ |
| | | List<RecordType> rtList = new List<RecordType>([select Id,DeveloperName from RecordType where SobjectType ='Repair__c' and DeveloperName ='Repair']); |
| | |
| | | //自定义格式转换 |
| | | for (String fieldAPI: fieldValueMap.keySet()) { |
| | | system.debug('field API'+fieldAPI); |
| | | Schema.DisplayType fielddataType = fieldAPIToTypeMap.get(fieldAPI).getDescribe().getType(); |
| | | String fieldValue = String.valueOf(fieldValueMap.get(fieldAPI)); |
| | | if(String.isBlank(fieldValue)){ |
| | | if(!fieldAPIToTypeMap.containskey(fieldAPI)){ |
| | | continue; |
| | | } |
| | | Schema.DisplayType fielddataType = fieldAPIToTypeMap.get(fieldAPI).getDescribe().getType(); |
| | | String fieldValue = String.valueOf(fieldValueMap.get(fieldAPI)); |
| | | if(String.valueOf(fielddataType)=='DATE'){ |
| | | repairInfo.put(fieldAPI, Date.valueOf(String.valueOf(fieldValueMap.get(fieldAPI)).replace('/', '-'))); |
| | | repairInfo.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',' '); |
| | | repairInfo.put(fieldAPI, Datetime.valueOfGmt(dt)); |
| | | }else if(String.isNotBlank(dt)) { |
| | | dt = dt.replace('/', '-') + ':00'; |
| | | System.debug('dt = ' + dt); |
| | | repairInfo.put(fieldAPI, Datetime.valueOf(dt)); |
| | | if(String.isNotBlank(fieldValue)&&fieldValue.contains('T')){ |
| | | fieldValue = fieldValue.replace('T',' '); |
| | | repairInfo.put(fieldAPI, Datetime.valueOfGmt(fieldValue)); |
| | | }else if(String.isNotBlank(fieldValue)) { |
| | | fieldValue = fieldValue.replace('/', '-') + ':00'; |
| | | System.debug('fieldValue = ' + fieldValue); |
| | | repairInfo.put(fieldAPI, Datetime.valueOf(fieldValue)); |
| | | }else{ |
| | | repairInfo.put(fieldAPI, null); |
| | | } |
| | | |
| | | }else if(String.valueOf(fielddataType)=='PERCENT'||String.valueOf(fielddataType)=='CURRENCY'||String.valueOf(fielddataType)=='Number'||String.valueOf(fielddataType)=='DOUBLE' ){ |
| | | repairInfo.put(fieldAPI, Decimal.valueOf(String.valueOf(fieldValueMap.get(fieldAPI)))); |
| | | repairInfo.put(fieldAPI, (String.isBlank(fieldValue)||String.isEmpty(fieldValue))?null:Decimal.valueOf(fieldValue.replace(',', ''))); |
| | | } else if(String.valueof(fielddataType)=='BOOLEAN'){ |
| | | repairInfo.put(fieldAPI, fieldValueMap.get(fieldAPI)); |
| | | }else { |
| | |
| | | * @description : |
| | | * @author : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | * @group : |
| | | * @last modified on : 03-17-2022 |
| | | * @last modified on : 03-28-2022 |
| | | * @last modified by : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | **/ |
| | | global without sharing class OnCallController { |
| | |
| | | // Add fields to controller. This is to avoid the SOQL error in visualforce page |
| | | if(!Test.isRunningTest()){ |
| | | controller.addFields(fieldList); |
| | | } |
| | | } |
| | | SObject obj = controller.getRecord(); |
| | | if(obj.Id != null){ |
| | | //更新 |
| | |
| | | On_Call__c onCallInfo = new On_Call__c(); |
| | | //自定义格式转换 |
| | | for (String fieldAPI: fieldValueMap.keySet()) { |
| | | system.debug('field API='+fieldAPI); |
| | | system.debug('field API'+fieldAPI); |
| | | if(!fieldAPIToTypeMap.containskey(fieldAPI)){ |
| | | continue; |
| | | } |
| | | Schema.DisplayType fielddataType = fieldAPIToTypeMap.get(fieldAPI).getDescribe().getType(); |
| | | String fieldValue = String.valueOf(fieldValueMap.get(fieldAPI)); |
| | | system.debug('Field Type:'+fielddataType+' field Value='+fieldValue); |
| | | if(String.valueOf(fielddataType)=='DATE'){ |
| | | onCallInfo.put(fieldAPI,(String.isBlank(fieldValue)||String.isEmpty(fieldValue))? null:Date.valueOf(fieldValue.replace('/', '-'))); |
| | | onCallInfo.put(fieldAPI,(String.isBlank(fieldValue)||String.isEmpty(fieldValue))? null:Date.valueOf(fieldValue.replace('/', '-'))); |
| | | }else if(String.valueOf(fielddataType)=='DATETIME'){ |
| | | if(String.isNotBlank(fieldValue)&&fieldValue.contains('T')){ |
| | | fieldValue = fieldValue.replace('T',' '); |
| | | onCallInfo.put(fieldAPI, Datetime.valueOfGmt(fieldValue)); |
| | | }else if(String.isNotBlank(fieldValue)) { |
| | | fieldValue = fieldValue.replace('/', '-') + ':00'; |
| | | System.debug('fieldValue = ' + fieldValue); |
| | | onCallInfo.put(fieldAPI, Datetime.valueOf(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)=='PERCENT'||String.valueOf(fielddataType)=='CURRENCY'||String.valueOf(fielddataType)=='Number'||String.valueOf(fielddataType)=='DOUBLE' ){ |
| | | onCallInfo.put(fieldAPI, (String.isBlank(fieldValue)||String.isEmpty(fieldValue))?null:Decimal.valueOf(fieldValue.replace(',', ''))); |
| | | } else if(String.valueof(fielddataType)=='BOOLEAN'){ |
| | | onCallInfo.put(fieldAPI, fieldValueMap.get(fieldAPI)); |
| | | }else { |
| | | onCallInfo.put(fieldAPI,fieldValue); |
| | | } |
| | | onCallInfo.put(fieldAPI, String.valueOf(fieldValueMap.get(fieldAPI))); |
| | | } |
| | | } |
| | | |
| | | //2. Save Record Process |
| | |
| | | traLog.TransId__c = transId; |
| | | Integer MaxLogColumnLength = 131072; |
| | | if (!String.isEmpty(sfRecordId)) { |
| | | traLog.SFRecordId__c=sfRecordId.substring(0, (sfRecordId.length() > MaxLogColumnLength ? MaxLogColumnLength : sfRecordId.length())); |
| | | traLog.Request__c=sfRecordId.substring(0, (sfRecordId.length() > MaxLogColumnLength ? MaxLogColumnLength : sfRecordId.length())); |
| | | }else { |
| | | String sfIds =JSON.serialize(idList); |
| | | traLog.SFRecordId__c=sfIds.substring(0, (sfIds.length() > MaxLogColumnLength ? MaxLogColumnLength : sfIds.length())); |
| | | traLog.Request__c=sfIds.substring(0, (sfIds.length() > MaxLogColumnLength ? MaxLogColumnLength : sfIds.length())); |
| | | } |
| | | if(isSuccess==0){ |
| | | traLog.Status__c = 'fail'; |
| | |
| | | * @description : |
| | | * @author : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | * @group : |
| | | * @last modified on : 03-23-2022 |
| | | * @last modified on : 03-28-2022 |
| | | * @last modified by : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | **/ |
| | | global without sharing class RentalApplyController { |
| | |
| | | PIPL_Input_Account_Error_Msg = label.PIPL_Input_Account_Error_Msg; |
| | | //获取所有字段 |
| | | List<String> fieldList = new List<String>(Schema.getGlobalDescribe().get('Rental_Apply__c').getDescribe().fields.getMap().keyset()); |
| | | controller.addFields(fieldList); |
| | | if(!Test.isRunningTest()){ |
| | | controller.addFields(fieldList); |
| | | } |
| | | SObject obj = controller.getRecord(); |
| | | if(obj.Id != null){ |
| | | //更新 |
| | |
| | | Rental_Apply__c rentalApplyInfo = new Rental_Apply__c(); |
| | | //自定义格式转换 |
| | | for (String fieldAPI: fieldValueMap.keySet()) { |
| | | Schema.DisplayType fielddataType = fieldAPIToTypeMap.get(fieldAPI).getDescribe().getType(); |
| | | String fieldValue = String.valueOf(fieldValueMap.get(fieldAPI)); |
| | | if(String.isBlank(fieldValue)){ |
| | | system.debug('field API'+fieldAPI); |
| | | if(!fieldAPIToTypeMap.containskey(fieldAPI)){ |
| | | continue; |
| | | } |
| | | Schema.DisplayType fielddataType = fieldAPIToTypeMap.get(fieldAPI).getDescribe().getType(); |
| | | String fieldValue = String.valueOf(fieldValueMap.get(fieldAPI)); |
| | | if(String.valueOf(fielddataType)=='DATE'){ |
| | | System.debug('DATE fieldAPI = '+fieldAPI+' filedData = '+String.valueOf(fieldValueMap.get(fieldAPI))); |
| | | rentalApplyInfo.put(fieldAPI, Date.valueOf(String.valueOf(fieldValueMap.get(fieldAPI)).replace('/', '-'))); |
| | | rentalApplyInfo.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',' '); |
| | | rentalApplyInfo.put(fieldAPI, Datetime.valueOfGmt(dt)); |
| | | }else if(String.isNotBlank(dt)) { |
| | | rentalApplyInfo.put(fieldAPI, Datetime.valueOf(dt)); |
| | | } |
| | | }else if(String.valueOf(fielddataType)=='Number'||String.valueOf(fielddataType)=='DOUBLE' ){ |
| | | rentalApplyInfo.put(fieldAPI, Decimal.valueOf(String.valueOf(fieldValueMap.get(fieldAPI)))); |
| | | if(String.isNotBlank(fieldValue)&&fieldValue.contains('T')){ |
| | | fieldValue = fieldValue.replace('T',' '); |
| | | rentalApplyInfo.put(fieldAPI, Datetime.valueOfGmt(fieldValue)); |
| | | }else if(String.isNotBlank(fieldValue)) { |
| | | fieldValue = fieldValue.replace('/', '-') + ':00'; |
| | | System.debug('fieldValue = ' + fieldValue); |
| | | rentalApplyInfo.put(fieldAPI, Datetime.valueOf(fieldValue)); |
| | | }else{ |
| | | rentalApplyInfo.put(fieldAPI, null); |
| | | } |
| | | |
| | | }else if(String.valueOf(fielddataType)=='PERCENT'||String.valueOf(fielddataType)=='CURRENCY'||String.valueOf(fielddataType)=='Number'||String.valueOf(fielddataType)=='DOUBLE' ){ |
| | | rentalApplyInfo.put(fieldAPI, (String.isBlank(fieldValue)||String.isEmpty(fieldValue))?null:Decimal.valueOf(fieldValue.replace(',', ''))); |
| | | } else if(String.valueof(fielddataType)=='BOOLEAN'){ |
| | | rentalApplyInfo.put(fieldAPI, fieldValueMap.get(fieldAPI)); |
| | | }else { |
| | |
| | | public String contactAWSIds {set;get;} |
| | | public String contactsInfo {set;get;} |
| | | public String awsDataIdArray {set;get;} |
| | | public String sfContactId{set;get;} |
| | | //Add By Li Jun 20220217 End |
| | | |
| | | public SearchVisitorController(){ |
| | |
| | | Savepoint sp = Database.setSavepoint(); |
| | | try{ |
| | | upsert rc; |
| | | sfContactId = rc.Id; |
| | | }catch(Exception io){ |
| | | Database.rollback(sp); |
| | | return null; |
| | |
| | | |
| | | } |
| | | |
| | | public static string WId(string wid){ |
| | | public static string WId(object wid){ |
| | | return '\'' + wid + '\''; |
| | | } |
| | | |
| | |
| | | return string.join(lo, ','); |
| | | } |
| | | |
| | | /* |
| | | public static string ToInCondition(List<AggregateResult> lar ,string key) |
| | | { |
| | | if(lar==null || lar.size() == 0) |
| | |
| | | ss+=') '; |
| | | return ss; |
| | | } |
| | | |
| | | */ |
| | | public static string ToInCondition(Set<string> so){ |
| | | return ToInCondition(new List<string>(so)); |
| | | } |
| | |
| | | if(so_list == null || so_list.size() == 0)return; |
| | | update so_list; |
| | | } |
| | | |
| | | /* |
| | | public static Map<string,Database.UpsertResult> UpsertList(List<Sobject> so_list, Schema.SObjectField field) |
| | | { |
| | | Map<string,Database.UpsertResult> mid = new Map<string,Database.UpsertResult>(); |
| | |
| | | } |
| | | return mid; |
| | | } |
| | | |
| | | */ |
| | | public static void DeleteList(List<Sobject> so_list) |
| | | { |
| | | if(so_list == null || so_list.size() == 0)return; |
| | |
| | | public String contactNameValue{set;get;} |
| | | public String contactIdValue{set;get;} |
| | | public String addressDataIds{set;get;} |
| | | public String sfRecordId{set;get;} |
| | | // Add by Li Jun for PIPL 20220308 End |
| | | |
| | | public String accRecordTypeId {set;get;}//当前 记录类型id |
| | |
| | | try{ |
| | | //新增一条联系人数据 |
| | | insert addContact; |
| | | sfRecordId = addContact.id; |
| | | insUpdData.Create_Contacts__c = ''; |
| | | }catch(Exception e){ |
| | | //ApexPages.addMessages(e); |
| | |
| | | try{ |
| | | //新增或修改数据 |
| | | upsert insUpdData; |
| | | |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, '保存成功!')); |
| | | isSearchBtn = true; |
| | | //保存成功,需要初始化一下此对象,防止再次点击此按钮保存一个条同样的数据 |
| | |
| | | |
| | | List<String> fieldList = new List<String>(Schema.getGlobalDescribe().get('Inquiry_form__c').getDescribe().fields.getMap().keyset()); |
| | | // Add fields to controller. This is to avoid the SOQL error in visualforce page |
| | | controller.addFields(fieldList); |
| | | if(!Test.isRunningTest()){ |
| | | controller.addFields(fieldList); |
| | | } |
| | | LookUpOverrideFields.add('Contact_Name__c'); |
| | | //添加项 |
| | | Init(controller.getRecord()); |
| | |
| | | //2021-10-15 mzy 任务管理改善 end |
| | | ) { |
| | | if (!String.isBlank(a.act.Activity_Type2__c) && a.act.Activity_Type2__c == '病院' |
| | | && a.act.Free_Input__c == false && String.isBlank(a.act.Visitor1__c)) { |
| | | && a.act.Free_Input__c == false && String.isBlank(a.act.Visitor1_ID__c)) { //Add By Chen Yanan 20220325 for PIPL |
| | | // && a.act.Free_Input__c == false && String.isBlank(a.act.Visitor1__c)) { |
| | | a.act.Visitor1__c.addError('请至少填写一位访问对象'); |
| | | eventFlg = true; |
| | | } |
| | |
| | | function Foo(){ |
| | | j$('[aws-id]').each(function(i,e){ |
| | | let awsDataId = j$(e).attr('aws-id'); |
| | | let piInformation = '姓名:'+contact[awsDataId].lastName +'<br/>' +'手机号:'+ (contact[awsDataId].mobilePhone ? contact[awsDataId].mobilePhone :''); |
| | | j$(e).find('.decrypt').html(piInformation); |
| | | if (contact.hasOwnProperty(awsDataId)) { |
| | | let piInformation = '姓名:'+contact[awsDataId].lastName +'<br/>' +'手机号:'+ (contact[awsDataId].mobilePhone ? contact[awsDataId].mobilePhone :''); |
| | | j$(e).find('.decrypt').html(piInformation); |
| | | }else{ |
| | | console.log(awsDataId+' not in contact'); |
| | | } |
| | | |
| | | }); |
| | | } |
| | | |
| | |
| | | <!-- <td><a href="#" onclick="setContact('{!lineinfo.lineNo}');" id="943114607025717249" onmouseover="showPIDiv('943114607025717249')" onmouseout="hidePIDiv('943114607025717249')">{!lineinfo.con.Name}</a></td> --> |
| | | <!-- 2022/02/15 张华建 解密信息 start --> |
| | | <td> |
| | | <a href="/{!lineinfo.con.Id}" onclick="setContact('{!lineinfo.lineNo}','{!lineinfo.con.AWS_Data_Id__c}');" aws-id="{!lineinfo.con.AWS_Data_Id__c}" style="position:relative"> |
| | | <a href="/{!lineinfo.con.Id}" target="_blank" onclick="setContact('{!lineinfo.lineNo}','{!lineinfo.con.AWS_Data_Id__c}');" aws-id="{!lineinfo.con.AWS_Data_Id__c}" style="position:relative"> |
| | | <span class="encrypt">{!lineinfo.con.Name}</span> |
| | | <span class="decrypt"></span> |
| | | </a> |
| | |
| | | var aws_result={}; |
| | | |
| | | jQuery(function(){ |
| | | var eles = document.getElementsByClassName("contact"); |
| | | for(let ei in eles){let e=eles[ei]; |
| | | let awsid = e.getAttribute('awsid'); |
| | | |
| | | jQuery("input.contact").each(function(){ |
| | | let awsid = this.getAttribute('awsid'); |
| | | if(awsid) awsids.push(awsid); |
| | | } |
| | | }) |
| | | |
| | | if(awsids.length > 0){ |
| | | AWSService.search(staticResource.searchUrl,JSON.stringify({dataIds:awsids}),function(result){ |
| | |
| | | body { |
| | | font-family: Arial Unicode MS; |
| | | page-break-inside: auto; |
| | | font-size: 14px; |
| | | font-size: 14pt; |
| | | } |
| | | table { |
| | | border-collapse: collapse; |
| | | width: 100%; |
| | | } |
| | | table, th, td { |
| | | border: 1px solid black; |
| | | border: 1pt solid black; |
| | | text-align: left; |
| | | } |
| | | table.headTable tr td { |
| | | font-size: 13px; |
| | | font-size: 13pt; |
| | | } |
| | | table.deliInfoTable tr td { |
| | | font-size: 13px; |
| | | font-size: 12pt; |
| | | } |
| | | table.detailListTable tr td { |
| | | font-size: 8px; |
| | | font-size: 8pt; |
| | | text-align: left; |
| | | box-sizing:border-box; |
| | | padding: 1px; |
| | | padding: 1pt; |
| | | } |
| | | table.tailTable tr td { |
| | | font-size: 12px; |
| | | font-size: 12pt; |
| | | } |
| | | body{margin: 0 auto;width: 920px;font-size: 14px;} |
| | | #title1{height: 30px;} |
| | | body{margin: 0 auto;width: 920px;font-size: 14pt;} |
| | | #title1{height: 50pt;} |
| | | #title2{height: 80px;} |
| | | #pdf-wrapper {position: relative;} |
| | | #pdf-wrapper table{width: 100%;border-spacing: 0px;border-collapse: collapse; border: none;} |
| | |
| | | <!-- 20220221 PI改造 by 徐亮 start --> |
| | | <apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }" /> |
| | | <script src="../../soap/ajax/53.0/connection.js" type="text/javascript"></script> |
| | | <!-- <script src="https://cdn.bootcss.com/es6-promise/4.1.1/es6-promise.auto.min.js" type="text/javascript"></script> --> |
| | | |
| | | <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/> |
| | |
| | | <!-- 序号 --> |
| | | <apex:variable value="{!1}" var="lineCnt" /> |
| | | <apex:repeat value="{!pdfPageList}" var="eachPdfPage"> |
| | | <img style="width:79px;height:79px;padding:0px;margin-top:1px;z-index:999;position:absolute;" |
| | | <div class="pdf-page"> |
| | | <div id="title1"></div> |
| | | <img style="width:72pt;height:72pt;padding:0px;margin-top:1pt;z-index:999;position:absolute;" |
| | | src="{!QRSrc}" /> |
| | | <!-- 表头 --> |
| | | <table class="headTable" style="position:relative;"> |
| | | <colgroup> |
| | | <col width="100%"/> |
| | | </colgroup> |
| | | <tr> |
| | | <th style="box-sizing:border-box; text-align:center; font-size:24px; font-weight:900;" height="35">奥林巴斯医疗手术附件(器械)临床试用表</th> |
| | | </tr> |
| | | <tr> |
| | | <td style="text-align:right;"> |
| | | 耗材备品申请单号:<apex:outputText value="{!targetConsumApply.Name}" /> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td style="text-align:right;"> |
| | | 本单附件第(<apex:outputText value="{!pageCnt}" />)页/共(<apex:outputText value="{!pageTotalCnt}" />)页 |
| | | </td> |
| | | </tr> |
| | | </table> |
| | | |
| | | <!-- 发货信息 --> |
| | | <table class="deliInfoTable"> |
| | | <colgroup> |
| | | <col width="16%" /> |
| | | <col width="14%" /> |
| | | <col width="36%" /> |
| | | <col width="16%" /> |
| | | <col width="18%" /> |
| | | </colgroup> |
| | | <tr> |
| | | <th style="text-align:center;" colspan="5" height="25">发货信息</th> |
| | | </tr> |
| | | <tr> |
| | | <td>使用目的</td> |
| | | <td colspan="4"> |
| | | <apex:outputText value="{!targetConsumApply.demo_purpose2__c}" /> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td rowspan="2">申请人信息</td> |
| | | <td>所属本部名</td> |
| | | <td> |
| | | <apex:outputText value="{!targetConsumApply.Salesdept__c}" /> |
| | | </td> |
| | | <td>所属办事处名</td> |
| | | <td> |
| | | <apex:outputText value="{!targetConsumApply.WorkPlace__c}" /> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td>姓名</td> |
| | | <td> |
| | | <apex:outputText value="{!targetConsumApply.Person_In_Charge__r.Name}" /> |
| | | </td> |
| | | <td colspan="1">联系电话</td> |
| | | <td> |
| | | <apex:outputText value="{!targetConsumApply.ApplyPerson_Phone__c}" /> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td>医疗机构信息</td> |
| | | <td>医疗机构名</td> |
| | | <td> |
| | | <apex:outputText value="{!hospitalName}" /> |
| | | </td> |
| | | <td>科室名</td> |
| | | <td> |
| | | <apex:outputText value="{!targetConsumApply.Account__r.Department_Name__c}" /> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td rowspan="3" >发货地址</td> |
| | | <td colspan="2" rowspan="3"> |
| | | <apex:outputText value="{!shippmentAddress}" /> |
| | | </td> |
| | | <td colspan="1">邮编</td> |
| | | <td> |
| | | <apex:outputText value="{!IF(targetConsumApply.Shipment_address__r.Post_Code__c==null, targetConsumApply.Post_Code__c, targetConsumApply.Shipment_address__r.Post_Code__c)}" /> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td colspan="1">接收人姓名</td> |
| | | <td> |
| | | <apex:outputText value="{!targetConsumApply.Loaner_received_staff__c}" /> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td colspan="1">接收人电话</td> |
| | | <td> |
| | | <apex:outputText value="{!targetConsumApply.Loaner_received_staff_phone__c}" /> |
| | | </td> |
| | | </tr> |
| | | </table> |
| | | <apex:outputPanel layout="none" rendered="{!pageCnt == 1}"> |
| | | <!-- ※奥林巴斯耗材备品借用须知 --> |
| | | <table style="table-layout:fixed;"> |
| | | <!-- 表头 --> |
| | | <table class="headTable" style="position:relative;"> |
| | | <colgroup> |
| | | <col width="100%" /> |
| | | <col width="100%"/> |
| | | </colgroup> |
| | | <tr> |
| | | <th style="text-align:center;" colspan="5" height="25">※奥林巴斯耗材备品借用须知</th> |
| | | <th style="box-sizing:border-box; text-align:center; font-size:24pt; font-weight:900;" height="35">奥林巴斯医疗手术附件(器械)临床试用表</th> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size:12px;"> |
| | | 1、严格遵循医疗产品的合规使用原则,为评价该产品在临床使用的有效性、安全性无偿提供给医疗从业者进行试用。<br /> |
| | | 2、一次性医疗产品和重复性使用产品用于临床后由试用者按该院对医疗废弃物的处置规定进行废弃。<br /> |
| | | 3、未经奥林巴斯公司书面同意,借用方不得以任何理由对耗材进行临床用途以外的处理,包括但不限于向第三方转借、出租、出售、抵押等。<br /> |
| | | 4、此次耗材出借基于正当合理的理由,而非通过出借耗材对借用方购买、推荐奥林巴斯公司产品、服务等产生任何不正当影响。<br /> |
| | | 5、借用方应独立依靠其专业水平和能力,严格按照奥林巴斯公司的要求(“产品使用说明书”)内容尽审慎义务正确操作、维护、监测耗材,<br />由于借用方错误、疏忽等借用方原因而导致的任何问题均应由借用方自行负责处理。<br /> |
| | | 6、其他未尽事宜,双方应本着友好合作原则进行协商解决。 |
| | | <td style="text-align:right;"> |
| | | 耗材备品申请单号:<apex:outputText value="{!targetConsumApply.Name}" /> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td style="text-align:right;"> |
| | | 本单附件第(<apex:outputText value="{!pageCnt}" />)页/共(<apex:outputText value="{!pageTotalCnt}" />)页 |
| | | </td> |
| | | </tr> |
| | | </table> |
| | | </apex:outputPanel> |
| | | <!-- 借用耗材备品发货清单 --> |
| | | <table class="detailListTable" style="width: 100%;"> |
| | | <colgroup> |
| | | <!-- 序号 --> |
| | | <col width="3.00%" /> |
| | | <!-- 明细型号 --> |
| | | <col width="12.00%" /> |
| | | <!-- 中文名称 33--> |
| | | <col width="28.00%" /> |
| | | <!-- 管理编码 耗材追溯 yc --> |
| | | <col width="5.00%" /> |
| | | <!-- 备品管理码 耗材追溯 yc --> |
| | | <col width="3.00%" /> |
| | | <!-- 消耗品有效期 --> |
| | | <col width="6.00%" /> |
| | | <!-- 展示/演示 --> |
| | | <col width="5.27%" /> |
| | | <!-- 试用数量 3.46--> |
| | | <col width="3.46%" /> |
| | | <!-- 试用日期 --> |
| | | <col width="6.78%" /> |
| | | <!-- 病例/动物脏器 --> |
| | | <col width="4.82%" /> |
| | | <!-- 试用者盖章 --> |
| | | <col width="4.52%" /> |
| | | <!-- 跟台者盖章 --> |
| | | <col width="4.37%" /> |
| | | <!-- 备用 --> |
| | | <col width="3.46%" /> |
| | | <!-- 备注 --> |
| | | <!-- <col width="10%" /> --> |
| | | </colgroup> |
| | | <apex:outputPanel layout="none" rendered="{!eachPdfPage.equipSetDetailList.size > 0}"> |
| | | <tr> |
| | | <th style="text-align:center;" colspan="12" height="25">借用耗材备品发货清单</th> |
| | | </tr> |
| | | <tr> |
| | | <th style="text-align:center; font-size:10px;" colspan="12" height="25">共计耗材备品({!consumApplySetDetailListSize})件</th> |
| | | </tr> |
| | | <tr> |
| | | <td style="text-align: center;"><c:PDFWbr targetStr="序号"/></td> |
| | | <td style="text-align: center;"><c:PDFWbr targetStr="明细型号"/></td> |
| | | <td style="text-align: center;"><c:PDFWbr targetStr="中文名称"/></td> |
| | | <td style="text-align: center;"><c:PDFWbr targetStr="管理编码"/></td> |
| | | <td style="text-align: center;"><c:PDFWbr targetStr="备品管理码"/></td> |
| | | <td style="text-align: center;"><c:PDFWbr targetStr="消耗品有效期"/></td> |
| | | <td style="text-align: center;"><c:PDFWbr targetStr="展示/演示"/></td> |
| | | <td style="text-align: center;"><c:PDFWbr targetStr="试用数量"/></td> |
| | | <td style="text-align: center;"><c:PDFWbr targetStr="试用日期"/></td> |
| | | <td style="text-align: center;"><c:PDFWbr targetStr="病例/动物脏器"/></td> |
| | | <td style="text-align: center;"><c:PDFWbr targetStr="试用者盖章"/></td> |
| | | <td style="text-align: center;"><c:PDFWbr targetStr="跟台者盖章"/></td> |
| | | <td style="text-align: center;"><c:PDFWbr targetStr="备用"/></td> |
| | | <td style="text-align: center;"><c:PDFWbr targetStr="备注"/></td> |
| | | </tr> |
| | | </apex:outputPanel> |
| | | <apex:repeat value="{!eachPdfPage.equipSetDetailList}" var="eachEquipSetDetail"> |
| | | <tr style="vertical-align:center;"> |
| | | <!-- 序号 --> |
| | | <td style="text-align:center;height:30px;"> |
| | | <apex:outputPanel rendered="{!lineCnt <= consumApplySetDetailListSize}" layout="none"> |
| | | <c:PDFWbr targetStr="{!lineCnt}"/> |
| | | </apex:outputPanel> |
| | | <apex:outputPanel rendered="{!lineCnt > consumApplySetDetailListSize}" layout="none"><br /></apex:outputPanel> |
| | | </td> |
| | | <!-- 明细型号 --> |
| | | <td><c:PDFWbr targetStr="{!eachEquipSetDetail.Fixture_Model_No_F__c}"/></td> |
| | | <!-- 中文名称 --> |
| | | <td><c:PDFWbr targetStr="{!eachEquipSetDetail.ProductName__c}"/></td> |
| | | <td><c:PDFWbr targetStr="{!eachEquipSetDetail.ManagementCode__c}"/></td> |
| | | <td><c:PDFWbr targetStr="{!eachEquipSetDetail.EquipmentManagementCode__c}"/></td> |
| | | <!-- 消耗品有效期 --> |
| | | <td style="text-align: center;"> |
| | | <apex:outputText value="{0,date,yyyy'/'MM'/'dd}"> |
| | | <apex:param value="{!eachEquipSetDetail.Consumable_Guaranteen_end_F__c}"/> |
| | | </apex:outputText> |
| | | </td> |
| | | <!-- 展示/演示 --> |
| | | <td><c:PDFWbr targetStr="{!eachEquipSetDetail.Show_demonstration__c}"/></td> |
| | | <!-- 试用数量 --> |
| | | <td style="text-align: right;"><c:PDFWbr targetStr="{!eachEquipSetDetail.Trial_Num__c}"/></td> |
| | | <!-- 试用日期 --> |
| | | <!-- <td style="text-align:left;"><c:PDFWbr targetStr="{!eachEquipSetDetail.Consum_Start_Date__c}"/></td> --> |
| | | <td style="text-align: center;"> |
| | | <apex:outputText value="{0,date,yyyy'/'MM'/'dd}"> |
| | | <apex:param value="{!eachEquipSetDetail.Consum_Start_Date__c}"/> |
| | | </apex:outputText> |
| | | </td> |
| | | <!-- 病例/动物脏器 --> |
| | | <td><c:PDFWbr targetStr="{!eachEquipSetDetail.Case_OR_animal_organ__c}"/></td> |
| | | <!-- 试用者盖章 --> |
| | | <td aws-data-id="{!eachEquipSetDetail.AWS_Data_Id__c}"><c:PDFWbr targetStr="{!eachEquipSetDetail.Trial_User__c}"/></td> |
| | | <!-- 跟台者盖章 --> |
| | | <td><c:PDFWbr targetStr="{!eachEquipSetDetail.Follower_User__r.Name}"/></td> |
| | | <!-- 备用 --> |
| | | <td style="text-align: center;"> |
| | | <!-- eachEquipSetDetail.Spare__c --> |
| | | <apex:outputPanel rendered="{!eachEquipSetDetail.Spare__c}"> |
| | | ✔️ |
| | | </apex:outputPanel> |
| | | </td> |
| | | <!-- 备注 --> |
| | | <td style="box-sizing: border-box;text-align:left;padding: 0px;"><c:PDFWbr targetStr="{!eachEquipSetDetail.Comment__c}"/></td> |
| | | </tr> |
| | | <apex:variable value="{!lineCnt + 1}" var="lineCnt" /> |
| | | </apex:repeat> |
| | | |
| | | </table> |
| | | <table class="tailTable" style="width:100%;"> |
| | | <tr> |
| | | <!-- 20210812 SFDC-C5CC5S 修改地址--> |
| | | <td colspan="2" height="40" > |
| | | 奥林巴斯 上海备品中心地址:上海市浦东新区金吉路778号3号楼1F<br /> |
| | | 邮编:201206 TEL:021-60391318-8877 FAX:021-60391316 |
| | | <!-- TODO 如果地址等内容需要修改的话,FixtureRentalPDF、LostReportEdit的地址等信息也需要确认是否需要一起修改 --> |
| | | </td> |
| | | </tr> |
| | | <!-- 20211210 ljh SFDC-C923SR add --> |
| | | <tr> |
| | | <td colspan="2" style=" border: none;"> |
| | | <img align="left" src="{!BRSrc}" /> |
| | | </td> |
| | | </tr> |
| | | <!-- 20211210 ljh SFDC-C923SR end --> |
| | | </table> |
| | | <apex:outputPanel rendered="{!pageCnt < pageTotalCnt}" layout="none"> |
| | | <div style="page-break-after:always;"/> |
| | | </apex:outputPanel> |
| | | <apex:variable value="{!pageCnt + 1}" var="pageCnt" /> |
| | | <!-- 发货信息 --> |
| | | <table class="deliInfoTable"> |
| | | <colgroup> |
| | | <col width="16%" /> |
| | | <col width="14%" /> |
| | | <col width="36%" /> |
| | | <col width="16%" /> |
| | | <col width="18%" /> |
| | | </colgroup> |
| | | <tr> |
| | | <th style="text-align:center;" colspan="5" height="25">发货信息</th> |
| | | </tr> |
| | | <tr> |
| | | <td>使用目的</td> |
| | | <td colspan="4"> |
| | | <apex:outputText value="{!targetConsumApply.demo_purpose2__c}" /> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td rowspan="2">申请人信息</td> |
| | | <td>所属本部名</td> |
| | | <td> |
| | | <apex:outputText value="{!targetConsumApply.Salesdept__c}" /> |
| | | </td> |
| | | <td>所属办事处名</td> |
| | | <td> |
| | | <apex:outputText value="{!targetConsumApply.WorkPlace__c}" /> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td>姓名</td> |
| | | <td> |
| | | <apex:outputText value="{!targetConsumApply.Person_In_Charge__r.Name}" /> |
| | | </td> |
| | | <td colspan="1">联系电话</td> |
| | | <td> |
| | | <apex:outputText value="{!targetConsumApply.ApplyPerson_Phone__c}" /> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td>医疗机构信息</td> |
| | | <td>医疗机构名</td> |
| | | <td> |
| | | <apex:outputText value="{!hospitalName}" /> |
| | | </td> |
| | | <td>科室名</td> |
| | | <td> |
| | | <apex:outputText value="{!targetConsumApply.Account__r.Department_Name__c}" /> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td rowspan="3" >发货地址</td> |
| | | <td colspan="2" rowspan="3" id="shippmentAddress"> |
| | | <apex:outputText value="{!shippmentAddress}" /> |
| | | </td> |
| | | <td colspan="1">邮编</td> |
| | | <td> |
| | | <apex:outputText value="{!IF(targetConsumApply.Shipment_address__r.Post_Code__c==null, targetConsumApply.Post_Code__c, targetConsumApply.Shipment_address__r.Post_Code__c)}" /> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td colspan="1">接收人姓名</td> |
| | | <td> |
| | | <apex:outputText value="{!targetConsumApply.Loaner_received_staff__c}" /> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td colspan="1">接收人电话</td> |
| | | <td> |
| | | <apex:outputText value="{!targetConsumApply.Loaner_received_staff_phone__c}" /> |
| | | </td> |
| | | </tr> |
| | | </table> |
| | | <apex:outputPanel layout="none" rendered="{!pageCnt == 1}"> |
| | | <!-- ※奥林巴斯耗材备品借用须知 --> |
| | | <table style="table-layout:fixed;"> |
| | | <colgroup> |
| | | <col width="100%" /> |
| | | </colgroup> |
| | | <tr> |
| | | <th style="text-align:center;" colspan="5" height="25">※奥林巴斯耗材备品借用须知</th> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size:12pt;"> |
| | | 1、严格遵循医疗产品的合规使用原则,为评价该产品在临床使用的有效性、安全性无偿提供给医疗从业者进行试用。<br /> |
| | | 2、一次性医疗产品和重复性使用产品用于临床后由试用者按该院对医疗废弃物的处置规定进行废弃。<br /> |
| | | 3、未经奥林巴斯公司书面同意,借用方不得以任何理由对耗材进行临床用途以外的处理,包括但不限于向第三方转借、出租、出售、抵押等。<br /> |
| | | 4、此次耗材出借基于正当合理的理由,而非通过出借耗材对借用方购买、推荐奥林巴斯公司产品、服务等产生任何不正当影响。<br /> |
| | | 5、借用方应独立依靠其专业水平和能力,严格按照奥林巴斯公司的要求(“产品使用说明书”)内容尽审慎义务正确操作、维护、监测耗材,<br />由于借用方错误、疏忽等借用方原因而导致的任何问题均应由借用方自行负责处理。<br /> |
| | | 6、其他未尽事宜,双方应本着友好合作原则进行协商解决。 |
| | | </td> |
| | | </tr> |
| | | </table> |
| | | </apex:outputPanel> |
| | | <!-- 借用耗材备品发货清单 --> |
| | | <table class="detailListTable" style="width: 100%;"> |
| | | <colgroup> |
| | | <!-- 序号 --> |
| | | <col width="3.00%" /> |
| | | <!-- 明细型号 --> |
| | | <col width="12.00%" /> |
| | | <!-- 中文名称 33--> |
| | | <col width="28.00%" /> |
| | | <!-- 管理编码 耗材追溯 yc --> |
| | | <col width="5.00%" /> |
| | | <!-- 备品管理码 耗材追溯 yc --> |
| | | <col width="3.00%" /> |
| | | <!-- 消耗品有效期 --> |
| | | <col width="6.00%" /> |
| | | <!-- 展示/演示 --> |
| | | <col width="5.27%" /> |
| | | <!-- 试用数量 3.46--> |
| | | <col width="3.46%" /> |
| | | <!-- 试用日期 --> |
| | | <col width="6.78%" /> |
| | | <!-- 病例/动物脏器 --> |
| | | <col width="4.82%" /> |
| | | <!-- 试用者盖章 --> |
| | | <col width="4.52%" /> |
| | | <!-- 跟台者盖章 --> |
| | | <col width="4.37%" /> |
| | | <!-- 备用 --> |
| | | <col width="3.46%" /> |
| | | <!-- 备注 --> |
| | | <!-- <col width="10%" /> --> |
| | | </colgroup> |
| | | <apex:outputPanel layout="none" rendered="{!eachPdfPage.equipSetDetailList.size > 0}"> |
| | | <tr> |
| | | <th style="text-align:center;" colspan="14" height="25">借用耗材备品发货清单</th> |
| | | </tr> |
| | | <tr> |
| | | <th style="text-align:center; font-size:10pt;" colspan="14" height="25">共计耗材备品({!consumApplySetDetailListSize})件</th> |
| | | </tr> |
| | | <tr> |
| | | <td style="text-align: center;"><c:PDFWbr targetStr="序号"/></td> |
| | | <td style="text-align: center;"><c:PDFWbr targetStr="明细型号"/></td> |
| | | <td style="text-align: center;"><c:PDFWbr targetStr="中文名称"/></td> |
| | | <td style="text-align: center;"><c:PDFWbr targetStr="管理编码"/></td> |
| | | <td style="text-align: center;"><c:PDFWbr targetStr="备品管理码"/></td> |
| | | <td style="text-align: center;"><c:PDFWbr targetStr="消耗品有效期"/></td> |
| | | <td style="text-align: center;"><c:PDFWbr targetStr="展示/演示"/></td> |
| | | <td style="text-align: center;"><c:PDFWbr targetStr="试用数量"/></td> |
| | | <td style="text-align: center;"><c:PDFWbr targetStr="试用日期"/></td> |
| | | <td style="text-align: center;"><c:PDFWbr targetStr="病例/动物脏器"/></td> |
| | | <td style="text-align: center;"><c:PDFWbr targetStr="试用者盖章"/></td> |
| | | <td style="text-align: center;"><c:PDFWbr targetStr="跟台者盖章"/></td> |
| | | <td style="text-align: center;"><c:PDFWbr targetStr="备用"/></td> |
| | | <td style="text-align: center;"><c:PDFWbr targetStr="备注"/></td> |
| | | </tr> |
| | | </apex:outputPanel> |
| | | <apex:repeat value="{!eachPdfPage.equipSetDetailList}" var="eachEquipSetDetail"> |
| | | <tr style="vertical-align:center;"> |
| | | <!-- 序号 --> |
| | | <td style="text-align:center;height:25pt;"> |
| | | <apex:outputPanel rendered="{!lineCnt <= consumApplySetDetailListSize}" layout="none"> |
| | | <c:PDFWbr targetStr="{!lineCnt}"/> |
| | | </apex:outputPanel> |
| | | <apex:outputPanel rendered="{!lineCnt > consumApplySetDetailListSize}" layout="none"><br /></apex:outputPanel> |
| | | </td> |
| | | <!-- 明细型号 --> |
| | | <td><c:PDFWbr targetStr="{!eachEquipSetDetail.Fixture_Model_No_F__c}"/></td> |
| | | <!-- 中文名称 --> |
| | | <td><c:PDFWbr targetStr="{!eachEquipSetDetail.ProductName__c}"/></td> |
| | | <td><c:PDFWbr targetStr="{!eachEquipSetDetail.ManagementCode__c}"/></td> |
| | | <td><c:PDFWbr targetStr="{!eachEquipSetDetail.EquipmentManagementCode__c}"/></td> |
| | | <!-- 消耗品有效期 --> |
| | | <td style="text-align: center;"> |
| | | <apex:outputText value="{0,date,yyyy'/'MM'/'dd}"> |
| | | <apex:param value="{!eachEquipSetDetail.Consumable_Guaranteen_end_F__c}"/> |
| | | </apex:outputText> |
| | | </td> |
| | | <!-- 展示/演示 --> |
| | | <td><c:PDFWbr targetStr="{!eachEquipSetDetail.Show_demonstration__c}"/></td> |
| | | <!-- 试用数量 --> |
| | | <td style="text-align: right;"><c:PDFWbr targetStr="{!eachEquipSetDetail.Trial_Num__c}"/></td> |
| | | <!-- 试用日期 --> |
| | | <!-- <td style="text-align:left;"><c:PDFWbr targetStr="{!eachEquipSetDetail.Consum_Start_Date__c}"/></td> --> |
| | | <td style="text-align: center;"> |
| | | <apex:outputText value="{0,date,yyyy'/'MM'/'dd}"> |
| | | <apex:param value="{!eachEquipSetDetail.Consum_Start_Date__c}"/> |
| | | </apex:outputText> |
| | | </td> |
| | | <!-- 病例/动物脏器 --> |
| | | <td><c:PDFWbr targetStr="{!eachEquipSetDetail.Case_OR_animal_organ__c}"/></td> |
| | | <!-- 试用者盖章 --> |
| | | <td aws-data-id="{!eachEquipSetDetail.AWS_Data_Id__c}"><c:PDFWbr targetStr="{!eachEquipSetDetail.Trial_User__c}"/></td> |
| | | <!-- 跟台者盖章 --> |
| | | <td><c:PDFWbr targetStr="{!eachEquipSetDetail.Follower_User__r.Name}"/></td> |
| | | <!-- 备用 --> |
| | | <td style="text-align: center;"> |
| | | <!-- eachEquipSetDetail.Spare__c --> |
| | | <apex:outputPanel rendered="{!eachEquipSetDetail.Spare__c}"> |
| | | ✔️ |
| | | </apex:outputPanel> |
| | | </td> |
| | | <!-- 备注 --> |
| | | <td style="box-sizing: border-box;text-align:left;padding: 0px;"><c:PDFWbr targetStr="{!eachEquipSetDetail.Comment__c}"/></td> |
| | | </tr> |
| | | <apex:variable value="{!lineCnt + 1}" var="lineCnt" /> |
| | | </apex:repeat> |
| | | |
| | | </table> |
| | | <table class="tailTable" style="width:100%;"> |
| | | <tr> |
| | | <!-- 20210812 SFDC-C5CC5S 修改地址--> |
| | | <td colspan="2" height="40" > |
| | | 奥林巴斯 上海备品中心地址:上海市浦东新区金吉路778号3号楼1F<br /> |
| | | 邮编:201206 TEL:021-60391318-8877 FAX:021-60391316 |
| | | <!-- TODO 如果地址等内容需要修改的话,FixtureRentalPDF、LostReportEdit的地址等信息也需要确认是否需要一起修改 --> |
| | | </td> |
| | | </tr> |
| | | <!-- 20211210 ljh SFDC-C923SR add --> |
| | | <tr> |
| | | <td colspan="2" style=" border: none;"> |
| | | <img align="left" src="{!BRSrc}" /> |
| | | </td> |
| | | </tr> |
| | | <!-- 20211210 ljh SFDC-C923SR end --> |
| | | </table> |
| | | <apex:outputPanel rendered="{!pageCnt < pageTotalCnt}" layout="none"> |
| | | <div style="page-break-after:always;"/> |
| | | </apex:outputPanel> |
| | | <apex:variable value="{!pageCnt + 1}" var="pageCnt" /> |
| | | </div> |
| | | </apex:repeat> |
| | | </div> |
| | | </body> |
| | |
| | | <script> |
| | | AWSService.sfSessionId = '{!GETSESSIONID()}'; |
| | | var staticResource = JSON.parse('{!staticResource}'); |
| | | var staticResourceCon = JSON.parse('{!staticResourceCon}'); |
| | | var staticResourceFile = JSON.parse('{!staticResourceFile}'); |
| | | function Fun(pdf){ |
| | | var iframe = document.createElement('iframe'); |
| | | iframe.setAttribute('style', 'position:absolute;right:0; top:0; bottom:0; height:100%; width:100%'); |
| | | document.body.appendChild(iframe); |
| | | iframe.src = pdf.output('datauristring'); |
| | | for(let e of document.body.childNodes){ |
| | | if( e != iframe && e.style){ |
| | | e.style.display = 'none'; |
| | | } |
| | | } |
| | | |
| | | var form = jQuery("<form method='post'></form>"); |
| | | jQuery(document.body).append(form); |
| | | form.attr({"action":staticResourceFile.viewUnifiedContactUrl+"?from="+encodeURIComponent(window.location.href)}); |
| | | // form.attr({"action":"http://127.0.0.1:8080/a/d?from="+encodeURIComponent(window.location.href)}); |
| | | let input = jQuery("<input type='hidden'/>"); |
| | | input.attr({"name":"base64Str"}); |
| | | input.val(pdf.output('datauristring').substr(28)); |
| | | form.append(input); |
| | | form.submit(); |
| | | |
| | | // jQuery("body > *").each(function(){ |
| | | // jQuery(this).css('display','none'); |
| | | // }) |
| | | // jQuery("body").append('<embed style="position:absolute; left: 0; top: 0;" width="100%" height="100%" src="'+pdf.output('datauristring')+'" type="application/pdf"/>') |
| | | |
| | | } |
| | | |
| | | let id = "pdf-wrapper"; |
| | | var target = document.getElementById(id); |
| | | function jsPdfDownload(){ |
| | | let pdfName = "测试"; |
| | | let id = "pdf-wrapper"; |
| | | var target = document.getElementById(id); |
| | | target.style.background = "#FFFFFF"; |
| | | if(pdfName==''||pdfName==undefined) pdfName= getNowFormatDate(); |
| | | |
| | | html2canvas(target, { |
| | | scale: 2, |
| | | onrendered:function(canvas) { |
| | | var contentWidth = canvas.width; |
| | | var contentHeight = canvas.height; |
| | | let jtargets = jQuery("#pdf-wrapper .pdf-page"); |
| | | let j_arr = new Array(jtargets.length+1).join(0).split('').map(function(){return false}); |
| | | let landscape = false; |
| | | let pw = 595.28; |
| | | let ph = 841.89; |
| | | const marginw = 40; |
| | | |
| | | let orientation = ''; |
| | | if (landscape) { |
| | | pw += ph;ph = pw - ph;pw = pw - ph; |
| | | orientation = 'l'; |
| | | } |
| | | var pdf = new jsPDF(orientation, 'pt', 'a4');// 第一个参数填字母l,注意不是数字1,为横向pdf |
| | | jtargets.each(function(i,e){ |
| | | e.style.background = "#FFFFFF"; |
| | | }) |
| | | |
| | | //一页pdf显示html页面生成的canvas高度; |
| | | var pageHeight = contentWidth / 592.28 * 841.89; |
| | | //未生成pdf的html页面高度 |
| | | var leftHeight = contentHeight; |
| | | //页面偏移 |
| | | var position = 0; |
| | | //a4纸的尺寸[595.28,841.89],html页面生成的canvas在pdf中图片的宽高 |
| | | var imgWidth = 515.28;//595.28//左右边距20 |
| | | var imgHeight = 515.28/contentWidth * contentHeight;//左右边距20 |
| | | let rei = 0; |
| | | let recursion = null; |
| | | recursion = function(i){ |
| | | if(i>= jtargets.length){ |
| | | Fun(pdf); |
| | | return; |
| | | } |
| | | e = jtargets[i]; |
| | | html2canvas(e, { |
| | | scale: 2, |
| | | onrendered:function(canvas) { |
| | | |
| | | let canvas_max_page_num = 1; |
| | | let canvas_current_page_num = 0; |
| | | var contentWidth = canvas.width; |
| | | var contentHeight = canvas.height; |
| | | |
| | | var pageData = canvas.toDataURL('image/jpeg', 1.0); |
| | | //一页pdf显示html页面生成的canvas高度; |
| | | var pageHeight = contentWidth / pw * ph; |
| | | //未生成pdf的html页面高度 |
| | | var leftHeight = contentHeight; |
| | | //页面偏移 |
| | | var position = 0; |
| | | //a4纸的尺寸[595.28,841.89],html页面生成的canvas在pdf中图片的宽高 |
| | | var imgWidth = pw-2*marginw;//595.28//左右边距20 |
| | | var imgHeight = imgWidth/contentWidth * contentHeight;//左右边距20 |
| | | |
| | | var pdf = new jsPDF('', 'pt', 'a4'); |
| | | var pageData = canvas.toDataURL('image/jpeg', 1.0); |
| | | |
| | | //有两个高度需要区分,一个是html页面的实际高度,和生成pdf的页面高度(841.89) |
| | | //当内容未超过pdf一页显示的范围,无需分页 |
| | | if (leftHeight < pageHeight) { |
| | | pdf.addImage(pageData, 'JPEG', 40, 0, imgWidth, imgHeight );//左右边距20 |
| | | } else { |
| | | while(leftHeight > 0) { |
| | | pdf.addImage(pageData, 'JPEG', 40, position, imgWidth, imgHeight)//左右边距20 |
| | | leftHeight -= pageHeight; |
| | | position -= 841.89; |
| | | //避免添加空白页 |
| | | if(leftHeight > 0) { |
| | | pdf.addPage(); |
| | | |
| | | |
| | | //有两个高度需要区分,一个是html页面的实际高度,和生成pdf的页面高度(841.89) |
| | | //当内容未超过pdf一页显示的范围,无需分页 |
| | | if (leftHeight < pageHeight) { |
| | | pdf.addImage(pageData, 'JPEG', marginw, 0, imgWidth, imgHeight );//左右边距20 |
| | | } else { |
| | | while(leftHeight > 0) { |
| | | |
| | | if(i){ |
| | | pdf.addPage(); |
| | | } |
| | | canvas_current_page_num++; |
| | | pdf.addImage(pageData, 'JPEG', marginw, position, imgWidth, imgHeight)//左右边距20 |
| | | leftHeight -= pageHeight; |
| | | position -= ph; |
| | | |
| | | if (canvas_max_page_num > 0 && canvas_current_page_num>=canvas_max_page_num) { |
| | | break; |
| | | } |
| | | |
| | | //避免添加空白页 |
| | | if(leftHeight > 0) { |
| | | pdf.addPage(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | recursion(i+1); |
| | | } |
| | | Fun(pdf); |
| | | } |
| | | }) |
| | | }) |
| | | }; |
| | | recursion(rei); |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | blockme(); |
| | | //blockme(); |
| | | document.body.onload = function(){ |
| | | let aws_ids = []; |
| | | j$("[aws-data-id]").each(function(i,e){ |
| | |
| | | |
| | | }) |
| | | |
| | | |
| | | let a1 = false; |
| | | let a2 = false; |
| | | var Foo = function(){ |
| | | if(a1 && a2){ |
| | | setTimeout(function() { |
| | | jsPdfDownload(); |
| | | }, 1500); |
| | | } |
| | | } |
| | | AWSService.search(staticResource.searchUrl, JSON.stringify({ |
| | | dataIds:aws_ids |
| | | }), function(data){ |
| | | unblockUI(); |
| | | //unblockUI(); |
| | | if (data && data.object && data.object.length > 0) { |
| | | for (const d of data.object) { |
| | | for(let di in data.object){let d=data.object[di]; |
| | | j$("[aws-data-id='"+d.dataId +"']").html(d.trialUser); |
| | | } |
| | | } |
| | | //document.getElementById("Responsible_Person_HP__c").innerHTML = data.object.responsiblePersonHP; |
| | | //document.getElementById("Caller_phone__c").innerHTML = data.object.callerPhone; |
| | | |
| | | setTimeout(() => { |
| | | jsPdfDownload(); |
| | | }, 1500); |
| | | } |
| | | a1= true; |
| | | Foo(); |
| | | }, staticResource.token); |
| | | |
| | | if('{!targetConsumApply.Shippment_adress_detail__c}'){ |
| | | a2 = true; |
| | | Foo(); |
| | | }else{ |
| | | AWSService.query(staticResourceCon.queryUrl, '{!targetConsumApply.AWS_Data_Id__c}', function(data){ |
| | | //unblockUI(); |
| | | if (data && data.object ) { |
| | | |
| | | j$("#shippmentAddress").html(data.object.directShippmentAddress); |
| | | } |
| | | a2 = true; |
| | | Foo(); |
| | | }, staticResource.token); |
| | | } |
| | | |
| | | |
| | | } |
| | | document.body.onclick = function(){ |
| | | //jsPdfDownload(); |
| | |
| | | iframe.setAttribute('style', 'position:absolute;right:0; top:0; bottom:0; height:100%; width:100%'); |
| | | document.body.appendChild(iframe); |
| | | iframe.src = pdf.output('datauristring'); |
| | | for(let e of document.body.childNodes){ |
| | | for(let ei in document.body.childNodes){let e=document.body.childNodes[ei]; |
| | | if( e != iframe && e.style){ |
| | | e.style.display = 'none'; |
| | | } |
| | |
| | | unblockUI(); |
| | | document.getElementById("Responsible_Person__c").innerHTML = data.object.responsiblePerson; |
| | | |
| | | setTimeout(() => { |
| | | setTimeout(function(){ |
| | | jsPdfDownload(); |
| | | }, 1500); |
| | | }, staticResources.token); |
| | |
| | | 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); |
| | | let e = document.querySelector("[data-id='"+layoutField.fieldAPI+"']"); |
| | | e.disabled = !(layoutField.editableField); |
| | | if (!(layoutField.editableField)) { |
| | | if (e.getAttribute("multiple") && e.getAttribute("multiple") == 'multiple') { |
| | | e.parentNode.classList.add("disabledbutton"); |
| | | } |
| | | if (e.tagName == 'DIV') { |
| | | e.classList.add("disabledbutton"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | 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); |
| | | let e = document.querySelector("[data-id='"+layoutField.fieldAPI+"']"); |
| | | e.disabled = !(layoutField.editableField); |
| | | if (!(layoutField.editableField)) { |
| | | if (e.getAttribute("multiple") && e.getAttribute("multiple") == 'multiple') { |
| | | e.parentNode.classList.add("disabledbutton"); |
| | | } |
| | | if (e.tagName == 'DIV') { |
| | | e.classList.add("disabledbutton"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | //1. Get Sobject Information from Form |
| | | let sobjJson = getSobjectInformation(); |
| | | //2. Validate the Sobject field value formate, for example the email formate or phone formate |
| | | |
| | | let validationResultMessage = validateFieldValueFormate(); |
| | | console.log(validationResultMessage); |
| | | if (validationResultMessage) { |
| | | //Popup error message. - To Do After POC |
| | | alertErrorMessage(validationResultMessage); |
| | | return |
| | | } |
| | | //updated by Lijun0325 Start |
| | | //let validationResultMessage = validateFieldValueFormate(); |
| | | //console.log(validationResultMessage); |
| | | // if (validationResultMessage) { |
| | | // //Popup error message. - To Do After POC |
| | | // alertErrorMessage(validationResultMessage); |
| | | // return |
| | | // } |
| | | //updated by Lijun0325 End |
| | | // Check Required Field |
| | | let checkRequiredFieldMsgResult = checkRequiredFieldMsg(sobjJson); |
| | | if (checkRequiredFieldMsgResult) { |
| | |
| | | accountValue = document.getElementById(accountNodeId).value; |
| | | } |
| | | console.log(accountValue); |
| | | if(accountValue !='000000000000000'){ |
| | | if(accountValue !='000000000000000' || true){ |
| | | if (accountValue == '000000000000000') { |
| | | accountValue = ''; |
| | | } |
| | | |
| | | let baseUrl = "/apex/SearchContactPage"; |
| | | let searchContactKeyWord = document.querySelector("[data-id='ContactId']").value; |
| | | let suffixUrl = "?contactId=" + contactNodeId + "&accountId=" + accountValue+"&searchContactKeyWord=" + searchContactKeyWord; |
| | |
| | | |
| | | function alertErrorMessage(errorMsg) { |
| | | let errorMsgNode = document.getElementById("page:form:block:msgContent"); |
| | | errorMsg = '错误:无效数据。' + '\n' + errorMsg; |
| | | errorMsgNode.innerText = errorMsg; |
| | | errorMsgNode.className = 'pbError'; |
| | | } |
| | |
| | | let searchContactKeyWord = document.querySelector("[data-id='Contact_Name__c']").value; |
| | | if(accountValue !='000000000000000'){ |
| | | suffixUrl = "?contactId=" + contactNodeId + "&accountId=" + accountValue+"&searchContactKeyWord=" + searchContactKeyWord; |
| | | let baseUrl = "/apex/SearchContactPage"; |
| | | let newSearchContactParam = 'height=600,width=800,left=100,top=100,dialogHide=true,resizable=no,scrollbars=yes,toolbar=no,status=no'; |
| | | newSearchContactWindow = window.open(baseUrl+suffixUrl, 'Popup', newSearchContactParam); |
| | | if (window.focus) { |
| | | newSearchContactWindow.focus(); |
| | | } |
| | | return false; |
| | | }else{ |
| | | suffixUrl = "?contactId="+contactNodeId+"&searchContactKeyWord=" + searchContactKeyWord; |
| | | // suffixUrl = "?contactId="+contactNodeId+"&searchContactKeyWord=" + searchContactKeyWord; |
| | | alertErrorMessage('请先选择科室名'); |
| | | } |
| | | let baseUrl = "/apex/SearchContactPage"; |
| | | let newSearchContactParam = 'height=600,width=800,left=100,top=100,dialogHide=true,resizable=no,scrollbars=yes,toolbar=no,status=no'; |
| | | newSearchContactWindow = window.open(baseUrl+suffixUrl, 'Popup', newSearchContactParam); |
| | | if (window.focus) { |
| | | newSearchContactWindow.focus(); |
| | | } |
| | | return false; |
| | | } |
| | | //窗口关闭时发生 |
| | | function closePopupWindow() { |
| | |
| | | function replaceSearchContactLookup() { |
| | | let lookUpNode = htmlToElement(contactHtmlString); |
| | | console.log(lookUpNode); |
| | | let eleContactValue = document.querySelector("[data-id='Contact_Name__c']").parentNode.parentNode.children[0].value; |
| | | let eleContactValue = document.querySelector("[data-id='Contact_Name__c']").parentNode.parentNode.children[1].value; |
| | | if (eleContactValue) { |
| | | if (!{!isNewMode} || (eleContactValue != '000000000000000')) { |
| | | //1. Query Contact from AWS by AWSDataId |
| | |
| | | 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); |
| | | let e = document.querySelector("[data-id='"+layoutField.fieldAPI+"']"); |
| | | e.disabled = !(layoutField.editableField); |
| | | if (!(layoutField.editableField)) { |
| | | if (e.getAttribute("multiple") && e.getAttribute("multiple") == 'multiple') { |
| | | e.parentNode.classList.add("disabledbutton"); |
| | | }else if (e.tagName == 'DIV') { |
| | | e.classList.add("disabledbutton"); |
| | | }else if (VLookUpFields.indexOf(layoutField.fieldAPI) >= 0) { |
| | | e.parentNode.classList.add("disabledbutton"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | } |
| | | //let reporter = GetEleApiName(nodelist[5]) |
| | | //console.log('reporter:'+reporter); |
| | | result['Reporter__c'] = document.getElementById('page:form:block:j_id50:0:j_id51:j_id52:4:j_id53_lkid').value; |
| | | //赋值富文本区域 |
| | | //科室负责人签字 |
| | | if(document.querySelector("[title = 'RTF 編輯器, page:form:block:j_id51:0:j_id52:j_id53:5:j_id54:textAreaDelegate_ResponsiblePerson_Sign__c']")){ |
| | | result.ResponsiblePerson_Sign__c = document.querySelector("[title = 'RTF 編輯器, page:form:block:j_id51:0:j_id52:j_id53:5:j_id54:textAreaDelegate_ResponsiblePerson_Sign__c']").contentWindow.document.getElementsByTagName('body')[0].innerHTML |
| | | } |
| | | result['Reporter__c'] = document.getElementById('page:form:block:j_id51:0:j_id52:j_id53:4:j_id54_lkid').value; |
| | | return result; |
| | | } |
| | | function QuerySobjectFromAWS() { |
| | |
| | | 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); |
| | | if (layoutField.fieldAPI != '' && document.querySelector("[data-id='"+layoutField.fieldAPI+"']") != null) { |
| | | let e = document.querySelector("[data-id='"+layoutField.fieldAPI+"']"); |
| | | e.disabled = !(layoutField.editableField); |
| | | if (!(layoutField.editableField)) { |
| | | if (e.getAttribute("multiple") && e.getAttribute("multiple") == 'multiple') { |
| | | e.parentNode.classList.add("disabledbutton"); |
| | | } |
| | | if (e.tagName == 'DIV') { |
| | | e.classList.add("disabledbutton"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/> |
| | | <style> |
| | | .disabledbutton { |
| | | pointer-events: none; |
| | | opacity: 0.4; |
| | | } |
| | | </style> |
| | | <script> |
| | | |
| | | var config = {}; |
| | | config = { |
| | | SobjectName : "{!SobjectName}", |
| | |
| | | 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); |
| | | let e = document.querySelector("[data-id='"+layoutField.fieldAPI+"']"); |
| | | e.disabled = !(layoutField.editableField); |
| | | if (!(layoutField.editableField)) { |
| | | if (e.getAttribute("multiple") && e.getAttribute("multiple") == 'multiple') { |
| | | e.parentNode.classList.add("disabledbutton"); |
| | | } |
| | | if (e.tagName == 'DIV') { |
| | | e.classList.add("disabledbutton"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | 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); |
| | | let e = document.querySelector("[data-id='"+layoutField.fieldAPI+"']"); |
| | | e.disabled = !(layoutField.editableField); |
| | | if (!(layoutField.editableField)) { |
| | | if (e.getAttribute("multiple") && e.getAttribute("multiple") == 'multiple') { |
| | | e.parentNode.classList.add("disabledbutton"); |
| | | } |
| | | if (e.tagName == 'DIV') { |
| | | e.classList.add("disabledbutton"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | 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); |
| | | let e = document.querySelector("[data-id='"+layoutField.fieldAPI+"']"); |
| | | e.disabled = !(layoutField.editableField); |
| | | if (!(layoutField.editableField)) { |
| | | if (e.getAttribute("multiple") && e.getAttribute("multiple") == 'multiple') { |
| | | e.parentNode.classList.add("disabledbutton"); |
| | | } |
| | | if (e.tagName == 'DIV') { |
| | | e.classList.add("disabledbutton"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | @description : |
| | | @author : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | @group : |
| | | @last modified on : 03-23-2022 |
| | | @last modified on : 03-28-2022 |
| | | @last modified by : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | --> |
| | | <apex:page standardController="Consum_Apply__c" extensions="NewConsumApplyController" id="page"> |
| | |
| | | if(result.pickup_time__c){ |
| | | result.pickup_time__c = result.pickup_time__c.replace(/\//g, '-')+':00'; |
| | | } |
| | | if(result.Request_Shipping_7days_Before__c){ |
| | | result.Request_Shipping_7days_Before__c = result.Request_Shipping_7days_Before__c.replace(/\//g, '-')+':00'; |
| | | } |
| | | if(result.Request_shipping_day__c){ |
| | | result.Request_shipping_day__c = result.Request_shipping_day__c.replace(/\//g, '-')+':00'; |
| | | } |
| | | if(result.Consum_Received_Day__c){ |
| | | result.Consum_Received_Day__c = result.Consum_Received_Day__c.replace(/\//g, '-')+':00'; |
| | | } |
| | | if(result.Request_demo_time__c){ |
| | | result.Request_demo_time__c = result.Request_demo_time__c.replace(/\//g, '-')+':00'; |
| | | } |
| | | if(result.Request_approval_time__c){ |
| | | result.Request_approval_time__c = result.Request_approval_time__c.replace(/\//g, '-')+':00'; |
| | | } |
| | | if(result.Application_accept_time__c){ |
| | | result.Application_accept_time__c = result.Application_accept_time__c.replace(/\//g, '-')+':00'; |
| | | } |
| | | if(result.Request_answer_time__c){ |
| | | result.Request_answer_time__c = result.Request_answer_time__c.replace(/\//g, '-')+':00'; |
| | | } |
| | | if(result.HP_received_sign_rich__c == '<br>'){ |
| | | result.HP_received_sign_rich__c = ''; |
| | | } |
| | |
| | | return template.content.firstChild; |
| | | } |
| | | function queryContactName() { |
| | | let sfId = document.getElementById(document.querySelector("[data-id='Account__c']").id + '_lkid').value; |
| | | let sfId = document.getElementById(document.querySelector("[data-id='Loaner_medical_Staff__c']").id + '_lkid').value; |
| | | let contactsInfo = JSON.parse('{!contactsInfo}'); |
| | | let dataId = contactsInfo[sfId]; |
| | | 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) => { |
| | | let queryBackContactName = function queryBackContactName(result){ |
| | | document.querySelector("[data-id='Loaner_medical_Staff__c']").value = result.object.lastName; |
| | | }) |
| | | //document.querySelector("[data-id='LastName']").value = result.object.lastName; |
| | | }; |
| | | AWSService.query(staticResourcesContact.queryUrl, dataId, queryBackContactName, staticResourcesContact.token); |
| | | // fetch(url, { |
| | | // method: 'GET', |
| | | // headers: { |
| | | // 'Content-Type': 'application/json', |
| | | // 'pi-token': staticResources.token |
| | | // } |
| | | // }).then((data) => { |
| | | // return data.json(); |
| | | // }).then((result) => { |
| | | // document.querySelector("[data-id='Loaner_medical_Staff__c']").value = result.object.lastName; |
| | | // }) |
| | | } |
| | | //自定义lookup查询 |
| | | function searchContact(contactNodeId){ |
| | |
| | | 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); |
| | | let e = document.querySelector("[data-id='"+layoutField.fieldAPI+"']"); |
| | | e.disabled = !(layoutField.editableField); |
| | | if (!(layoutField.editableField)) { |
| | | if (e.getAttribute("multiple") && e.getAttribute("multiple") == 'multiple') { |
| | | e.parentNode.classList.add("disabledbutton"); |
| | | } |
| | | if (e.tagName == 'DIV') { |
| | | e.classList.add("disabledbutton"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | @description : |
| | | @author : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | @group : |
| | | @last modified on : 03-23-2022 |
| | | @last modified on : 03-24-2022 |
| | | @last modified by : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | --> |
| | | <apex:page standardController="On_Call__c" extensions="OnCallController" id="page"> |
| | |
| | | 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); |
| | | let e = document.querySelector("[data-id='"+layoutField.fieldAPI+"']"); |
| | | e.disabled = !(layoutField.editableField); |
| | | if (!(layoutField.editableField)) { |
| | | if (e.getAttribute("multiple") && e.getAttribute("multiple") == 'multiple') { |
| | | e.parentNode.classList.add("disabledbutton"); |
| | | } |
| | | if (e.tagName == 'DIV') { |
| | | e.classList.add("disabledbutton"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | @description : |
| | | @author : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | @group : |
| | | @last modified on : 03-23-2022 |
| | | @last modified on : 03-28-2022 |
| | | @last modified by : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | --> |
| | | <apex:page standardController="Rental_Apply__c" extensions="RentalApplyController" id="page"> |
| | |
| | | let nodelist = document.querySelectorAll("[data-id]"); |
| | | let result = {} |
| | | //富文本 |
| | | if(document.querySelector("[aria-describedby = 'cke_34']")){ |
| | | result.HP_received_sign_rich__c = document.querySelector("[aria-describedby = 'cke_34']").contentWindow.document.getElementsByTagName('body')[0].innerHTML |
| | | } |
| | | if(document.querySelector("[aria-describedby = 'cke_38']")){ |
| | | result.HP_received_sign_rich__c = document.querySelector("[aria-describedby = 'cke_38']").contentWindow.document.getElementsByTagName('body')[0].innerHTML |
| | | } |
| | | if(document.querySelector("[aria-describedby = 'cke_71']")){ |
| | | 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')); |
| | |
| | | result.ToAgency__c = document.querySelector("[id='page:form:block:j_id34:0:j_id35:j_id36:14:j_id37']").value; |
| | | result.Loaner_cancel_reason__c = document.querySelector("[id='page:form:block:j_id34:12:j_id35:j_id36:1:j_id37']").value; |
| | | console.log(JSON.stringify(result)); |
| | | if(result.HP_received_sign_rich__c == '<br>'){ |
| | | result.HP_received_sign_rich__c = ''; |
| | | //格式化时间 |
| | | if(result.HP_received_sign_day__c){ |
| | | result.HP_received_sign_day__c = result.HP_received_sign_day__c.replace(/\//g, '-')+':00'; |
| | | } |
| | | return result; |
| | | } |
| | |
| | | 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); |
| | | let e = document.querySelector("[data-id='"+layoutField.fieldAPI+"']"); |
| | | e.disabled = !(layoutField.editableField); |
| | | if (!(layoutField.editableField)) { |
| | | if (e.getAttribute("multiple") && e.getAttribute("multiple") == 'multiple') { |
| | | e.parentNode.classList.add("disabledbutton"); |
| | | } |
| | | if (e.tagName == 'DIV') { |
| | | e.classList.add("disabledbutton"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | @description : |
| | | @author : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | @group : |
| | | @last modified on : 03-23-2022 |
| | | @last modified on : 03-25-2022 |
| | | @last modified by : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | --> |
| | | <apex:page standardController="Repair__c" extensions="NewRepairController" id="page"> |
| | |
| | | alertErrorMessage(errorMessage); |
| | | } |
| | | } |
| | | var GetEleApiName = function(ele){ |
| | | for(let ci in ele.classList){ |
| | | let c = ele.classList[ci]; |
| | | if(c.indexOf('PIBackApi'+'_')>-1){ |
| | | return c.replace('PIBackApi'+'_',''); |
| | | } |
| | | } |
| | | return ''; |
| | | } |
| | | |
| | | //Query Required Parameter |
| | | // var queryBack = function queryBack(data) { |
| | |
| | | for (let i = 0; i < userVLookUpFields.length; i++) { |
| | | if(document.querySelector("[data-id='" + userVLookUpFields[i] + "']")!=null){ |
| | | // let userVlookUpNodeValue = document.querySelector("[data-id='" + userVLookUpFields[i] + "']").children[1].value; |
| | | let userVlookUpNodeValue = jQuery('[data-id="Incharge_Staff__c"] .lookupInput input').val() |
| | | console.log('userVlookUpNodeValue:'+userVlookUpNodeValue); |
| | | if(userVlookUpNodeValue!='000000000000000'){ |
| | | result[userVLookUpFields[i]] = userVlookUpNodeValue; |
| | | let e = document.getElementById(jQuery('[data-id="'+userVLookUpFields[i]+'"] .lookupInput input').attr('id')+'_lkid'); |
| | | //let userVlookUpNodeValue = jQuery('[data-id="Incharge_Staff__c"] .lookupInput input').val() |
| | | // console.log('userVlookUpNodeValue:'+e.value); |
| | | if(e && e.value!='000000000000000'){ |
| | | result[userVLookUpFields[i]] = e.value; |
| | | } |
| | | } |
| | | } |
| | | result.work_location_select__c = document.querySelector("[id='page:form:block:j_id34:1:j_id35:j_id36:18:j_id37']").value; |
| | | // result.work_location_select__c = document.querySelector("[id='page:form:block: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 |
| | | /* |
| | | if(result.engineerSendDate__c){ |
| | | result.engineerSendDate__c = result.engineerSendDate__c.replace(/\//g, '-')+':00'; |
| | | } |
| | | */ |
| | | let e = null; |
| | | e = document.getElementById(jQuery('[data-id="Incharge_Staff__c"] .lookupInput input').attr('id')+'_lkid'); |
| | | if(e){ |
| | | result.Incharge_Staff__c = e.value; |
| | | } |
| | | |
| | | e = document.getElementById(api_id_map['work_location_select__c']); |
| | | if(e){ |
| | | result.work_location_select__c = e.value; |
| | | } |
| | | e = document.getElementById(jQuery('[data-id="OCSM_RC_CordingUser__c"] .lookupInput input').attr('id')+'_lkid'); |
| | | if(e){ |
| | | result.OCSM_RC_CordingUser__c = e.value; |
| | | } |
| | | |
| | | e = document.getElementById(jQuery('[data-id="OSH_Affirmant__c"] .lookupInput input').attr('id')+'_lkid'); |
| | | if(e){ |
| | | result.OSH_Affirmant__c = e.value; |
| | | } |
| | | e = document.getElementById(jQuery('[data-id="OSHRAConfirmUser__c"] .lookupInput input').attr('id')+'_lkid'); |
| | | if(e){ |
| | | result.OSHRAConfirmUser__c = e.value; |
| | | } |
| | | e = document.getElementById(jQuery('[data-id="Repair_Authenticator__c"] .lookupInput input').attr('id')+'_lkid'); |
| | | if(e){ |
| | | result.Repair_Authenticator__c = e.value; |
| | | } |
| | | e = document.getElementById(jQuery('[data-id="Repair_Determine_result_ConfirmationUser__c"] .lookupInput input').attr('id')+'_lkid'); |
| | | if(e){ |
| | | result.Repair_Determine_result_ConfirmationUser__c = e.value; |
| | | } |
| | | console.log(JSON.stringify(result)); |
| | | return result; |
| | | } |
| | |
| | | |
| | | var queryBack = function queryBack(data) { |
| | | console.log(data); |
| | | document.querySelector("[data-id='address_Contacts__c']").innerHTML = data.object.addressContacts; |
| | | document.querySelector("[data-id='address_Contacts_Name__c']").innerHTML = data.object.addressContactsName; |
| | | document.querySelector("[data-id='address_Telephone__c']").innerHTML = data.object.addressTelephone; |
| | | document.querySelector("[data-id='address_ZipCode__c']").innerHTML = data.object.addressZipCode; |
| | | document.querySelector("[data-id='Detailed_Address__c']").innerHTML = data.object.detailedAddress; |
| | | document.querySelector("[data-id='RepairApplicant__c']").innerHTML = data.object.repairApplicant; |
| | | document.querySelector("[data-id='address_Contacts__c']").value = data.object.addressContacts; |
| | | document.querySelector("[data-id='address_Contacts_Name__c']").value = data.object.addressContactsName; |
| | | document.querySelector("[data-id='address_Telephone__c']").value = data.object.addressTelephone; |
| | | document.querySelector("[data-id='address_ZipCode__c']").value = data.object.addressZipCode; |
| | | document.querySelector("[data-id='Detailed_Address__c']").value = data.object.detailedAddress; |
| | | document.querySelector("[data-id='RepairApplicant__c']").value = data.object.repairApplicant; |
| | | AWSService.query(staticResourceAddress.queryUrl, '{!DecryptAWSDataId}', queryBackDecrypt, staticResourceAddress.token); |
| | | }; |
| | | var queryBackContact = function queryBack(data) { |
| | | console.log(data); |
| | | document.querySelector("[data-id='address_Contacts__c']").innerHTML = data.object.lastName; |
| | | document.querySelector("[data-id='address_Contacts__c']").value = data.object.lastName; |
| | | }; |
| | | var queryBackDecrypt = function queryBack(data) { |
| | | document.querySelector("[data-id='Detailed_Address__c']").innerHTML = data.object.detailedAddress; |
| | | document.querySelector("[data-id='address_ZipCode__c']").innerHTML = data.object.zipCode; |
| | | document.querySelector("[data-id='address_Telephone__c']").innerHTML = data.object.telephone; |
| | | document.querySelector("[data-id='Detailed_Address__c']").value = data.object.detailedAddress; |
| | | document.querySelector("[data-id='address_ZipCode__c']").value = data.object.zipCode; |
| | | document.querySelector("[data-id='address_Telephone__c']").value = data.object.telephone; |
| | | AWSService.query(staticResourceContact.queryUrl, '{!ContactAWSDataId}', queryBackContact, staticResourceContact.token); |
| | | } |
| | | |
| | |
| | | </apex:pageBlockSection> |
| | | </apex:repeat> |
| | | <script> |
| | | function IsFormTag(tag_name){ |
| | | if (!tag_name) { |
| | | return false; |
| | | } |
| | | return ['input','select','textarea'].indexOf(tag_name.toLowerCase())>-1; |
| | | } |
| | | |
| | | function IsFormElement(e){ |
| | | return IsFormTag(e.tagName); |
| | | } |
| | | var init_nodes = document.getElementsByClassName("PIBackApi"); |
| | | var api_id_map={}; |
| | | 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; |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | //Append Page |
| | | sfdcPage.appendToOnloadQueue(function () { |
| | | var layoutSections = JSON.parse('{!layoutSectionsStr}'); |
| | |
| | | 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); |
| | | let e = document.querySelector("[data-id='"+layoutField.fieldAPI+"']"); |
| | | e.disabled = !(layoutField.editableField); |
| | | if (!(layoutField.editableField)) { |
| | | if (e.getAttribute("multiple") && e.getAttribute("multiple") == 'multiple') { |
| | | e.parentNode.classList.add("disabledbutton"); |
| | | } |
| | | if (e.tagName == 'DIV') { |
| | | e.classList.add("disabledbutton"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | if (!{!isNewMode}) { |
| | | blockme(); |
| | | QueryRepairFromAWS(); |
| | | unblockUI(); |
| | | }; |
| | | document.querySelector("[data-id='OwnerId']").classList.add("disabledbutton"); |
| | | if(document.querySelector("[data-id='OwnerId']") != null) |
| | | document.querySelector("[data-id='OwnerId']").classList.add("disabledbutton"); |
| | | |
| | | let previous_value = {}; |
| | | jQuery(".lookupInput input").each(function(i,e){ |
| | |
| | | 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 clsi in divs[i].classList){let cls=divs[i].classList[clsi]; |
| | | if (cls.indexOf('error')>-1) { |
| | | return true; |
| | | } |
| | |
| | | <apex:page controller="SearchContactController" id="page"> |
| | | <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}" /> |
| | | <apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }" /> |
| | | <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}" /> |
| | | <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}" /> |
| | | |
| | | <head> |
| | | </head> |
| | |
| | | var searchContactName = ''; |
| | | function searchAWSContact(){ |
| | | console.log('Search process!'); |
| | | //1. reset table; |
| | | //1. reset table; |
| | | blockme(); |
| | | resetTable(); |
| | | //2. get contact name value |
| | | searchContactName = document.getElementById('page:form:lksrch').value; |
| | |
| | | queryLeadFromAWS(); |
| | | }else{ |
| | | alert("请输入至少2个关键字"); |
| | | unblockUI(); |
| | | } |
| | | |
| | | } |
| | |
| | | } |
| | | } |
| | | myTableDiv.appendChild(table); |
| | | unblockUI(); |
| | | } |
| | | function initContactTable(data) { |
| | | let cols = ['Name','AccountName','Email', 'Phone']; |
| | |
| | | //Invoke SF BackEnd |
| | | Visualforce.remoting.Manager.invokeAction( |
| | | '{!$RemoteAction.SearchContactController.searchContacts}', |
| | | JSON.stringify(awsDataIds), |
| | | JSON.stringify(awsDataIds),'','', |
| | | function (result, event) { |
| | | if(event.status){ |
| | | if(result.status == 'success'){ |
| | |
| | | <apex:page controller="SearchContactController" showHeader="false" id="page"> |
| | | <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}" /> |
| | | <apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }" /> |
| | | <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}" /> |
| | | <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}" /> |
| | | |
| | | <head> |
| | | </head> |
| | |
| | | var searchContactName = searchKeyWord; |
| | | queryLeadFromAWS(); |
| | | function searchAWSContact(){ |
| | | //1. reset table; |
| | | //1. reset table; |
| | | blockme(); |
| | | resetTable(); |
| | | //2. get contact name value |
| | | searchContactName = document.getElementById('page:form:lksrch').value; |
| | | queryLeadFromAWS(); |
| | | |
| | | } |
| | | function resetTable(){ |
| | | let queryResult = document.getElementById('QueryResult'); |
| | |
| | | } |
| | | } |
| | | myTableDiv.appendChild(table); |
| | | unblockUI(); |
| | | } |
| | | function initContactTable(data) { |
| | | let cols = ['Name','AccountName', 'Email', 'Phone']; |
| | |
| | | ProcessPIForAWS({},GetEditObj()); |
| | | } |
| | | function Trans(){ |
| | | console.log('SFRcordId:'+document.getElementById('Page:mainForm:sfContactId').value); |
| | | AWSService.postAWS(staticResources.transactionUrl,AWSService.confirmTrans, JSON.stringify({ |
| | | "txId":aws_result.txId, |
| | | "sfRecordId":"", |
| | | "sfRecordId":document.getElementById('Page:mainForm:sfContactId').value, |
| | | "isSuccess":1 |
| | | }), function(result){ |
| | | window.location.reload(); |
| | |
| | | <apex:actionFunction name="editVistor" action="{!editVistor}" rerender="idRegistration" oncomplete="assignDencrypted();setButtonDisable(document.getElementById('Page:mainForm:idSearchVisitor:idRegSave'), false);"> |
| | | <apex:param name="index" assignTo="{!index}" value=""/> |
| | | </apex:actionFunction> |
| | | <apex:actionFunction name="saveNew" action="{!regContact}" rerender="idRegistration,idRezultVisitor,idAddVisitor,idMessage" onComplete="Trans();"> |
| | | <apex:actionFunction name="saveNew" action="{!regContact}" rerender="idRegistration,idRezultVisitor,idAddVisitor,idMessage,sfContactId" onComplete="Trans()"> |
| | | </apex:actionFunction> |
| | | <!-- Add By Li Jun for PIPL 20220228 Start --> |
| | | <apex:inputHidden id="LastName_Encrypted__c" value="{!rc.LastName_Encrypted__c}"/> |
| | |
| | | <apex:inputHidden id="Doctor_Division1_Encrypted__c" value="{!rc.Doctor_Division1_Encrypted__c}"/> |
| | | |
| | | <apex:inputHidden id="AWS_Data_Id__c" value="{!rc.AWS_Data_Id__c}"/> |
| | | <apex:inputHidden id="sfContactId" value="{!sfContactId}"/> |
| | | <!-- Add By Li Jun for PIPL 20220221 End --> |
| | | <apex:pageBlock id="idSearchVisitor" > |
| | | <table width="1060" height="50" border="0"> |
| | |
| | | if(isAddCon){ |
| | | AWSService.post(staticResourceContact.transactionUrl, JSON.stringify({ |
| | | "txId":con_aws_result.txId, |
| | | "isSuccess":b ? 0 : 1 |
| | | "isSuccess":b ? 0 : 1, |
| | | "sfRecordId":document.getElementById('allPage:allForm:sfRecordId').value |
| | | }), function(result){ |
| | | if(!b) |
| | | window.location.reload(); |
| | |
| | | '\n邮编: '+PIData[awsDataId].zipCode+ |
| | | '\n详细地址: '+PIData[awsDataId].detailedAddress |
| | | }else{ |
| | | piInformation = '联系人: null'+ |
| | | '\n电话: '+PIData[awsDataId].telephone+ |
| | | piInformation = |
| | | '电话: '+PIData[awsDataId].telephone+ |
| | | '\n邮编: '+PIData[awsDataId].zipCode+ |
| | | '\n详细地址: '+PIData[awsDataId].detailedAddress |
| | | } |
| | |
| | | <apex:inputHidden id="tableValueFrontEnd" value="{!tableDataStr}"/> |
| | | <apex:inputHidden value="{!contactId}" id="contactId"/> |
| | | <apex:inputHidden value="{!insUpdDataStr}" id="insUpdDataStr"/> |
| | | <apex:inputHidden value="{!sfRecordId}" id="sfRecordId"/> |
| | | <div id="tab01"> |
| | | <!-- 页面数据初始化方法 --> |
| | | <apex:actionFunction name="init" action="{!init}" rerender="oppBlock1,message,checEventFrame" onComplete="unblockUI();"></apex:actionFunction> |
| | |
| | | <apex:param name="isUpload" assignTo="{!isUpload}" value="" /> |
| | | </apex:actionFunction> |
| | | <!-- 保存和修改方法 --> |
| | | <apex:actionFunction name="save" action="{!save}" rerender="oppBlock2,message" onComplete="unblockUI();{!IF(isSearchBtn,'searchBtnJs()',false)};Trans()"></apex:actionFunction> |
| | | <apex:actionFunction name="save" action="{!save}" rerender="oppBlock2,message,sfRecordId" onComplete="unblockUI();{!IF(isSearchBtn,'searchBtnJs()',false)};Trans();"></apex:actionFunction> |
| | | <!-- 查询客户记录类型方法 --> |
| | | <apex:actionFunction name="queryRecordType" action="{!queryRecordType}" rerender="oppBlock2,message" onComplete="unblockUI();"></apex:actionFunction> |
| | | <!-- 点击修改按钮获取修改数据方法 --> |
| | |
| | | <td align="left" style="vertical-align: inherit;border-width: 0px 1px 1px 0px;"> |
| | | <apex:outputText value="{!or.address.Detailed_Address__c}" /> |
| | | </td> |
| | | <!-- <td align="center" style="vertical-align: inherit;width:30px;"> |
| | | <td align="center" style="vertical-align: inherit;width:30px;"> |
| | | <apex:commandButton value=" 编辑 " onclick="onEditorJs('{!or.address.id}');return false;" style="background:#98c1fbf7;display:{!or.canEdit};"/> |
| | | </td> --> |
| | | </td> |
| | | <td align="center" style="vertical-align: inherit;width:30px;"> |
| | | <apex:commandButton value=" 复制 " onclick="onCopyJs('{!or.address.id}');return false;" style="background: #98c1fbf7;display:{!or.canCopy};"/> |
| | | </td> |
| | |
| | | </apex:repeat> |
| | | </apex:pageBlockSection> |
| | | <script> |
| | | var config = { |
| | | var config = { |
| | | SobjectName : "{!SobjectName}", |
| | | ApiPrefix:"{!ApiPrefix}", |
| | | AWSToSobjectMap:{!AWSToSobjectMapJson}, |
| | |
| | | AWSToSobjectEncryptedMap:{!AWSToSobjectEncryptedMapJson} |
| | | }; |
| | | var staticResources = JSON.parse('{!staticResource}'); |
| | | var staticResourceAWSContact = JSON.parse('{!staticResourceAWSContact}'); |
| | | function QuerySobjectFromAWS() { |
| | | AWSService.query(staticResources.queryUrl, '{!AWSDataId}', queryBack, staticResources.token); |
| | | console.log('Query contact by awsid:'+'{!awsContactId}'); |
| | | if('{!awsContactId}'){ |
| | | AWSService.query(staticResourceAWSContact.queryUrl, '{!awsContactId}', queryBack, staticResources.token); |
| | | } |
| | | |
| | | } |
| | | var queryBack = function queryBack(data) { |
| | | if(!data.object){ |
| | | console.log('data.object is ' + data.object); |
| | | return; |
| | | } |
| | | console.log('Data from AWS:'+JSON.stringify(data.object)); |
| | | if('{!awsContactId}'){ |
| | | data.object.name = data.object.lastName; |
| | | data.object.type = data.object.type; |
| | | data.object.doctorDivision1 = data.object.doctorDivision1; |
| | | } |
| | | console.log('Data from AWS:'+JSON.stringify(data.object)); |
| | | |
| | | for(let f in config.AWSToSobjectNonEncryptedMap){ |
| | | let t = "[title='"+config.ApiPrefix+config.AWSToSobjectNonEncryptedMap[f]+"']"; |
| | |
| | | <apex:pageblock id="pageBlock"> |
| | | <apex:pageBlockSection showHeader="false" title="" collapsible="true" columns="2" id="pageBlockSection"> |
| | | <!--Each section has layoutFields, let's iterate them as well--> |
| | | <apex:repeat value="{!layoutEncryptedAPIList}" var="encryptedAPI"> |
| | | <!-- <apex:repeat value="{!layoutEncryptedAPIList}" var="encryptedAPI"> |
| | | <apex:outputField html-data-id="{!encryptedAPI}" title="{!ApiPrefix}{!encryptedAPI}" value="{!Event[encryptedAPI]}" /> |
| | | </apex:repeat> |
| | | </apex:repeat> --> |
| | | <apex:outputField html-data-id="Visitor1__c" title="{!ApiPrefix}Visitor1__c" value="{!Event['Visitor1__c']}" /> |
| | | <apex:outputField html-data-id="Visitor2__c" title="{!ApiPrefix}Visitor2__c" value="{!Event['Visitor2__c']}" /> |
| | | <apex:outputField html-data-id="Visitor3__c" title="{!ApiPrefix}Visitor3__c" value="{!Event['Visitor3__c']}" /> |
| | | <apex:outputField html-data-id="Visitor4__c" title="{!ApiPrefix}Visitor4__c" value="{!Event['Visitor4__c']}" /> |
| | | <apex:outputField html-data-id="Visitor5__c" title="{!ApiPrefix}Visitor5__c" value="{!Event['Visitor5__c']}" /> |
| | | </apex:pageBlockSection> |
| | | <script> |
| | | // var config = { |
| | |
| | | // AWSToSobjectNonEncryptedMap:{!AWSToSobjectNonEncryptedMapJson}, |
| | | // AWSToSobjectEncryptedMap:{!AWSToSobjectEncryptedMapJson} |
| | | // }; |
| | | AWSService.sfSessionId = '{!GETSESSIONID()}'; |
| | | |
| | | var staticResources = JSON.parse('{!staticResources}'); |
| | | var contactAWSIds = JSON.parse('{!contactAWSIds}'); //AWS ContactId |
| | | var sfIdToContactInfo = {}; |
| | |
| | | var queryBack = function queryBack(data) { |
| | | document.querySelector("[data-id='LastName']").innerHTML = data.object.lastName; |
| | | document.querySelector("[id='page:form:pageBlock:pageBlockSection:j_id3:0:j_id4']").innerHTML = data.object.phone; |
| | | document.querySelector("[data-id='Email']").innerHTML = data.object.email; |
| | | |
| | | //document.querySelector("[data-id='Email']").innerHTML = data.object.email; |
| | | let eml = document.querySelector("[data-id='Email']"); |
| | | eml.href = 'mailto:'+data.object.email; |
| | | eml.text = data.object.email; |
| | | }; |
| | | sfdcPage.appendToOnloadQueue(function () { |
| | | console.log('sfdcPage.appendToOnloadQueue') |
| | |
| | | </apex:repeat> |
| | | </apex:pageBlockSection> |
| | | <script> |
| | | AWSService.sfSessionId = '{!GETSESSIONID()}'; |
| | | var staticResources = JSON.parse('{!staticResource}'); |
| | | function QueryConsumApplyFromAWS() { |
| | | AWSService.query(staticResources.queryUrl, '{!AWSDataId}', queryBack, staticResources.token); |
| | |
| | | AWSService.query(staticResources.queryUrl, '{!AWSDataId}', queryBack, staticResources.token); |
| | | } |
| | | var queryBack = function queryBack(data) { |
| | | document.querySelector("[data-id='VOC_Informer_Name__c']").innerHTML=data.object.vocInformerName |
| | | document.querySelector("[id='page:form:pageBlock:pageBlockSection:j_id2:1:j_id3']").innerHTML=data.object.callerPhone |
| | | document.querySelector("[data-id='VOC_Informer_Contact__c']").innerHTML=data.object.vocInformerContact |
| | | document.querySelector("[data-id='Person_In_Charge_Text__c']").innerHTML=data.object.personInChargeText |
| | | document.querySelector("[data-id='Professor_sigh_text__c']").innerHTML=data.object.professorSighText |
| | | document.querySelector("[data-id='Staff_Info_Manual_c__c']").innerHTML=data.object.staffInfoManual |
| | | document.querySelector("[data-id='Medical_History__c']").innerHTML = data.object.medicalHistory |
| | | document.querySelector("[data-id='Practitioner1_Part__c']").innerHTML=data.object.practitioner1Part |
| | | document.querySelector("[data-id='Practitioner2_Part__c']").innerHTML=data.object.practitioner2Part |
| | | document.querySelector("[data-id='Practitioner3_Part__c']").innerHTML=data.object.practitioner3Part |
| | | document.getElementById('page:form:pageBlock:pageBlockSection:j_id2:10:j_id3').innerHTML=data.object.practitioner4Part |
| | | document.getElementById('page:form:pageBlock:pageBlockSection:j_id2:11:j_id3').innerHTML=data.object.practitioner5Part |
| | | document.getElementById('page:form:pageBlock:pageBlockSection:j_id2:12:j_id3').innerHTML=data.object.age |
| | | document.getElementById('page:form:pageBlock:pageBlockSection:j_id2:13:j_id3').innerHTML=data.object.responsiblePersonHP |
| | | document.querySelector("[data-id='sex__c']").innerHTML=data.object.sex |
| | | document.querySelector("[data-id='VOC_Informer_Name__c']").innerText=data.object.vocInformerName |
| | | document.querySelector("[id='page:form:pageBlock:pageBlockSection:j_id2:1:j_id3']").innerText=data.object.callerPhone |
| | | document.querySelector("[data-id='VOC_Informer_Contact__c']").innerText=data.object.vocInformerContact |
| | | document.querySelector("[data-id='Person_In_Charge_Text__c']").innerText=data.object.personInChargeText |
| | | document.querySelector("[data-id='Professor_sigh_text__c']").innerText=data.object.professorSighText |
| | | document.querySelector("[data-id='Staff_Info_Manual_c__c']").innerText=data.object.staffInfoManual |
| | | document.querySelector("[data-id='Medical_History__c']").innerText = data.object.medicalHistory |
| | | document.querySelector("[data-id='Responsible_Person_HP_c__c']").innerText=data.object.responsiblePersonHP |
| | | document.querySelector("[data-id='Practitioner1_Part__c']").innerText=data.object.practitioner1Part |
| | | document.getElementById('page:form:pageBlock:pageBlockSection:j_id2:8:j_id3').innerText=data.object.practitioner2Part |
| | | document.getElementById('page:form:pageBlock:pageBlockSection:j_id2:9:j_id3').innerText=data.object.practitioner3Part |
| | | document.getElementById('page:form:pageBlock:pageBlockSection:j_id2:10:j_id3').innerText=data.object.practitioner4Part |
| | | document.getElementById('page:form:pageBlock:pageBlockSection:j_id2:11:j_id3').innerText=data.object.practitioner5Part |
| | | document.querySelector("[data-id='age__c']").innerText=data.object.age |
| | | document.querySelector("[data-id='sex__c']").innerText=data.object.sex |
| | | }; |
| | | sfdcPage.appendToOnloadQueue(function () { |
| | | console.log('awsDataId = '+'{!AWSDataId}') |