| | |
| | | |
| | | <div class="slds-truncate"> |
| | | <a href="{!'/partner/s/agency-contact/' + item.Id}" style="position: relative;"> |
| | | <span class="encrypt">{!item.Name}</span> |
| | | <span class="decrypt">{!item.awsdata.name}</span> |
| | | {!item.Name} |
| | | </a> |
| | | </div> |
| | | </th> |
| | |
| | | controller="NewAgencyContactController"> |
| | | |
| | | <aura:attribute name = "recordId" type = "Id" default = ""/> |
| | | <aura:attribute name="title" type="string"/> |
| | | <aura:handler name="init" value="{!this}" action="{!c.doInit}" /> |
| | | <aura:attribute name="layout" type="LayoutDescriberHelper.LayoutWrapper"/> |
| | | <aura:attribute name="record_data" type="Map"/> |
| | |
| | | <aura:attribute name="showSpinner" type="Boolean" default = "False"/> |
| | | <aura:attribute name="staticResource" type="Map"/> |
| | | <aura:attribute name="pi_fields_map" type="Map"/> |
| | | <aura:attribute name="isClone" type="Boolean" default = "False"/> |
| | | <ltng:require scripts="{! $Resource.AWSService+'/AWSService.js' }" /> |
| | | <ltng:require scripts="{! $Resource.jquery183minjs }" /> |
| | | |
| | |
| | | <!-- header --> |
| | | <header class="slds-modal__header"> |
| | | <h2 id="modal-heading-01" class="slds-modal__title slds-hyphenate"> |
| | | Create Agency Contact |
| | | {!v.title} |
| | | </h2> |
| | | </header> |
| | | |
| | |
| | | if(!rid){ |
| | | pid = window.location.href.replace("https://","").split("/")[4]; |
| | | } |
| | | let isClone = component.get('v.isClone'); |
| | | if(!rid || isClone){ |
| | | component.set('v.title',$A.get("$Label.c.New")+'.客户人员'); |
| | | }else{ |
| | | component.set('v.title',$A.get("$Label.c.Edit")+'.客户人员'); |
| | | } |
| | | |
| | | let record_type_id = null; |
| | | let pageref = component.get("v.pageReference") |
| | | if(!record_type_id && pageref){ |
| | | record_type_id = pageref.state.recordTypeId |
| | | } |
| | | component.set("v.showSpinner", true); |
| | | helper.CallBackAction(component,'Init',{ |
| | | rid : rid, |
| | | pid : pid, |
| | | //rid : component.get('v.recordId'), |
| | | record_type_id : component.get("v.pageReference").state.recordTypeId, |
| | | record_type_id : record_type_id, |
| | | },function(data){ |
| | | component.set("v.showSpinner", false); |
| | | |
| | |
| | | |
| | | let staticResource = component.get('v.staticResource'); |
| | | let record_id = component.get('v.recordId'); |
| | | let record_type_id = component.get('v.recordTypeId'); |
| | | |
| | | let isClone = component.get('v.isClone'); |
| | | let url = staticResource.newUrl; |
| | | let payloadPi = {}; |
| | | if (record_id) { |
| | | if (record_id && !isClone) { |
| | | url = staticResource.updateUrl |
| | | payloadPi['dataId'] = component.get('v.record_data').AWS_Data_Id__c; |
| | | } |
| | |
| | | |
| | | let obj = result.object[0]; |
| | | let data = {}; |
| | | if(record_id){ |
| | | if(record_id && !isClone){ |
| | | data.Id = record_id; |
| | | }else{ |
| | | data.AWS_Data_Id__c = obj.dataId; |
| | |
| | | "type" : "success" |
| | | }); |
| | | |
| | | if (record_id){ |
| | | if (record_id && !isClone){ |
| | | |
| | | $A.get("e.force:closeQuickAction").fire(); |
| | | $A.get('e.force:refreshView').fire(); |
| | |
| | | /*Map<String, object> nameDetails = (Map<String,object>) layoutComponents.get('Name');*/ |
| | | String fieldLabel = (String) fields.get('label'); |
| | | boolean placeholderF = (boolean) fields.get('placeholder'); |
| | | boolean isEditable = (boolean) fields.get('editableForNew'); // Check the editable prop |
| | | boolean isEditable = (boolean) fields.get('editableForUpdate')||(boolean)fields.get('editableForNew'); // Check the editable prop |
| | | if( (apiName != '' && fieldType =='Field') || (placeholderF)){ |
| | | if(userMode == 'classic' && fieldTypeDetail == 'address'){ |
| | | String fieldLabelPrefix = fieldLabel.split(' ')[0] == 'Address'?'':fieldLabel.split(' ')[0]; |
| | |
| | | public LightningUtil() { |
| | | |
| | | } |
| | | // 精琢科技 zxk 查询用户的用户产品区分字段 start |
| | | public static User loginUserId(){ |
| | | system.debug('UserInfo.getUserId()================>'+UserInfo.getUserId()); |
| | | return [select UserPro_Type__c from User where id =: UserInfo.getUserId()]; |
| | | } |
| | | // 精琢科技 zxk 查询用户的用户产品区分字段 end |
| | | public static List<Agency_Contact__c> selectOCMAgencyContact(Set<String> hospitalSet, Set<String> ahospitalSet) { |
| | | return [select Id, Agency_Hospital__c, IsOlympusContact__c, Name, Doctor_Division1__c, Type__c, Hospital_DC_Name__c,Department_Cateogy_F__c,Hospital_Name__c, |
| | | AWS_Data_Id__c // 20220222 PI改造 by Bright |
| | |
| | | public static void upsertAgencyOpportunity(List<Agency_Opportunity__c> upsertList) { |
| | | upsert upsertList Agency_Opportunity__c.TargetInputKey__c; |
| | | } |
| | | |
| | | //经销商系统 |
| | | public static List<Agency_Report__c> selectAgencyReport(Date week, String person_str) { |
| | | if (String.isBlank(person_str)) { |
| | | List<Contact> person_list = selectAgencyPerson(); |
| | | return [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, Department_Cateogy__c, Purpose_Type__c, Agency_Report_Header__c, Agency_Hospital__r.Name, Agency_Hospital__r.Hospital__c, OppName__c, |
| | | Person_In_Charge2__c, Person_In_Charge2__r.Name, doctor2__c, doctor2__r.Name, Submit_date__c, |
| | | return [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, WorkMark__c,warlocksNumber__c,Department_Cateogy__c,ProductClassification__c,WarlockClassification__c,ProductCcategory__c, productCategories__c,DealerPersonnel__c,WorkRecord__c,Purpose_Type__c,SupportNeeds__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, |
| | | doctor2__r.AWS_Data_Id__c,Person_In_Charge2__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 |
| | | Product_Category__c, Product_Category__r.Name, Result__c, visitor_title__c, Opportunity__c, Opportunity__r.Name,EffectProgress__c, |
| | | UseProduct1__c,UseProduct2__c,UseProduct3__c,UseProduct1__r.Name,UseProduct2__r.Name,UseProduct3__r.Name |
| | | From Agency_Report__c |
| | | where Submit_date__c=:week and Person_In_Charge2__c in :person_list order by LastModifiedDate desc]; |
| | | where Submit_date__c=:week and Person_In_Charge2__c in :person_list and WeeklyReportClassification__c = '' order by LastModifiedDate desc]; |
| | | } else { |
| | | return [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, Department_Cateogy__c, Purpose_Type__c, Agency_Report_Header__c, Agency_Hospital__r.Name, Agency_Hospital__r.Hospital__c, OppName__c, |
| | | Person_In_Charge2__c, Person_In_Charge2__r.Name, doctor2__c, doctor2__r.Name, Submit_date__c, |
| | | return [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, WorkMark__c,warlocksNumber__c,Department_Cateogy__c,DealerPersonnel__c,ProductClassification__c,WarlockClassification__c,ProductCcategory__c,productCategories__c,WorkRecord__c,Purpose_Type__c,SupportNeeds__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, |
| | | doctor2__r.AWS_Data_Id__c,Person_In_Charge2__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 |
| | | Product_Category__c, Product_Category__r.Name, Result__c, visitor_title__c, Opportunity__c, Opportunity__r.Name,EffectProgress__c, |
| | | UseProduct1__c,UseProduct2__c,UseProduct3__c,UseProduct1__r.Name,UseProduct2__r.Name,UseProduct3__r.Name |
| | | From Agency_Report__c |
| | | where Submit_date__c=:week and Person_In_Charge2__c=:person_str order by LastModifiedDate desc]; |
| | | where Submit_date__c=:week and Person_In_Charge2__c=:person_str and WeeklyReportClassification__c = '' order by LastModifiedDate desc]; |
| | | } |
| | | } |
| | | |
| | | 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, Department_Cateogy__c, Purpose_Type__c, Agency_Report_Header__c, Agency_Hospital__r.Name, Agency_Hospital__r.Hospital__c, OppName__c, |
| | | Person_In_Charge2__c, Person_In_Charge2__r.Name, doctor2__c, doctor2__r.Name, Submit_date__c, |
| | | //追溯系统 |
| | | public static List<Agency_Report__c> selectAgencyReport01(Date week, String person_str) { |
| | | system.debug('person_strperson_str=================>'+person_str); |
| | | if (String.isBlank(person_str)) { |
| | | List<Contact> person_list = selectAgencyPerson01(); |
| | | return [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, WorkMark__c,warlocksNumber__c,Department_Cateogy__c,ProductClassification__c,WarlockClassification__c,ProductCcategory__c,productCategories__c, DealerPersonnel__c,WorkRecord__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, |
| | | Product_Category__c, Product_Category__r.Name, Result__c, visitor_title__c, Opportunity__c, Opportunity__r.Name,EffectProgress__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 |
| | | UseProduct1__c,UseProduct2__c,UseProduct3__c,UseProduct1__r.Name,UseProduct2__r.Name,UseProduct3__r.Name |
| | | From Agency_Report__c |
| | | where Person_In_Charge2__c in :conMList and Report_Date__c >= :date1 and Report_Date__c <= :date2 ]; |
| | | where Submit_date__c=:week and Person_In_Charge2__c in :person_list and WeeklyReportClassification__c != '' order by LastModifiedDate desc]; |
| | | } else { |
| | | return [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, WorkMark__c,warlocksNumber__c,Department_Cateogy__c,DealerPersonnel__c,ProductClassification__c,WarlockClassification__c,ProductCcategory__c,productCategories__c, WorkRecord__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, |
| | | 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, |
| | | UseProduct1__c,UseProduct2__c,UseProduct3__c,UseProduct1__r.Name,UseProduct2__r.Name,UseProduct3__r.Name |
| | | From Agency_Report__c |
| | | where Submit_date__c=:week and Person_In_Charge2__c=:person_str and WeeklyReportClassification__c != '' order by LastModifiedDate desc]; |
| | | } |
| | | } |
| | | //经销商系统 |
| | | 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 |
| | | where Person_In_Charge2__c in :conMList and Report_Date__c >= :date1 and Report_Date__c <= :date2 and WeeklyReportClassification__c = '' ]; |
| | | return reportlist; |
| | | } |
| | | |
| | | public static List<Agency_Report__c> selectAgencyReportById(String report_id) { |
| | | return [Select Id, Name, Department_Cateogy__c, Purpose_Type__c, Agency_Report_Header__c, Agency_Hospital__r.Name, Agency_Hospital__r.Hospital__c, OppName__c, |
| | | Person_In_Charge2__c, Person_In_Charge2__r.Name, doctor2__c, doctor2__r.Name, Submit_date__c, |
| | | //追溯系统 |
| | | public static List<Agency_Report__c> selectMAgencyReport01(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,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, |
| | | 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 |
| | | Product_Category__c, Product_Category__r.Name, Result__c, visitor_title__c, Opportunity__c, Opportunity__r.Name,EffectProgress__c, |
| | | UseProduct1__c,UseProduct2__c,UseProduct3__c,UseProduct1__r.Name,UseProduct2__r.Name,UseProduct3__r.Name |
| | | From Agency_Report__c |
| | | where Person_In_Charge2__c in :conMList and Report_Date__c >= :date1 and Report_Date__c <= :date2 and WeeklyReportClassification__c != '' ]; |
| | | return reportlist; |
| | | } |
| | | //经销商系统的 |
| | | public static List<Agency_Report__c> selectAgencyReportById(String report_id) { |
| | | return [Select Id, Name, Department_Cateogy__c,Purpose_Type__c, ConsumptionOfConsumables__c,warlocksNumber__c,WorkMark__c,WorkRecord__c,EffectProgress__c,ProductClassification__c,ProductCcategory__c,productCategories__c, Agency_Report_Header__c, Agency_Hospital__r.Name, Agency_Hospital__r.Hospital__c, OppName__c, |
| | | Person_In_Charge2__c,DealerPersonnel__c,DealerPersonnel__r.Name, Person_In_Charge2__r.Name, doctor2__c, doctor2__r.Name, Submit_date__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 |
| | | From Agency_Report__c |
| | | where id=:report_id ]; |
| | | } |
| | | //追溯系统的 |
| | | public static List<Agency_Report__c> selectAgencyReportById01(String report_id) { |
| | | return [Select Id, Name, Department_Cateogy__c, ConsumptionOfConsumables__c,warlocksNumber__c,WorkMark__c,WorkRecord__c,EffectProgress__c,ProductClassification__c,ProductCcategory__c,productCategories__c, Agency_Report_Header__c, Agency_Hospital__r.Name, Agency_Hospital__r.Hospital__c, OppName__c, |
| | | Person_In_Charge2__c,DealerPersonnel__c,DealerPersonnel__r.Name, Person_In_Charge2__r.Name, doctor2__c, doctor2__r.Name, Submit_date__c, |
| | | doctor2__r.AWS_Data_Id__c,// 20220222 PI改造 by Bright |
| | | Product_Category__c, Product_Category__r.Name, Result__c, visitor_title__c |
| | | From Agency_Report__c |
| | | where id=:report_id]; |
| | | } |
| | |
| | | me.NumberOfRecord = '' + gds.GeData.size(); |
| | | gds.Monitoring = me; |
| | | |
| | | |
| | | |
| | | logstr = iflog.Log__c + '\nNumberOfRecord=' + gds.GeData.size() + ' '; |
| | | NFMUtil.Monitoring Monitoring = new NFMUtil.Monitoring(); |
| | | Monitoring.Tag = gds.Monitoring.Tag; |
| | |
| | | if (rowData != null) { |
| | | upsert rowData; |
| | | } |
| | | iflog.Log__c = iflog.Log__c + logstr; |
| | | iflog.Log__c = logstr; |
| | | system.debug('======================================'+logstr); |
| | | upsert iflog; |
| | | |
| | | } |
| | | |
| | | private static GeData getStateAndCity(GeData ged,Contact con){ |
| | |
| | | repair.ProcessResult__c = ged.applyRepairInfo.processResult; //处理结果 |
| | | |
| | | // 2022/4/6 zhangyuheng update start |
| | | repair.RepairFinishDate__c = NFMUtil.parseStr2Date(ged.repairOderInfo.RepairFinishDate) ; //修理品处理完成日 |
| | | repair.RepairFinishDate__c = NFMUtil.parseDateTimeStr2Date(ged.repairOderInfo.RepairFinishDate) ; //修理品处理完成日 |
| | | repair.ApplicanterPhone__c = ged.repairOderInfo.ApplicanterPhone; //处理人电话 |
| | | repair.CancelleRepairTime__c = NFMUtil.parseStr2Date(ged.repairOderInfo.CancelDate); //受理人取消报修日 |
| | | repair.CancelleRepairTime__c = NFMUtil.parseDateTimeStr2Date(ged.repairOderInfo.CancelDate); //受理人取消报修日 |
| | | // repair.CancelleRepairTime__c = NFMUtil.parseStr2Date(ged.repairOderInfo.CancelDate); //受理人取消报修日 |
| | | repair.RepairCancelReason__c = ged.repairOderInfo.cancelReportReason; //修理取消原因 |
| | | // 2022/4/6 zhangyuheng update end |
| | | |
| | |
| | | public static Map<String, Schema.SObjectType> schemaMap = Schema.getGlobalDescribe(); |
| | | public static String sobjectTypeValue = 'Case'; |
| | | public Boolean isNewMode{set;get;} |
| | | public Boolean isCloneMode{protected set;get;} |
| | | public String rtTypeId {get; set;} |
| | | public String AWSDataId{set;get;} |
| | | public String contactId{set;get;}//For Lookup field |
| | |
| | | public string AWSToSobjectEncryptedMapJson{get{return JSON.serialize(AWSToSobjectEncryptedMap);}} |
| | | public NewAndEditCaseController(ApexPages.StandardController controller) { |
| | | isNewMode = true; |
| | | isCloneMode = false; |
| | | Input_Required_Field_Msg = Label.Input_Required_Field_Msg; |
| | | PIPL_Name_Label = Label.PIPL_Name_Label; |
| | | PIPL_Input_Account_Error_Msg = label.PIPL_Input_Account_Error_Msg; |
| | |
| | | //获取所有字段 |
| | | 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 |
| | | Map<string,string> mso = ApexPages.currentPage().getParameters(); |
| | | if(mso != null && mso.containsKey('newclone')){ |
| | | isCloneMode = true; |
| | | } |
| | | if (!Test.isRunningTest()) { |
| | | controller.addFields(fieldList); |
| | | } |
| | |
| | | contactsInfo = JSON.serialize(sfIdToAWSIdMap); |
| | | }else{ |
| | | //新建 |
| | | rtTypeId = ApexPages.currentPage().getParameters().get('RecordType'); |
| | | // rtTypeId = ApexPages.currentPage().getParameters().get('RecordType'); |
| | | rtTypeId = mso.get('RecordType'); |
| | | obj.put('OwnerId',UserInfo.getUserId()); |
| | | } |
| | | LayoutDescriberHelper.LayoutWrapper LayoutWrapperValue = LayoutDescriberHelper.describeSectionWithFieldsWrapper(rtTypeId, 'Case','classic'); |
| | |
| | | } |
| | | } |
| | | |
| | | System.debug('caseInfo='+caseInfo); |
| | | 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; |
| | | if (Id.valueOf(caseInfo.ContactId).to15() !='000000000000000') { |
| | | Contact c = [select id,AccountId from Contact where id = :caseInfo.ContactId]; |
| | | caseInfo.Account__c = c.AccountId; |
| | | } |
| | | } |
| | | |
| | | //2. Save Record Process |
| | |
| | | Response resp = new Response(); |
| | | Savepoint sp = Database.setSavepoint(); |
| | | String rid = ''; |
| | | String awsDataId = ''; |
| | | Boolean isClone = false; |
| | | try{ |
| | | System.debug('abcde'); |
| | | if(isNew){ |
| | | awsDataId = (String)caseInfo.get('AWS_Data_Id__c'); |
| | | System.debug('awsDataId = ' + awsDataId); |
| | | Case[] cases = [select id from Case where AWS_Data_Id__c =:awsDataId]; |
| | | |
| | | if(!isNew){ |
| | | isClone = cases.size() == 0; |
| | | } |
| | | if(isNew || isClone){ |
| | | System.debug('caseInfozhj = ' + caseInfo); |
| | | if(!Test.isRunningTest()){ |
| | | insert caseInfo; |
| | | } |
| | | }else{ |
| | | System.debug('into update'); |
| | | 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]; |
| | | // 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; |
| | |
| | | // if(mso.containsKey('CF00N10000006qNtt_lkid ')){ |
| | | // controller.getRecord().put('Department_Class__c',mso.get('CF00N10000006qNtt_lkid ')); |
| | | // } |
| | | // 2022-04-13 来源 jz start |
| | | if (mso.containsKey('LeadSource')) { |
| | | controller.getRecord().put('LeadSource', mso.get('LeadSource')); |
| | | } |
| | | // 2022-04-13 来源 jz end |
| | | rtTypeId = ApexPages.currentPage().getParameters().get('RecordType'); |
| | | obj.put('OwnerId',UserInfo.getUserId()); |
| | | } |
| | |
| | | global with sharing class NewAndEditQISController extends NewAndEditBaseController{ |
| | | public String Input_Required_Field_Msg{set;get;} |
| | | public String qisId{set;get;} |
| | | 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()); |
| | |
| | | |
| | | //Updated by Chen Yanan 20220323 Start |
| | | String contactId = controller.getRecord().Id; |
| | | Map<string,string> mso = ApexPages.currentPage().getParameters(); |
| | | if(contactId == null){ |
| | | Map<string,string> mso = ApexPages.currentPage().getParameters(); |
| | | system.debug('mso='+mso); |
| | | if(mso.containsKey('CF00N10000002FHFK_lkid')){ |
| | | controller.getRecord().put('Name', '*'); |
| | | } |
| | | } |
| | | if(mso.containsKey('CF00N100000073PA0_lkid')){ |
| | | controller.getRecord().put('QIS_pre__c',mso.get('CF00N100000073PA0_lkid')); |
| | | } |
| | | system.debug('controller.getRecord()='+controller.getRecord()); |
| | | //Updated by Chen Yanan 20220323 End |
| | | } |
| | |
| | | public String awsToken{set;get;} |
| | | public static Map<String, Schema.SObjectType> schemaMap = Schema.getGlobalDescribe(); |
| | | public static String sobjectTypeValue = 'Consum_Apply_Equipment_Set_Detail__c'; |
| | | public Boolean isCloneMode{protected set;get;} |
| | | public Boolean isNewMode{set;get;} |
| | | public String rtTypeId {get; set;} |
| | | public String AWSDataId{set;get;} |
| | |
| | | public String sobjectPrefix{set;get;} |
| | | public NewConsumApplyEquipSetDetailController(ApexPages.StandardController controller) { |
| | | isNewMode = true; |
| | | isCloneMode = false; |
| | | Input_Required_Field_Msg = Label.Input_Required_Field_Msg; |
| | | sobjecttypeForFrontEnd = sobjectTypeValue; |
| | | //获取所有字段 |
| | | Map<string,string> mso = ApexPages.currentPage().getParameters(); |
| | | if(mso != null && mso.containsKey('newclone')){ |
| | | isCloneMode = true; |
| | | } |
| | | List<String> fieldList = new List<String>(Schema.getGlobalDescribe().get('Consum_Apply_Equipment_Set_Detail__c').getDescribe().fields.getMap().keyset()); |
| | | if (!Test.isRunningTest()) { |
| | | controller.addFields(fieldList); |
| | |
| | | Response resp = new Response(); |
| | | Savepoint sp = Database.setSavepoint(); |
| | | String rid = ''; |
| | | Boolean isClone = false; |
| | | String awsDataId = ''; |
| | | try{ |
| | | System.debug('abcde'); |
| | | awsDataId = (String)consumApplyInfo.get('AWS_Data_Id__c'); |
| | | System.debug('awsDataId = ' + awsDataId); |
| | | Consum_Apply_Equipment_Set_Detail__c[] ConsumApplys = [select id from Consum_Apply_Equipment_Set_Detail__c where AWS_Data_Id__c =:awsDataId]; |
| | | |
| | | if(!isNew || isClone){ |
| | | isClone = ConsumApplys.size() == 0; |
| | | } |
| | | if(isNew){ |
| | | System.debug('consumApplyInfozhj = ' + consumApplyInfo); |
| | | insert consumApplyInfo; |
| | | System.debug('consumApplyInfo.Id' + consumApplyInfo.Id); |
| | | }else{ |
| | | System.debug('into update'); |
| | | String awsDataId = (String)consumApplyInfo.get('AWS_Data_Id__c'); |
| | | System.debug('awsDataId = ' + awsDataId); |
| | | Consum_Apply_Equipment_Set_Detail__c[] ConsumApplys = [select id from Consum_Apply_Equipment_Set_Detail__c where AWS_Data_Id__c =:awsDataId]; |
| | | // String awsDataId = (String)consumApplyInfo.get('AWS_Data_Id__c'); |
| | | // System.debug('awsDataId = ' + awsDataId); |
| | | // Consum_Apply_Equipment_Set_Detail__c[] ConsumApplys = [select id from Consum_Apply_Equipment_Set_Detail__c where AWS_Data_Id__c =:awsDataId]; |
| | | System.debug('ConsumApplys[0].id = ' + ConsumApplys[0].id); |
| | | consumApplyInfo.put('Id',ConsumApplys[0].id);//For testing; |
| | | update consumApplyInfo; |
| | |
| | | if(mso.containsKey('00N10000008rsVuEAI')){ |
| | | controller.getRecord().put('ProblemDescription__c',mso.get('00N10000008rsVuEAI')); |
| | | } |
| | | //如果是测试环境 |
| | | Boolean isTest = NFMUtil.isSandbox(); |
| | | //报修人00N1m0000054ufW |
| | | if(mso.containsKey('00N1m0000054ufW')){ |
| | | controller.getRecord().put('RepairApplicant__c',mso.get('00N1m0000054ufW')); |
| | | String RepairApplicant = isTest==true?'00N1m0000054ufW':'00N10000009H1rQ'; |
| | | if(mso.containsKey(RepairApplicant)){ |
| | | controller.getRecord().put('RepairApplicant__c',mso.get(RepairApplicant)); |
| | | } |
| | | //报修人医院00N1m0000054ufU |
| | | if(mso.containsKey('00N1m0000054ufU')){ |
| | | controller.getRecord().put('RepairApplicantHospital__c',mso.get('00N1m0000054ufU')); |
| | | String RepairApplicantHospital = isTest==true?'00N1m0000054ufU':'00N10000009H1rP'; |
| | | if(mso.containsKey(RepairApplicantHospital)){ |
| | | controller.getRecord().put('RepairApplicantHospital__c',mso.get(RepairApplicantHospital)); |
| | | } |
| | | //报修人科室00N1m0000054ufT |
| | | if(mso.containsKey('00N1m0000054ufT')){ |
| | | controller.getRecord().put('RepairApplicantDepartment__c',mso.get('00N1m0000054ufT')); |
| | | String RepairApplicantDepartment = isTest==true?'00N1m0000054ufT':'00N10000009H1rO'; |
| | | if(mso.containsKey(RepairApplicantDepartment)){ |
| | | controller.getRecord().put('RepairApplicantDepartment__c',mso.get(RepairApplicantDepartment)); |
| | | } |
| | | //报修子单CF00N1m0000054ufZ_lkid |
| | | String RepairSubOrder = isTest==true?'CF00N1m0000054ufZ_lkid':'CF00N10000009H1rR_lkid'; |
| | | if(mso.containsKey(RepairSubOrder)){ |
| | | controller.getRecord().put('RepairSubOrder__c',mso.get(RepairSubOrder)); |
| | | //查询AWSDataId |
| | | List<RepairSubOrder__c> rso = [select AWS_Data_Id__c from RepairSubOrder__c where Id=:mso.get(RepairSubOrder)]; |
| | | if(rso.size() > 0){ |
| | | RepairSubOrderAWSDataId = rso[0].AWS_Data_Id__c; |
| | | } |
| | | } |
| | | //报修发起日 |
| | | String RepairTime = isTest==true?'00N1m0000054ufa':'00N10000009H1rS'; |
| | | if(mso.containsKey(RepairTime)){ |
| | | String o = mso.get(RepairTime); |
| | | controller.getRecord().put('RepairTime__c',(String.isBlank(o)||String.isEmpty(o))? null:Date.valueOf(o.replace('/', '-'))); |
| | | } |
| | | //报修单受理日ReceiverTime__c |
| | | String ReceiverTime = isTest==true?'00N1m0000054ufS':'00N10000009H1rN'; |
| | | if(mso.containsKey(ReceiverTime)){ |
| | | String o = mso.get(ReceiverTime); |
| | | controller.getRecord().put('ReceiverTime__c',(String.isBlank(o)||String.isEmpty(o))? null:Date.valueOf(o.replace('/', '-'))); |
| | | } |
| | | //计划上门日 |
| | | String PlannedVisitDay = isTest==true?'00N1m000005SRiF':'00N10000009H1rM'; |
| | | if(mso.containsKey(PlannedVisitDay)){ |
| | | String o = mso.get(PlannedVisitDay); |
| | | controller.getRecord().put('PlannedVisitDay__c',(String.isBlank(o)||String.isEmpty(o))? null:Date.valueOf(o.replace('/', '-'))); |
| | | } |
| | | //一次上门日 |
| | | String ActualVisitDateFirst = isTest==true?'00N1m000005SRiK':'00N10000009H1r6'; |
| | | if(mso.containsKey(ActualVisitDateFirst)){ |
| | | String o = mso.get(ActualVisitDateFirst); |
| | | controller.getRecord().put('ActualVisitDateFirst__c',(String.isBlank(o)||String.isEmpty(o))? null:Date.valueOf(o.replace('/', '-'))); |
| | | } |
| | | //二次上门日 |
| | | String ActualVisitDateSecond = isTest==true?'00N1m000005SRiP':'00N10000009H1r7'; |
| | | if(mso.containsKey(ActualVisitDateSecond)){ |
| | | String o = mso.get(ActualVisitDateSecond); |
| | | controller.getRecord().put('ActualVisitDateSecond__c',(String.isBlank(o)||String.isEmpty(o))? null:Date.valueOf(o.replace('/', '-'))); |
| | | } |
| | | //三次上门日 |
| | | String ActualVisitDateThird = isTest==true?'00N1m000005SRiU':'00N10000009H1r8'; |
| | | if(mso.containsKey(ActualVisitDateThird)){ |
| | | String o = mso.get(ActualVisitDateThird); |
| | | controller.getRecord().put('ActualVisitDateThird__c',(String.isBlank(o)||String.isEmpty(o))? null:Date.valueOf(o.replace('/', '-'))); |
| | | } |
| | | //移动端申请修理日 |
| | | String SubOrderCompleteDate = isTest==true?'00N1m000005SRmg':'00N10000009H1ri'; |
| | | if(mso.containsKey(SubOrderCompleteDate)){ |
| | | String o = mso.get(SubOrderCompleteDate); |
| | | controller.getRecord().put('SubOrderCompleteDate__c',(String.isBlank(o)||String.isEmpty(o))? null:Date.valueOf(o.replace('/', '-'))); |
| | | } |
| | | //报修单处理完成日 |
| | | String SubOrderCreatedDate = isTest==true?'00N1m000005SRmW':'00N10000009H1rj'; |
| | | if(mso.containsKey(SubOrderCreatedDate)){ |
| | | String o = mso.get(SubOrderCreatedDate); |
| | | controller.getRecord().put('SubOrderCreatedDate__c',(String.isBlank(o)||String.isEmpty(o))? null:Date.valueOf(o.replace('/', '-'))); |
| | | } |
| | | |
| | | //送修物流方式00N1m0000054ufE |
| | | if(mso.containsKey('00N1m0000054ufE')){ |
| | | controller.getRecord().put('DeliveryLogisticsMode__c',mso.get('00N1m0000054ufE')); |
| | |
| | | if(mso.containsKey('00N10000008rsVS')){ |
| | | controller.getRecord().put('DelayReportReason__c',mso.get('00N10000008rsVS')); |
| | | } |
| | | //报修子单CF00N1m0000054ufZ_lkid |
| | | if(mso.containsKey('CF00N1m0000054ufZ_lkid')){ |
| | | controller.getRecord().put('RepairSubOrder__c',mso.get('CF00N1m0000054ufZ_lkid')); |
| | | //查询AWSDataId |
| | | List<RepairSubOrder__c> rso = [select AWS_Data_Id__c from RepairSubOrder__c where Id=:mso.get('CF00N1m0000054ufZ_lkid')]; |
| | | if(rso.size() > 0){ |
| | | RepairSubOrderAWSDataId = rso[0].AWS_Data_Id__c; |
| | | } |
| | | } |
| | | |
| | | 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']); |
| | |
| | | |
| | | @RemoteAction |
| | | global static Response EncryptUpdate(string rid){ |
| | | system.debug('rid='+rid); |
| | | Response r = new Response(); |
| | | List<Repair__c> reps = new List<Repair__c>(); |
| | | if(Test.isRunningTest()){ |
| | | if(rid=='a0J1m000001QqXk'){ |
| | | reps.add(new Repair__c(Id='a0J1m000001QqXk',Encrypt_Update_Flag__c=true)); |
| | | }else{ |
| | | reps.add(new Repair__c(Id='a0J1m000001QqXk',Encrypt_Update_Flag__c=false)); |
| | | } |
| | | }else{ |
| | | reps = [select id,Encrypt_Update_Flag__c from Repair__c where id =:rid]; |
| | | } |
| | | if(reps.size()==0){ |
| | | r.status = 'failed'; |
| | | r.message = '符合条件的数据未找到'; |
| | | return r; |
| | | } |
| | | Repair__c rep = reps[0]; |
| | | if(!rep.Encrypt_Update_Flag__c){ |
| | | r.status = 'success'; |
| | | r.message = ''; |
| | | return r; |
| | | } |
| | | |
| | | boolean b = AWSServiceTool2.EncryptPushData(new string[]{rid}); |
| | | Response r = new Response(); |
| | | rep.Encrypt_Update_Flag__c = false; |
| | | if(!Test.isRunningTest()){ |
| | | update rep; |
| | | } |
| | | r.status = b ? 'success' : 'failed'; |
| | | r.message = b ? '' : '加密推送失败'; |
| | | r.recordId = rid; |
| | |
| | | url = ApexPages.currentPage().getParameters().put('00N10000006P6SM','%E9%83%91%E5%B7%9E'); |
| | | url = ApexPages.currentPage().getParameters().put('00N10000002FH86','%E4%BB%8EQIS'); |
| | | url = ApexPages.currentPage().getParameters().put('00N10000006P6Rn','%E5%8C%97%E4%BA%AC%E5%8A%9E%E4%BA%8B%E5%A4%84'); |
| | | |
| | | url = ApexPages.currentPage().getParameters().put('00N1m000005gt1l','%E4%BB%8EQIS'); |
| | | url = ApexPages.currentPage().getParameters().put('00N10000006P1dw','121212'); |
| | | url = ApexPages.currentPage().getParameters().put('00N10000008rsVT','12'); |
| | | url = ApexPages.currentPage().getParameters().put('00N10000008rsVv','其他'); |
| | | url = ApexPages.currentPage().getParameters().put('00N10000008rsW5','是'); |
| | | |
| | | |
| | | |
| | | Repair__c repTest = TestDataUtility.CreateRepairs(1)[0]; |
| | | url = ApexPages.currentPage().getParameters().put('RepairId',repTest.Id); |
| | | Test.startTest(); |
| | |
| | | } |
| | | static testMethod void testMethod3(){ |
| | | TestDataUtility.CreatePIPolicyConfiguration('Repair__c'); |
| | | NewRepairController.EncryptUpdate('a0J1m000001QqXk'); |
| | | ApexPages.StandardController con = new ApexPages.StandardController(new Repair__c()); |
| | | try{ |
| | | NewRepairController controllerTest = new NewRepairController(con); |
| | | controllerTest.awsToken = 'TestToken'; |
| | | controllerTest.RepairSubOrderAWSDataId = 'RepairSubOrderAWSDataId'; |
| | | }catch(Exception e){ |
| | | system.debug('Exception from insert repair:'+e.getMessage()); |
| | | } |
| | | NewRepairController.EncryptUpdate('a0J1m000001QqX'); |
| | | NewRepairController.EncryptUpdate('a0J1m000001QqXk'); |
| | | } |
| | | } |
| | |
| | | PIIntegration piIntegration = new PIIntegration(); |
| | | //查询url |
| | | System.debug('thhsobjectType = ' + sobjectType); |
| | | PI_Policy_Configuration__c config = [SELECT Full_New_URL__c,Full_Search_URL__c,Full_Update_URL__c,Full_Undelete_URL__c,Full_Read_URL__c,Full_Delete_URL__c,Full_View_Unified_Contact_URL__c,TransactionURL__c FROM PI_Policy_Configuration__c WHERE Sobject_Type__c =:sobjectType]; |
| | | PI_Policy_Configuration__c config = [SELECT Full_New_URL__c,Full_New_Encrypt_URL__c,Full_Update_Encrypt_URL__c,Full_Search_URL__c,Full_Update_URL__c,Full_Undelete_URL__c,Full_Read_URL__c,Full_Delete_URL__c,Full_View_Unified_Contact_URL__c,TransactionURL__c FROM PI_Policy_Configuration__c WHERE Sobject_Type__c =:sobjectType]; |
| | | System.debug('thhconfig = ' + config); |
| | | |
| | | //获取appid和appsecret |
| | |
| | | token = (String)results.get('object'); |
| | | System.debug('token = ' + token); |
| | | }catch(Exception e){ |
| | | system.debug(e.getMessage()); |
| | | system.debug(e.getStackTraceString()); |
| | | |
| | | Transaction_Log__c traLog = new Transaction_Log__c(); |
| | | traLog.Module__c = 'Get Token'; |
| | | traLog.Status__c = 'fail'; |
| | |
| | | //Insert Get Token Log |
| | | |
| | | //获取敏感字段 |
| | | piIntegration.PIDetails = [select id,PI_Policy_Configuration__r.Full_New_URL__c, Enable_Encrypt__c, SF_Field_API_Name__c,SF_Field_Encrypted_API__c, AWS_Field_API__c,AWS_Encrypted_Field_API__c,Field_Type__c from PI_Field_Policy_Detail__c where PI_Policy_Configuration_Name__c =:sobjectType and Enable_Encrypt__c=true]; |
| | | piIntegration.PIDetails = [select id,PI_Policy_Configuration__r.Full_New_URL__c,PI_Policy_Configuration__r.Full_New_Encrypt_URL__c,PI_Policy_Configuration__r.Full_Update_Encrypt_URL__c, Enable_Encrypt__c, SF_Field_API_Name__c,SF_Field_Encrypted_API__c, AWS_Field_API__c,AWS_Encrypted_Field_API__c,Field_Type__c from PI_Field_Policy_Detail__c where PI_Policy_Configuration_Name__c =:sobjectType and Enable_Encrypt__c=true]; |
| | | if(displayByOrderNumberObject.contains(sobjectType)){ |
| | | piIntegration.PIDetails = [select id,PI_Policy_Configuration__r.Full_New_URL__c, Enable_Encrypt__c, SF_Field_API_Name__c,SF_Field_Encrypted_API__c, AWS_Field_API__c,AWS_Encrypted_Field_API__c,Field_Type__c from PI_Field_Policy_Detail__c where PI_Policy_Configuration_Name__c =:sobjectType and Enable_Encrypt__c=true order by Order_Number__c]; |
| | | piIntegration.PIDetails = [select id,PI_Policy_Configuration__r.Full_New_URL__c,PI_Policy_Configuration__r.Full_New_Encrypt_URL__c,PI_Policy_Configuration__r.Full_Update_Encrypt_URL__c, Enable_Encrypt__c, SF_Field_API_Name__c,SF_Field_Encrypted_API__c, AWS_Field_API__c,AWS_Encrypted_Field_API__c,Field_Type__c from PI_Field_Policy_Detail__c where PI_Policy_Configuration_Name__c =:sobjectType and Enable_Encrypt__c=true order by Order_Number__c]; |
| | | } |
| | | List<String> vLookUpFields = new List<String>(); |
| | | List<String> PIFields = new List<String>(); |
| | |
| | | piIntegration.deleteUrl = config.Full_Delete_URL__c; |
| | | piIntegration.undeleteUrl = config.Full_Undelete_URL__c; |
| | | piIntegration.viewUnifiedContactUrl = config.Full_View_Unified_Contact_URL__c; |
| | | piIntegration.newEncryptUrl = config.Full_New_Encrypt_URL__c; |
| | | piIntegration.updateEncryptUrl = config.Full_Update_Encrypt_URL__c; |
| | | piIntegration.transactionURL = config.TransactionURL__c; |
| | | piIntegration.hostUrl = awsConfiguration.Host_URL__c; |
| | | piIntegration.searchUrl = config.Full_Search_URL__c; |
| | |
| | | public String deleteUrl{set;get;} |
| | | public String undeleteUrl{set;get;} |
| | | public String viewUnifiedContactUrl{set;get;} |
| | | public String newEncryptUrl{set;get;} |
| | | public String updateEncryptUrl{set;get;} |
| | | public String hostUrl{set;get;} |
| | | public String token{set;get;} |
| | | public String awsAppId{set;get;} |
| | |
| | | // HWAG-BC68W3 故障发生日为空时, 它为真 start |
| | | public Boolean outOfGuarantee { get; private set; } |
| | | // HWAG-BC68W3 故障发生日为空时, 它为真 end |
| | | |
| | | public string Photo_1_Text { get; private set; } |
| | | public string Photo_2_Text { get; private set; } |
| | | public string Photo_3_Text { get; private set; } |
| | | public string Photo_4_Text { get; private set; } |
| | | |
| | | |
| | | public QISPDFController() { |
| | | qr = new QIS_Report__c(); |
| | | usr = new User(); |
| | |
| | | //HWAG-BC68W3 end |
| | | inGuarantee = true; |
| | | } |
| | | |
| | | Photo_1_Text = getImageByUrl(qr.Photo_1_Text__c); |
| | | Photo_2_Text = getImageByUrl(qr.Photo_2_Text__c); |
| | | Photo_3_Text = getImageByUrl(qr.Photo_3_Text__c); |
| | | Photo_4_Text = getImageByUrl(qr.Photo_4_Text__c); |
| | | } |
| | | } |
| | | |
| | | public static String getImageByUrl(string urlStr){ |
| | | //urlStr = 'https://ocsm--stagefull--c.documentforce.com/servlet/rtaImage?eid=a0f1000000cS7qH&feoid=00N10000006P4rz&refid=0EM10000002WIgq'; |
| | | // 'https://ocsm--stagefull.my.salesforce.com/services/data/v51.0/sobjects/QIS_Report__c/a0f1000000IJay1/richTextImageFields/Photo_1__c/0EM100000017hLN |
| | | System.debug('urlStr='+urlStr); |
| | | Id eid = getUrlParameters(urlStr,'eid'); |
| | | if (string.isBlank(eid)) { |
| | | System.debug('eid not found'); |
| | | return null; |
| | | } |
| | | |
| | | Id feoid = getUrlParameters(urlStr,'feoid'); |
| | | if (string.isBlank(feoid)) { |
| | | System.debug('feoid not found'); |
| | | return null; |
| | | } |
| | | |
| | | Id refid = getUrlParameters(urlStr,'refid'); |
| | | if (string.isBlank(refid)) { |
| | | System.debug('refid not found'); |
| | | return null; |
| | | } |
| | | |
| | | string body = MetaDataUtility.ToolingQuery('select id,FullName from CustomField where id=\''+feoid+'\''); |
| | | if(string.isBlank(body)){ |
| | | System.debug('body is blank'); |
| | | return null; |
| | | } |
| | | string sobjecttype = eid.getSobjectType().getDescribe().getName(); |
| | | List<object> lo = (List<object>)(((Map<string,object>)JSON.deserializeUntyped(body)).get('records')); |
| | | Map<string,object> mso = (Map<string,object>)(lo[0]); |
| | | string f = ((string)mso.get('FullName')).replace(sobjecttype+'.', ''); |
| | | |
| | | String urlForClassic = 'https://'+System.URL.getOrgDomainUrl().getHost()+'/services/data/v53.0/sobjects/'+sobjecttype+'/'+eid+'/richTextImageFields/'+f+'/'+refid; |
| | | |
| | | system.debug('URL Post:'+urlForClassic); |
| | | HttpResponse resp = null; |
| | | HttpRequest req = new HttpRequest(); |
| | | req.setMethod('GET'); |
| | | req.setEndpoint(urlForClassic); |
| | | req.setHeader('Authorization', 'Bearer ' + UserInfo.getsessionid()); |
| | | Http client = new Http(); |
| | | resp = client.send(req); |
| | | system.debug('getStatusCode:'+resp.getStatusCode()); |
| | | return 'data:image/png;base64,' + EncodingUtil.base64Encode(resp.getBodyAsBlob()); |
| | | } |
| | | |
| | | public static String getUrlParameters(string url,string para){ |
| | | //string url = 'https://sfpi-mebg-test.olympuschina.com:8081/stg/api/file/convert?from=https%3A%2F%2Focsm--stagefull--c.visualforce.com%2Fapex%2FQISPDF%3Fid%3Da0f1000000cS7qH&fileName=QISPDF'; |
| | | if (string.isBlank(url) || string.isBlank(para)) { |
| | | return null; |
| | | } |
| | | Pattern p = Pattern.compile('(?<=' + para + '=)[^&]*'); |
| | | Matcher m = p.matcher(url); |
| | | if (m.find()) { |
| | | return m.group(); |
| | | }else { |
| | | system.debug('no found '+para+' in url='+url); |
| | | return null; |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | QISPDFController controller = new QISPDFController(); |
| | | controller.init(); |
| | | } |
| | | |
| | | static testMethod void Test1(){ |
| | | QISPDFController.getImageByUrl('https://ocsm--stagefull--c.documentforce.com/servlet/rtaImage?eid=a0f1000000cS7qH&refid=0EM10000002WIgq'); |
| | | QISPDFController.getImageByUrl('https://ocsm--stagefull--c.documentforce.com/servlet/rtaImage?eid=a0f1000000cS7qH&feoid=00N10000006P4rz'); |
| | | } |
| | | } |
| | |
| | | this.lead = [select id,SI_OppoLeadSec__c,owner_not_automatically_update__c, Hospital_Name__c, Opportunity_stage__c,Hospital_Name__r.RecordType.DeveloperName, Hospital_Name__r.Parent.RecordType.DeveloperName, |
| | | LastName, FirstName, LeadSource, Other_Society__c, Opp_Name__c, Purchase_Reason__c, Trade__c, Sales_Root__c, |
| | | Close_Forecasted_Date__c, Competitor__c, Hospital_Budget__c, Promise_Class__c, Dicision_Maker__c, Purchase_Type__c, |
| | | Sales_Method__c, Fund_Basis__c, OwnerId, Wholesale_Price__c, Lead_No__c,CreatedDate,CreatedById |
| | | Sales_Method__c, Fund_Basis__c, OwnerId, Wholesale_Price__c, Lead_No__c,Inquiry_Num__c,CreatedDate,CreatedById |
| | | from Lead where id =: this.leadId]; |
| | | |
| | | // 診療科選択リストの取得(条件:病院=リード情報の病院名称) |
| | |
| | | else{ |
| | | opp.Name = '*'; |
| | | } |
| | | //20220412 SWAG-CBUB2W you start |
| | | opp.Inquiry_Num__c = this.lead.Inquiry_Num__c; |
| | | //20220412 SWAG-CBUB2W you end |
| | | opp.From_Lead_TF__c = true; |
| | | opp.Trade__c = (String.isBlank(this.lead.Trade__c)) ? '内貿' : this.lead.Trade__c; |
| | | opp.StageName = '引合'; |
| | |
| | | newCon = new Contact(); |
| | | return null; |
| | | } |
| | | |
| | | //查询客户记录类型 |
| | | public PageReference queryRecordType(){ |
| | | if(insUpdData.Customer__c!=null){ |
| | |
| | | } |
| | | return null; |
| | | } |
| | | /* |
| | | //采用按钮 |
| | | public PageReference adoptSave(){ |
| | | //adoptId 要采用的地址数据id |
| | |
| | | } |
| | | rc.address_Telephone__c=tableData[i].address.Telephone__c; |
| | | rc.Detailed_Address__c=address; |
| | | update rc; |
| | | if(!Test.isRunningTest()){ |
| | | update rc; |
| | | } |
| | | |
| | | //保存数据到保有设备表中 |
| | | Asset ast = new Asset( |
| | |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | */ |
| | | //重定向到 修理页面 |
| | | public PageReference redirectPag(){ |
| | | PageReference ref = new Pagereference('/' + RepairId); |
| | | ref.setRedirect(true); |
| | | return ref; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 检索数据查询 |
| | |
| | | + ' RecordType.name,Parent.Parent.Id FROM Account WHERE ID = \'' + accId + '\''; |
| | | return AccountSql; |
| | | } |
| | | |
| | | @RemoteAction |
| | | public static string SaveEx(string repaire_json,string asset_json, string address_id){ |
| | | return SaveExCore(repaire_json,asset_json,address_id); |
| | | } |
| | | |
| | | public static string SaveExCore(string repaire_json,string asset_json, string address_id){ |
| | | string message = null; |
| | | string savemessage = null; |
| | | savepoint sp = Database.setsavepoint(); |
| | | try { |
| | | Repair__c r = (Repair__c)JSON.deserialize(repaire_json,Repair__c.class); |
| | | Asset ast = (Asset)JSON.deserialize(asset_json,Asset.class); |
| | | Address__c add = new Address__c(Id=address_id,Using_Datetime__c = Datetime.now()); |
| | | update r; |
| | | update ast; |
| | | update add; |
| | | }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); |
| | | |
| | | message ='保存失败,原因:'+ e.getDmlMessage(index); |
| | | savemessage = e.getMessage()+e.getStackTraceString(); |
| | | } catch (Exception e) { |
| | | System.debug('into catch'+e.getMessage()); |
| | | Database.rollback(sp); |
| | | |
| | | savemessage = e.getMessage()+e.getStackTraceString(); |
| | | message = '保存失败'; |
| | | } finally { |
| | | PIHelper.saveTransLog('StraightBackAddressController',address_id,address_id,address_id, repaire_json ,asset_json,message); |
| | | } |
| | | return message; |
| | | } |
| | | |
| | | /** |
| | | * 为了方便前段table获取值 |
| | |
| | | strList.add('Address__c'); |
| | | strList.add('Contact'); |
| | | strList.add('Repair__c'); |
| | | strList.add('Agency_Contact__c'); |
| | | TestDataUtility.CreatePIPolicyConfigurations(strList); |
| | | } |
| | | @isTest |
| | |
| | | //测试构造器里面的代码 |
| | | PageReference peg = new PageReference('/apex/StraightBackAddress?id='+rpr.id); |
| | | System.Test.setCurrentPage(peg); |
| | | |
| | | |
| | | StraightBackAddressController sbac = new StraightBackAddressController(); |
| | | sbac.txtName = '北京'; |
| | | sbac.txtAddress = '市'; |
| | |
| | | sbac.insUpdData.Contacts__c = null; |
| | | sbac.insUpdData.Create_Contacts__c = '王五'; |
| | | sbac.save(); |
| | | sbac.adoptSave(); |
| | | //sbac.adoptSave(); |
| | | sbac.searchBtn(); |
| | | |
| | | sbac.insUpdData.Customer__c = depart.Id; |
| | | sbac.queryRecordType(); |
| | | |
| | | sbac.redirectPag(); |
| | | sbac.optionAddressClassification.Address_Classification__c = '经销商'; |
| | | sbac.searchBtn(); |
| | | /* |
| | | StraightBackAddressController ss = new StraightBackAddressController(); |
| | | ss.txtName = '经销商'; |
| | | ss.txtAddress = '哈哈'; |
| | | sbac.typeText = '办事处'; |
| | | ss.typeText = '经销商'; |
| | | ss.UpdId = ascc.id; |
| | | ss.adoptId = ascc.id; |
| | | ss.searchBtn(); |
| | | ss.init();//页面初始化方法 |
| | | |
| | | ss.onEditor();//修改按钮方法 |
| | | ss.onCopy();//复制按钮方法 |
| | | ss.insUpdData.Address_Classification__c = ''; |
| | |
| | | ss.insUpdData.Detailed_Address__c = null; |
| | | ss.insUpdData.Customer__c = null; |
| | | ss.save(); |
| | | ss.searchBtn(); |
| | | */ |
| | | } |
| | | |
| | | @isTest |
| | | static void testSaveEx() { |
| | | StraightBackAddressController.SaveExCore(null,null,null); |
| | | StraightBackAddressController.SaveExCore('{"attributes":{"type":"Repair__c"}}','{"attributes":{"type":"Asset"}}','a4R1m000000Lfme'); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 为了方便前段table获取值 |
| | | */ |
| | |
| | | if('申請中'.equals(report.Status__c )){ |
| | | XinDailyReportController.updateTask( report.id); |
| | | //sla信息更新 zh start |
| | | |
| | | //2021-08-27 杨杰克 修改逻辑:是否逾期都调用saveSLADetails方法,将是否逾期传入方法,方法内做逻辑处理 |
| | | if (eventCAndSLA.size()>0 && SLAIds.size()>0) { |
| | | UpdateSLACompleteNumber.saveSLADetails(eventCAndSLA, SLAIds,report.Submit_DateTime_New__c <= report.Report_Deadline__c ); |
| | | } |
| | | |
| | | if (report.Submit_DateTime_New__c <= report.Report_Deadline__c ) { //提交日超过最后提交期限,不计入次数 |
| | | |
| | | if (eventCAndMainC.size()>0 && mainCIds.size()>0) { |
| | | UpdateSLACompleteNumber.saveSLARecorded(eventCAndMainC, mainCIds); |
| | | } |
| | | } |
| | | |
| | | //sla信息更新 zh end |
| | | |
| | | // 任务框架bug 应对 by zys start 原代码 |
| | |
| | | // 20200420 任务日报管理 add gzw end |
| | | activities.add(a); |
| | | actSize = activities.size(); |
| | | //Add log by Li Jun 20220407 Start |
| | | system.debug('Activity Data:'+JSON.serialize(activities)); |
| | | //Add log by Li Jun 20220407 end |
| | | } |
| | | |
| | | public String delIndex { |
| | |
| | | <apex:page applyHtmlTag="false" Controller="FixtureRentalPDFController" showHeader="false" sidebar="false" id="allPage" action="{!init}" ><!-- renderAs="pdf" --> |
| | | <apex:page applyHtmlTag="false" Controller="FixtureRentalPDFController" showHeader="false" sidebar="false" id="allPage" action="{!init}"> |
| | | <!-- renderAs="pdf" --> |
| | | <html> |
| | | <head> |
| | | <style type="text/css" media="print"> |
| | | @page { |
| | | size: A4; |
| | | margin: 1mm 2.5mm 0mm 2.5mm; |
| | | } |
| | | |
| | | /*td{ |
| | | <head> |
| | | <style type="text/css" media="print"> |
| | | @page { |
| | | size: A4; |
| | | margin: 1mm 2.5mm 0mm 2.5mm; |
| | | } |
| | | |
| | | /*td{ |
| | | height: 23px; |
| | | }*/ |
| | | |
| | | </style> |
| | | <style> |
| | | body{margin: 0 auto; |
| | | width: 780px;} |
| | | #title1{height: 30px;} |
| | | #title2{height: 110px;} |
| | | </style> |
| | | <apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }" /> |
| | | <script src="../../soap/ajax/53.0/connection.js" type="text/javascript"></script> |
| | | <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.jspdf)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.html2canvas)}"/> |
| | | |
| | | </head> |
| | | |
| | | </style> |
| | | <style> |
| | | body { |
| | | margin: 0 auto; |
| | | width: 780px; |
| | | } |
| | | |
| | | <body style="font-family: Arial Unicode MS; page-break-inside: auto;font-size: 14px"> |
| | | <div id="pdf-wrapper"> |
| | | <apex:outputPanel id="showhidden" rendered="true"> |
| | | .title1 { |
| | | height: 35px; |
| | | } |
| | | |
| | | .title2 { |
| | | height: 110px; |
| | | } |
| | | </style> |
| | | <apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }" /> |
| | | <script src="../../soap/ajax/53.0/connection.js" type="text/javascript"></script> |
| | | <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}" /> |
| | | <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}" /> |
| | | <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}" /> |
| | | <apex:includeScript value="{!URLFOR($Resource.jspdf)}" /> |
| | | <apex:includeScript value="{!URLFOR($Resource.html2canvas)}" /> |
| | | |
| | | </head> |
| | | |
| | | |
| | | <body style="font-family: Arial Unicode MS; page-break-inside: auto;font-size: 14px"> |
| | | <div id="pdf-wrapper"> |
| | | <apex:outputPanel id="showhidden" rendered="true"> |
| | | |
| | | <div class="pdf-page"> |
| | | <div class="title1"></div> |
| | | <!-- 20201119 LJH OCSM_BP5-61 update start 现地管理和现地管理的主单不显示--> |
| | | <!-- <apex:outputText style="float:left;font-size:22px;margin-top: 25px;" value="{!centreAddress}" /> --> |
| | | <apex:outputText style="float:left;font-size:22px;margin-top: 25px;" value="{!IF(IsShowLU,centreAddress,'')}" /> |
| | |
| | | </colgroup> |
| | | <tr> |
| | | <th style="text-align:center;" colspan="2" height="38">奥林巴斯备品签收单 |
| | | <!-- <img style="float: right; width: 35px; height: 35px;padding: 0px;margin-top: -7px;" src="{!'/servlet/servlet.FileDownload?file=' + ApplyHeadShow.QRId__c}" /> --> |
| | | <!-- <img style="float: right; width: 35px; height: 35px;padding: 0px;margin-top: -7px;" src="{!qrcode}" /> --> |
| | | </th> |
| | | </tr> |
| | | <tr> |
| | | <td style="text-align:left;border-right-style: none;">★填写完整后请自发货日起10天内上传SFDC</td> |
| | | <td style="text-align:right;border-left-style: none;">备品管理中心申请单号:<apex:outputText value="{!ApplyHeadShow.Name}" /></td> |
| | | <td style="text-align:right;border-left-style: none;">备品管理中心申请单号: |
| | | <apex:outputText value="{!ApplyHeadShow.Name}" /> |
| | | </td> |
| | | </tr> |
| | | <!-- <tr style="background-color:#003399;color:white"> |
| | | <th style="text-align:center;" height="40">发货信息</th> |
| | | </tr> --> |
| | | <th style="text-align:center;" height="40">发货信息</th> |
| | | </tr> --> |
| | | <!-- <tr> |
| | | <td style="text-align:left;font-size:12px"> |
| | | 1、本发货确认单共两页。首页中到货确认部分为现场必填项目,填写完整后请回传至备品中心(传真或扫描件即可);<br /> |
| | | 末页中清洗消毒灭菌确认栏为现场必填项目,备品回寄时请将此页随备品一同寄回备品中心。<br /> |
| | | 2、请对产品进行清洗消毒或灭菌后再使用。<br /> |
| | | 3、在使用备品前,敬请仔细阅读背面“备品使用须知”,请明确申请人及申请方责任与义务。 |
| | | </td> |
| | | </tr> --> |
| | | <td style="text-align:left;font-size:12px"> |
| | | 1、本发货确认单共两页。首页中到货确认部分为现场必填项目,填写完整后请回传至备品中心(传真或扫描件即可);<br /> |
| | | 末页中清洗消毒灭菌确认栏为现场必填项目,备品回寄时请将此页随备品一同寄回备品中心。<br /> |
| | | 2、请对产品进行清洗消毒或灭菌后再使用。<br /> |
| | | 3、在使用备品前,敬请仔细阅读背面“备品使用须知”,请明确申请人及申请方责任与义务。 |
| | | </td> |
| | | </tr> --> |
| | | </table> |
| | | <table border="1px" width="100%" style="border-collapse: collapse;"> |
| | | <colgroup> |
| | |
| | | <th style="text-align:center;" colspan="5" height="25">发货信息</th> |
| | | </tr> |
| | | <tr> |
| | | <td style="text-align:left;">使用目的</td> <td style="text-align:left;font-size: 13px" colspan="4"><apex:outputText value="{!ApplyHeadShow.Demo_purpose1__c}" /></td> |
| | | <td style="text-align:left;">使用目的</td> |
| | | <td style="text-align:left;font-size: 13px" colspan="4"> |
| | | <apex:outputText value="{!ApplyHeadShow.Demo_purpose1__c}" /> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td style="text-align:left;" rowspan="2">申请人信息</td> |
| | | <td style="text-align:left;">所属本部名</td> <td style="text-align:left;font-size: 13px"> <apex:outputText value="{!ApplyHeadShow.Salesdept__c}" /></td> |
| | | <td style="text-align:left;" >所属办事处名</td> <td style="text-align:left;font-size: 13px"> <apex:outputText value="{!ApplyHeadShow.WorkPlace__c}" /></td> |
| | | <td style="text-align:left;">所属本部名</td> |
| | | <td style="text-align:left;font-size: 13px"> |
| | | <apex:outputText value="{!ApplyHeadShow.Salesdept__c}" /> |
| | | </td> |
| | | <td style="text-align:left;">所属办事处名</td> |
| | | <td style="text-align:left;font-size: 13px"> |
| | | <apex:outputText value="{!ApplyHeadShow.WorkPlace__c}" /> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td style="text-align:left;" >姓名 </td> <td style="text-align:left;font-size: 13px"> <apex:outputText value="{!ApplyHeadShow.Person_In_Charge__r.name}" /></td> |
| | | <td style="text-align:left;" colspan="1">联系电话</td> <td style="text-align:left;font-size: 13px"> <apex:outputText value="{!ApplyHeadShow.ApplyPerson_Phone__c}" /></td> |
| | | <td style="text-align:left;">姓名 </td> |
| | | <td style="text-align:left;font-size: 13px"> |
| | | <apex:outputText value="{!ApplyHeadShow.Person_In_Charge__r.name}" /> |
| | | </td> |
| | | <td style="text-align:left;" colspan="1">联系电话</td> |
| | | <td style="text-align:left;font-size: 13px"> |
| | | <apex:outputText value="{!ApplyHeadShow.ApplyPerson_Phone__c}" /> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td style="text-align:left;" >医疗机构信息</td> |
| | | <td style="text-align:left;" >医疗机构名</td> <td style="text-align:left;font-size: 13px"> <apex:outputText value="{!HospitalName}" /></td> |
| | | <td style="text-align:left;" >科室名</td> <td style="text-align:left;font-size: 13px"><apex:outputText value="{!ApplyHeadShow.Account__r.Department_Name__c}" /></td> |
| | | <td style="text-align:left;">医疗机构信息</td> |
| | | <td style="text-align:left;">医疗机构名</td> |
| | | <td style="text-align:left;font-size: 13px"> |
| | | <apex:outputText value="{!HospitalName}" /> |
| | | </td> |
| | | <td style="text-align:left;">科室名</td> |
| | | <td style="text-align:left;font-size: 13px"> |
| | | <apex:outputText value="{!ApplyHeadShow.Account__r.Department_Name__c}" /> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td style="text-align:left;" rowspan="3" >发货地址</td> <td colspan="2" rowspan="3" style="text-align:left;font-size: 13px"> <apex:outputText styleClass="Shippmentadress" value="{!Shippmentadress}" /></td> |
| | | <td style="text-align:left;" colspan="1">邮编</td> <td style="text-align:left;"> <apex:outputText value="{!IF(ApplyHeadShow.Shipment_address__r.Post_Code__c==null,ApplyHeadShow.Post_Code__c,ApplyHeadShow.Shipment_address__r.Post_Code__c)}" /></td> |
| | | <td style="text-align:left;" rowspan="3">发货地址</td> |
| | | <td colspan="2" rowspan="3" style="text-align:left;font-size: 13px"> |
| | | <apex:outputText styleClass="Shippmentadress" value="{!Shippmentadress}" /> |
| | | </td> |
| | | <td style="text-align:left;" colspan="1">邮编</td> |
| | | <td style="text-align:left;"> |
| | | <apex:outputText value="{!IF(ApplyHeadShow.Shipment_address__r.Post_Code__c==null,ApplyHeadShow.Post_Code__c,ApplyHeadShow.Shipment_address__r.Post_Code__c)}" |
| | | /> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td style="text-align:left;" colspan="1">接收人姓名</td> <td style="text-align:left;font-size: 13px"> <apex:outputText value="{!ApplyHeadShow.Loaner_received_staff__c}" /></td> |
| | | <td style="text-align:left;" colspan="1">接收人姓名</td> |
| | | <td style="text-align:left;font-size: 13px"> |
| | | <apex:outputText value="{!ApplyHeadShow.Loaner_received_staff__c}" /> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td style="text-align:left;" colspan="1">接收人电话</td> <td style="text-align:left;font-size: 13px"> <apex:outputText value="{!ApplyHeadShow.Loaner_received_staff_phone__c}" /></td> |
| | | <td style="text-align:left;" colspan="1">接收人电话</td> |
| | | <td style="text-align:left;font-size: 13px"> |
| | | <apex:outputText value="{!ApplyHeadShow.Loaner_received_staff_phone__c}" /> |
| | | </td> |
| | | </tr> |
| | | </table> |
| | | <table border="1" width="100%" style="border-collapse: collapse;"> |
| | |
| | | </table> |
| | | <table border="1" width="100%" style="border-collapse: collapse;"> |
| | | <colgroup> |
| | | |
| | | |
| | | <col width="19%" /> |
| | | <col width="29%" /> |
| | | <col width="29%" /> |
| | | <col width="23%" /> |
| | | </colgroup> |
| | | <tr> |
| | | <th style="text-align:center;" colspan="4" height="40"> 奥林巴斯备品借用申请・安装人填写栏<small>(必填)</small><br/>到货确认部分为奥林巴斯员工必填项目</th> |
| | | <th style="text-align:center;" colspan="4" height="40"> 奥林巴斯备品借用申请・安装人填写栏 |
| | | <small>(必填)</small> |
| | | <br/>到货确认部分为奥林巴斯员工必填项目</th> |
| | | </tr> |
| | | <tr> |
| | | <td style="text-align:left;" >签收者姓名</td> <td style="text-align:left;"></td> |
| | | <td style="text-align:left;">备品安装者姓名</td> <td style="text-align:left;"></td> |
| | | <td style="text-align:left;">签收者姓名</td> |
| | | <td style="text-align:left;"></td> |
| | | <td style="text-align:left;">备品安装者姓名</td> |
| | | <td style="text-align:left;"></td> |
| | | </tr> |
| | | <tr> |
| | | <td style="text-align:left;">签收日期</td> <td style="text-align:left;"></td> |
| | | <td style="text-align:left;">安装及安装说明日期</td> <td style="text-align:left;"> </td> |
| | | <td style="text-align:left;">签收日期</td> |
| | | <td style="text-align:left;"></td> |
| | | <td style="text-align:left;">安装及安装说明日期</td> |
| | | <td style="text-align:left;"> </td> |
| | | </tr> |
| | | </table> |
| | | <table border="1" width="100%" style="border-collapse: collapse;"> |
| | | <colgroup> |
| | | |
| | | |
| | | <col width="19%" /> |
| | | <col width="29%" /> |
| | | <col width="29%" /> |
| | | <col width="29%" /> |
| | | <col width="23%" /> |
| | | </colgroup> |
| | | <tr> |
| | | <th style="text-align:center;" colspan="4" height="40"> 医疗机构签收填写栏<small>(必填)</small><br/>敬请使用备品前仔细阅读下方“奥林巴斯备品借用须知”,以明确使用方的责任与义务</th> |
| | | |
| | | <th style="text-align:center;" colspan="4" height="40"> 医疗机构签收填写栏 |
| | | <small>(必填)</small> |
| | | <br/>敬请使用备品前仔细阅读下方“奥林巴斯备品借用须知”,以明确使用方的责任与义务</th> |
| | | |
| | | </tr> |
| | | <!--根据OLY_OCM-260记载,先注释掉(OLY_OCM-251取消注释) --> |
| | | <tr><th style="text-align:center;" height="25" colspan="4">《奥林巴斯备品发货清单》所列备品悉数收到, |
| | | 共计主机{!mainCnt}件,附属品{!accessoryCnt}件;并已接受产品使用说明和了解借用须知。</th></tr> |
| | | <tr> |
| | | <td style="text-align:left;" >签收者姓名</td> <td style="text-align:left;"></td> |
| | | <th style="text-align:center;" height="25" colspan="4">《奥林巴斯备品发货清单》所列备品悉数收到, 共计主机{!mainCnt}件,附属品{!accessoryCnt}件;并已接受产品使用说明和了解借用须知。 |
| | | </th> |
| | | </tr> |
| | | <tr> |
| | | <td style="text-align:left;">签收者姓名</td> |
| | | <td style="text-align:left;"></td> |
| | | <td style="text-align:left;" rowspan="2">接收单位(科室)章 </td> |
| | | <td style="text-align:left;" rowspan="2"> </td> |
| | | </tr> |
| | | <tr> |
| | | <td style="text-align:left;">签收日期</td> <td style="text-align:left;"></td> |
| | | |
| | | <td style="text-align:left;">签收日期</td> |
| | | <td style="text-align:left;"></td> |
| | | |
| | | </tr> |
| | | </table> |
| | | <table border="1" width="100%" style="border-collapse: collapse;"> |
| | |
| | | </tr> |
| | | <tr> |
| | | <td style="text-align:left;font-size: 12px"> |
| | | 1,备品:本须知所指的备品,是指本签收单附件《奥林巴斯备品发货清单》所列的由奥林巴斯(北京)销售服务有限公司(以下简称奥林<br/>巴斯)在规定期限内免费提供给借用单位为实施医疗行为或培训等所使用的设备包括产品及相关附属品,附件是本须知有效组成部分,与本<br/>须知具有同等法律效力。<br/> |
| | | 2,备品所有权:备品所有权归属于奥林巴斯公司。未经奥林巴斯公司书面同意,借用单位不得以任何理由向任何第三方转借、转让附件所<br/>列备品,或将附件所列备品作为担保抵押给任何第三方。<br/> |
| | | 3,备品使用权:借用期限内,借用单位对出借的备品享有独立合理的使用权利。若在使用过程中存在不确定情况时,借用单位应及时通知<br/>奥林巴斯公司,奥林巴斯公司将到场给予指导和协助,借用单位不应擅自处理。<br/> |
| | | 4,备品之日常使用与维护:借用单位在使用备品过程中应按照奥林巴斯公司的要求(“产品使用说明书”)内容尽审慎义务正确操作使用、<br/>爱护使用。备品使用前后都应进行必要的清洗消毒(灭菌)及日常检测工作,以确保备品的正常运作。<br/> |
| | | 5,备品损坏、遗失之赔偿责任:附件所列备品若因正常损耗而产生的维修或维护费用,由奥林巴斯公司承担;若因借用单位使用不当或超<br/>期借用等原因造成的备品损坏,借用单位应承担相关维修费用。当备品借用中发生故障需要维修时,应联系奥林巴斯进行检测和维修,不得<br/>擅自将相关备品交由任何第三方维修。若因借用单位原因造成备品遗失时,则借用单位应负赔偿责任。<br/> |
| | | 6,医疗责任事故:备品是符合国家质量标准并经检验合格的医疗器械产品,借用单位应独立依靠其医疗专业水平和能力利用备品进行医疗<br/>活动或培训。借用单位使用备品时所发生的任何问题均由借用单位自行负责、处理。<br/> |
| | | 7,备品返还:借用单位应按照本单注明的使用期限履行按时返还备品的承诺。返回前,借用单位应对备品进行清洗消毒或灭菌,以保证所<br/>有备品接触者的健康安全,同时借用单位有义务为奥林巴斯公司回收备品提供必要协助。<br/> |
| | | 8,借用单位知悉且同意,此次备品出借基于正当合理的理由,而非通过出借备品对借用单位购买、推荐奥林巴斯公司产品、服务等产生任<br/>何不正当影响。<br/> |
| | | 9,借用单位应严格按本单所载使用目的使用备品,禁止将备品用于本单所载使用目的以外的其他用途。<br/> |
| | | 10,若借用单位选择以加盖实际接收备品的借用单位内部部门章或签收者签名方式确认以上内容,实际接收备品的借用单位内部部门或签<br/>收者确认其具备相应资格代表借用单位进行签收和确认。<br/> |
| | | 11,其它:其它未尽事宜,双方应本着友好合作的原则进行协商解决。 |
| | | 1,备品:本须知所指的备品,是指本签收单附件《奥林巴斯备品发货清单》所列的由奥林巴斯(北京)销售服务有限公司(以下简称奥林 |
| | | <br/>巴斯)在规定期限内免费提供给借用单位为实施医疗行为或培训等所使用的设备包括产品及相关附属品,附件是本须知有效组成部分,与本 |
| | | <br/>须知具有同等法律效力。 |
| | | <br/> 2,备品所有权:备品所有权归属于奥林巴斯公司。未经奥林巴斯公司书面同意,借用单位不得以任何理由向任何第三方转借、转让附件所 |
| | | <br/>列备品,或将附件所列备品作为担保抵押给任何第三方。 |
| | | <br/> 3,备品使用权:借用期限内,借用单位对出借的备品享有独立合理的使用权利。若在使用过程中存在不确定情况时,借用单位应及时通知 |
| | | <br/>奥林巴斯公司,奥林巴斯公司将到场给予指导和协助,借用单位不应擅自处理。 |
| | | <br/> 4,备品之日常使用与维护:借用单位在使用备品过程中应按照奥林巴斯公司的要求(“产品使用说明书”)内容尽审慎义务正确操作使用、 |
| | | <br/>爱护使用。备品使用前后都应进行必要的清洗消毒(灭菌)及日常检测工作,以确保备品的正常运作。 |
| | | <br/> 5,备品损坏、遗失之赔偿责任:附件所列备品若因正常损耗而产生的维修或维护费用,由奥林巴斯公司承担;若因借用单位使用不当或超 |
| | | <br/>期借用等原因造成的备品损坏,借用单位应承担相关维修费用。当备品借用中发生故障需要维修时,应联系奥林巴斯进行检测和维修,不得 |
| | | <br/>擅自将相关备品交由任何第三方维修。若因借用单位原因造成备品遗失时,则借用单位应负赔偿责任。 |
| | | <br/> 6,医疗责任事故:备品是符合国家质量标准并经检验合格的医疗器械产品,借用单位应独立依靠其医疗专业水平和能力利用备品进行医疗 |
| | | <br/>活动或培训。借用单位使用备品时所发生的任何问题均由借用单位自行负责、处理。 |
| | | <br/> 7,备品返还:借用单位应按照本单注明的使用期限履行按时返还备品的承诺。返回前,借用单位应对备品进行清洗消毒或灭菌,以保证所 |
| | | <br/>有备品接触者的健康安全,同时借用单位有义务为奥林巴斯公司回收备品提供必要协助。 |
| | | <br/> 8,借用单位知悉且同意,此次备品出借基于正当合理的理由,而非通过出借备品对借用单位购买、推荐奥林巴斯公司产品、服务等产生任 |
| | | <br/>何不正当影响。 |
| | | <br/> 9,借用单位应严格按本单所载使用目的使用备品,禁止将备品用于本单所载使用目的以外的其他用途。 |
| | | <br/> 10,若借用单位选择以加盖实际接收备品的借用单位内部部门章或签收者签名方式确认以上内容,实际接收备品的借用单位内部部门或签 |
| | | <br/>收者确认其具备相应资格代表借用单位进行签收和确认。 |
| | | <br/> 11,其它:其它未尽事宜,双方应本着友好合作的原则进行协商解决。 |
| | | </td> |
| | | <!-- 20211008 ljh SFDC-C7L4ED 增加8,9,10--> |
| | | <!-- 20211008 ljh SFDC-C7L4ED 增加8,9,10--> |
| | | </tr> |
| | | <tr> |
| | | <td style="text-align:left;font-size:12px;border-collapse: collapse;" colspan="2" height="80"> |
| | | 奥林巴斯 北京备品中心地址:北京市朝阳区酒仙桥路10号恒通商务园B12C座西门1F<br /> |
| | | 邮编:100015 TEL:010-59756006-1871 FAX: 010-59756534<br /> |
| | | 奥林巴斯 广州备品中心地址:广州市番禺区东环街番禺大道北537号番山创业中心3号楼1F<br /> |
| | | 邮编:511400 TEL:020-39198888-8876 FAX:020-39198848<br /> |
| | | 奥林巴斯 上海备品中心地址:上海市浦东新区金吉路778号3号楼1F<br /> |
| | | 邮编:201206 TEL:021-60391318-8877 FAX:021-60391316<br /> |
| | | 奥林巴斯 北京备品中心地址:北京市朝阳区酒仙桥路10号恒通商务园B12C座西门1F |
| | | <br /> 邮编:100015 TEL:010-59756006-1871 FAX: 010-59756534 |
| | | <br /> 奥林巴斯 广州备品中心地址:广州市番禺区东环街番禺大道北537号番山创业中心3号楼1F |
| | | <br /> 邮编:511400 TEL:020-39198888-8876 FAX:020-39198848 |
| | | <br /> 奥林巴斯 上海备品中心地址:上海市浦东新区金吉路778号3号楼1F |
| | | <br /> 邮编:201206 TEL:021-60391318-8877 FAX:021-60391316 |
| | | <br /> |
| | | </td> |
| | | <!-- 20210812 SFDC-C5CC5S 修改地址--> |
| | | </tr> |
| | | </table> |
| | | <apex:outputPanel layout="none"> |
| | | <div style="page-break-after: always;"/> |
| | | <div style="page-break-after: always;"></div> |
| | | </apex:outputPanel> |
| | | |
| | | </div> |
| | | <apex:variable value="{!1}" var="pNcnt" /> |
| | | <apex:variable value="{!1}" var="pcnt" /> |
| | | <apex:repeat value="{!records}" var="record"> |
| | | <div style="{position:absolute;width:100%;height:15px"> </div> |
| | | <!-- 20201119 LJH OCSM_BP5-61 update start 主单是显示办事处和备品中心分来显示且内容不同 --> |
| | | <!-- <apex:outputText style="float:left;font-size:22px;margin-top: 15px;" value="{!centreAddress}"/> --> |
| | | <!-- height: 15mm; --> |
| | | <table border="0" width="100%" style="border-collapse: collapse;margin: 0;"> |
| | | <apex:outputPanel layout="none" rendered="{!IF(!IsShowLU , true, false)}"> |
| | | <tr> |
| | | <td style="font-size:22px;"><apex:outputText value="{!IF(record.isAgencyOrCenter,record.AgencyAddressName,centreAddress)}"/></td> |
| | | <td rowspan="2"> |
| | | <img style="float: right; width: 55px; height: 55px;padding: 0px;margin-top: 0mm;" src="{!'/servlet/servlet.FileDownload?file=' + ApplyHeadShow.QRId__c}" /> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size:15px;"><c:PDFWbr targetStr="{!IF(record.AgencyOrCenterAddress=='BeiJingCenter','北京市朝阳区酒仙桥路10号恒通商务园B12C座西门1F 电话:010-59756006-1871',IF(record.AgencyOrCenterAddress=='ShangHaiCenter','上海市浦东新区唐镇创业路183号2幢1F 电话:021-60391318-8877',IF(record.AgencyOrCenterAddress=='GuangZhouCenter','广州市番禺区东环街番禺大道北537号番山创业中心3号楼1F 电话:020-39198888-8876',record.AgencyOrCenterAddress)))}"/></td> |
| | | </tr> |
| | | </apex:outputPanel> |
| | | <apex:outputPanel layout="none" rendered="{!IF(IsShowLU , true, false)}"> |
| | | <tr> |
| | | <td style="font-size:22px;height: 55px;line-height: 55px;"><apex:outputText value="{!centreAddress}"/> |
| | | </td> |
| | | <td> |
| | | <img style="float: right; width: 55px; height: 55px;padding: 0px;margin-top: 0mm;" src="{!'/servlet/servlet.FileDownload?file=' + ApplyHeadShow.QRId__c}" /> |
| | | </td> |
| | | </tr> |
| | | </apex:outputPanel> |
| | | </table> |
| | | <!-- 20201119 LJH OCSM_BP5-61 update end 主单是显示办事处和备品中心分来显示且内容不同 --> |
| | | <!-- margin-top: 15mm; --> |
| | | <table border="1" width="100%" style="border-collapse: collapse;"> |
| | | <tr> |
| | | <th style="box-sizing: border-box;text-align:center;font-size:24px;font-weight:900;" height="40">奥林巴斯备品发货清单 |
| | | <!-- <img style="float: right; width: 35px; height: 35px;padding: 0px;" src="{!'/servlet/servlet.FileDownload?file=' + ApplyHeadShow.QRId__c}" /> --> |
| | | <!-- <td align="right" valign="top"><apex:outputField value="{!ApplyHeadShow.QRImg__c}" /></td> --> |
| | | </th> |
| | | </tr> |
| | | <tr> |
| | | <td style="box-sizing: border-box;text-align:right;font-size:13px;" >备品管理中心申请单号:<apex:outputText value="{!ApplyHeadShow.Name}" /></td> <!-- {!RentalApplyName} 20201119 LJH OCSM_BP5-61 update--> |
| | | </tr> |
| | | <tr style="background-color:white;"> |
| | | <td style="box-sizing: border-box;text-align:right;font-size:13px;">本单附件第( {!pNcnt})页/共( {!pageCnt})页</td> |
| | | </tr> |
| | | <tr> |
| | | <th style="box-sizing: border-box;text-align:center;font-size:16px;"> |
| | | ※提示 |
| | | </th> |
| | | </tr> |
| | | <tr> |
| | | <td style="box-sizing: border-box;text-align:left;font-size:12.3px;">本《奥林巴斯备品发货清单》一式两份,由奥林巴斯备品借用申请人(备品安装人)和医疗机构借用方各执一份,作为出借和归还时双方进<br/>行清点确认凭证 |
| | | </td> |
| | | </tr> |
| | | </table> |
| | | <div class="pdf-page"> |
| | | <div class="title1"> </div> |
| | | <!-- 20201119 LJH OCSM_BP5-61 update start 主单是显示办事处和备品中心分来显示且内容不同 --> |
| | | <!-- <apex:outputText style="float:left;font-size:22px;margin-top: 15px;" value="{!centreAddress}"/> --> |
| | | <!-- height: 15mm; --> |
| | | <table border="0" width="100%" style="border-collapse: collapse;margin: 0;"> |
| | | <apex:outputPanel layout="none" rendered="{!IF(!IsShowLU , true, false)}"> |
| | | <tr> |
| | | <td style="font-size:22px;"> |
| | | <apex:outputText value="{!IF(record.isAgencyOrCenter,record.AgencyAddressName,centreAddress)}" /> |
| | | </td> |
| | | <td rowspan="2"> |
| | | <img style="float: right; width: 55px; height: 55px;padding: 0px;margin-top: 0mm;" src="{!qrcode}" |
| | | /> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size:15px;"> |
| | | <c:PDFWbr targetStr="{!IF(record.AgencyOrCenterAddress=='BeiJingCenter','北京市朝阳区酒仙桥路10号恒通商务园B12C座西门1F 电话:010-59756006-1871',IF(record.AgencyOrCenterAddress=='ShangHaiCenter','上海市浦东新区唐镇创业路183号2幢1F 电话:021-60391318-8877',IF(record.AgencyOrCenterAddress=='GuangZhouCenter','广州市番禺区东环街番禺大道北537号番山创业中心3号楼1F 电话:020-39198888-8876',record.AgencyOrCenterAddress)))}" |
| | | /> |
| | | </td> |
| | | </tr> |
| | | </apex:outputPanel> |
| | | <apex:outputPanel layout="none" rendered="{!IF(IsShowLU , true, false)}"> |
| | | <tr> |
| | | <td style="font-size:22px;height: 55px;line-height: 55px;"> |
| | | <apex:outputText value="{!centreAddress}" /> |
| | | </td> |
| | | <td> |
| | | <img style="float: right; width: 55px; height: 55px;padding: 0px;margin-top: 0mm;" src="{!qrcode}" |
| | | /> |
| | | </td> |
| | | </tr> |
| | | </apex:outputPanel> |
| | | </table> |
| | | <!-- 20201119 LJH OCSM_BP5-61 update end 主单是显示办事处和备品中心分来显示且内容不同 --> |
| | | <!-- margin-top: 15mm; --> |
| | | <table border="1" width="100%" style="border-collapse: collapse;"> |
| | | <tr> |
| | | <th style="box-sizing: border-box;text-align:center;font-size:24px;font-weight:900;" height="40">奥林巴斯备品发货清单 |
| | | <!-- <img style="float: right; width: 35px; height: 35px;padding: 0px;" src="{!qrcode}" /> --> |
| | | <!-- <td align="right" valign="top"><apex:outputField value="{!ApplyHeadShow.QRImg__c}" /></td> --> |
| | | </th> |
| | | </tr> |
| | | <tr> |
| | | <td style="box-sizing: border-box;text-align:right;font-size:13px;">备品管理中心申请单号: |
| | | <apex:outputText value="{!ApplyHeadShow.Name}" /> |
| | | </td> |
| | | <!-- {!RentalApplyName} 20201119 LJH OCSM_BP5-61 update--> |
| | | </tr> |
| | | <tr style="background-color:white;"> |
| | | <td style="box-sizing: border-box;text-align:right;font-size:13px;">本单附件第( {!pNcnt})页/共( {!pageCnt})页</td> |
| | | </tr> |
| | | <tr> |
| | | <th style="box-sizing: border-box;text-align:center;font-size:16px;"> |
| | | ※提示 |
| | | </th> |
| | | </tr> |
| | | <tr> |
| | | <td style="box-sizing: border-box;text-align:left;font-size:12.3px;">本《奥林巴斯备品发货清单》一式两份,由奥林巴斯备品借用申请人(备品安装人)和医疗机构借用方各执一份,作为出借和归还时双方进 |
| | | <br/>行清点确认凭证 |
| | | </td> |
| | | </tr> |
| | | </table> |
| | | |
| | | <table border="1" width="100%" style="border-collapse: collapse;"> |
| | | <colgroup> |
| | | <col width="4%" /> |
| | | <col width="8%" /> |
| | | <col width="20%" /> |
| | | <col width="11%" /> |
| | | <col width="29%" /> |
| | | <col width="9%" /> |
| | | <col width="9%" /> |
| | | <col width="7%" /> |
| | | </colgroup> |
| | | <tr> |
| | | <td style="box-sizing: border-box;text-align:center;font-size:13px;height: 16px;" colspan="2">申请人</td> |
| | | <td style="box-sizing: border-box;text-align:left;font-size: 13px"> |
| | | <apex:outputText value="{!ApplyHeadShow.Person_In_Charge__r.name}" /> |
| | | </td> |
| | | <td style="box-sizing: border-box;text-align:center;font-size:13px;border-left: solid 1px;" rowspan="2">医疗机构</td> |
| | | <!-- 20220124 ljh SFDC-C4U3PH update colspan="4" --> |
| | | <td style="box-sizing: border-box;text-align:left;font-size: 13px;" colspan="5" rowspan="2"> |
| | | <apex:outputText value="{!HospitalName}" /> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td style="box-sizing: border-box;text-align:center;font-size:13px;" colspan="2">使用目的</td> |
| | | <td style="box-sizing: border-box;text-align:left;font-size: 13px;border-right: solid 1px"> |
| | | <apex:outputText value="{!ApplyHeadShow.Demo_purpose1__c}" /> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td style="box-sizing: border-box;text-align:center;font-size:13px;height: 16px;" colspan="2">收件者姓名</td> |
| | | <td style="box-sizing: border-box;text-align:left;font-size: 13px"> |
| | | <apex:outputText value="{!ApplyHeadShow.Loaner_received_staff__c}" /> |
| | | </td> |
| | | <td style="box-sizing: border-box;text-align:center;font-size:13px;border-left: solid 1px;" rowspan="2">发货地址</td> |
| | | <!-- 20220124 ljh SFDC-C4U3PH update colspan="4" --> |
| | | <td style="box-sizing: border-box;text-align:left;font-size: 13px;" colspan="5" rowspan="2"> |
| | | <apex:outputText styleClass="address" value="{!if(isblank(ApplyHeadShow.Shippment_adress_detail__c), ApplyHeadShow.direct_shippment_address__c, ApplyHeadShow.Shippment_adress_detail__c)}" /> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td style="box-sizing: border-box;text-align:center;font-size:13px;" colspan="2">收件者电话</td> |
| | | <td style="box-sizing: border-box;text-align:left;font-size: 13px;border-right: solid 1px"> |
| | | <apex:outputText value="{!ApplyHeadShow.Loaner_received_staff_phone__c}" /> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <!-- 20220124 ljh SFDC-C4U3PH update colspan="8" --> |
| | | <th style="text-align:center;font-size:13px;height: 7pt;" colspan="9" >借用备品发货清单</th> |
| | | </tr> |
| | | <tr> |
| | | <td rowspan="2" style="box-sizing: border-box;text-align:center;font-size: 11px;">序号</td> |
| | | <td rowspan="2" style="box-sizing: border-box;text-align:center;font-size: 11px;">管理编号</td> |
| | | <!-- 20220124 ljh SFDC-C4U3PH update colspan="6" --> |
| | | <td colspan="7" style="box-sizing: border-box;text-align:center;font-size: 11px;">明细</td> |
| | | </tr> |
| | | <tr> |
| | | <!-- <td style="text-align:center;">序号</td> |
| | | <table border="1" width="100%" style="border-collapse: collapse;"> |
| | | <colgroup> |
| | | <col width="4%" /> |
| | | <col width="8%" /> |
| | | <col width="20%" /> |
| | | <col width="11%" /> |
| | | <col width="29%" /> |
| | | <col width="9%" /> |
| | | <col width="9%" /> |
| | | <col width="7%" /> |
| | | </colgroup> |
| | | <tr> |
| | | <td style="box-sizing: border-box;text-align:center;font-size:13px;height: 16px;" colspan="2">申请人</td> |
| | | <td style="box-sizing: border-box;text-align:left;font-size: 13px"> |
| | | <apex:outputText value="{!ApplyHeadShow.Person_In_Charge__r.name}" /> |
| | | </td> |
| | | <td style="box-sizing: border-box;text-align:center;font-size:13px;border-left: solid 1px;" rowspan="2">医疗机构</td> |
| | | <!-- 20220124 ljh SFDC-C4U3PH update colspan="4" --> |
| | | <td style="box-sizing: border-box;text-align:left;font-size: 13px;" colspan="5" rowspan="2"> |
| | | <apex:outputText value="{!HospitalName}" /> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td style="box-sizing: border-box;text-align:center;font-size:13px;" colspan="2">使用目的</td> |
| | | <td style="box-sizing: border-box;text-align:left;font-size: 13px;border-right: solid 1px"> |
| | | <apex:outputText value="{!ApplyHeadShow.Demo_purpose1__c}" /> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td style="box-sizing: border-box;text-align:center;font-size:13px;height: 16px;" colspan="2">收件者姓名</td> |
| | | <td style="box-sizing: border-box;text-align:left;font-size: 13px"> |
| | | <apex:outputText value="{!ApplyHeadShow.Loaner_received_staff__c}" /> |
| | | </td> |
| | | <td style="box-sizing: border-box;text-align:center;font-size:13px;border-left: solid 1px;" rowspan="2">发货地址</td> |
| | | <!-- 20220124 ljh SFDC-C4U3PH update colspan="4" --> |
| | | <td style="box-sizing: border-box;text-align:left;font-size: 13px;" colspan="5" rowspan="2"> |
| | | <apex:outputText styleClass="address" value="{!if(isblank(ApplyHeadShow.Shippment_adress_detail__c), ApplyHeadShow.direct_shippment_address__c, ApplyHeadShow.Shippment_adress_detail__c)}" |
| | | /> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td style="box-sizing: border-box;text-align:center;font-size:13px;" colspan="2">收件者电话</td> |
| | | <td style="box-sizing: border-box;text-align:left;font-size: 13px;border-right: solid 1px"> |
| | | <apex:outputText value="{!ApplyHeadShow.Loaner_received_staff_phone__c}" /> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <!-- 20220124 ljh SFDC-C4U3PH update colspan="8" --> |
| | | <th style="text-align:center;font-size:13px;height: 7pt;" colspan="9">借用备品发货清单</th> |
| | | </tr> |
| | | <tr> |
| | | <td rowspan="2" style="box-sizing: border-box;text-align:center;font-size: 11px;">序号</td> |
| | | <td rowspan="2" style="box-sizing: border-box;text-align:center;font-size: 11px;">管理编号</td> |
| | | <!-- 20220124 ljh SFDC-C4U3PH update colspan="6" --> |
| | | <td colspan="7" style="box-sizing: border-box;text-align:center;font-size: 11px;">明细</td> |
| | | </tr> |
| | | <tr> |
| | | <!-- <td style="text-align:center;">序号</td> |
| | | <td style="text-align:center;">备品set型号</td> |
| | | <td style="text-align:center;">管理编号</td> |
| | | <td style="text-align:center;">产品型号</td> |
| | | <td style="text-align:center;">机身号</td> |
| | | <td style="text-align:center;">附属品明细</td> --> |
| | | <td style="box-sizing: border-box;text-align:center;font-size: 11px;">明细型号</td> |
| | | <td style="box-sizing: border-box;text-align:center;font-size: 11px;" colspan="2">中文名称</td> |
| | | <td style="box-sizing: border-box;text-align:center;font-size: 11px;">机身号</td> |
| | | <td style="text-align:center;font-size: 11px;">固定资产号</td> |
| | | <td style="box-sizing: border-box;text-align:center;font-size: 11px;">货位号</td> |
| | | <!-- 20220124 ljh SFDC-C4U3PH add start --> |
| | | <td style="box-sizing: border-box;text-align:center;font-size: 11px;">备注</td> |
| | | <!-- 20220124 ljh SFDC-C4U3PH add end --> |
| | | <!-- <td style="text-align:center;">二维码</td> --> |
| | | </tr> |
| | | <apex:repeat value="{!record.lineList}" var="line"> |
| | | <tr> |
| | | <td style="box-sizing: border-box;text-align:center;font-size: 10px;height:30px;padding: 0px;"><c:PDFWbr targetStr="{!line.index}" /></td> |
| | | <td style="box-sizing: border-box;text-align:left;font-size: 10px;padding: 0px;"><c:PDFWbr targetStr="{!line.dManagementnumber}" /></td> |
| | | <td style="box-sizing: border-box;text-align:left;font-size: 10px;padding: 0px;"><c:PDFWbr targetStr="{!line.dModelNo}" /></td> |
| | | <td style="box-sizing: border-box;text-align:left;font-size: 10px;padding: 0px;" colspan="2"><c:PDFWbr targetStr="{!line.dChinaName}" /></td> |
| | | <td style="box-sizing: border-box;text-align:left;font-size: 10px;padding: 0px;"><c:PDFWbr targetStr="{!line.dSerialNumber}" /></td> |
| | | <td style="box-sizing: border-box;text-align:left;font-size: 10px;padding: 0px;"><c:PDFWbr targetStr="{!line.dLoaner_asset_no}" /></td> |
| | | <td style="box-sizing: border-box;text-align:left;font-size: 10px;padding: 0px;"><c:PDFWbr targetStr="{!line.wh_location}" /></td> |
| | | <td style="box-sizing: border-box;text-align:center;font-size: 11px;">明细型号</td> |
| | | <td style="box-sizing: border-box;text-align:center;font-size: 11px;" colspan="2">中文名称</td> |
| | | <td style="box-sizing: border-box;text-align:center;font-size: 11px;">机身号</td> |
| | | <td style="text-align:center;font-size: 11px;">固定资产号</td> |
| | | <td style="box-sizing: border-box;text-align:center;font-size: 11px;">货位号</td> |
| | | <!-- 20220124 ljh SFDC-C4U3PH add start --> |
| | | <td style="box-sizing: border-box;text-align:left;font-size: 10px;padding: 0px;"><c:PDFWbr targetStr="" /></td> |
| | | <!-- {!line.Received_ng_detail} --> |
| | | <td style="box-sizing: border-box;text-align:center;font-size: 11px;min-width:30px">备注</td> |
| | | <!-- 20220124 ljh SFDC-C4U3PH add end --> |
| | | <!-- <td style="text-align:center;font-size: 10px"><c:PDFWbr targetStr="{!line.dQRCode}" /></td> --> |
| | | <!-- <td style="text-align:center;">二维码</td> --> |
| | | </tr> |
| | | <apex:repeat value="{!record.lineList}" var="line"> |
| | | <tr> |
| | | <td style="box-sizing: border-box;text-align:center;font-size: 10px;height:30px;padding: 0px;"> |
| | | <c:PDFWbr targetStr="{!line.index}" /> |
| | | </td> |
| | | <td style="box-sizing: border-box;text-align:left;font-size: 10px;padding: 0px;"> |
| | | <c:PDFWbr targetStr="{!line.dManagementnumber}" /> |
| | | </td> |
| | | <td style="box-sizing: border-box;text-align:left;font-size: 10px;padding: 0px;"> |
| | | <c:PDFWbr targetStr="{!line.dModelNo}" /> |
| | | </td> |
| | | <td style="box-sizing: border-box;text-align:left;font-size: 10px;padding: 0px;" colspan="2"> |
| | | <c:PDFWbr targetStr="{!line.dChinaName}" /> |
| | | </td> |
| | | <td style="box-sizing: border-box;text-align:left;font-size: 10px;padding: 0px;"> |
| | | <c:PDFWbr targetStr="{!line.dSerialNumber}" /> |
| | | </td> |
| | | <td style="box-sizing: border-box;text-align:left;font-size: 10px;padding: 0px;"> |
| | | <c:PDFWbr targetStr="{!line.dLoaner_asset_no}" /> |
| | | </td> |
| | | <td style="box-sizing: border-box;text-align:left;font-size: 10px;padding: 0px;"> |
| | | <c:PDFWbr targetStr="{!line.wh_location}" /> |
| | | </td> |
| | | <!-- 20220124 ljh SFDC-C4U3PH add start --> |
| | | <td style="box-sizing: border-box;text-align:left;font-size: 10px;padding: 0px;"> |
| | | <c:PDFWbr targetStr="" /> |
| | | </td> |
| | | <!-- {!line.Received_ng_detail} --> |
| | | <!-- 20220124 ljh SFDC-C4U3PH add end --> |
| | | <!-- <td style="text-align:center;font-size: 10px"><c:PDFWbr targetStr="{!line.dQRCode}" /></td> --> |
| | | |
| | | <!-- <td style="text-align:left;font-size: 13px"><apex:outputText value="{!IF(pcnt < AllSum +1,pcnt,'')}" /></td> --> |
| | | <!-- <td style="text-align:left;font-size: 13px"><apex:outputText value="{!line.index}" /></td> |
| | | <!-- <td style="text-align:left;font-size: 13px"><apex:outputText value="{!IF(pcnt < AllSum +1,pcnt,'')}" /></td> --> |
| | | <!-- <td style="text-align:left;font-size: 13px"><apex:outputText value="{!line.index}" /></td> |
| | | <td style="text-align:left;font-size: 13px"><apex:outputText value="{!line.setName}" /></td> |
| | | <td style="text-align:left;font-size: 13px"><apex:outputText value="{!line.name1}" /></td> |
| | | <td style="text-align:left;font-size: 13px"><apex:outputText value="{!line.LoanerCode}" /></td> |
| | | <td style="text-align:left;font-size: 13px"><apex:outputText value="{!line.serialNumber1}" /></td> |
| | | <td style="text-align:left;font-size: 13px"><apex:outputText value="{!line.AssetModelNo}" /></td> --> |
| | | </tr> |
| | | <apex:variable value="{!pcnt + 1}" var="pcnt" /> |
| | | </apex:repeat> |
| | | </table> |
| | | <!-- 20211209 ljh SFDC-C923SR 条形码 --> |
| | | <img style="float:left;position:absolute;z-index: 99;" src="{!barcode}" /> |
| | | </tr> |
| | | <apex:variable value="{!pcnt + 1}" var="pcnt" /> |
| | | </apex:repeat> |
| | | </table> |
| | | <!-- 20211209 ljh SFDC-C923SR 条形码 --> |
| | | <img style="float:left;position:absolute;z-index: 99;" src="{!barcode}" /> |
| | | <div style="height:30px"></div> |
| | | <!-- 20211209 ljh SFDC-C923SR 条形码 --> |
| | | <div style="{position:absolute;width:100%;height:20px"> </div> |
| | | <apex:outputPanel rendered="{!pNcnt < pageCnt}" layout="none"> |
| | | <!-- <div style="{position:absolute;width:100%;height:30px"> </div> |
| | | <div style="{position:absolute;width:100%;height:30px"> </div>--> |
| | | <div style="page-break-after: always;"/> |
| | | </apex:outputPanel> |
| | | <apex:variable value="{!pNcnt+1}" var="pNcnt" /> |
| | | <!-- 20211209 ljh SFDC-C923SR 条形码 --> |
| | | <div style="{position:absolute;width:100%;height:20px"> </div> |
| | | <apex:outputPanel rendered="{!pNcnt < pageCnt}" layout="none"> |
| | | <!-- <div style="{position:absolute;width:100%;height:30px"> </div> |
| | | <div style="{position:absolute;width:100%;height:30px"> </div>--> |
| | | <div style="page-break-after: always;" /> |
| | | </apex:outputPanel> |
| | | <apex:variable value="{!pNcnt+1}" var="pNcnt" /> |
| | | </div> |
| | | </apex:repeat> |
| | | |
| | | </apex:outputPanel> |
| | | </div> |
| | | </body> |
| | | <script> |
| | | console.log('----start----') |
| | | console.log('----{!ApplyHeadShow.AWS_Data_Id__c}----') |
| | | AWSService.sfSessionId = '{!GETSESSIONID()}'; |
| | | //sforce.connection.sessionId = '{!GETSESSIONID()}'; |
| | | var staticResources = JSON.parse('{!staticResource}'); |
| | | //blockme(); |
| | | document.body.onload = function(){ |
| | | console.log('document.body.onload') |
| | | if ({!addFlag} || !'{!ApplyHeadShow.Shippment_adress_detail__c}') { |
| | | AWSService.query(staticResources.queryUrl, '{!ApplyHeadShow.AWS_Data_Id__c}', function(data){ |
| | | console.log('data----------') |
| | | console.log(data); |
| | | //unblockUI(); |
| | | if ({!addFlag}) { |
| | | jQuery(".Shippmentadress").html(data.object.directShippmentAddress); |
| | | } |
| | | //document.getElementById("Caller_phone__c").innerHTML = data.object.callerPhone; |
| | | if (!'{!ApplyHeadShow.Shippment_adress_detail__c}') { |
| | | jQuery(".address").html(data.object.directShippmentAddress); |
| | | //document.getElementById("allPage:address").innerHTML = data.object.directShippmentAddress; |
| | | } |
| | | jsPdfDownload(); |
| | | }, staticResources.token); |
| | | }else{ |
| | | jsPdfDownload(); |
| | | } |
| | | </apex:outputPanel> |
| | | </div> |
| | | </body> |
| | | <script> |
| | | console.log('----start----') |
| | | console.log('----{!ApplyHeadShow.AWS_Data_Id__c}----') |
| | | AWSService.sfSessionId = '{!GETSESSIONID()}'; |
| | | //sforce.connection.sessionId = '{!GETSESSIONID()}'; |
| | | var staticResources = JSON.parse('{!staticResource}'); |
| | | //blockme(); |
| | | document.body.onload = function () { |
| | | console.log('document.body.onload') |
| | | if ({!addFlag |
| | | } || !'{!ApplyHeadShow.Shippment_adress_detail__c}') { |
| | | AWSService.query(staticResources.queryUrl, '{!ApplyHeadShow.AWS_Data_Id__c}', function (data) { |
| | | console.log('data----------') |
| | | console.log(data); |
| | | //unblockUI(); |
| | | if ({!addFlag |
| | | }) { |
| | | jQuery(".Shippmentadress").html(data.object.directShippmentAddress); |
| | | } |
| | | //document.getElementById("Caller_phone__c").innerHTML = data.object.callerPhone; |
| | | if (!'{!ApplyHeadShow.Shippment_adress_detail__c}') { |
| | | jQuery(".address").html(data.object.directShippmentAddress); |
| | | //document.getElementById("allPage:address").innerHTML = data.object.directShippmentAddress; |
| | | } |
| | | jsPdfDownload(); |
| | | }, staticResources.token); |
| | | }else { |
| | | jsPdfDownload(); |
| | | } |
| | | |
| | | |
| | | } |
| | | 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, { |
| | | function jsPdfDownload() { |
| | | |
| | | 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"; |
| | | }) |
| | | |
| | | 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) { |
| | | onrendered: function (canvas) { |
| | | |
| | | let canvas_max_page_num = 1; |
| | | let canvas_current_page_num = 0; |
| | | var contentWidth = canvas.width; |
| | | var contentHeight = canvas.height; |
| | | |
| | | |
| | | //一页pdf显示html页面生成的canvas高度; |
| | | var pageHeight = contentWidth / 592.28 * 841.89; |
| | | var pageHeight = contentWidth / pw * ph; |
| | | //未生成pdf的html页面高度 |
| | | var leftHeight = contentHeight; |
| | | //页面偏移 |
| | | var position = 0; |
| | | //a4纸的尺寸[595.28,841.89],html页面生成的canvas在pdf中图片的宽高 |
| | | var imgWidth = 565.28;//595.28//左右边距20 |
| | | var imgHeight = 605.28/contentWidth * contentHeight;//左右边距20 |
| | | |
| | | var imgWidth = pw - 2 * marginw;//595.28//左右边距20 |
| | | var imgHeight = imgWidth / contentWidth * contentHeight;//左右边距20 |
| | | |
| | | var pageData = canvas.toDataURL('image/jpeg', 1.0); |
| | | |
| | | var pdf = new jsPDF('', 'pt', 'a4'); |
| | | |
| | | |
| | | |
| | | if (i) { |
| | | pdf.addPage(); |
| | | } |
| | | //有两个高度需要区分,一个是html页面的实际高度,和生成pdf的页面高度(841.89) |
| | | //当内容未超过pdf一页显示的范围,无需分页 |
| | | if (leftHeight < pageHeight) { |
| | | pdf.addImage(pageData, 'JPEG', 15, 0, imgWidth, imgHeight );//左右边距7.5 |
| | | pdf.addImage(pageData, 'JPEG', marginw, 0, imgWidth, imgHeight);//左右边距20 |
| | | } else { |
| | | while(leftHeight > 0) { |
| | | pdf.addImage(pageData, 'JPEG', 15, position, imgWidth, imgHeight)//左右边距7.5 |
| | | while (leftHeight > 0) { |
| | | |
| | | |
| | | canvas_current_page_num++; |
| | | pdf.addImage(pageData, 'JPEG', marginw, position, imgWidth, imgHeight)//左右边距20 |
| | | leftHeight -= pageHeight; |
| | | position -= 841.89; |
| | | position -= ph; |
| | | |
| | | if (canvas_max_page_num > 0 && canvas_current_page_num >= canvas_max_page_num) { |
| | | break; |
| | | } |
| | | |
| | | //避免添加空白页 |
| | | if(leftHeight > 0) { |
| | | if (leftHeight > 0) { |
| | | pdf.addPage(); |
| | | } |
| | | } |
| | | } |
| | | Fun(pdf); |
| | | |
| | | recursion(i + 1); |
| | | } |
| | | }) |
| | | } |
| | | var staticResourceFile = JSON.parse('{!staticResourceFile}'); |
| | | function Fun(pdf){ |
| | | var form = jQuery("<form method='post'></form>"); |
| | | jQuery(document.body).append(form); |
| | | let href = window.location.href |
| | | let arr = href.split('/') |
| | | form.attr({"action":staticResourceFile.viewUnifiedContactUrl+"?from="+encodeURIComponent(href)+"&fileName="+encodeURIComponent(arr[arr.length-1].split('?')[0])}); |
| | | // 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(); |
| | | } |
| | | </script> |
| | | }; |
| | | recursion(rei); |
| | | |
| | | |
| | | |
| | | } |
| | | var staticResourceFile = JSON.parse('{!staticResourceFile}'); |
| | | function Fun(pdf) { |
| | | |
| | | var form = jQuery("<form method='post'></form>"); |
| | | jQuery(document.body).append(form); |
| | | let href = window.location.href |
| | | let arr = href.split('/') |
| | | form.attr({ "action": staticResourceFile.viewUnifiedContactUrl + "?from=" + encodeURIComponent(href) + "&fileName=" + encodeURIComponent(arr[arr.length - 1].split('?')[0]) }); |
| | | // 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"/>') |
| | | |
| | | } |
| | | </script> |
| | | |
| | | </html> |
| | | </apex:page> |
| | |
| | | var staticResourceFile = JSON.parse('{!staticResourceFile}'); |
| | | function Fun(pdf){ |
| | | |
| | | var form = jQuery("<form method='post'></form>"); |
| | | jQuery(document.body).append(form); |
| | | let href = window.location.href |
| | | let arr = href.split('/') |
| | | form.attr({"action":staticResourceFile.viewUnifiedContactUrl+"?from="+encodeURIComponent(href)+"&fileName="+encodeURIComponent(arr[arr.length-1].split('?')[0])}); |
| | | // 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(); |
| | | // var form = jQuery("<form method='post'></form>"); |
| | | // jQuery(document.body).append(form); |
| | | // let href = window.location.href |
| | | // let arr = href.split('/') |
| | | // form.attr({"action":staticResourceFile.viewUnifiedContactUrl+"?from="+encodeURIComponent(href)+"&fileName="+encodeURIComponent(arr[arr.length-1].split('?')[0])}); |
| | | // // 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"/>') |
| | | 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"/>') |
| | | |
| | | } |
| | | |
| | |
| | | payloadJson.AWS_Data_Id__c = '{!AWSDataId}'; |
| | | if (isNewMode || {!isCloneMode}) { |
| | | payloadJson.AWS_Data_Id__c = r.object[0].dataId; |
| | | delete payloadJson.OwnerId; |
| | | } else { |
| | | payloadJson.AWS_Data_Id__c = '{!AWSDataId}'; |
| | | } |
| | |
| | | payloadJson.AWS_Data_Id__c = '{!AWSDataId}'; |
| | | if (isNewMode || {!isCloneMode}) { |
| | | payloadJson.AWS_Data_Id__c = r.object[0].dataId; |
| | | delete payloadJson.OwnerId; |
| | | } else { |
| | | payloadJson.AWS_Data_Id__c = '{!AWSDataId}'; |
| | | } |
| | |
| | | payloadJson.AWS_Data_Id__c = '{!AWSDataId}'; |
| | | if (isNewMode || {!isCloneMode}) { |
| | | payloadJson.AWS_Data_Id__c = r.object[0].dataId; |
| | | delete payloadJson.OwnerId; |
| | | } else { |
| | | payloadJson.AWS_Data_Id__c = '{!AWSDataId}'; |
| | | } |
| | |
| | | } |
| | | |
| | | var staticResources = JSON.parse('{!staticResource}'); |
| | | var staticResourceAWSContact = JSON.parse('{!staticResourceAWSContact}'); |
| | | |
| | | var requiredFieldAPIList = JSON.parse('{!requiredFieldAPIListStr}'); |
| | | var fieldAPIToLabelMap = JSON.parse('{!fieldAPIToLabelMapStr}'); |
| | | console.log('{!staticResource}'); |
| | |
| | | let contactsInfo = JSON.parse('{!LookUpOverrideFieldsMapJson}'); |
| | | let dataId = contactsInfo[sfId]; |
| | | |
| | | AWSService.query(staticResourcesContact.queryUrl,dataId,function(result){ |
| | | if(result.object){ |
| | | document.querySelector("[data-id='Contact__c']").value = result.object.lastName; |
| | | } |
| | | |
| | | },staticResources.token); |
| | | if(dataId){ |
| | | AWSService.query(staticResourceAWSContact.queryUrl,dataId,function(result){ |
| | | if(result.object){ |
| | | document.querySelector("[data-id='Contact__c']").value = result.object.lastName; |
| | | } |
| | | |
| | | },staticResources.token); |
| | | } |
| | | |
| | | } |
| | | |
| | | </script> |
| | |
| | | //判断insert or update |
| | | function ProcessPI(caseJson, payloadForNewPI) { |
| | | blockme(); |
| | | if ({!isNewMode}) { |
| | | if ({!isNewMode} || {!isCloneMode}) { |
| | | NewPIToAWS(caseJson, payloadForNewPI) |
| | | }else { |
| | | UpdatePIToAWS(caseJson, payloadForNewPI) |
| | |
| | | console.log(nodelist[index].id.indexOf('lkwgt')); |
| | | if (nodelist[index].id.indexOf('lkwgt') == -1) { |
| | | let vlookUpNodeId = nodelist[index].id + '_lkid'; |
| | | if (nodelist[index].getAttribute("data-id") == 'Field1_staff__c') { |
| | | vlookUpNodeId = nodelist[index].id.substring(0,nodelist[index].id.length-4) + '_lkid'; |
| | | } |
| | | let vlookUpNodeValue = document.getElementById(vlookUpNodeId).value; |
| | | result[nodelist[index].getAttribute("data-id")] = vlookUpNodeValue; |
| | | } |
| | |
| | | index++; |
| | | } |
| | | } |
| | | //针对id的手动添加 |
| | | if (document.getElementById("page:form:block:j_id31:0:j_id32:j_id33:1:j_id34_lkid") && (!result.hasOwnProperty("Field1_staff__c") || !result["Field1_staff__c"])){ |
| | | if(document.getElementById("page:form:block:j_id31:0:j_id32:j_id33:1:j_id34_lkid").value != '000000000000000'){ |
| | | result["Field1_staff__c"] = document.getElementById("page:form:block:j_id31:0:j_id32:j_id33:1:j_id34_lkid").value; |
| | | } |
| | | } |
| | | |
| | | return result; |
| | | } |
| | |
| | | //需要解密字段 |
| | | var queryBack = function queryBack(data) { |
| | | console.log('data = ' + data); |
| | | document.querySelector("[data-id='cic_telephone__c']").value = data.object.cicTelephone; |
| | | document.querySelector("[data-id='CASE_CUSTOMER__c']").value = data.object.caseCustomer; |
| | | document.querySelector("[data-id='Customer_manual__c']").value = data.object.customerManual; |
| | | if (document.querySelector("[data-id='cic_telephone__c']")) { |
| | | document.querySelector("[data-id='cic_telephone__c']").value = data.object.cicTelephone; |
| | | } |
| | | if (document.querySelector("[data-id='CASE_CUSTOMER__c']")) { |
| | | document.querySelector("[data-id='CASE_CUSTOMER__c']").value = data.object.caseCustomer; |
| | | } |
| | | if (document.querySelector("[data-id='Customer_manual__c']")) { |
| | | document.querySelector("[data-id='Customer_manual__c']").value = data.object.customerManual; |
| | | } |
| | | }; |
| | | |
| | | var insertOrUpdateBack = function insertOrUpdateBack(payloadJson, result, isNewMode) { |
| | |
| | | payloadJson.Customer_manual_Encrypted__c = r.object[0].customerManualEncrypt; |
| | | //payloadJson.AWS_Data_Id__c = r.object[0].dataId; |
| | | payloadJson.AWS_Data_Id__c = '{!AWSDataId}'; |
| | | if (isNewMode) { |
| | | if (isNewMode || {!isCloneMode}) { |
| | | payloadJson.AWS_Data_Id__c = r.object[0].dataId; |
| | | } else { |
| | | payloadJson.AWS_Data_Id__c = '{!AWSDataId}'; |
| | |
| | | //1. Get Case Information from Form |
| | | let caseJson = getCaseInformation(); |
| | | //2. Validate the Case field value formate, for example the email formate or phone formate |
| | | /* |
| | | let validationResultMessage = validateFieldValueFormate(); |
| | | console.log(validationResultMessage); |
| | | if (!validationResultMessage) { |
| | |
| | | alertErrorMessage('手机格式输入有误,请重新输入!'); |
| | | return |
| | | } |
| | | */ |
| | | // Check Required Field |
| | | let checkRequiredFieldMsgResult = checkRequiredFieldMsg(caseJson); |
| | | if (checkRequiredFieldMsgResult) { |
| | |
| | | payloadJson.AWS_Data_Id__c = '{!AWSDataId}'; |
| | | if (isNewMode || {!isCloneMode}) { |
| | | payloadJson.AWS_Data_Id__c = r.object[0].dataId; |
| | | delete payloadJson.OwnerId; |
| | | } else { |
| | | payloadJson.AWS_Data_Id__c = '{!AWSDataId}'; |
| | | } |
| | |
| | | payloadJson.AWS_Data_Id__c = '{!AWSDataId}'; |
| | | if (isNewMode || {!isCloneMode}) { |
| | | payloadJson.AWS_Data_Id__c = r.object[0].dataId; |
| | | delete payloadJson.OwnerId; |
| | | } else { |
| | | payloadJson.AWS_Data_Id__c = '{!AWSDataId}'; |
| | | } |
| | |
| | | } else if (ele.type == 'checkbox') { |
| | | result[field_api_name] = ele.checked; |
| | | } else if (ele.type == 'select-multiple') { |
| | | //field_api_name |
| | | let multiple = field_api_name; |
| | | let targets = ""; |
| | | //InquiryForm特殊处理 |
| | | if(multiple == "Product1__c"){ |
| | | targets = GetEleByClass(config.ApiPrefix+'_'+field_api_name).parentNode.children[1].rows[1].cells[2].innerText; |
| | | }else if(multiple == "Request1__c"){ |
| | | targets = GetEleByClass(config.ApiPrefix+'_'+field_api_name).parentNode.children[2].rows[1].cells[2].innerText; |
| | | }else{ |
| | | targets = GetEleByClass(config.ApiPrefix+'_'+field_api_name).parentNode.children[1].children[0].children[1].children[2].children[0].innerText; |
| | | //After Update By zhj 20220411 Start |
| | | let multiple = nodelist[index].getAttribute("data-id"); |
| | | let targets = document.querySelector("[data-id=" + multiple + "]").options; |
| | | let selValues = []; |
| | | for(i=0; i < targets.length; i++){ |
| | | if(targets[i].selected){ |
| | | selValues.push(targets[i].value); |
| | | } |
| | | } |
| | | targets = targets.replace(/\n/g, ";"); |
| | | console.log('targets = ' + targets); |
| | | result[field_api_name] = targets; |
| | | let setValuesStr = JSON.stringify(selValues); |
| | | setValuesStr = setValuesStr.substring(1,setValuesStr.length-1); |
| | | if(setValuesStr){ |
| | | setValuesStr = setValuesStr.replace(/"/g,""); |
| | | if(setValuesStr.indexOf(',')!=-1){ |
| | | setValuesStr = setValuesStr.replace(/,/g,";"); |
| | | } |
| | | } |
| | | console.log('targets = ' + setValuesStr); |
| | | result[nodelist[index].getAttribute("data-id")] = setValuesStr; |
| | | //After Update By zhj 20220411 end |
| | | } else { |
| | | result[field_api_name] = ele.value; |
| | | } |
| | |
| | | payloadJson.AWS_Data_Id__c = '{!AWSDataId}'; |
| | | if (isNewMode || {!isCloneMode}) { |
| | | payloadJson.AWS_Data_Id__c = r.object[0].dataId; |
| | | delete payloadJson.OwnerId; |
| | | } else { |
| | | payloadJson.AWS_Data_Id__c = '{!AWSDataId}'; |
| | | } |
| | |
| | | |
| | | return error_msg; |
| | | } |
| | | |
| | | function getCKEinstance(api_name){ |
| | | let t = jQuery("label[for$='textAreaDelegate_"+api_name+"']").parent().next().find("textarea")[0]; |
| | | if(t && t.id){ |
| | | return CKEDITOR.instances[t.id] |
| | | |
| | | } |
| | | return null; |
| | | } |
| | | function getSobjectInformation() { |
| | | |
| | | let nodelist = document.getElementsByClassName(config.ApiPrefix); |
| | |
| | | } |
| | | //赋值富文本区域 |
| | | //科室负责人签字 |
| | | 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 |
| | | |
| | | if(getCKEinstance('ResponsiblePerson_Sign__c')){ |
| | | result.ResponsiblePerson_Sign__c = getCKEinstance('ResponsiblePerson_Sign__c').getData() |
| | | } |
| | | if(document.querySelector("[data-id='Reporter__c']")){ |
| | | result['Reporter__c'] = document.getElementById(document.querySelector("[data-id='Reporter__c']").children[7].children[0].id + '_lkid').value; |
| | |
| | | } else if (nodelist[index].type == 'checkbox') { |
| | | result[nodelist[index].getAttribute("data-id")] = nodelist[index].checked; |
| | | } else if (nodelist[index].type == 'select-multiple') { |
| | | //nodelist[index].getAttribute("data-id") |
| | | //After Update By zhj 20220411 Start |
| | | let multiple = nodelist[index].getAttribute("data-id"); |
| | | let targets = document.querySelector("[data-id=" + multiple + "]").parentNode.children[1].children[0].children[1].children[2].children[0].innerText; |
| | | targets = targets.replace(/\n/g, ";"); |
| | | console.log('targets = ' + targets); |
| | | result[nodelist[index].getAttribute("data-id")] = targets; |
| | | let targets = document.querySelector("[data-id=" + multiple + "]").options; |
| | | let selValues = []; |
| | | for(i=0; i < targets.length; i++){ |
| | | if(targets[i].selected){ |
| | | selValues.push(targets[i].value); |
| | | } |
| | | } |
| | | let setValuesStr = JSON.stringify(selValues); |
| | | setValuesStr = setValuesStr.substring(1,setValuesStr.length-1); |
| | | if(setValuesStr){ |
| | | setValuesStr = setValuesStr.replace(/"/g,""); |
| | | if(setValuesStr.indexOf(',')!=-1){ |
| | | setValuesStr = setValuesStr.replace(/,/g,";"); |
| | | } |
| | | } |
| | | console.log('targets = ' + setValuesStr); |
| | | result[nodelist[index].getAttribute("data-id")] = setValuesStr; |
| | | //After Update By zhj 20220411 end |
| | | } else { |
| | | result[nodelist[index].getAttribute("data-id")] = nodelist[index].value; |
| | | } |
| | |
| | | payloadJson.AWS_Data_Id__c = '{!AWSDataId}'; |
| | | if (isNewMode || {!isCloneMode}) { |
| | | payloadJson.AWS_Data_Id__c = r.object[0].dataId; |
| | | delete payloadJson.OwnerId; |
| | | } else { |
| | | payloadJson.AWS_Data_Id__c = '{!AWSDataId}'; |
| | | } |
| | |
| | | document.querySelector("[data-id='Status']").value = '未跟进' |
| | | //会议询问单 |
| | | if ('{!ifc.Id}') |
| | | document.getElementById('page:form:block:j_id34:0:j_id35:j_id36:15:j_id37_lkid').value = '{!ifc.Id}' |
| | | document.getElementById(document.querySelector("[data-id='Lead_Inquiry_form__c']").id+'_lkid').value = '{!ifc.Id}' |
| | | if ('{!ifc.Name}') |
| | | document.querySelector("[data-id='Lead_Inquiry_form__c']").value = '{!ifc.Name}' |
| | | //客户姓名 |
| | |
| | | document.getElementById(document.querySelector("[data-id='Contact_Name__c']").id + '_lkid').value = '{!ifc.Contact_Id__c}' |
| | | //医院 |
| | | if ('{!ifc.Hospital_Name__c}') |
| | | document.getElementById('page:form:block:j_id34:0:j_id35:j_id36:2:j_id37_lkold').value = '{!ifc.Hospital_Name__c}' |
| | | document.getElementById(document.querySelector("[data-id='Hospital_Name__c']").id+'_lkold').value = '{!ifc.Hospital_Name__c}' |
| | | if ('{!ifc.Hospital_ID__c}') |
| | | document.getElementById('page:form:block:j_id34:0:j_id35:j_id36:2:j_id37_lkid').value = '{!ifc.Hospital_ID__c}' |
| | | document.getElementById(document.querySelector("[data-id='Hospital_Name__c']").id+'_lkid').value = '{!ifc.Hospital_ID__c}' |
| | | //战略科室分类 |
| | | if ('{!ifc.Department_Class__c}') |
| | | document.getElementById('page:form:block:j_id34:0:j_id35:j_id36:4:j_id37_lkold').value = '{!ifc.Department_Class__c}' |
| | | document.getElementById(document.querySelector("[data-id='Department_Class__c']").id+'_lkold').value = '{!ifc.Department_Class__c}' |
| | | if ('{!ifc.Department_ID__c}') |
| | | document.getElementById('page:form:block:j_id34:0:j_id35:j_id36:4:j_id37_lkid').value = '{!ifc.Department_ID__c}' |
| | | document.getElementById(document.querySelector("[data-id='Department_Class__c']").id+'_lkid').value = '{!ifc.Department_ID__c}' |
| | | //已有询价名称 |
| | | if ('{!ifc.Opp_Name_Search__c}') |
| | | //document.getElementById('page:form:block:j_id34:0:j_id35:j_id36:12:j_id37_lkold').value = '{!ifc.Opp_Name_Search__c}' |
| | | document.getElementById(document.querySelector("[data-id='Opp_Name_Search__c']").id + '_lkold').value = '{!ifc.Opp_Name_Search__c}' |
| | | if ('{!ifc.Opp_Name_Search_ID__c}') |
| | | document.getElementById(document.querySelector("[data-id='Opp_Name_Search__c']").id + '_lkid').value = '{!ifc.Opp_Name_Search_ID__c}' |
| | | //主要学会 |
| | | if ('{!ifc.Campaign__c}') |
| | | document.getElementById('page:form:block:j_id34:1:j_id35:j_id36:3:j_id37_lkold').value = '{!ifc.Campaign__c}' |
| | | document.getElementById(document.querySelector("[data-id='Campaign__c']").id +'_lkold').value = '{!ifc.Campaign__c}' |
| | | if ('{!ifc.Campaign_ID__c}') |
| | | document.getElementById('page:form:block:j_id34:1:j_id35:j_id36:3:j_id37_lkid').value = '{!ifc.Campaign_ID__c}' |
| | | document.getElementById(document.querySelector("[data-id='Campaign__c']").id +'_lkid').value = '{!ifc.Campaign_ID__c}' |
| | | //取消原因 |
| | | if ('{!ifc.Cancel_Reason__c}') |
| | | document.querySelector("[data-id='Cancel_Reason__c']").value = '{!ifc.Cancel_Reason__c}' |
| | |
| | | payloadJson.AWS_Data_Id__c = '{!AWSDataId}'; |
| | | if (isNewMode || {!isCloneMode}) { |
| | | payloadJson.AWS_Data_Id__c = r.object[0].dataId; |
| | | delete payloadJson.OwnerId; |
| | | } else { |
| | | payloadJson.AWS_Data_Id__c = '{!AWSDataId}'; |
| | | } |
| | |
| | | result[nodelist[index].getAttribute("data-id")] = nodelist[index].checked; |
| | | } else if (nodelist[index].type == 'select-multiple') { |
| | | //nodelist[index].getAttribute("data-id") |
| | | let multiple = nodelist[index].getAttribute("data-id"); |
| | | //let targets = document.querySelector("[data-id=" + multiple + "]").nextSibling.children[0].children[1].children[2].innerText; |
| | | //Before Update By Li Jun 20220411 |
| | | // let targets = document.querySelector("[data-id=" + multiple + "]").parentNode.children[2].children[0].children[1].children[2].children[0].innerText; |
| | |
| | | //Before Update By Li Jun 20220411 |
| | | |
| | | //After Update By Li Jun 20220411 Start |
| | | let multiple = nodelist[index].getAttribute("data-id"); |
| | | let targets = document.querySelector("[data-id=" + multiple + "]").options; |
| | | let selValues = []; |
| | | for(i=0; i < targets.length; i++){ |
| | |
| | | payloadJson.sex_Encrypted__c = result.object[0].sexEncrypt; |
| | | if (isNewMode || {!isCloneMode}) { |
| | | payloadJson.AWS_Data_Id__c = result.object[0].dataId; |
| | | delete payloadJson.OwnerId; |
| | | } else { |
| | | payloadJson.AWS_Data_Id__c = '{!AWSDataId}'; |
| | | } |
| | |
| | | |
| | | <!--Each section has layoutFields, let's iterate them as well--> |
| | | <apex:repeat value="{!layoutSection.layoutFields}" var="layoutField"> |
| | | <apex:inputField html-data-id="{!layoutField.fieldAPI}" styleClass="{!layoutField.fieldAPI}" value="{!Report__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)}" |
| | | <apex:inputField html-title="{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" styleClass="{!layoutField.fieldAPI}" value="{!Report__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)}" |
| | | required="{!layoutField.isRequired}" /> |
| | | <apex:pageblocksectionitem rendered="{!layoutField.isPlaceHolder}"> |
| | | </apex:pageblocksectionitem> |
| | |
| | | payloadJson.AWS_Data_Id__c = '{!AWSDataId}'; |
| | | if (isNewMode || {!isCloneMode}) { |
| | | payloadJson.AWS_Data_Id__c = r.object[0].dataId; |
| | | delete payloadJson.OwnerId; |
| | | } else { |
| | | payloadJson.AWS_Data_Id__c = '{!AWSDataId}'; |
| | | } |
| | |
| | | payloadJson.AWS_Data_Id__c = '{!AWSDataId}'; |
| | | if (isNewMode || {!isCloneMode}) { |
| | | payloadJson.AWS_Data_Id__c = r.object[0].dataId; |
| | | delete payloadJson.OwnerId; |
| | | } else { |
| | | payloadJson.AWS_Data_Id__c = '{!AWSDataId}'; |
| | | } |
| | |
| | | <!-- |
| | | @description : |
| | | @author : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | @group : |
| | | @last modified on : 04-02-2022 |
| | | @last modified by : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | --> |
| | | <apex:page standardController="Consum_Apply_Equipment_Set_Detail__c" extensions="NewConsumApplyEquipSetDetailController" id="page"> |
| | | <apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }" /> |
| | | <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/> |
| | |
| | | payloadJson.Trial_User__c = r.object[0].trialUser; |
| | | payloadJson.Trial_User_Encrypt__c = r.object[0].trialUserEncrypt; |
| | | payloadJson.AWS_Data_Id__c = '{!AWSDataId}'; |
| | | if (isNewMode) { |
| | | if (isNewMode || {!isCloneMode}) { |
| | | payloadJson.AWS_Data_Id__c = r.object[0].dataId; |
| | | } else { |
| | | payloadJson.AWS_Data_Id__c = '{!AWSDataId}'; |
| | |
| | | // New Or Edit |
| | | function ProcessPI(consumApplyJson, payloadForNewPI) { |
| | | blockme(); |
| | | if ({!isNewMode |
| | | }) { |
| | | if ({!isNewMode} || {!isCloneMode}) { |
| | | NewPIToAWS(consumApplyJson, payloadForNewPI) |
| | | }else { |
| | | UpdatePIToAWS(consumApplyJson, payloadForNewPI) |
| | |
| | | <script> |
| | | //Append Page |
| | | sfdcPage.appendToOnloadQueue(function () { |
| | | //判断是否为只读选项 |
| | | var layoutSections = JSON.parse('{!layoutSectionsStr}'); |
| | | for (let m = 0; m < layoutSections.length; m++) { |
| | | let layoutSection = layoutSections[m].layoutFields; |
| | | for (let n = 0; n < layoutSection.length; n++) { |
| | | let layoutField = layoutSection[n]; |
| | | if (layoutField.fieldAPI != '' && document.querySelector("[data-id='"+layoutField.fieldAPI+"']") != null) { |
| | | document.querySelector("[data-id='"+layoutField.fieldAPI+"']").disabled = !(layoutField.editableField); |
| | | for (let m = 0; m < layoutSections.length; m++) { |
| | | let layoutSection = layoutSections[m].layoutFields; |
| | | for (let n = 0; n < layoutSection.length; n++) { |
| | | let layoutField = layoutSection[n]; |
| | | if (layoutField.fieldAPI != '' && document.querySelector("[data-id='"+layoutField.fieldAPI+"']") != null) { |
| | | 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"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | //2. Query AWS Data by dataId |
| | | console.log('Mode for consumApply Page:' + {!isNewMode}); |
| | | if (!{!isNewMode}) { |
| | |
| | | }; |
| | | document.querySelector("[data-id='OwnerId']").classList.add("disabledbutton"); |
| | | |
| | | jQuery(".lookupInput").each(function(i,e){ |
| | | let je =jQuery(e).find('input'); |
| | | je.attr("readonly",""); |
| | | je.css("background","unset"); |
| | | //zhj 2022/04/11 start |
| | | // jQuery(".lookupInput").each(function(i,e){ |
| | | // let je =jQuery(e).find('input'); |
| | | // je.attr("readonly",""); |
| | | // je.css("background","unset"); |
| | | |
| | | let dataid = je.attr('data-id'); |
| | | if(['Hospital_Name__c','Department_Class__c','OwnerId'].indexOf(dataid) > -1) return; |
| | | jQuery(e).children(":last-child").before('<img class="closeIcon" data-id="'+dataid+'" generate="" alt="Clear" src="/s.gif" style="display: inline-block;">'); |
| | | }) |
| | | // let dataid = je.attr('data-id'); |
| | | // if(['Hospital_Name__c','Department_Class__c','OwnerId'].indexOf(dataid) > -1) return; |
| | | // jQuery(e).children(":last-child").before('<img class="closeIcon" data-id="'+dataid+'" generate="" alt="Clear" src="/s.gif" style="display: inline-block;">'); |
| | | // }) |
| | | |
| | | jQuery(".lookupInput").on("mouseenter","img[generate]",function(e){ |
| | | this.className = "closeIconOn"; |
| | | }); |
| | | // jQuery(".lookupInput").on("mouseenter","img[generate]",function(e){ |
| | | // this.className = "closeIconOn"; |
| | | // }); |
| | | |
| | | jQuery(".lookupInput").on("mouseleave","img[generate]",function(e){ |
| | | this.className = "closeIcon" |
| | | }); |
| | | // jQuery(".lookupInput").on("mouseleave","img[generate]",function(e){ |
| | | // this.className = "closeIcon" |
| | | // }); |
| | | |
| | | jQuery(".lookupInput").on("click","img[generate]",function(e){ |
| | | let id = jQuery("input[data-id='"+jQuery(this).attr("data-id")+ "']").attr("id"); |
| | | let input = document.getElementById(id); |
| | | if(input){ |
| | | input.value = ''; |
| | | let hidden = document.getElementById(id+'_lkid'); |
| | | if(hidden){ |
| | | hidden.value = ''; |
| | | } |
| | | } |
| | | }); |
| | | |
| | | // jQuery(".lookupInput").on("click","img[generate]",function(e){ |
| | | // let id = jQuery("input[data-id='"+jQuery(this).attr("data-id")+ "']").attr("id"); |
| | | // let input = document.getElementById(id); |
| | | // if(input){ |
| | | // input.value = ''; |
| | | // let hidden = document.getElementById(id+'_lkid'); |
| | | // if(hidden){ |
| | | // hidden.value = ''; |
| | | // } |
| | | // } |
| | | // }); |
| | | //zhj 2022/04/11 end |
| | | }); |
| | | </script> |
| | | <div class="pbBottomButtons"> |
| | |
| | | payloadJson.AWS_Data_Id__c = '{!AWSDataId}'; |
| | | if (isNewMode|| {!isCloneMode}) { |
| | | payloadJson.AWS_Data_Id__c = r.object[0].dataId; |
| | | delete payloadJson.OwnerId; |
| | | } else { |
| | | payloadJson.AWS_Data_Id__c = '{!AWSDataId}'; |
| | | } |
| | |
| | | payloadJson.AWS_Data_Id__c = '{!AWSDataId}'; |
| | | if (isNewMode || {!isCloneMode}) { |
| | | payloadJson.AWS_Data_Id__c = r.object[0].dataId; |
| | | delete payloadJson.OwnerId; |
| | | } else { |
| | | payloadJson.AWS_Data_Id__c = '{!AWSDataId}'; |
| | | } |
| | |
| | | //page:form:block:j_id34:17:j_id35:j_id36:2:j_id37 |
| | | //page:form:block:j_id34:17:j_id35:j_id36:2:j_id37 |
| | | if(document.getElementById('page:form:block:j_id34:17:j_id35:j_id36:2:j_id37')){ |
| | | result.Return_Without_Repair_Reason__c = document.getElementById('page:form:block:j_id34:17:j_id35:j_id36:2:j_id37').value; |
| | | result.Return_Without_Repair_Reason__c = document.getElementById('page:form:block:j_id34:17:j_id35:j_id36:2:j_id37').value=='_\x01_'?'':document.getElementById('page:form:block:j_id34:17:j_id35:j_id36:2:j_id37').value; |
| | | } |
| | | console.log(JSON.stringify(result)); |
| | | return result; |
| | |
| | | for (let i = 0; i < divs.length; i++) { |
| | | for (let j = 0; j < divs[i].classList.length; j++) { |
| | | for(let clsi in divs[i].classList){let cls=divs[i].classList[clsi]; |
| | | if (cls.indexOf('error')>-1) { |
| | | if (typeof cls == 'string' && cls.indexOf('error')>-1) { |
| | | return true; |
| | | } |
| | | } |
| | |
| | | /* 20220221 PI改造 by 徐亮 start */ |
| | | body{margin: 0 auto; |
| | | width: 780px;} |
| | | #title1{height: 30px;} |
| | | #title2{height: 110px;} |
| | | .title1{height: 30px;} |
| | | .title2{height: 110px;} |
| | | /* 20220221 PI改造 by 徐亮 end */ |
| | | |
| | | |
| | |
| | | |
| | | <body style="font-family: MS Gothic;"> |
| | | <div id="pdf-wrapper"> |
| | | <div id="title1"></div> |
| | | <div class="pdf-page"> |
| | | |
| | | <table width="100%" border="0"> |
| | | <tr> |
| | | <td width="25%"> |
| | |
| | | </tr> |
| | | </table> |
| | | |
| | | <div style="page-break-after: always;"></div> |
| | | |
| | | <div id="title2"></div> |
| | | </div> |
| | | <div style="page-break-after: always;"></div> |
| | | <div class="pdf-page"> |
| | | |
| | | <table width="100%" border="0"> |
| | | <tr> |
| | | <td width="25%"> |
| | |
| | | <br/> |
| | | <table width="100%" border="1" cellspacing="2" style="font-size: 8pt;"> |
| | | <tr> |
| | | <td> |
| | | <table width="100%" border="1" cellspacing="0"> |
| | | <tr><td style="height:300px; text-align: center;"><apex:image value="{!qr.Photo_1_Text__c}" width="80%" rendered="{!NOT(ISBLANK(qr.Photo_1_Text__c))}" /></td></tr> |
| | | <td style="width:50%"> |
| | | <table width="100%" border="0" cellspacing="0"> |
| | | <tr><td style="height:300px; text-align: center;"><apex:image id="Photo_1_Text" value="{!Photo_1_Text}" width="80%" rendered="{!NOT(ISBLANK(qr.Photo_1_Text__c))}" /></td></tr> |
| | | <tr><td style="height:40px;"></td></tr> |
| | | </table> |
| | | </td> |
| | | <td style="border-left-color: white;"> |
| | | <table width="100%" border="1" cellspacing="0"> |
| | | <tr><td style="height:300px; text-align: center;"><apex:image value="{!qr.Photo_2_Text__c}" width="80%" rendered="{!NOT(ISBLANK(qr.Photo_2_Text__c))}" /></td></tr> |
| | | <table width="100%" border="0" cellspacing="0"> |
| | | <tr><td style="height:300px; text-align: center;"><apex:image value="{!Photo_2_Text}" width="80%" rendered="{!NOT(ISBLANK(qr.Photo_2_Text__c))}" /></td></tr> |
| | | <tr><td style="height:40px;"></td></tr> |
| | | </table> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td style="border-top-color: white;"> |
| | | <table width="100%" border="1" cellspacing="0"> |
| | | <tr><td style="height:300px; text-align: center;"><apex:image value="{!qr.Photo_3_Text__c}" width="80%" rendered="{!NOT(ISBLANK(qr.Photo_3_Text__c))}" /></td></tr> |
| | | <table width="100%" border="0" cellspacing="0"> |
| | | <tr><td style="height:300px; text-align: center;"><apex:image value="{!Photo_3_Text}" width="80%" rendered="{!NOT(ISBLANK(qr.Photo_3_Text__c))}" /></td></tr> |
| | | <tr><td style="height:40px;"></td></tr> |
| | | </table> |
| | | </td> |
| | | <td style="border-left-color: white; border-top-color: white;"> |
| | | <table width="100%" border="1" cellspacing="0"> |
| | | <tr><td style="height:300px; text-align: center;"><apex:image value="{!qr.Photo_4_Text__c}" width="80%" rendered="{!NOT(ISBLANK(qr.Photo_4_Text__c))}" /></td></tr> |
| | | <table width="100%" border="0" cellspacing="0"> |
| | | <tr><td style="height:300px; text-align: center;"><apex:image value="{!Photo_4_Text}" width="80%" rendered="{!NOT(ISBLANK(qr.Photo_4_Text__c))}" /></td></tr> |
| | | <tr><td style="height:40px;"></td></tr> |
| | | </table> |
| | | </td> |
| | | </tr> |
| | | </table> |
| | | </div> |
| | | |
| | | </div> |
| | | </body> |
| | | |
| | |
| | | AWSService.sfSessionId = '{!GETSESSIONID()}'; |
| | | var staticResources = JSON.parse('{!staticResource}'); |
| | | var staticResourceFile = JSON.parse('{!staticResourceFile}'); |
| | | function Fun(pdf){ |
| | | function Fun(pdf) { |
| | | |
| | | var form = jQuery("<form method='post'></form>"); |
| | | jQuery(document.body).append(form); |
| | | let href = window.location.href |
| | | let arr = href.split('/') |
| | | form.attr({"action":staticResourceFile.viewUnifiedContactUrl+"?from="+encodeURIComponent(href)+"&fileName="+encodeURIComponent(arr[arr.length-1].split('?')[0])}); |
| | | form.attr({ "action": staticResourceFile.viewUnifiedContactUrl + "?from=" + encodeURIComponent(href) + "&fileName=" + encodeURIComponent(arr[arr.length - 1].split('?')[0]) }); |
| | | // 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.attr({ "name": "base64Str" }); |
| | | input.val(pdf.output('datauristring').substr(28)); |
| | | form.append(input); |
| | | form.submit(); |
| | |
| | | |
| | | 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; |
| | | |
| | | //一页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 |
| | | |
| | | var pageData = canvas.toDataURL('image/jpeg', 1.0); |
| | | |
| | | var pdf = new jsPDF('', 'pt', 'a4'); |
| | | |
| | | //有两个高度需要区分,一个是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(); |
| | | } |
| | | } |
| | | } |
| | | Fun(pdf); |
| | | } |
| | | }) |
| | | } |
| | | // 把imageDta转换成url |
| | | // page_height:一页的高度 |
| | | function ImageDataToUrl(img_data,page_height){ |
| | | let cvs = document.createElement("CANVAS"); |
| | | cvs.width = img_data.width; |
| | | cvs.height = page_height; |
| | | var ctx= cvs.getContext("2d"); |
| | | ctx.fillStyle="white"; |
| | | ctx.fillRect(0,0,cvs.width,cvs.height);// 填充canvas所有区域为白色 |
| | | ctx.putImageData(img_data,0,0); |
| | | return cvs.toDataURL('image/jpeg', 1.0); |
| | | } |
| | | function jsPdfDownload() { |
| | | |
| | | //blockme(); |
| | | document.body.onload = function(){ |
| | | |
| | | AWSService.query(staticResources.queryUrl, '{!qr.AWS_Data_Id__c}', function(data){ |
| | | //unblockUI(); |
| | | document.getElementById("Responsible_Person_HP__c").innerHTML = data.object.responsiblePersonHP; |
| | | document.getElementById("Caller_phone__c").innerHTML = data.object.callerPhone; |
| | | 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; |
| | | const marginh = 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"; |
| | | }) |
| | | |
| | | 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) { |
| | | /** |
| | | 本方法需要做几个事情 |
| | | 1.需要把canvas的内容分页显示到pdf的页中 |
| | | 2.canvas的宽高需要和pdf的宽高进行映射 |
| | | 3.截取到的内容需要放进一页宽高的canvas里面,并对其余区域刷白 |
| | | */ |
| | | var ctx = canvas.getContext("2d"); |
| | | let canvas_max_page_num = 9; |
| | | let canvas_current_page_num = 0; |
| | | var contentWidth = canvas.width; |
| | | var contentHeight = canvas.height; |
| | | |
| | | |
| | | //未生成pdf的html页面高度 |
| | | var leftHeight = contentHeight; |
| | | //页面偏移 |
| | | var position = 0; |
| | | |
| | | //a4纸的尺寸[595.28,841.89],html页面生成的canvas在pdf中图片的宽高 |
| | | var outputWidth = pw - 2 * marginw;//595.28//左右边距20 |
| | | let rate = outputWidth / 780;//输出宽度和内容宽度的比例 |
| | | var outputHeight = ph - 2 * marginh;//左右边距20 |
| | | let onePdfPageInCanvasHeight = contentWidth/outputWidth*outputHeight;//一页pdf在canvas中的高度; |
| | | //var pageData = canvas.toDataURL('image/jpeg', 1.0); |
| | | var pageData = null; |
| | | var imgData = null; |
| | | |
| | | var captureHeight = null;// 截取的当前canvas页的高度 |
| | | |
| | | let j = i; |
| | | while(position < contentHeight){ |
| | | |
| | | if (j++) { |
| | | pdf.addPage(); |
| | | } |
| | | |
| | | if(position+onePdfPageInCanvasHeight>contentHeight){ |
| | | captureHeight = contentHeight-position; |
| | | }else{ |
| | | captureHeight = onePdfPageInCanvasHeight; |
| | | } |
| | | |
| | | imgData = ctx.getImageData(0,position,contentWidth,captureHeight); |
| | | pageData = ImageDataToUrl(imgData,onePdfPageInCanvasHeight); |
| | | pdf.addImage(pageData, 'JPEG', marginw, marginh, outputWidth, outputHeight);//左右边距20,被输出的图片会被拉伸为outputWidth,outputHeight的宽高 |
| | | canvas_current_page_num++; |
| | | position += onePdfPageInCanvasHeight; |
| | | if (canvas_max_page_num > 0 && canvas_current_page_num >= canvas_max_page_num) { |
| | | break; |
| | | } |
| | | } |
| | | |
| | | recursion(i + 1); |
| | | } |
| | | }) |
| | | }; |
| | | recursion(rei); |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | //blockme(); |
| | | document.body.onload = function(){ |
| | | |
| | | jsPdfDownload(); |
| | | }, staticResources.token); |
| | | AWSService.query(staticResources.queryUrl, '{!qr.AWS_Data_Id__c}', function(data){ |
| | | //unblockUI(); |
| | | document.getElementById("Responsible_Person_HP__c").innerHTML = data.object.responsiblePersonHP; |
| | | document.getElementById("Caller_phone__c").innerHTML = data.object.callerPhone; |
| | | if(confirm("PDF已加载完毕,是否显示?")){ |
| | | jsPdfDownload(); |
| | | } |
| | | }, staticResources.token); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | </script> |
| | | <!-- 20220221 PI改造 by 徐亮 end --> |
| | | </html> |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | function showPITR(obj){ |
| | | var awsDataId = obj.childNodes[1].childNodes[2].value; |
| | | if(awsDataId.length == 1){ |
| | | let sfId = j$(escapeVfId('Page:mainForm:idSearchVisitor:idAddVisitor:' + awsDataId + ':idAddHiddenId')).val() |
| | | awsDataId = sfIdToAWSIdMapValue.get(sfId); |
| | | } |
| | | if(contactInfo[awsDataId]){ |
| | | document.getElementById(obj.childNodes[1].childNodes[0].id).innerText = contactInfo[awsDataId].lastName; |
| | | document.getElementById(obj.childNodes[3].childNodes[0].id).innerText = contactInfo[awsDataId].doctorDivision1; |
| | | document.getElementById(obj.childNodes[4].childNodes[0].id).innerText = contactInfo[awsDataId].phone; |
| | | } |
| | | } |
| | | |
| | | function hidePIDiv(obj){ |
| | | document.getElementById(obj.id+'_PI').remove(); |
| | | } |
| | |
| | | <tr> |
| | | <td> |
| | | <div id="iframelike"> |
| | | <apex:pageBlockTable id="idRezultVisitor" value="{!scwl}" var="scw" border="1" columns="8" columnsWidth="47px,90px,,90px,180x,90px,40px,200px"> |
| | | <apex:pageBlockTable id="idRezultVisitor" value="{!scwl}" var="scw" onRowMouseOver="showPITR(this)" border="1" columns="8" columnsWidth="47px,90px,,90px,180x,90px,40px,200px"> |
| | | <apex:column > |
| | | <apex:facet name="header">{!$Label.Selected}</apex:facet> |
| | | <input type="button" id="idSlt" value="{!$Label.Selected}" onclick="sltContact('{!scw.index}');" class="btn" style="width:40px"/> |
| | |
| | | <apex:facet name="header">{!$Label.Visitor_Name}</apex:facet> |
| | | <apex:outputLink onmouseover="showPIDiv('{!scw.con.AWS_Data_Id__c}',this)" onmouseout="hidePIDiv(this)" value="/{!scw.con.Id}" id="idName" target="_blank">{!scw.con.Name}</apex:outputLink> |
| | | <apex:inputText id="idHiddenId" value="{!scw.conid}" style="display:none" /> |
| | | <apex:inputText id="AWSDataId" value="{!scw.con.AWS_Data_Id__c}" style="display:none" /> |
| | | </apex:column> |
| | | <apex:column > |
| | | <apex:facet name="header">{!$Label.Department_Name}</apex:facet> |
| | |
| | | <tr> |
| | | <td> |
| | | <div id="iframelike2"> |
| | | <apex:pageBlockTable id="idAddVisitor" value="{!acwl}" var="acw" border="1" columns="7" columnsWidth="47px,90px,,90px,180x,90px,40px"> |
| | | <apex:pageBlockTable id="idAddVisitor" value="{!acwl}" var="acw" border="1" columns="7" onRowMouseOver="showPITR(this)" columnsWidth="47px,90px,,90px,180x,90px,40px"> |
| | | <apex:column > |
| | | <apex:facet name="header">{!$Label.Back}</apex:facet> |
| | | <input type="button" id="idDel" value="{!$Label.Back}" onclick="delContact('{!acw.index}');" class="btn" style="width:40px"/> |
| | |
| | | <!-- <apex:outputText id="idAddName" value="{!IF(acw.con.Name==null,' ',acw.con.Name)}" /> --> |
| | | <apex:outputLink onmouseover="showPIDiv('{!acw.index}',this)" onmouseout="hidePIDiv(this)" value="/{!acw.conid}" id="idAddName" target="_blank">{!IF(acw.con.Name==null,' ',acw.con.Name)}</apex:outputLink> |
| | | <apex:inputText id="idAddHiddenId" value="{!acw.conid}" style="display:none" /> |
| | | <apex:inputText id="AWSDataId" value="{!acw.index}" style="display:none" /> |
| | | </apex:column> |
| | | <apex:column > |
| | | <apex:facet name="header">{!$Label.Department_Name}</apex:facet> |
| | |
| | | rc.address_ZipCode__c=addressAwsData[address.AWS_Data_Id__c].zipCode; |
| | | } |
| | | |
| | | let GetAsset = function(){ |
| | | let ast = new sforce.SObject('Asset'); |
| | | ast.Id = '{!pc.Delivered_Product__c}', |
| | | ast.address_Contacts__c= contactsName, |
| | | ast.address_ZipCode__c = address.ZipCode__c, |
| | | ast.address_City__c = cityName, |
| | | ast.address_Telephone__c = address.Telephone__c, |
| | | ast.address_Contacts_Name__c = ContactPerson, |
| | | ast.Detailed_Address__c= address_str |
| | | if (addressAwsData.hasOwnProperty(address.AWS_Data_Id__c)) { |
| | | ast.address_ZipCode__c=addressAwsData[address.AWS_Data_Id__c].zipCode; |
| | | ast.address_Telephone__c=addressAwsData[address.AWS_Data_Id__c].telephone; |
| | | } |
| | | return ast; |
| | | } |
| | | |
| | | //保存数据到保有设备表中 |
| | | let UpdateAsset = function(){ |
| | | let ast = GetAsset(); |
| | | let result = sforce.connection.update([ast]); |
| | | let b = result[0].getBoolean('success'); |
| | | return b; |
| | | } |
| | | |
| | | let UpdateRepair = function(callback){ |
| | | AWSService.post(staticResourceRepair.updateUrl,[{ |
| | | dataId:'{!pc.AWS_Data_Id__c}', |
| | |
| | | rc.Detailed_Address__c = data.object[0].detailedAddress; |
| | | rc.Detailed_Address_Encrypt__c = data.object[0].detailedAddressEncrypt; |
| | | |
| | | UpdateSobject(staticResourceRepair,rc,data.txId,callback); |
| | | //UpdateSobject(staticResourceRepair,rc,data.txId,callback); |
| | | Visualforce.remoting.Manager.invokeAction( |
| | | 'StraightBackAddressController.SaveEx', |
| | | JSON.stringify(rc), JSON.stringify(GetAsset()), address.Id, |
| | | function (result, event) { |
| | | |
| | | let message = ''; |
| | | if (event.status) { |
| | | if (result) { |
| | | message = result; |
| | | }else{ |
| | | } |
| | | }else{ |
| | | } |
| | | let tobj = { |
| | | txId: data.txId |
| | | }; |
| | | if(message) { |
| | | console.log('call sf to insert log'); |
| | | tobj.isSuccess = 0; |
| | | }else { |
| | | console.log('call sf Log Id: ' + rc.id); |
| | | tobj.sfRecordId = rc.id; |
| | | tobj.isSuccess = 1; |
| | | } |
| | | |
| | | AWSService.post(staticResource.transactionUrl,tobj,function(data){ |
| | | if (message) { |
| | | ub(); |
| | | alert(message); |
| | | }else{ |
| | | window.location.href = '/{!RepairId}'; |
| | | } |
| | | },staticResource.token); |
| | | }, |
| | | { escape: true } |
| | | ); |
| | | }else{ |
| | | alert('AWS更新修理失败'); |
| | | ub(); |
| | |
| | | },staticResourceRepair.token) |
| | | } |
| | | |
| | | //保存数据到保有设备表中 |
| | | let UpdateAsset = function(){ |
| | | let ast = new sforce.SObject('Asset'); |
| | | ast.Id = '{!pc.Delivered_Product__c}', |
| | | ast.address_Contacts__c= contactsName, |
| | | ast.address_ZipCode__c = address.ZipCode__c, |
| | | ast.address_City__c = cityName, |
| | | ast.address_Telephone__c = address.Telephone__c, |
| | | ast.address_Contacts_Name__c = ContactPerson, |
| | | ast.Detailed_Address__c= address_str |
| | | if (addressAwsData.hasOwnProperty(address.AWS_Data_Id__c)) { |
| | | ast.address_ZipCode__c=addressAwsData[address.AWS_Data_Id__c].zipCode; |
| | | ast.address_Telephone__c=addressAwsData[address.AWS_Data_Id__c].telephone; |
| | | } |
| | | let result = sforce.connection.update([ast]); |
| | | let b = result[0].getBoolean('success'); |
| | | return b; |
| | | } |
| | | |
| | | |
| | | |
| | | let UpdateAddress = function(){ |
| | |
| | | } |
| | | |
| | | b(); |
| | | UpdateRepair(); |
| | | /* |
| | | UpdateRepair(function(data){ |
| | | if (data.isSuccess) { |
| | | let b = UpdateAsset(); |
| | |
| | | ub(); |
| | | alert('SF更新修理失败'); |
| | | } |
| | | }) |
| | | })*/ |
| | | |
| | | //页面重定向 |
| | | //return redirectPag(); |
| | |
| | | <apex:param name="addressDataIds" assignTo="{!addressDataIds}" value=""></apex:param> |
| | | </apex:actionFunction> |
| | | <!-- 采用方法 --> |
| | | <apex:actionFunction name="adoptSave" action="{!adoptSave}" rerender="oppBlock2,message" onComplete="ub();"> |
| | | <!--<actionFunction name="adoptSave" action="{!adoptSave}" rerender="oppBlock2,message" onComplete="ub();"> |
| | | <apex:param name="adoptId" assignTo="{!adoptId}" value="" /> |
| | | <apex:param name="isUpload" assignTo="{!isUpload}" value="" /> |
| | | </apex:actionFunction> |
| | | </actionFunction>--> |
| | | <!-- 保存和修改方法 --> |
| | | <apex:actionFunction name="save" action="{!save}" rerender="oppBlock2,message" onComplete="ub();Trans()"></apex:actionFunction> |
| | | <!-- 点击修改按钮获取修改数据方法 --> |
| | |
| | | searchPayload.contactName = ''; |
| | | return JSON.stringify(searchPayload); |
| | | } |
| | | |
| | | function refreshContactAll(){ |
| | | let contactIdsFromSF = []; |
| | | // let allSizeForAct =document.getElementById('Page:mainForm:idDayEdit:AllSize').value; |
| | | let allSizeForAct = j$(escapeVfId('idActSize')).value(); |
| | | console.log('allSizeForAct:'+allSizeForAct); |
| | | for(let i=0;i<allSizeForAct;i++){ |
| | | for(let j=1;j<6;j++){ |
| | | let contactIdForVis = document.getElementById("Page:mainForm:idDayEdit:idActivities:"+i+":idVisitor"+j+"_IdHidden").value; |
| | | contactIdsFromSF.push(contactIdForVis); |
| | | } |
| | | }; |
| | | sforce.connection.sessionId = '{!GETSESSIONID()}'; |
| | | var condition = ''; |
| | | for(var i=0;i<contactIdsFromSF.length;i++){ |
| | | if(contactIdsFromSF[i] != ''){ |
| | | condition += "," + "\'"+contactIdsFromSF[i]+"\'"; |
| | | } |
| | | } |
| | | condition = condition.substr(1); |
| | | console.log('condition = ' + condition); |
| | | var record = sforce.connection.query("select AWS_Data_Id__c from Contact where id in("+condition+")"); |
| | | var records = record.getArray("records"); |
| | | for(var i =0;i<records.length;i++){ |
| | | contactAWSIds.push(records[i].AWS_Data_Id__c); |
| | | } |
| | | searchContactAll(); |
| | | } |
| | | function searchContactAll(){ |
| | | let data = preparePayloadForSearchContact(); |
| | | let searchCallBack = function searchCallBack(result){ |
| | |
| | | } |
| | | } |
| | | console.log('AWS Result:'+JSON.stringify(sfIdToContactInfo)); |
| | | let allSizeForAct =document.getElementById('Page:mainForm:idDayEdit:AllSize').value; |
| | | // let allSizeForAct =document.getElementById('Page:mainForm:idDayEdit:AllSize').value; |
| | | let allSizeForAct = j$(escapeVfId('idActSize')).value(); |
| | | console.log('Act size:'+allSizeForAct); |
| | | for(let i=0;i<allSizeForAct;i++){ |
| | | for(let j=1;j<6;j++){ |
| | |
| | | if(sfIdToContactInfo.hasOwnProperty(contactIdForVis)){ |
| | | document.getElementById("Page:mainForm:idDayEdit:idActivities:"+i+":idVisitor"+j).value = sfIdToContactInfo[contactIdForVis].lastName; |
| | | } |
| | | } |
| | | }else{ |
| | | document.getElementById("Page:mainForm:idDayEdit:idActivities:"+i+":idVisitor"+j).value = ''; |
| | | } |
| | | } |
| | | } |
| | | }; |
| | |
| | | <td> </td> |
| | | <td><apex:commandButton value="{!$Label.Add_Line}" id="idAddAct" action="{!addActivity}" |
| | | reRender="Activities,idAddActPanel" onClick="blockme();" |
| | | onComplete="bindAllDoubleTap();setVisitorPlaceDisabled();unblockUI();initSetPage();" |
| | | onComplete="bindAllDoubleTap();setVisitorPlaceDisabled();unblockUI();initSetPage();refreshContactAll();" |
| | | style="width:100px;display:{!IF(actSize>14,'none','')}"/></td> |
| | | <th> </th> |
| | | <td> </td> |