Li Jun
2022-04-19 2f183a6b0a83ec3f7d35375d5d25d200efc2a3e1
20220419FixIssue
35个文件已修改
1823 ■■■■■ 已修改文件
force-app/main/default/classes/ConsumTrialController.cls 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/ConsumTrialPDFController.cls 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/FileUploadController.cls 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/FileUploadControllerTest.cls 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/FixtureRentalPDFController.cls 51 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/LightningUtil.cls 40 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/NewAndEditBaseController.cls 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/NewAndEditBaseControllerTest.cls 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/NewAndEditReportController.cls 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/NewRepairController.cls 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/PIHelper.cls 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/RentalApplyController.cls 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/StartTradingController.cls 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/XinDailyReportController.cls 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/pages/ConsumTrial.page 899 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/pages/FixtureRentalPDF.page 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/pages/NewAndEditASEActivity.page 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/pages/NewAndEditAddress.page 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/pages/NewAndEditAgencyContact.page 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/pages/NewAndEditCampaignMember.page 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/pages/NewAndEditCase.page 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/pages/NewAndEditContact.page 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/pages/NewAndEditInquiryForm.page 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/pages/NewAndEditInspectionReport.page 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/pages/NewAndEditLead.page 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/pages/NewAndEditQIS.page 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/pages/NewAndEditRepairSubOrder.page 43 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/pages/NewAndEditReport.page 78 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/pages/NewAndEditTenderinformation.page 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/pages/NewConsumApply.page 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/pages/NewConsumApplyEquipmentSetDetail.page 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/pages/NewOnCall.page 50 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/pages/NewRentalApply.page 95 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/pages/NewRepair.page 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/pages/XinDailyReport.page 159 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/ConsumTrialController.cls
@@ -231,7 +231,7 @@
                FixtureUtil.withoutUpdate(rndList, true);
                PageReference pag = new PageReference('/apex/ConsumTrial?id=' + parId + '&canedit=true&saveType=1');
                pag.setRedirect(true);
                return pag;
                return null;
            }
            else{
                init();
@@ -418,7 +418,7 @@
                    + String.join(assetFieldApiList, ',')
                    + (assetFieldApiList.size() > 0 ? ',' : '')
                    + String.join(receivingNoteFieldApiList, ',')
                    + ',AWS_Data_Id__c'
                    + ',AWS_Data_Id__c,Trial_User_Encrypt__c'
                 + ' FROM Consum_Apply_Equipment_Set_Detail__c '
                + ' WHERE Consum_Apply_Equipment_Set__r.Consum_Apply__c = \'' + rn.Id + '\'' + wher
                  + ' AND (Cancel_Select__c = false OR NG_Select_Again__c = true)'
@@ -488,7 +488,7 @@
            // dataConfirmation = rnd1.DataConfirmation__c;
            lineNo = lineNo1 + 1;
            canChangeField = 'Show_demonstration__c, Operation_Type__c, Consum_Start_Date__c';
            canChangeField += ',AWS_Data_Id__c, Case_OR_animal_organ__c, Trial_User__c, Follower_User__c, Spare__c, Comment__c, Degree_Of_Importance__c';
            canChangeField += ',AWS_Data_Id__c, Case_OR_animal_organ__c, Trial_User__c,Trial_User_Encrypt__c, Follower_User__c, Spare__c, Comment__c, Degree_Of_Importance__c';
            haveAsset = String.isNotBlank(rnd1.Asset__c);
        }
force-app/main/default/classes/ConsumTrialPDFController.cls
@@ -159,7 +159,7 @@
                  FROM Consum_Apply_Equipment_Set_Detail__c
                 WHERE Consum_Apply_Equipment_Set__r.Consum_Apply__c = :targetConsumApplyId  // 耗材备品配套一览.耗材备品申请
                   AND (Cancel_Select__c = false OR NG_Select_Again__c = true)
                   AND Shipment_request_time2__c != null
                   //AND Shipment_request_time2__c != null
              ORDER BY Consum_Apply_Equipment_Set__r.Consum_Apply__c, Consum_Apply_Equipment_Set__c, Fixture_Model_No_F__c, Degree_Of_Importance__c
        ];
        if (consumApplySetDetailList.size() > 0) {
force-app/main/default/classes/FileUploadController.cls
@@ -23,6 +23,8 @@
    global static Response saveFile(String fileName,String key,String transId,String parentId){
        FileAddress__c file = new FileAddress__c();
        PIHelper.PIIntegration pI=PIHelper.getPIIntegrationInfo('Document');
        // 去除filename里得“&” bysushanhu 20220414
        fileName = fileName.remove('&');
        file.DownloadLink__c =pI.undeleteUrl+key+'&fileName='+fileName;
        file.FileName__c =fileName;
        file.ViewLink__c =pI.queryUrl+key;
force-app/main/default/classes/FileUploadControllerTest.cls
@@ -1,7 +1,8 @@
@isTest
private class FileUploadControllerTest {
    static testMethod void testMethod1() {
        TestDataUtility.CreatePIPolicyConfiguration('Document');
        // TestDataUtility.CreatePIPolicyConfiguration('Document');
        TestDataUtility.CreatePIPolicyConfiguration();
        Account acc = new Account(Name = 'test');
        Map<String,Object> accMap = new Map<String,Object>();
        accMap.put('Account',acc);
force-app/main/default/classes/FixtureRentalPDFController.cls
@@ -36,6 +36,12 @@
    public Boolean addFlag { get; private set; }//敏感地址使用标记
    public String qrcode { get; private set; }
    public String barcode { get; private set; }
    // 20220413 ljh 抬头显示 add start
    public String AgencyAddressName { get; private set; }
    public Boolean isAgencyOrCenter { get; private set; }
    public String AgencyOrCenterAddress { get; private set; }
    // 20220413 ljh 抬头显示 add end
    public FixtureRentalPDFController() {
        pageNum = Integer.valueOf(ApexPages.currentPage().getParameters().get('page'));
        rentalApplyIdIMG = ApexPages.currentPage().getParameters().get('raid');
@@ -483,23 +489,40 @@
        //新建一页
        
        PDFInfo info = new PDFInfo(new Rental_Apply__c(),New List<Rental_Apply_Equipment_Set_Detail__c>());
        // 20220413 ljh  抬头显示 update start
        //20201120 LJH OCSM_BP5-61 update start
        // if(!IsShowLU){
        //     if(!IsMain){
        //         info.isAgencyOrCenter = true;//办事处
        //         info.AgencyAddressName = '请将备品回寄至';
        //         info.AgencyAddressName += ApplyHeadShow.ToAgency__c == null ? '' : ApplyHeadShow.ToAgency__c;
        //         info.AgencyAddressName += '办事处';
        //         info.AgencyOrCenterAddress = AgencyAddressIdMap.get(ApplyHeadShow.Id);
        //     }else{
        //         info.isAgencyOrCenter = false;//备品中心
        //         info.AgencyOrCenterAddress = centerAddressInfo;
        //     }
        // }else{
        //     info.isAgencyOrCenter = false;//备品中心
        //     info.AgencyOrCenterAddress = centerAddressInfo;
        // }
        //20201120 LJH OCSM_BP5-61 update  end
        if(!IsShowLU){
            if(!IsMain){
                info.isAgencyOrCenter = true;//办事处
                info.AgencyAddressName = '请将备品回寄至';
                info.AgencyAddressName += ApplyHeadShow.ToAgency__c == null ? '' : ApplyHeadShow.ToAgency__c;
                info.AgencyAddressName += '办事处';
                info.AgencyOrCenterAddress = AgencyAddressIdMap.get(ApplyHeadShow.Id);
                isAgencyOrCenter = true;//办事处
                AgencyAddressName = '请将备品回寄至';
                AgencyAddressName += ApplyHeadShow.ToAgency__c == null ? '' : ApplyHeadShow.ToAgency__c;
                AgencyAddressName += '办事处';
                AgencyOrCenterAddress = AgencyAddressIdMap.get(ApplyHeadShow.Id);
            }else{
                info.isAgencyOrCenter = false;//备品中心
                info.AgencyOrCenterAddress = centerAddressInfo;
                isAgencyOrCenter = false;//备品中心
                AgencyOrCenterAddress = centerAddressInfo;
            }   
        }else{
            info.isAgencyOrCenter = false;//备品中心
            info.AgencyOrCenterAddress = centerAddressInfo;
            isAgencyOrCenter = false;//备品中心
            AgencyOrCenterAddress = centerAddressInfo;
        }
        //20201120 LJH OCSM_BP5-61 update  end
        // 20220413 ljh  抬头显示 update end
        integer PageCut = 0;
        if (PageAllNum>=7) {
           PageAllNum=7;
@@ -579,9 +602,11 @@
    // Data Bean
    class PDFInfo {
        public String eSetName { get; private set; } //备品中心管理单号
        public String AgencyAddressName { get; private set; } //回寄地址 20201123 LJH OCSM_BP5-61 add
        public Boolean isAgencyOrCenter { get; private set; } //备品中心?办事处 20201123 LJH OCSM_BP5-61 add
        public String AgencyOrCenterAddress { get; private set; }//20201124 LJH OCSM_BP5-61 add
        // 20220413 ljh  抬头显示 update start
        // public String AgencyAddressName { get; private set; } //回寄地址 20201123 LJH OCSM_BP5-61 add
        // public Boolean isAgencyOrCenter { get; private set; } //备品中心?办事处 20201123 LJH OCSM_BP5-61 add
        // public String AgencyOrCenterAddress { get; private set; }//20201124 LJH OCSM_BP5-61 add
        // 20220413 ljh  抬头显示 update end
        public String requestOwner { get; private set; } //申请人
        public String salesDept { get; private set; } //所属本部
        public String workPlace { get; private set; } //所属办事处
force-app/main/default/classes/LightningUtil.cls
@@ -162,16 +162,16 @@
    //经销商系统
    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,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,
            List<Contact> person_list = selectAgencyPerson();//fy Department_Cateogy_text__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,Department_Cateogy_text__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,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 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,Purpose_Type__c,SupportNeeds__c, Agency_Report_Header__c, Agency_Hospital__r.Name, Agency_Hospital__r.Hospital__c, OppName__c,
        } else {//fy Department_Cateogy_text__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,Department_Cateogy_text__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,EffectProgress__c,
@@ -184,17 +184,17 @@
    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,
            List<Contact> person_list = selectAgencyPerson01();//fy Department_Cateogy_text__c  doctor3__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,Department_Cateogy_text__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,doctor3__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
                            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 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,
        } else {//fy Department_Cateogy_text__c  doctor3__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,Department_Cateogy_text__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,doctor3__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   
@@ -203,8 +203,8 @@
        }
    }
    //经销商系统
    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,
    public static List<Agency_Report__c> selectMAgencyReport(Date date1, Date date2 ,List<Contact> conMList) {//fy Department_Cateogy_text__c
        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,Department_Cateogy_text__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,
@@ -214,9 +214,9 @@
        return reportlist;
    }
    //追溯系统
    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,
    public static List<Agency_Report__c> selectMAgencyReport01(Date date1, Date date2 ,List<Contact> conMList) {//fy Department_Cateogy_text__c  doctor3__c
        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,Department_Cateogy_text__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,doctor3__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  
@@ -225,8 +225,8 @@
        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,
    public static List<Agency_Report__c> selectAgencyReportById(String report_id) {//fy Department_Cateogy_text__c
        return [Select Id, Name, Department_Cateogy__c,Department_Cateogy_text__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
@@ -234,9 +234,9 @@
                            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,
    public static List<Agency_Report__c> selectAgencyReportById01(String report_id) {//fy Department_Cateogy_text__c doctor3__c
        return [Select Id, Name, Department_Cateogy__c,Department_Cateogy_text__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,doctor3__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
force-app/main/default/classes/NewAndEditBaseController.cls
@@ -198,7 +198,13 @@
        Map<String, Schema.SObjectField> fieldAPIToTypeMap = leadSchema.getDescribe().fields.getMap();
        Map<String,Object> fieldValueMap = (Map<String,Object>)JSON.deserializeUntyped(leadJson);
        
        system.debug('enter Foo');
        string rtid = null;
        if (fieldValueMap.containsKey('RecordTypeId')) {
            rtid = String.valueOf(fieldValueMap.get('RecordTypeId'));
        }
        List<string> invalid_fields = GetInvalidFieldFromLayout(rtid,sobjectTypeValue);
        Boolean isClone = false;
        //2. Save Record Process
        String status = 'success';    
@@ -210,6 +216,12 @@
            
            for (String fieldAPI: fieldValueMap.keySet()) {
                system.debug('field API='+fieldAPI);
                if(invalid_fields.contains(fieldAPI)){
                    system.debug(fieldAPI+' is invalid');
                    continue;
                }
                if(!fieldAPIToTypeMap.containskey(fieldAPI)){
                    continue;
                }
@@ -252,7 +264,7 @@
                isClone = sobjects.size() == 0;
            }
            System.debug('isNew---------'+isNew);
            if(isNew || isClone){
                System.debug('leadInfozhj = ' + leadInfo);
                if(!Test.isRunningTest()){
@@ -312,4 +324,41 @@
        }
    }
    
    public static List<string> GetInvalidFieldFromLayout(string rtid, string sobject_name){
        List<string> ls = new List<string>();
        string[] only_type = new string[]{'QIS_Report__c'};
        if(!only_type.contains(sobject_name)){
            system.debug('not allow');
            return ls;
        }
        List<Metadata.LayoutSection> sections = MetaDataUtility.GetRecordTypePageLayout(rtid, sobject_name);
        if (sections == null) {
            System.debug('sections=null');
            return ls;
        }
        system.debug(Json.serialize(sections));
        for (Metadata.LayoutSection section : sections) {
            if (section.layoutColumns != null) {
                for (Metadata.LayoutColumn layoutColumn : section.layoutColumns) {
                    if(layoutColumn.layoutItems != null){
                        for (Metadata.LayoutItem item : layoutColumn.layoutItems) {
                            System.debug(item);
                            if(item.field==null)continue;
                            if (item.behavior == Metadata.UiBehavior.READONLY  ) {
                                ls.add(item.field);
                            }
                        }
                    }
                }
            }
        }
        return ls;
    }
}
force-app/main/default/classes/NewAndEditBaseControllerTest.cls
@@ -97,4 +97,6 @@
        NewAndEditBaseController.save(aseTest, baseJson, 'avgwshDFcxAS', true);
        Test.stopTest();
    }
}
force-app/main/default/classes/NewAndEditReportController.cls
@@ -140,7 +140,17 @@
                contactAWSDataId1 = '无';
                contactName1 = '无';
            }
        }else if(ApexPages.currentPage().getParameters().get('CF00N10000008ps6d_lkid') != null){
        }else{
            //新建
            // Map<string,string> mso = ApexPages.currentPage().getParameters();
            //医院/科室/经销商(手写)
            if(mso.containsKey('00N10000002GE3Z')){
                controller.getRecord().put('Manual_Name__c',mso.get('00N10000002GE3Z'));
            }
            rtTypeId = ApexPages.currentPage().getParameters().get('RecordType');
            obj.put('OwnerId',UserInfo.getUserId());
        }
        if(ApexPages.currentPage().getParameters().get('CF00N10000008ps6d_lkid') != null){
            //OPD计划过来的,通过Id查出借出备品申请No1进行展示
            String opdPlanId = ApexPages.currentPage().getParameters().get('CF00N10000008ps6d_lkid');
            if(String.isNotEmpty(opdPlanId)&&String.isNotBlank(opdPlanId)){
@@ -153,17 +163,10 @@
                    }                   
                }
            }                                  
            rtTypeId = ApexPages.currentPage().getParameters().get('RecordType');
            obj.put('OwnerId',UserInfo.getUserId());
        }else{
            //新建
            // Map<string,string> mso = ApexPages.currentPage().getParameters();
            //医院/科室/经销商(手写)
            if(mso.containsKey('00N10000002GE3Z')){
                controller.getRecord().put('Manual_Name__c',mso.get('00N10000002GE3Z'));
            }
            rtTypeId = ApexPages.currentPage().getParameters().get('RecordType');
            obj.put('OwnerId',UserInfo.getUserId());
        }
        //OPD计划
        if(mso.containsKey('CF00N10000008ps6d_lkid')){
            controller.getRecord().put('Report_OPDPlan__c',mso.get('CF00N10000008ps6d_lkid'));
        }
        LayoutDescriberHelper.LayoutWrapper LayoutWrapperValue = LayoutDescriberHelper.describeSectionWithFieldsWrapper(rtTypeId, 'Report__c','classic');
        layoutSections = LayoutWrapperValue.layoutSections;
force-app/main/default/classes/NewRepairController.cls
@@ -363,6 +363,7 @@
        Map<String, Schema.SObjectField> fieldAPIToTypeMap = repairSchema.getDescribe().fields.getMap();
        Map<String,Object> fieldValueMap = (Map<String,Object>)JSON.deserializeUntyped(repairJson);
        Repair__c repairInfo = new Repair__c();
        Boolean updateRepairCheck = false;
        //自定义格式转换
        for (String fieldAPI: fieldValueMap.keySet()) {
            system.debug('field API'+fieldAPI);
@@ -388,12 +389,15 @@
            }else if(String.valueOf(fielddataType)=='PERCENT'||String.valueOf(fielddataType)=='CURRENCY'||String.valueOf(fielddataType)=='Number'||String.valueOf(fielddataType)=='DOUBLE' ){
                repairInfo.put(fieldAPI, (String.isBlank(fieldValue)||String.isEmpty(fieldValue))?null:Decimal.valueOf(fieldValue.replace(',', ''))); 
            } else if(String.valueof(fielddataType)=='BOOLEAN'){
                 //check repair check value
                if(fieldAPI == 'Return_Without_Repair__c'&&Boolean.valueof(fieldValueMap.get(fieldAPI))){
                    updateRepairCheck = true;
                }
                repairInfo.put(fieldAPI, fieldValueMap.get(fieldAPI));
            }else {
                repairInfo.put(fieldAPI, String.valueOf(fieldValueMap.get(fieldAPI)));
            }                  
        }
        //2. Save Record Process
        String status = 'success';    
        Response resp = new Response();
@@ -408,7 +412,13 @@
                System.debug('into update');
                String awsDataId = (String)repairInfo.get('AWS_Data_Id__c');
                System.debug('awsDataId = ' + awsDataId);
                Repair__c[] repairs = [select id from Repair__c where AWS_Data_Id__c =:awsDataId];
                Repair__c[] repairs = [select id,Return_Without_Repair_Reason__c,SAP_Transfer_time__c from Repair__c where AWS_Data_Id__c =:awsDataId];
                if(!updateRepairCheck){
                    repairInfo.put('Return_Without_Repair_Reason__c',repairs[0].Return_Without_Repair_Reason__c);
                }
                if(repairs!=null&&repairs[0]!=null){
                    repairInfo.put('SAP_Transfer_time__c',repairs[0].SAP_Transfer_time__c);
                }
                System.debug('repairs[0].id = ' + repairs[0].id);
                repairInfo.put('Id',repairs[0].id);//For testing;
                update repairInfo;
force-app/main/default/classes/PIHelper.cls
@@ -144,6 +144,7 @@
        //查询url
        System.debug('thhsobjectType = ' + 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];
        // 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,Full_New_Encrypt_URL__c FROM PI_Policy_Configuration__c WHERE Sobject_Type__c =:sobjectType];
        System.debug('thhconfig = ' + config);
        //获取appid和appsecret
force-app/main/default/classes/RentalApplyController.cls
@@ -36,7 +36,7 @@
        if(!Test.isRunningTest()){
            controller.addFields(fieldList);
        }
        SObject obj = controller.getRecord();
        SObject obj = controller.getRecord();
        if(obj.Id != null){
            //更新
            isNewMode = false;
@@ -79,9 +79,23 @@
            if(mso.containsKey('00N10000003OJzc')){
                controller.getRecord().put('Loaner_received_staff__c',mso.get('00N10000003OJzc'));
            }
            rtTypeId = ApexPages.currentPage().getParameters().get('RecordType');
            obj.put('OwnerId',UserInfo.getUserId());
        }
        if(mso.containsKey('00N10000003Mp2H')){
            system.debug('00N10000003Mp2H='+mso.get('00N10000003Mp2H'));
            controller.getRecord().put('Status__c',mso.get('00N10000003Mp2H'));
        }
        if(mso.containsKey('00N10000007oQKh')){
            system.debug('00N10000007oQKh='+mso.get('00N10000007oQKh'));
            controller.getRecord().put('Split_Apply_Reason__c',mso.get('00N10000007oQKh'));
        }
        system.debug('Rental Apply Record Type:'+rtTypeId);
        LayoutDescriberHelper.LayoutWrapper LayoutWrapperValue = LayoutDescriberHelper.describeSectionWithFieldsWrapper(rtTypeId, 'Rental_Apply__c','classic');
        layoutSections = LayoutWrapperValue.layoutSections;
        layoutSectionsStr = JSON.serialize(layoutSections); //for dynamic add readonly attribute
force-app/main/default/classes/StartTradingController.cls
@@ -77,7 +77,7 @@
        // リード情報を取得  
        this.lead = [select id,SI_OppoLeadSec__c,owner_not_automatically_update__c, Hospital_Name__c, Contact_Name__c, Contact_Name__r.Name, 
                     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,
                     LastName, FirstName, LeadSource, Other_Society__c, Opp_Name__c, Purchase_Reason__c, Trade__c, Sales_Root__c, Campaign__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,Inquiry_Num__c,CreatedDate,CreatedById
                     from Lead where id =: this.leadId];
@@ -380,6 +380,11 @@
        System.debug('opp.Sales_Method__c:'+opp.Sales_Method__c);
        System.debug('opp.Fund_Basis__c:'+opp.Fund_Basis__c);
        System.debug('opp.SAP_Province__c:'+opp.SAP_Province__c);
        // 2022-04-15 OBSAP新增修改 start
        opp.CampaignId = this.lead.Campaign__c;
        System.debug('opp.CampaignId:'+opp.CampaignId);
        // 2022-04-15 OBSAP新增修改 end
        update opp;
        return null;
    }
force-app/main/default/classes/XinDailyReportController.cls
@@ -733,6 +733,7 @@
                        Purpose_Type__c = e.Purpose_Type__c,
                        Related_Opportunity1__c = e.Related_Opportunity1__c,
                        OPDPlan_Flag__c = e.OPDPlan_Flag__c,
                        Opd_Plan__c = e.Opd_Plan__c,  //2022-4-14 yjk 增加opd计划
                        Related_Opportunity1_ID__c = e.Related_Opportunity1_ID__c,
                        Related_Opportunity2__c = e.Related_Opportunity2__c,
                        Related_Opportunity2_ID__c = e.Related_Opportunity2_ID__c,
force-app/main/default/pages/ConsumTrial.page
@@ -6,6 +6,12 @@
    <apex:includeScript value="{!URLFOR($Resource.ReceivingNotePageJS)}"/>
    <apex:includeScript value="{!URLFOR($Resource.CommonUtilJs)}"/>
    <apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }"/>
    <script type="text/javascript">
        var txIds = [];
        var trialuserMap={};
    </script>
    <apex:form id="allForm">
        <style>
            table.headTable td   {
@@ -25,468 +31,536 @@
            }
        </style>
        <script type="text/javascript">
            var heightAjustment = 120;
            var widthAjustment = 30;
            var staticResource = JSON.parse('{!staticResource}');
        var heightAjustment = 120;
        var widthAjustment = 30;
        var staticResource = JSON.parse('{!staticResource}');
            // 适用按钮
            function applyJs() {
                var appliedFlag = true;
                var selectFlag = true;
                var isCheckFlag = false;
                var ShowDemonstration = j$(escapeVfId('allPage:allForm:searchBlock:ShowDemonstration')).val();  // 展示/演示
                var OperationType = j$(escapeVfId('allPage:allForm:searchBlock:OperationType')).val();  // 术式类别
                var ConsumStartDate = j$(escapeVfId('allPage:allForm:searchBlock:ConsumStartDate')).val();  // 预计使用日
                var CaseOrAnimalOrgan = j$(escapeVfId('allPage:allForm:searchBlock:CaseOrAnimalOrgan')).val();  // 病例/动物脏器
                var TrialUser= j$(escapeVfId('allPage:allForm:searchBlock:TrialUser')).val();  // 试用者
                var FollowerUserid = j$(escapeVfId('allPage:allForm:searchBlock:FollowerUser_lkid')).val();  // 跟台者Id
                var FollowerUsername = j$(escapeVfId('allPage:allForm:searchBlock:FollowerUser_lkold')).val();  // 跟台者Name
        // 适用按钮
        function applyJs() {
            var appliedFlag = true;
            var selectFlag = true;
            var isCheckFlag = false;
            var ShowDemonstration = j$(escapeVfId('allPage:allForm:searchBlock:ShowDemonstration')).val();  // 展示/演示
            var OperationType = j$(escapeVfId('allPage:allForm:searchBlock:OperationType')).val();  // 术式类别
            var ConsumStartDate = j$(escapeVfId('allPage:allForm:searchBlock:ConsumStartDate')).val();  // 预计使用日
            var CaseOrAnimalOrgan = j$(escapeVfId('allPage:allForm:searchBlock:CaseOrAnimalOrgan')).val();  // 病例/动物脏器
            var TrialUser= j$(escapeVfId('allPage:allForm:searchBlock:TrialUser')).val();  // 试用者
            var FollowerUserid = j$(escapeVfId('allPage:allForm:searchBlock:FollowerUser_lkid')).val();  // 跟台者Id
            var FollowerUsername = j$(escapeVfId('allPage:allForm:searchBlock:FollowerUser_lkold')).val();  // 跟台者Name
                var ShowDemonstrations = []; // 展示/演示
                j$("td.intf.dataCellBorder1.Show_demonstration__c").each(function() {
                    ShowDemonstrations.push(j$(this));
                });
                var OperationTypes = [];  // 术式类别
                j$("td.intf.dataCellBorder1.Operation_Type__c").each(function() {
                    OperationTypes.push(j$(this));
                });
                var ConsumStartDates = [];  // 备品预计使用日
                j$("td.intf.dataCellBorder1.Consum_Start_Date__c").each(function() {
                    ConsumStartDates.push(j$(this));
                });
                var CaseOrAnimalOrgans = [];  // 病例/动物脏器
                j$("td.intf.dataCellBorder1.Case_OR_animal_organ__c").each(function() {
                    CaseOrAnimalOrgans.push(j$(this));
                });
            var ShowDemonstrations = []; // 展示/演示
            j$("td.intf.dataCellBorder1.Show_demonstration__c").each(function() {
                ShowDemonstrations.push(j$(this));
            });
            var OperationTypes = [];  // 术式类别
            j$("td.intf.dataCellBorder1.Operation_Type__c").each(function() {
                OperationTypes.push(j$(this));
            });
            var ConsumStartDates = [];  // 备品预计使用日
            j$("td.intf.dataCellBorder1.Consum_Start_Date__c").each(function() {
                ConsumStartDates.push(j$(this));
            });
            var CaseOrAnimalOrgans = [];  // 病例/动物脏器
            j$("td.intf.dataCellBorder1.Case_OR_animal_organ__c").each(function() {
                CaseOrAnimalOrgans.push(j$(this));
            });
                var TrialUsers = [];  // 试用者
                j$("td.intf.dataCellBorder1.Trial_User__c").each(function() {
                    TrialUsers.push(j$(this));
                });
            var TrialUsers = [];  // 试用者
            j$("td.intf.dataCellBorder1.Trial_User__c").each(function() {
                TrialUsers.push(j$(this));
            });
                var FollowerUsers = [];  // 跟台者:
                j$("td.intf.dataCellBorder1.Follower_User__c").each(function() {
                    FollowerUsers.push(j$(this));
                });
            var FollowerUsers = [];  // 跟台者:
            j$("td.intf.dataCellBorder1.Follower_User__c").each(function() {
                FollowerUsers.push(j$(this));
            });
                var currentPageRecordCount = j$(escapeVfId('allPage:allForm:dataBlock:currentPageRecordCnt')).val();
                for (var i = 0; i < currentPageRecordCount; i++) {
                    var checkBox = j$(escapeVfId('allPage:allForm:dataBlock:dataline_L:' + i + ':rowCheck'));
                    if (checkBox.prop('checked') == true) {
                        isCheckFlag = true;
                        // 'x'时不适用
                        if (ShowDemonstration != 'x') {
                            ShowDemonstrations[i].find("select").val(ShowDemonstration);
                            appliedFlag = false;
                        }
                        if (OperationType != 'x') {
                            OperationTypes[i].find("select").val(OperationType);
                            appliedFlag = false;
                        }
                        if (ConsumStartDate != null && ConsumStartDate != '' && typeof(ConsumStartDate) != "undefined") {
                            ConsumStartDates[i].find("input").val(ConsumStartDate);
                            appliedFlag = false;
                        }
                        if (CaseOrAnimalOrgan != 'x') {
                            CaseOrAnimalOrgans[i].find("select").val(CaseOrAnimalOrgan);
                            appliedFlag = false;
                        }
            var currentPageRecordCount = j$(escapeVfId('allPage:allForm:dataBlock:currentPageRecordCnt')).val();
            for (var i = 0; i < currentPageRecordCount; i++) {
                var checkBox = j$(escapeVfId('allPage:allForm:dataBlock:dataline_L:' + i + ':rowCheck'));
                if (checkBox.prop('checked') == true) {
                    isCheckFlag = true;
                    // 'x'时不适用
                    if (ShowDemonstration != 'x') {
                        ShowDemonstrations[i].find("select").val(ShowDemonstration);
                        appliedFlag = false;
                    }
                    if (OperationType != 'x') {
                        OperationTypes[i].find("select").val(OperationType);
                        appliedFlag = false;
                    }
                    if (ConsumStartDate != null && ConsumStartDate != '' && typeof(ConsumStartDate) != "undefined") {
                        ConsumStartDates[i].find("input").val(ConsumStartDate);
                        appliedFlag = false;
                    }
                    if (CaseOrAnimalOrgan != 'x') {
                        CaseOrAnimalOrgans[i].find("select").val(CaseOrAnimalOrgan);
                        appliedFlag = false;
                    }
                        if (TrialUser != null && TrialUser != '' && typeof(TrialUser) != "undefined") {
                            TrialUsers[i].find("input").val(TrialUser);
                            appliedFlag = false;
                        }
                    if (TrialUser != null && TrialUser != '' && typeof(TrialUser) != "undefined") {
                        TrialUsers[i].find("input").val(TrialUser);
                        appliedFlag = false;
                    }
                        // if (equipmentTypes[i].find("select").val() != productCategory && productCategory != '') {
                        if (FollowerUserid != null && parseInt(FollowerUserid) != 0 && typeof(FollowerUserid) != "undefined"
                            && FollowerUsername != null && FollowerUsername != 'null' && typeof(FollowerUsername) != "undefined") {
                            // setChangeFlg();
                    // if (equipmentTypes[i].find("select").val() != productCategory && productCategory != '') {
                    if (FollowerUserid != null && parseInt(FollowerUserid) != 0 && typeof(FollowerUserid) != "undefined"
                        && FollowerUsername != null && FollowerUsername != 'null' && typeof(FollowerUsername) != "undefined") {
                        // setChangeFlg();
                            var inputs = FollowerUsers[i].find("input");
                            for (var j = 0; j < inputs.length; j++) {
                                if(inputs[j].name.endsWith('_lkid')) {
                                    inputs[j].value = FollowerUserid;
                                }
                                else if (inputs[j].name.endsWith('_lkold')
                                    || inputs[j].name.endsWith('inputField')) {
                                    inputs[j].value = FollowerUsername;
                                }
                        var inputs = FollowerUsers[i].find("input");
                        for (var j = 0; j < inputs.length; j++) {
                            if(inputs[j].name.endsWith('_lkid')) {
                                inputs[j].value = FollowerUserid;
                            }
                            appliedFlag = false;
                            else if (inputs[j].name.endsWith('_lkold')
                                || inputs[j].name.endsWith('inputField')) {
                                inputs[j].value = FollowerUsername;
                            }
                        }
                        appliedFlag = false;
                    }
                }
                j$(escapeVfId('allPage:allForm:pageBlockButton1:clearApplyFlagId')).val(false);
                // var clearApplyFlag = false;
                window.setTimeout(function () {
                    if (ConsumStartDate == null
                        && TrialUser == null
                        && (FollowerUserid== null || FollowerUsername == null)) {  // 适用入力框全为空
                        // alert('适用区输入框为空,请输入适用值。');
                        var applyMsg = '适用区输入框为空,请输入适用值。';
                        //passApplyMsgToController(applyMsg, 'Fail');
                        return;
                    }
                    if (isCheckFlag == false) {
                        // alert('未勾选任何待适用数据。');
                        var applyMsg = '未勾选任何待适用数据。';
                        //passApplyMsgToController(applyMsg, 'Fail');
                        return;
                    }
            }
            j$(escapeVfId('allPage:allForm:pageBlockButton1:clearApplyFlagId')).val(false);
            // var clearApplyFlag = false;
            window.setTimeout(function () {
                if (ConsumStartDate == null
                    && TrialUser == null
                    && (FollowerUserid== null || FollowerUsername == null)) {  // 适用入力框全为空
                    // alert('适用区输入框为空,请输入适用值。');
                    var applyMsg = '适用区输入框为空,请输入适用值。';
                    //passApplyMsgToController(applyMsg, 'Fail');
                    return;
                }
                if (isCheckFlag == false) {
                    // alert('未勾选任何待适用数据。');
                    var applyMsg = '未勾选任何待适用数据。';
                    //passApplyMsgToController(applyMsg, 'Fail');
                    return;
                }
                    if (selectFlag) {
                        if (!appliedFlag) {
                            var alertMsg = "适用完了 \r\n";
                            if (ConsumStartDate != null && typeof(ConsumStartDate) != "undefined") {
                                var alertMsg1 = "已将打勾数据中的 " + "备品预计使用日" + " 适用为 " + ConsumStartDate + " \r\n";
                                alertMsg += alertMsg1;
                            }
                            if (TrialUser != null && typeof(TrialUser) != "undefined") {
                                var alertMsg1 = "已将打勾数据中的 " + "试用者" + " 适用为 " + TrialUser + " \r\n";
                                alertMsg += alertMsg1;
                            }
                            if (FollowerUserid != null && typeof(FollowerUserid) != "undefined"
                                && FollowerUsername != null && typeof(FollowerUsername) != "undefined") {
                                var alertMsg2 = "已将打勾数据中的 " + "跟台者:" + " 适用为 " + FollowerUsername + " \r\n";
                                alertMsg += alertMsg2;
                            }
                            // alert(alertMsg);
                            // clearApplyFlag = true;
                            j$(escapeVfId('allPage:allForm:pageBlockButton1:clearApplyFlagId')).val(true);
                            //passApplyMsgToController(alertMsg, 'Success');
                if (selectFlag) {
                    if (!appliedFlag) {
                        var alertMsg = "适用完了 \r\n";
                        if (ConsumStartDate != null && typeof(ConsumStartDate) != "undefined") {
                            var alertMsg1 = "已将打勾数据中的 " + "备品预计使用日" + " 适用为 " + ConsumStartDate + " \r\n";
                            alertMsg += alertMsg1;
                        }
                        if (TrialUser != null && typeof(TrialUser) != "undefined") {
                            var alertMsg1 = "已将打勾数据中的 " + "试用者" + " 适用为 " + TrialUser + " \r\n";
                            alertMsg += alertMsg1;
                        }
                        if (FollowerUserid != null && typeof(FollowerUserid) != "undefined"
                            && FollowerUsername != null && typeof(FollowerUsername) != "undefined") {
                            var alertMsg2 = "已将打勾数据中的 " + "跟台者:" + " 适用为 " + FollowerUsername + " \r\n";
                            alertMsg += alertMsg2;
                        }
                        // alert(alertMsg);
                        // clearApplyFlag = true;
                        j$(escapeVfId('allPage:allForm:pageBlockButton1:clearApplyFlagId')).val(true);
                        //passApplyMsgToController(alertMsg, 'Success');
                    }
                } else {
                    if (!appliedFlag) {
                        var alertMsg = "适用完了 \r\n";
                        if (ConsumStartDate != null && typeof(ConsumStartDate) != "undefined") {
                            var alertMsg1 = "已将打勾数据中的 " + "备品预计使用日" + " 适用为 " + ConsumStartDate + " \r\n";
                            alertMsg += alertMsg1;
                        }
                        if (TrialUser != null && typeof(TrialUser) != "undefined") {
                            var alertMsg1 = "已将打勾数据中的 " + " 试用者" + " 适用为 " + TrialUser + " \r\n";
                            alertMsg += alertMsg1;
                        }
                        if (FollowerUserid != null && typeof(FollowerUserid) != "undefined"
                            && FollowerUsername != null && typeof(FollowerUsername) != "undefined") {
                            var alertMsg2 = "已将打勾数据中的 " + "跟台者:" + " 适用为 " + FollowerUsername + " \r\n";
                            alertMsg += alertMsg2;
                        }
                        //passApplyMsgToController(alertMsg, 'Success');
                        j$(escapeVfId('allPage:allForm:pageBlockButton1:clearApplyFlagId')).val(true);
                    } else {
                        if (!appliedFlag) {
                            var alertMsg = "适用完了 \r\n";
                            if (ConsumStartDate != null && typeof(ConsumStartDate) != "undefined") {
                                var alertMsg1 = "已将打勾数据中的 " + "备品预计使用日" + " 适用为 " + ConsumStartDate + " \r\n";
                                alertMsg += alertMsg1;
                            }
                            if (TrialUser != null && typeof(TrialUser) != "undefined") {
                                var alertMsg1 = "已将打勾数据中的 " + " 试用者" + " 适用为 " + TrialUser + " \r\n";
                                alertMsg += alertMsg1;
                            }
                            if (FollowerUserid != null && typeof(FollowerUserid) != "undefined"
                                && FollowerUsername != null && typeof(FollowerUsername) != "undefined") {
                                var alertMsg2 = "已将打勾数据中的 " + "跟台者:" + " 适用为 " + FollowerUsername + " \r\n";
                                alertMsg += alertMsg2;
                            }
                            //passApplyMsgToController(alertMsg, 'Success');
                            j$(escapeVfId('allPage:allForm:pageBlockButton1:clearApplyFlagId')).val(true);
                        } else {
                            var alertMsg = "其他选项: " + otherSelectOptionText +"中无此选项值" + otherSelectOptionValue + ",无法更新。";
                            //passApplyMsgToController(alertMsg, 'Fail');
                        }
                        var alertMsg = "其他选项: " + otherSelectOptionText +"中无此选项值" + otherSelectOptionValue + ",无法更新。";
                        //passApplyMsgToController(alertMsg, 'Fail');
                    }
                }, 5);
            }
            function clearApplyValue() {
                var clearApplyValueFlag = j$(escapeVfId('allPage:allForm:pageBlockButton1:clearApplyFlagId')).val();
                if(clearApplyValueFlag) {
                    j$(escapeVfId('{!$Component.stockId}')).val('');
                    j$(escapeVfId('{!$Component.applyEquipmentTypeId}')).val('');
                    j$(escapeVfId('{!$Component.applyAssetTypeListId}')).val('');
                    j$(escapeVfId('{!$Component.otherSelectionId}')).val('');
                }
                j$(escapeVfId('allPage:allForm:pageBlockButton1:clearApplyFlagId')).val(false);
            }
            }, 5);
        }
            function checkSavingJs() {
                var isSavingSuccess = j$(escapeVfId('isSavingSuccessId')).val();
                // alert(isSavingSuccess);
                if (isSavingSuccess != 'false') {
                    //setSaveSuccessMsg();
        function clearApplyValue() {
            var clearApplyValueFlag = j$(escapeVfId('allPage:allForm:pageBlockButton1:clearApplyFlagId')).val();
            if(clearApplyValueFlag) {
                j$(escapeVfId('{!$Component.stockId}')).val('');
                j$(escapeVfId('{!$Component.applyEquipmentTypeId}')).val('');
                j$(escapeVfId('{!$Component.applyAssetTypeListId}')).val('');
                j$(escapeVfId('{!$Component.otherSelectionId}')).val('');
            }
            j$(escapeVfId('allPage:allForm:pageBlockButton1:clearApplyFlagId')).val(false);
        }
        function checkSavingJs() {
            var isSavingSuccess = j$(escapeVfId('isSavingSuccessId')).val();
            // alert(isSavingSuccess);
            if (isSavingSuccess != 'false') {
                //setSaveSuccessMsg();
            }
        }
        function resetMove(d, up, len) {
            var line = j$(escapeVfId(d)).find('input')[0].value;
            resetMoveUpDown(up, parseInt(line), len);
        }
        function moveToTop(d, up, len) {
            var line = j$(escapeVfId(d)).find('input')[0].value;
            console.log(line);
            var isSuccessful = true;
            if (up) {
                for(var i = parseInt(line) ; i > 1 && isSuccessful; i-- ) {
                    isSuccessful = resetMoveUpDown(up, i, len);
                }
            }
            function resetMove(d, up, len) {
                var line = j$(escapeVfId(d)).find('input')[0].value;
                resetMoveUpDown(up, parseInt(line), len);
            else {
                for(var i = parseInt(line) ; i < len && isSuccessful; i++ ) {
                    isSuccessful = resetMoveUpDown(up, i, len);
                }
            }
            unblockUI();
        }
            function moveToTop(d, up, len) {
                var line = j$(escapeVfId(d)).find('input')[0].value;
                console.log(line);
                var isSuccessful = true;
                if (up) {
                    for(var i = parseInt(line) ; i > 1 && isSuccessful; i-- ) {
                        isSuccessful = resetMoveUpDown(up, i, len);
        function resetMoveUpDown(up, line, len) {
            var items = j$(".dataCellBorder2");
            var item1 = j$("td.intf.dataCellBorder1.Degree_Of_Importance__c");
            var item2 = j$("td.dataCellBorder1.col_Fixture_Model_No__c");
            var currentPageRecordCount = j$(escapeVfId('allPage:allForm:dataBlock:currentPageRecordCnt')).val();
            var isSuccessful = false;
            // alert(item1);
            var i = line - 1;
            var i1 = line + 1;
            // var tr = j$('#tableData').find('tbody').find('tr:eq(' + (i) + ')');
            if (up == true){
                var tr = j$('#tableData').find('tbody').find('tr:eq(' + (i) + ')');
                var trL = j$('#tableData_L').find('tbody').find('tr:eq(' + (i) + ')');
                if(line != 1) {
                    var model1 = j$(item2[i - 1]).find("span").text();
                    var model2 = j$(item2[i]).find("span").text();
                    if (model1 != model2) {
                        unblockUI();
                        return;
                    }
                    var v1 = j$(item1[i - 1]).find("input").val();
                    var v2 = j$(item1[i]).find("input").val();
                    setChangeFlg(i-1);
                    setChangeFlg(i);
                    j$(items[i - 1]).children('.ordernocls').val(line);
                    j$(items[i]).children('.ordernocls').val(line - 1);
                    j$(item1[i - 1]).find("input").val(v2);
                    j$(item1[i]).find("input").val(v1);
                    isSuccessful = true;
                    // j$(item1[i - 1]).children('.ordernocls').val('' + line);
                    // j$(item1[i]).children('.ordernocls').val('' + i);
                }
                else {
                    for(var i = parseInt(line) ; i < len && isSuccessful; i++ ) {
                        isSuccessful = resetMoveUpDown(up, i, len);
                    }
                    j$(items[i]).children('.ordernocls').val(line);
                }
                unblockUI();
                var tr1 = j$(items[i]).parents("tr");
                tr.prev().before(tr);
                trL.prev().before(trL);
            }
            function resetMoveUpDown(up, line, len) {
                var items = j$(".dataCellBorder2");
                var item1 = j$("td.intf.dataCellBorder1.Degree_Of_Importance__c");
                var item2 = j$("td.dataCellBorder1.col_Fixture_Model_No__c");
                var currentPageRecordCount = j$(escapeVfId('allPage:allForm:dataBlock:currentPageRecordCnt')).val();
                var isSuccessful = false;
                // alert(item1);
                var i = line - 1;
                var i1 = line + 1;
                // var tr = j$('#tableData').find('tbody').find('tr:eq(' + (i) + ')');
                if (up == true){
            else {
                if(line < currentPageRecordCount) {
                    var model1 = j$(item2[i]).find("span").text();
                    var model2 = j$(item2[line]).find("span").text();
                    if (model1 != model2) {
                        unblockUI();
                        return;
                    }
                    var tr = j$('#tableData').find('tbody').find('tr:eq(' + (i) + ')');
                    var trL = j$('#tableData_L').find('tbody').find('tr:eq(' + (i) + ')');
                    if(line != 1) {
                        var model1 = j$(item2[i - 1]).find("span").text();
                        var model2 = j$(item2[i]).find("span").text();
                        if (model1 != model2) {
                            unblockUI();
                            return;
                        }
                        var v1 = j$(item1[i - 1]).find("input").val();
                        var v2 = j$(item1[i]).find("input").val();
                        setChangeFlg(i-1);
                        setChangeFlg(i);
                        j$(items[i - 1]).children('.ordernocls').val(line);
                        j$(items[i]).children('.ordernocls').val(line - 1);
                        j$(item1[i - 1]).find("input").val(v2);
                        j$(item1[i]).find("input").val(v1);
                        isSuccessful = true;
                        // j$(item1[i - 1]).children('.ordernocls').val('' + line);
                        // j$(item1[i]).children('.ordernocls').val('' + i);
                    }
                    else {
                        j$(items[i]).children('.ordernocls').val(line);
                    }
                    var v1 = j$(item1[i]).find("input").val();
                    var v2 = j$(item1[i + 1]).find("input").val();
                    setChangeFlg(i);
                    setChangeFlg(i + 1);
                    j$(items[i]).children('.ordernocls').val(line + 1);
                    j$(items[i + 1]).children('.ordernocls').val(line);
                    j$(item1[i]).find("input").val(v2);
                    j$(item1[line]).find("input").val(v1);
                    var tr1 = j$(items[i]).parents("tr");
                    tr.prev().before(tr);
                    trL.prev().before(trL);
                    tr.next().after(tr);
                    trL.next().after(trL);
                    isSuccessful = true;
                }
                else {
                    if(line < currentPageRecordCount) {
                        var model1 = j$(item2[i]).find("span").text();
                        var model2 = j$(item2[line]).find("span").text();
                        if (model1 != model2) {
                            unblockUI();
                            return;
                        }
                        var tr = j$('#tableData').find('tbody').find('tr:eq(' + (i) + ')');
                        var trL = j$('#tableData_L').find('tbody').find('tr:eq(' + (i) + ')');
                        var v1 = j$(item1[i]).find("input").val();
                        var v2 = j$(item1[i + 1]).find("input").val();
                        setChangeFlg(i);
                        setChangeFlg(i + 1);
                        j$(items[i]).children('.ordernocls').val(line + 1);
                        j$(items[i + 1]).children('.ordernocls').val(line);
                        j$(item1[i]).find("input").val(v2);
                        j$(item1[line]).find("input").val(v1);
                        var tr1 = j$(items[i]).parents("tr");
                        tr.next().after(tr);
                        trL.next().after(trL);
                        isSuccessful = true;
                    }
                    else {
                        j$(items[i]).children('.ordernocls').val(line);
                    }
                    j$(items[i]).children('.ordernocls').val(line);
                }
                unblockUI();
                return isSuccessful;
            }
            unblockUI();
            return isSuccessful;
        }
            function refopener() {
                window.opener.location.href = '/apex/ConsumTrial?id={!parId}';
        function refopener() {
            window.opener.location.href = '/apex/ConsumTrial?id={!parId}';
        }
        if (window.history.pushState) {
            if (window.location.href.indexOf('&saveType=1') > -1) {
                refopener();
            }
            window.history.pushState({}, "", window.location.href.replace('&saveType=1', ''));
        }
            if (window.history.pushState) {
                if (window.location.href.indexOf('&saveType=1') > -1) {
                    refopener();
                }
                window.history.pushState({}, "", window.location.href.replace('&saveType=1', ''));
        //2022 02 24 张华建 display PI Data start
        var rowBList;
        var TrialUser = {};
        var ids = [];
        function HasError(){
            // let e = document.getElementById("allPage:allForm:message");
            // if (!e) {
            //     return false;
            // }
            // let divs = j$(e).find("div.message");
            // for (let i = 0; i < divs.length; i++) {
            //     for (let j = 0; j < divs[i].classList.length; j++) {
            //         for(let cls in divs[i].classList){
            //             console.log('cls = ' + cls);
            //             if (cls.indexOf('error')>-1) {
            //                 return true;
            //             }
            //         }
            //     }
            // }
            // return false;
            if(document.getElementById("allPage:allForm:message").children[0] && document.getElementById("allPage:allForm:message").children[0].children[0].className == 'message errorM3'){
                return true;
            }
            return false;
        }
            //2022 02 24 张华建 display PI Data start
            var rowBList;
            var TrialUser = {};
            var ids = [];
            queryUser();
            function q1(){
                var p = new Promise(function(resolve, reject){
                    rowBList = JSON.parse('{!rowListString}')
                    var x = 0;
                    var y = 0;
                    let searchCallBack = function searchCallBack(result){
                        let contacts = result.object;
                        if(contacts == null){
                            return;
                        }
                        let temp = {}
                        temp.trialUser = contacts.trialUser;
                        TrialUser[contacts.dataId] = temp;
                        x++;
                    };
                    for(var i=0;i<rowBList.length;i++){
                        if(rowBList[i].rnd.AWS_Data_Id__c ){
                            y++;
                            ids.push(rowBList[i].rnd.AWS_Data_Id__c + '_' + rowBList[i].rnd.Id);
                            AWSService.query(staticResource.queryUrl,rowBList[i].rnd.AWS_Data_Id__c,searchCallBack,staticResource.token);
                        }
                    }
                    var id = setInterval(function(){
                        if(x == y){
                            console.log('success')
                            resolve('success');
                            clearInterval(id);
                        }
                    },500);
                });
                return p;
        function isError(){
            if(HasError()){
                alert('xxxx');
            }
        }
            function q2(value){
                var p = new Promise(function(resolve, reject){
                    console.log('进入q2'+value)
                    for(var i=0;i<ids.length;i++){
                        console.log('i = '+i);
                        document.getElementById(ids[i]).children[0].children[0].children[0].value = TrialUser[ids[i].substring(0,18)].trialUser;
                        console.log('i = '+i);
                    }
                });
            }
            function queryUser(){
        queryUser();
        function q1(){
            var p = new Promise(function(resolve, reject){
                rowBList = JSON.parse('{!rowListString}')
                console.log('pageB.fixMode = '+'{!pageB.fixMode}')
                if('{!pageB.fixMode}' == 'true'){
                    q1().then(function(data){
                        return q2(data);
                    })
                    unblockUI();
                }else{
                    blockme();
                    console.log(rowBList)
                    let searchCallBack = function searchCallBack(result){
                        let contacts = result.object;
                        if(contacts == null){
                            return;
                        }
                        let temp = {}
                        temp.trialUser = contacts.trialUser;
                        TrialUser[contacts.dataId] = temp;
                    };
                    for(var i=0;i<rowBList.length;i++){
                var x = 0;
                var y = 0;
                let searchCallBack = function searchCallBack(result){
                    let contacts = result.object;
                    if(contacts == null){
                        return;
                    }
                    let temp = {}
                    temp.trialUser = contacts.trialUser;
                    TrialUser[contacts.dataId] = temp;
                    x++;
                };
                for(var i=0;i<rowBList.length;i++){
                    if(rowBList[i].rnd.AWS_Data_Id__c ){
                        y++;
                        ids.push(rowBList[i].rnd.AWS_Data_Id__c + '_' + rowBList[i].rnd.Id);
                        AWSService.query(staticResource.queryUrl,rowBList[i].rnd.AWS_Data_Id__c,searchCallBack,staticResource.token);
                    }
                    unblockUI();
                }
            }
            function showPIDiv(awsDataId){
                if(awsDataId.length == 0){
                    return
                }
                if(TrialUser[awsDataId.substring(0,18)] == null){
                    return
                }
                console.log('awsDataId Value:'+awsDataId);
                let parentNode = document.getElementById(awsDataId);
                let createDiv = document.createElement("div");
                createDiv.id = awsDataId+"_PI";
                let piInformation = TrialUser[awsDataId.substring(0,18)].trialUser
                //let piInformation = 'Name:'+contact['943114607025717249'].lastName +'\n' +'Phone:'+contact['943114607025717249'].phone
                createDiv.innerText = piInformation;
                let x=window.event.x;
                let y=window.event.y;
                createDiv.style.left=x;
                createDiv.style.top=y;
                createDiv.style.background="#dddddd";
                createDiv.style.position = "absolute";
                parentNode.appendChild(createDiv);
                parentNode.style.position = "relative";
            }
            function hidePIDiv(awsDataId){
                if(awsDataId.length == 0){
                    return
                }
                if(TrialUser[awsDataId.substring(0,18)] == null){
                    return
                }
                document.getElementById(awsDataId+'_PI').remove();
            }
            function q3(){
                var p = new Promise(function(resolve, reject){
                    console.log('saveRecordJS')
                    var a = 0;
                    var b = 0;
                    let newCallBack = function newCallBack(result,indexNumber){
                        console.log('result = '+JSON.stringify(result))
                        //赋值dataId和trialUser
                        document.getElementById('allPage:allForm:dataBlock:dataline_R_aws:'+indexNumber+':EditAWSDataId').value = result.object[0].dataId;
                        document.getElementById('allPage:allForm:dataBlock:dataline_R:'+indexNumber+':inputField:6:inputField').value = result.object[0].trialUser;
                        let transParameters = {
                            txId: result.txId,
                            isSuccess: 1
                        };
                        let confirmCallBack = function confirmCallBack(result){
                            console.log('confirmCallBack = '+JSON.stringify(result))
                        }
                        b++;
                        AWSService.confirmTrans(staticResource.transactionUrl,JSON.stringify(transParameters),confirmCallBack,staticResource.token)
                    };
                    for(var i=0;i<rowBList.length;i++){
                        if(document.getElementById('allPage:allForm:dataBlock:dataline_L:'+i+':rowCheck').checked == true){
                            a++;
                        }
                var id = setInterval(function(){
                    if(x == y){
                        console.log('success')
                        resolve('success');
                        clearInterval(id);
                    }
                    debugger
                    for(var i=0;i<rowBList.length;i++){
                        if(document.getElementById('allPage:allForm:dataBlock:dataline_L:'+i+':rowCheck').checked == true){
                            //加密试用者
                            var trialUser = document.getElementById('allPage:allForm:dataBlock:dataline_R:'+i+':inputField:6:j_id86').children[0].children[0].value
                            let consumApplyPayloadList = [];
                            let consumApplyPIData = new Object();
                            consumApplyPIData.trialUser = trialUser;
                            consumApplyPIData.sfRecordId = '';
                            consumApplyPayloadList.push(consumApplyPIData);
                            AWSService.postConsumTrial(staticResource.newUrl,i,JSON.stringify(consumApplyPayloadList),newCallBack,staticResource.token);
                        }
                    }
                    var id = setInterval(function(){
                        if(a == b){
                            console.log('a==b success')
                            resolve('success');
                            clearInterval(id);
                        }
                    },500);
                });
                return p;
            }
                },500);
            });
            return p;
        }
            function q4(){
                debugger
                saveRecord();
            }
            function saveRecordJS(){
                if('{!pageB.fixMode}' != 'true'){
                        return
        function q2(value){
            var p = new Promise(function(resolve, reject){
                console.log('进入q2'+value)
                for(var i=0;i<ids.length;i++){
                    console.log('i = '+i);
                    document.getElementById(ids[i]).children[0].children[0].children[0].value = TrialUser[ids[i].substring(0,18)].trialUser;
                    console.log('i = '+i);
                }
            });
        }
        function queryUser(){
            rowBList = JSON.parse('{!rowListString}')
            console.log('pageB.fixMode = '+'{!pageB.fixMode}')
            if('{!pageB.fixMode}' == 'true'){
                q1().then(function(data){
                    return q2(data);
                })
                unblockUI();
            }else{
                blockme();
                console.log(rowBList)
                let searchCallBack = function searchCallBack(result){
                    let contacts = result.object;
                    if(contacts == null){
                        return;
                    }
                q3().then(function(data){
                        return q4(data);
                    })
                    let temp = {}
                    temp.trialUser = contacts.trialUser;
                    TrialUser[contacts.dataId] = temp;
                };
                for(var i=0;i<rowBList.length;i++){
                    ids.push(rowBList[i].rnd.AWS_Data_Id__c + '_' + rowBList[i].rnd.Id);
                    AWSService.query(staticResource.queryUrl,rowBList[i].rnd.AWS_Data_Id__c,searchCallBack,staticResource.token);
                }
                unblockUI();
            }
            //2022 02 24 张华建 display PI Data end
        </script>
        <apex:pageMessages />
        }
        function showPIDiv(awsDataId){
            if(awsDataId.length == 0){
                return
            }
            if(TrialUser[awsDataId.substring(0,18)] == null){
                return
            }
            console.log('awsDataId Value:'+awsDataId);
            let parentNode = document.getElementById(awsDataId);
            let createDiv = document.createElement("div");
            createDiv.id = awsDataId+"_PI";
            let piInformation = TrialUser[awsDataId.substring(0,18)].trialUser
            //let piInformation = 'Name:'+contact['943114607025717249'].lastName +'\n' +'Phone:'+contact['943114607025717249'].phone
            createDiv.innerText = piInformation;
            let x=window.event.x;
            let y=window.event.y;
            createDiv.style.left=x;
            createDiv.style.top=y;
            createDiv.style.background="#dddddd";
            createDiv.style.position = "absolute";
            parentNode.appendChild(createDiv);
            parentNode.style.position = "relative";
        }
        function hidePIDiv(awsDataId){
            if(awsDataId.length == 0){
                return
            }
            if(TrialUser[awsDataId.substring(0,18)] == null){
                return
            }
            document.getElementById(awsDataId+'_PI').remove();
        }
        function q3(){
            var p = new Promise(function(resolve, reject){
                console.log('saveRecordJS')
                txIds = [];
                trialuserMap = {};
                var a = 0;
                var b = 0;
                debugger
                let newCallBack = function newCallBack(result,indexNumber){
                    //赋值dataId和trialUser
                    document.getElementById('allPage:allForm:dataBlock:dataline_R_aws:'+indexNumber+':EditAWSDataId').value = result.object[0].dataId;
                    document.getElementById('allPage:allForm:dataBlock:dataline_R_aws:'+indexNumber+':TrialUserEncrypt').value = result.object[0].trialUserEncrypt;
                    document.getElementById('allPage:allForm:dataBlock:dataline_R:'+indexNumber+':inputField:6:inputField').value = result.object[0].trialUser;
                    // let transParameters = {
                    //     txId: result.txId,
                    //     isSuccess: 1
                    // };
                    // let confirmCallBack = function confirmCallBack(result){
                    //     console.log('confirmCallBack = '+JSON.stringify(result))
                    // }
                    b++;
                    txIds.push(result.txId)
                    //AWSService.confirmTrans(staticResource.transactionUrl,JSON.stringify(transParameters),confirmCallBack,staticResource.token)
                };
                for(var i=0;i<rowBList.length;i++){
                    if(document.getElementById('allPage:allForm:dataBlock:dataline_L:'+i+':rowCheck').checked == true){
                        a++;
                    }
                }
                for(var i=0;i<rowBList.length;i++){
                    if(document.getElementById('allPage:allForm:dataBlock:dataline_L:'+i+':rowCheck').checked == true){
                        //加密试用者
                        let e = document.getElementById('allPage:allForm:dataBlock:dataline_R:'+i+':inputField:6:j_id86').children[0].children[0];
                        var trialUser = e.value;
                        trialuserMap['allPage:allForm:dataBlock:dataline_R:'+i+':inputField:6:j_id86'] = trialUser;
                        let consumApplyPayloadList = [];
                        let consumApplyPIData = new Object();
                        consumApplyPIData.trialUser = trialUser;
                        consumApplyPIData.sfRecordId = '';
                        consumApplyPayloadList.push(consumApplyPIData);
                        AWSService.postConsumTrial(staticResource.newUrl,i,JSON.stringify(consumApplyPayloadList),newCallBack,staticResource.token);
                    }
                }
                var id = setInterval(function(){
                    if(a == b){
                        console.log('a==b success')
                        resolve('success');
                        clearInterval(id);
                    }
                },500);
            });
            return p;
        }
        function q4(){
            debugger
            saveRecord();
        }
        function Trans(){
            if(HasError()){
                unblockUI();
                for(var e in trialuserMap){
                    document.getElementById(e).children[0].children[0].value = trialuserMap[e];
                }
                return;
            }
            var x = 0;
            let confirmCallBack = function confirmCallBack(result){
                console.log('confirmCallBack = '+JSON.stringify(result))
                x++;
                if(x == txIds.length){
                    refopener();
                    unblockUI();
                    window.location.href='/apex/ConsumTrial?id=' + '{!parId}' + '&canedit=true&saveType=1';
                }
            }
            for(var i=0;i<txIds.length;i++){
                let transParameters = {
                        txId: txIds[i],
                        isSuccess: 1
                };
                AWSService.confirmTrans(staticResource.transactionUrl,JSON.stringify(transParameters),confirmCallBack,staticResource.token)
            }
        }
        function saveRecordJS(){
            if('{!pageB.fixMode}' != 'true'){
                    return
                }
            q3().then(function(data){
                    return q4(data);
                })
            unblockUI();
        }
        //2022 02 24 张华建 display PI Data end
    </script>
        <apex:pageMessages id="message"/>
        <!-- oncomplete="clearApplyValue(); return false;" -->
        <apex:actionFunction name="passApplyMsgToController" action="{!showApplyMsg}"  rerender="allForm">
            <apex:param name="applyMsg" value="" />
@@ -495,7 +569,7 @@
        <apex:actionFunction name="sendEmail" action="{!sendEmail}"  rerender="allForm" oncomplete="unblockUI();">
            <apex:param name="emailBody" value="" />
        </apex:actionFunction>
        <apex:actionFunction name="saveRecord" action="{!saveRecord}" oncomplete="refopener();unblockUI();" rerender="allForm"/>
        <apex:actionFunction name="saveRecord" action="{!saveRecord}" oncomplete="Trans();" rerender="allForm"/>
        <apex:inputHidden id="clearApplyFlagId" />
        <apex:outputPanel id="pageallPanel">
            <apex:pageBlock id="searchBlock">
@@ -631,6 +705,7 @@
                </div>
                <apex:repeat id="dataline_R_aws" value="{!pageB.rowBList}" var="var">
                    <apex:inputHidden value="{!var.rnd.AWS_Data_Id__c}" id="EditAWSDataId"/> 
                    <apex:inputHidden value="{!var.rnd.Trial_User_Encrypt__c}" id="TrialUserEncrypt"/>
                </apex:repeat>
                <div id="in_Div" style="overflow:auto;">
                    <table class="list" style="border-bottom-width: 0px; font-size:11px; border-spacing:0;" border="" id="tableData">
force-app/main/default/pages/FixtureRentalPDF.page
@@ -277,9 +277,14 @@
                        <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)}" />
                                        <!-- 20220413 ljh 抬头显示 update start -->
                                        <!-- <apex:outputText value="{!IF(record.isAgencyOrCenter,record.AgencyAddressName,centreAddress)}" /> -->
                                        <apex:outputText value="{!IF(isAgencyOrCenter,AgencyAddressName,centreAddress)}" />
                                        <!-- 20220413 ljh 抬头显示 update end -->
                                    </td>
                                    <td rowspan="2">
                                        <img style="float: right; width: 55px; height: 55px;padding: 0px;margin-top: 0mm;" src="{!qrcode}"
                                        />
@@ -287,8 +292,12 @@
                                </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)))}"
                                        <!-- 20220413 ljh 抬头显示 update start -->
                                        <!-- <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)))}"
                                        /> -->
                                        <c:PDFWbr targetStr="{!IF(AgencyOrCenterAddress=='BeiJingCenter','北京市朝阳区酒仙桥路10号恒通商务园B12C座西门1F 电话:010-59756006-1871',IF(AgencyOrCenterAddress=='ShangHaiCenter','上海市浦东新区金吉路778号3号楼1F 电话:021-60391318-8877',IF(AgencyOrCenterAddress=='GuangZhouCenter','广州市番禺区东环街番禺大道北537号番山创业中心3号楼1F 电话:020-39198888-8876',AgencyOrCenterAddress)))}"
                                        />
                                        <!-- 20220413 ljh 抬头显示 update start -->
                                    </td>
                                </tr>
                            </apex:outputPanel>
force-app/main/default/pages/NewAndEditASEActivity.page
@@ -495,7 +495,7 @@
                                <img src="/img/s.gif" alt="" class="minWidth" title="" width="1" height="1" />
                                <h2 class="mainTitle">{! SobjectLabel}<apex:outputText rendered="{!isNewMode}">{!$Label.New}</apex:outputText><apex:outputText rendered="{!not(isNewMode)}">{!$Label.Edit}</apex:outputText></h2>
                            </td>
                            <td class="pbButton" id="topButtonRow">
                            <td class="pbButton" id="topButtonRow" style="pointer-events: none; opacity: 0.4;">
                                <input class="btn" type="Button" value="{!$Label.Save}" onclick="saveSobjectProcess()" />
                                <input class="btn" type="Button" value="{!$Label.SaveAndNew}" onclick="saveSobjectProcess(1)" />
                                <apex:commandButton action="{!cancel}" value="{!$Label.Cancel}" />
@@ -517,8 +517,12 @@
                    <!--Each section has layoutFields, let's iterate them as well-->
                    <apex:repeat value="{!layoutSection.layoutFields}" var="layoutField">
                        <apex:inputField styleClass="{!ApiPrefix} {!ApiPrefix}_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!ASEActivity__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)}"
                        <apex:inputField styleClass="PIBackApi PIBackApi_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!ASEActivity__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)&&isNewMode}"
                            required="{!layoutField.isRequired}" />
                        <apex:inputField styleClass="PIBackApi PIBackApi_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!ASEActivity__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)&&not(isNewMode)&&layoutField.fieldAPI!='RecordTypeId'}"
                            required="{!layoutField.isRequired}" />
                        <apex:outputField styleClass="PIBackApi PIBackApi_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!ASEActivity__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)&&not(isNewMode)&&layoutField.fieldAPI=='RecordTypeId'}"
                       />
                        <apex:pageblocksectionitem rendered="{!layoutField.isPlaceHolder}">
                        </apex:pageblocksectionitem>
                    </apex:repeat>
@@ -526,18 +530,18 @@
                </apex:pageBlockSection>
            </apex:repeat>
            <script>
                var init_nodes = document.getElementsByClassName("PIBackApi");
                var api_id_map={};
                for(let ei in init_nodes){
                    let e = init_nodes[ei];
                    if(IsFormElement(e)){
                        if(e.getAttribute("multiple") != 'multiple' || e.style.display == 'none' && e.id.indexOf('selected') < 0){
                            api_id_map[GetEleApiName(e)] = e.id;
                        }
                    }
                }
                console.log(api_id_map);
                var init_nodes = document.getElementsByClassName("PIBackApi");
                var api_id_map={};
                for(let ei in init_nodes){
                    let e = init_nodes[ei];
                    if(IsFormElement(e)){
                        if(e.getAttribute("multiple") != 'multiple' || e.style.display == 'none' && e.id.indexOf('selected') < 0){
                            api_id_map[GetEleApiName(e)] = e.id;
                        }
                    }
                }
                console.log(api_id_map);
                
                sfdcPage.appendToOnloadQueue(function () {
@@ -571,6 +575,9 @@
                    //Replace Vlookup Field
                    replaceSearchContactLookup();
                    document.querySelectorAll("[data-id='OwnerId']")[0].classList.add("disabledbutton");
                    document.getElementById('topButtonRow').style = '';
                    document.getElementById('bottomButtonRow').style = '';
                    jQuery('a[data-id="OwnerId"]').remove();
                    /*
                    jQuery(".lookupInput").each(function(i,e){
@@ -628,7 +635,7 @@
                        <tr>
                            <td class="pbTitle">
                                <img src="/img/s.gif" alt="" class="minWidth" title="" width="1" height="1" />&nbsp;</td>
                            <td class="pbButtonb" id="bottomButtonRow">
                            <td class="pbButtonb" id="bottomButtonRow" style="pointer-events: none; opacity: 0.4;">
                                <input class="btn" type="Button" value="{!$Label.Save}" onclick="saveSobjectProcess()" />
                                <input class="btn" type="Button" value="{!$Label.SaveAndNew}" onclick="saveSobjectProcess()" />
                                <apex:commandButton action="{!cancel}" value="{!$Label.Cancel}" />
force-app/main/default/pages/NewAndEditAddress.page
@@ -81,7 +81,7 @@
            if(phone ){
                if(phone.value){
                    if(!/^1[3|5|8|7][0-9]\d{4,8}$/.test(phone.value)){
                        error_msg += ';电话号码错误';
                        error_msg += ';电话号码错误';
                    }
                }else{
                    if(phone.previousSibling && phone.previousSibling.className.indexOf('requiredBlock')>-1){
@@ -373,7 +373,7 @@
                                <img src="/img/s.gif" alt="" class="minWidth" title="" width="1" height="1" />
                                <h2 class="mainTitle">收货地址编辑</h2>
                            </td>
                            <td class="pbButton" id="topButtonRow">
                            <td class="pbButton" id="topButtonRow" style="pointer-events: none; opacity: 0.4;">
                                <input class="btn" type="Button" value="保存" onclick="saveAddressProcess('Save')" />
                                <input class="btn" type="Button" value="保存并新建" onclick="saveAddressProcess('SaveAndNew')" />
                                <apex:commandButton action="{!cancel}" value="取消" />
@@ -396,8 +396,12 @@
                    
                    <!--Each section has layoutFields, let's iterate them as well-->
                    <apex:repeat value="{!layoutSection.layoutFields}" var="layoutField">
                        <apex:inputField html-data-id="{!layoutField.fieldAPI}" value="{!Address__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)}"
                        <apex:inputField styleClass="PIBackApi PIBackApi_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!Address__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)&&isNewMode}"
                            required="{!layoutField.isRequired}" />
                        <apex:inputField styleClass="PIBackApi PIBackApi_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!Address__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)&&not(isNewMode)&&layoutField.fieldAPI!='RecordTypeId'}"
                            required="{!layoutField.isRequired}" />
                        <apex:outputField styleClass="PIBackApi PIBackApi_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!Address__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)&&not(isNewMode)&&layoutField.fieldAPI=='RecordTypeId'}"
                       />
                        <apex:pageblocksectionitem rendered="{!layoutField.isPlaceHolder}">
                        </apex:pageblocksectionitem>
                    </apex:repeat>
@@ -437,6 +441,8 @@
                    replaceSearchContactLookup();
                    //3. Set Readonly Attribute
                    // document.querySelector("[data-id='OwnerId']").classList.add("disabledbutton");
                    document.getElementById('topButtonRow').style = '';
              document.getElementById('bottomButtonRow').style = '';
                    /*
                    jQuery(".lookupInput").each(function(i,e){
                        let je =jQuery(e).find('input');
@@ -495,7 +501,7 @@
                        <tr>
                            <td class="pbTitle">
                                <img src="/img/s.gif" alt="" class="minWidth" title="" width="1" height="1" />&nbsp;</td>
                            <td class="pbButtonb" id="bottomButtonRow">
                            <td class="pbButtonb" id="bottomButtonRow" style="pointer-events: none; opacity: 0.4;">
                                <input class="btn" type="Button" value="保存" onclick="saveAddressProcess('Save')" />
                                <input class="btn" type="Button" value="保存并新建" onclick="saveAddressProcess('SaveAndNew')" />
                                <apex:commandButton action="{!cancel}" value="取消" />
force-app/main/default/pages/NewAndEditAgencyContact.page
@@ -123,7 +123,7 @@
        }
    
        var staticResources = JSON.parse('{!staticResource}');
        var staticResourceAWSContact = JSON.parse('{!staticResourceAWSContact}');
        var staticResourceAWSContact = JSON.parse('{!staticResourceAWSContact}');
    
        var requiredFieldAPIList = JSON.parse('{!requiredFieldAPIListStr}');
        var fieldAPIToLabelMap = JSON.parse('{!fieldAPIToLabelMapStr}');
@@ -132,7 +132,7 @@
        function ProcessPI(sobjJson, payloadForNewPI) {
            blockme();
            if ({!isNewMode} || {!isCloneMode}) {
                NewPIToAWS(sobjJson, payloadForNewPI)
                NewPIToAWS(sobjJson, payloadForNewPI)
            }else {
                UpdatePIToAWS(sobjJson, payloadForNewPI)
            }
@@ -160,8 +160,8 @@
            }
            return ['input','select','textarea'].indexOf(tag_name.toLowerCase())>-1;
        }
        function IsFormElement(e){
        function IsFormElement(e){
            return IsFormTag(e.tagName);
        }
@@ -422,7 +422,7 @@
            let dataId = contactsInfo[sfId];
            
            if(dataId){
                AWSService.query(staticResourceAWSContact.queryUrl,dataId,function(result){
                AWSService.query(staticResourceAWSContact.queryUrl,dataId,function(result){
                    if(result.object){
                        document.querySelector("[data-id='Contact__c']").value = result.object.lastName;
                    }
@@ -464,7 +464,7 @@
                                <img src="/img/s.gif" alt="" class="minWidth" title="" width="1" height="1" />
                                <h2 class="mainTitle">{! SobjectLabel}<apex:outputText rendered="{!isNewMode || isCloneMode}">{!$Label.New}</apex:outputText><apex:outputText rendered="{!not(isNewMode || isCloneMode)}">{!$Label.Edit}</apex:outputText></h2>
                            </td>
                            <td class="pbButton" id="topButtonRow">
                            <td class="pbButton" id="topButtonRow" style="pointer-events: none; opacity: 0.4;">
                                <input class="btn" type="Button" value="{!$Label.Save}" onclick="saveSobjectProcess()" />
                                <input class="btn" type="Button" value="{!$Label.SaveAndNew}" onclick="saveSobjectProcess(1)" />
                                <apex:commandButton action="{!cancel}" value="{!$Label.Cancel}" />
@@ -486,8 +486,10 @@
                    <!--Each section has layoutFields, let's iterate them as well-->
                    <apex:repeat value="{!layoutSection.layoutFields}" var="layoutField">
                        <apex:inputField styleClass="{!ApiPrefix} {!ApiPrefix}_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!Agency_Contact__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)}"
                        <apex:inputField styleClass="{!ApiPrefix} {!ApiPrefix}_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!Agency_Contact__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)&&layoutField.fieldAPI!='RecordTypeId'}"
                            required="{!layoutField.isRequired}" />
                        <apex:outputField styleClass="PIBackApi PIBackApi_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!Agency_Contact__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)&&layoutField.fieldAPI=='RecordTypeId'}"
                        />
                        <apex:pageblocksectionitem rendered="{!layoutField.isPlaceHolder}">
                        </apex:pageblocksectionitem>
                    </apex:repeat>
@@ -495,7 +497,7 @@
                </apex:pageBlockSection>
            </apex:repeat>
            <script>
                var init_nodes = document.getElementsByClassName("PIBackApi");
                var init_nodes = document.getElementsByClassName("PIBackApi");
                var api_id_map={};
                for(let ei in init_nodes){
                    let e = init_nodes[ei];
@@ -508,7 +510,7 @@
                }
                console.log(api_id_map);
                sfdcPage.appendToOnloadQueue(function () {
                    jQuery('option').each(function(i,e){
                    jQuery('option').each(function(i,e){
                        if(e.value == '_\x01_'){
                            e.value = '';
                        }
@@ -538,6 +540,8 @@
                    }
                    jQuery('a[data-id="OwnerId"]').remove();
                    document.getElementById('topButtonRow').style = '';
                    document.getElementById('bottomButtonRow').style = '';
                    /*
                    jQuery(".lookupInput").each(function(i,e){
                        let je =jQuery(e).find('input');
@@ -606,7 +610,7 @@
                        <tr>
                            <td class="pbTitle">
                                <img src="/img/s.gif" alt="" class="minWidth" title="" width="1" height="1" />&nbsp;</td>
                            <td class="pbButtonb" id="bottomButtonRow">
                            <td class="pbButtonb" id="bottomButtonRow" style="pointer-events: none; opacity: 0.4;">
                                <input class="btn" type="Button" value="{!$Label.Save}" onclick="saveSobjectProcess()" />
                                <input class="btn" type="Button" value="{!$Label.SaveAndNew}" onclick="saveSobjectProcess()" />
                                <apex:commandButton action="{!cancel}" value="{!$Label.Cancel}" />
force-app/main/default/pages/NewAndEditCampaignMember.page
@@ -114,7 +114,7 @@
        function ProcessPI(sobjJson, payloadForNewPI) {
            blockme();
            if ({!isNewMode}) {
                NewPIToAWS(sobjJson, payloadForNewPI)
                NewPIToAWS(sobjJson, payloadForNewPI)
            }else {
                UpdatePIToAWS(sobjJson, payloadForNewPI)
            }
@@ -359,7 +359,7 @@
                                <img src="/img/s.gif" alt="" class="minWidth" title="" width="1" height="1" />
                                <h2 class="mainTitle">{! SobjectLabel}<apex:outputText rendered="{!isNewMode}">{!$Label.New}</apex:outputText><apex:outputText rendered="{!not(isNewMode)}">{!$Label.Edit}</apex:outputText></h2>
                            </td>
                            <td class="pbButton" id="topButtonRow">
                            <td class="pbButton" id="topButtonRow" style="pointer-events: none; opacity: 0.4;">
                                <input class="btn" type="Button" value="{!$Label.Save}" onclick="saveSobjectProcess()" />
                                <input class="btn" type="Button" value="{!$Label.SaveAndNew}" onclick="saveSobjectProcess(1)" />
                                <apex:commandButton action="{!cancel}" value="{!$Label.Cancel}" />
@@ -381,8 +381,12 @@
                    <!--Each section has layoutFields, let's iterate them as well-->
                    <apex:repeat value="{!layoutSection.layoutFields}" var="layoutField">
                        <apex:inputField styleClass="{!ApiPrefix} {!ApiPrefix}_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!CampaignMember__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)}"
                        <apex:inputField styleClass="PIBackApi PIBackApi_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!CampaignMember__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)&&isNewMode}"
                            required="{!layoutField.isRequired}" />
                        <apex:inputField styleClass="PIBackApi PIBackApi_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!CampaignMember__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)&&not(isNewMode)&&layoutField.fieldAPI!='RecordTypeId'}"
                            required="{!layoutField.isRequired}" />
                        <apex:outputField styleClass="PIBackApi PIBackApi_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!CampaignMember__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)&&not(isNewMode)&&layoutField.fieldAPI=='RecordTypeId'}"
                       />
                        <apex:pageblocksectionitem rendered="{!layoutField.isPlaceHolder}">
                        </apex:pageblocksectionitem>
                    </apex:repeat>
@@ -398,6 +402,9 @@
                    if (!{!isNewMode}) {
                        QuerySobjectFromAWS();
                    }   
                    document.getElementById('topButtonRow').style = '';
                document.getElementById('bottomButtonRow').style = '';
                });
            </script>
            <div class="pbBottomButtons">
@@ -406,7 +413,7 @@
                        <tr>
                            <td class="pbTitle">
                                <img src="/img/s.gif" alt="" class="minWidth" title="" width="1" height="1" />&nbsp;</td>
                            <td class="pbButtonb" id="bottomButtonRow">
                            <td class="pbButtonb" id="bottomButtonRow" style="pointer-events: none; opacity: 0.4;">
                                <input class="btn" type="Button" value="{!$Label.Save}" onclick="saveSobjectProcess()" />
                                <input class="btn" type="Button" value="{!$Label.SaveAndNew}" onclick="saveSobjectProcess()" />
                                <apex:commandButton action="{!cancel}" value="{!$Label.Cancel}" />
force-app/main/default/pages/NewAndEditCase.page
@@ -395,7 +395,7 @@
                                <img src="/img/s.gif" alt="" class="minWidth" title="" width="1" height="1" />
                                <h2 class="mainTitle">CIC编辑</h2>
                            </td>
                            <td class="pbButton" id="topButtonRow">
                            <td class="pbButton" id="topButtonRow" style="pointer-events: none; opacity: 0.4;">
                                <input class="btn" type="Button" value="保存" onclick="saveCaseProcess('Save')" />
                                <input class="btn" type="Button" value="保存并关闭" onclick="saveCaseProcess('SaveAndClose')" />
                                <input class="btn" type="Button" value="保存并新建" onclick="saveCaseProcess('SaveAndNew')" />
@@ -417,8 +417,10 @@
                <apex:pageBlockSection title="{!layoutSection.name}" showHeader="{!layoutSection.useHeader}" collapsible="{!layoutSection.allowCollapse}" columns="{!layoutSection.columns}">
                    <!--Each section has layoutFields, let's iterate them as well-->
                    <apex:repeat value="{!layoutSection.layoutFields}" var="layoutField">
                        <apex:inputField html-data-id="{!layoutField.fieldAPI}" value="{!Case[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)}"
                            required="{!layoutField.isRequired}" />
                        <apex:inputField html-data-id="{!layoutField.fieldAPI}" value="{!Case[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)&&isNewMode}" required="{!layoutField.isRequired}" />
                        <apex:inputField html-data-id="{!layoutField.fieldAPI}" value="{!Case[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)&&not(isNewMode)&&layoutField.fieldAPI!='RecordTypeId'}}" required="{!layoutField.isRequired}" />
                        <apex:outputField html-data-id="{!layoutField.fieldAPI}" value="{!Case[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)&&not(isNewMode)&&layoutField.fieldAPI=='RecordTypeId'}}"  />
                        <apex:pageblocksectionitem rendered="{!layoutField.isPlaceHolder}">
                        </apex:pageblocksectionitem>
                    </apex:repeat>
@@ -432,7 +434,19 @@
                        for (let n = 0; n < layoutSection.length; n++) {
                            let layoutField = layoutSection[n];
                            if (layoutField.fieldAPI != '' && document.querySelector("[data-id='"+layoutField.fieldAPI+"']") != null) {
                                document.querySelector("[data-id='"+layoutField.fieldAPI+"']").disabled = !(layoutField.editableField);
                                let e = document.querySelector("[data-id='"+layoutField.fieldAPI+"']");
                                e.disabled = !(layoutField.editableField);
                                /*
                                if (!(layoutField.editableField)) {
                                    if (e.getAttribute("multiple") && e.getAttribute("multiple") == 'multiple') {
                                        e.parentNode.classList.add("disabledbutton");
                                    }else if (e.tagName == 'DIV') {
                                        e.classList.add("disabledbutton");
                                    }else if (VLookUpFields.indexOf(layoutField.fieldAPI) >= 0) {
                                        e.parentNode.classList.add("disabledbutton");
                                    }
                                }
                                */
                            }
                        }
                    }
@@ -450,6 +464,9 @@
                    //3. Set Readonly Attribute
                    document.querySelector("[data-id='OwnerId']").classList.add("disabledbutton");
                    document.querySelector("[data-id='RecordTypeId']").classList.add("disabledbutton");
                    document.getElementById('topButtonRow').style = '';
                    document.getElementById('bottomButtonRow').style = '';
                    //需要隐藏
                    // document.querySelector("[data-id='SuppliedEmail']").classList.add("displayblock");
                    
@@ -509,7 +526,7 @@
                        <tr>
                            <td class="pbTitle">
                                <img src="/img/s.gif" alt="" class="minWidth" title="" width="1" height="1" />&nbsp;</td>
                            <td class="pbButton" id="bottomButtonRow">
                            <td class="pbButton" id="bottomButtonRow" style="pointer-events: none; opacity: 0.4;">
                                <input class="btn" type="Button" value="保存" onclick="saveCaseProcess('Save')" />
                                <input class="btn" type="Button" value="保存并关闭" onclick="saveCaseProcess('SaveAndClose')" />
                                <input class="btn" type="Button" value="保存并新建" onclick="saveCaseProcess('SaveAndNew')" />
force-app/main/default/pages/NewAndEditContact.page
@@ -416,7 +416,7 @@
                                <img src="/img/s.gif" alt="" class="minWidth" title="" width="1" height="1" />
                                <h2 class="mainTitle">{! SobjectLabel}<apex:outputText rendered="{!isNewMode || isCloneMode}">{!$Label.New}</apex:outputText><apex:outputText rendered="{!not(isNewMode || isCloneMode)}">{!$Label.Edit}</apex:outputText></h2>
                            </td>
                            <td class="pbButton" id="topButtonRow">
                            <td class="pbButton" id="topButtonRow" style="pointer-events: none; opacity: 0.4;">
                                <input class="btn" type="Button" value="{!$Label.Save}" onclick="saveSobjectProcess()" />
                                <input class="btn" type="Button" value="{!$Label.SaveAndNew}" onclick="saveSobjectProcess(1)" />
                                <apex:commandButton action="{!cancel}" value="{!$Label.Cancel}" />
@@ -438,8 +438,9 @@
                    
                    <!--Each section has layoutFields, let's iterate them as well-->
                    <apex:repeat value="{!layoutSection.layoutFields}" var="layoutField">
                        <apex:inputField styleClass="{!ApiPrefix} {!ApiPrefix}_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!Contact[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)}"
                                         required="{!layoutField.isRequired}" />
                        <apex:inputField styleClass="{!ApiPrefix} {!ApiPrefix}_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!Contact[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)&&isNewMode}" required="{!layoutField.isRequired}" />
                        <apex:inputField styleClass="{!ApiPrefix} {!ApiPrefix}_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!Contact[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)&&not(isNewMode)&&layoutField.fieldAPI!='RecordTypeId'}" required="{!layoutField.isRequired}" />
                        <apex:outputField styleClass="{!ApiPrefix} {!ApiPrefix}_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!Contact[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)&&not(isNewMode)&&layoutField.fieldAPI=='RecordTypeId'}" />
                        <apex:pageblocksectionitem rendered="{!layoutField.isPlaceHolder}">
                        </apex:pageblocksectionitem>
                    </apex:repeat>
@@ -487,6 +488,9 @@
                        oi.value = '{!CurrentUserId}'
                    }
                }
                document.getElementById('topButtonRow').style = '';
           document.getElementById('bottomButtonRow').style = '';
                jQuery('a[data-id="OwnerId"]').remove();
                var layoutSections = JSON.parse('{!layoutSectionsStr}');
@@ -508,7 +512,7 @@
                        <tr>
                            <td class="pbTitle">
                                <img src="/img/s.gif" alt="" class="minWidth" title="" width="1" height="1" />&nbsp;</td>
                            <td class="pbButtonb" id="bottomButtonRow">
                            <td class="pbButtonb" id="bottomButtonRow" style="pointer-events: none; opacity: 0.4;">
                                <input class="btn" type="Button" value="{!$Label.Save}" onclick="saveSobjectProcess()" />
                                <input class="btn" type="Button" value="{!$Label.SaveAndNew}" onclick="saveSobjectProcess()" />
                                <apex:commandButton action="{!cancel}" value="{!$Label.Cancel}" />
force-app/main/default/pages/NewAndEditInquiryForm.page
@@ -422,7 +422,7 @@
        function replaceSearchContactLookup() {
            let lookUpNode = htmlToElement(contactHtmlString);
            console.log(lookUpNode);
            let eleContactValue = document.querySelector("[data-id='Contact_Name__c']").parentNode.parentNode.children[1].value;
            let eleContactValue = document.querySelector("[data-id='Contact_Name__c']").parentNode.parentNode.children[0].value;
            if (eleContactValue) {
                if (!{!isNewMode} || (eleContactValue != '000000000000000')) {
                    //1. Query Contact from AWS by AWSDataId
@@ -556,7 +556,7 @@
                                <img src="/img/s.gif" alt="" class="minWidth" title="" width="1" height="1" />
                                <h2 class="mainTitle">{! SobjectLabel}<apex:outputText rendered="{!isNewMode || isCloneMode}">{!$Label.New}</apex:outputText><apex:outputText rendered="{!not(isNewMode || isCloneMode)}">{!$Label.Edit}</apex:outputText></h2>
                            </td>
                            <td class="pbButton" id="topButtonRow">
                            <td class="pbButton" id="topButtonRow" style="pointer-events: none; opacity: 0.4;">
                                <input class="btn" type="Button" value="{!$Label.Save}" onclick="saveSobjectProcess()" />
                                <input class="btn" type="Button" value="{!$Label.SaveAndNew}" onclick="saveSobjectProcess(1)" />
                                <apex:commandButton action="{!cancel}" value="{!$Label.Cancel}" />
@@ -578,8 +578,9 @@
                    <!--Each section has layoutFields, let's iterate them as well-->
                    <apex:repeat value="{!layoutSection.layoutFields}" var="layoutField">
                        <apex:inputField styleClass="{!ApiPrefix} {!ApiPrefix}_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!Inquiry_form__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)}"
                            required="{!layoutField.isRequired}" />
                        <apex:inputField styleClass="{!ApiPrefix} {!ApiPrefix}_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!Inquiry_form__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)&&isNewMode}"  required="{!layoutField.isRequired}" />
                        <apex:inputField styleClass="{!ApiPrefix} {!ApiPrefix}_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!Inquiry_form__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)&&not(isNewMode)&&layoutField.fieldAPI!='RecordTypeId'}"  required="{!layoutField.isRequired}" />
                        <apex:outputField styleClass="{!ApiPrefix} {!ApiPrefix}_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!Inquiry_form__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)&&not(isNewMode)&&layoutField.fieldAPI=='RecordTypeId'}"  />
                        <apex:pageblocksectionitem rendered="{!layoutField.isPlaceHolder}">
                        </apex:pageblocksectionitem>
                    </apex:repeat>
@@ -646,7 +647,8 @@
                    replaceSearchLeadLookup(); 
                    document.querySelectorAll("[data-id='OwnerId']")[0].classList.add("disabledbutton");
                    // document.querySelectorAll("[data-id='OwnerId']")[1].classList.add("disabledbutton");
                    document.getElementById('topButtonRow').style = '';
                    document.getElementById('bottomButtonRow').style = '';
                    jQuery('a[data-id="OwnerId"]').remove();
                    //Updated by Li Jun 20220322 Start
@@ -714,7 +716,7 @@
                        JSON.stringify(lookups), lookup_id,
                        function (result, event) {
                            console.log("result = " + result);
                            if (result != null ){
                            if (result != null && result != '{}'){
                                var obj = JSON.parse(result.replaceAll('&'+'quot;','"'));
                                for (let i = 0; i < lookups.length; i++) {
                                    let lookup = lookups[i];
@@ -737,7 +739,10 @@
                                    }
                                }
                            }
                            }else {
                                clearVlookup('Department_Class__c');
                                clearVlookup('Hospital__c');
                            }
                        },
                        { escape: true }
                    );
@@ -766,7 +771,7 @@
                        <tr>
                            <td class="pbTitle">
                                <img src="/img/s.gif" alt="" class="minWidth" title="" width="1" height="1" />&nbsp;</td>
                            <td class="pbButtonb" id="bottomButtonRow">
                            <td class="pbButtonb" id="bottomButtonRow" style="pointer-events: none; opacity: 0.4;">
                                <input class="btn" type="Button" value="{!$Label.Save}" onclick="saveSobjectProcess()" />
                                <input class="btn" type="Button" value="{!$Label.SaveAndNew}" onclick="saveSobjectProcess()" />
                                <apex:commandButton action="{!cancel}" value="{!$Label.Cancel}" />
force-app/main/default/pages/NewAndEditInspectionReport.page
@@ -397,7 +397,7 @@
                                <img src="/img/s.gif" alt="" class="minWidth" title="" width="1" height="1" />
                                <h2 class="mainTitle">{! SobjectLabel}<apex:outputText rendered="{!isNewMode}">{!$Label.New}</apex:outputText><apex:outputText rendered="{!not(isNewMode)}">{!$Label.Edit}</apex:outputText></h2>
                            </td>
                            <td class="pbButton" id="topButtonRow">
                            <td class="pbButton" id="topButtonRow" style="pointer-events: none; opacity: 0.4;">
                                <input class="btn" type="Button" value="{!$Label.Save}" onclick="saveSobjectProcess()" />
                                <input class="btn" type="Button" value="{!$Label.SaveAndNew}" onclick="saveSobjectProcess(1)" />
                                <apex:commandButton action="{!cancel}" value="{!$Label.Cancel}" />
@@ -473,11 +473,13 @@
                    }
                    
                    //Replace Contact Vlookup Field
                    replaceSearchContactLookup();
                    //replaceSearchContactLookup();
                    //Replace Lead Vlookup Field
                    replaceSearchLeadLookup();
                    document.querySelectorAll("[data-id='OwnerId']")[0].classList.add("disabledbutton");
                    //replaceSearchLeadLookup();
                    //document.querySelectorAll("[data-id='OwnerId']")[0].classList.add("disabledbutton");
                    // document.querySelectorAll("[data-id='OwnerId']")[1].classList.add("disabledbutton");
                    document.getElementById('topButtonRow').style = '';
             document.getElementById('bottomButtonRow').style = '';
                    
                    jQuery('a[data-id="OwnerId"]').remove();
@@ -505,7 +507,7 @@
                    //         clearVlookup('Hospital__c');
                    //     }
                    // });
                    /*
                    jQuery("body").on("change","input[data-id='Hospital_Name__c']",function(){
                        setTimeout(() => {
                            console.log(document.getElementById(this.id+'_lkid').value);
@@ -520,7 +522,8 @@
                                clearVlookup('Hospital__c');
                            }
                        }, 50);
                    });
                    });
                    */
                });
            </script>
@@ -530,7 +533,7 @@
                        <tr>
                            <td class="pbTitle">
                                <img src="/img/s.gif" alt="" class="minWidth" title="" width="1" height="1" />&nbsp;</td>
                            <td class="pbButtonb" id="bottomButtonRow">
                            <td class="pbButtonb" id="bottomButtonRow" style="pointer-events: none; opacity: 0.4;">
                                <input class="btn" type="Button" value="{!$Label.Save}" onclick="saveSobjectProcess()" />
                                <input class="btn" type="Button" value="{!$Label.SaveAndNew}" onclick="saveSobjectProcess()" />
                                <apex:commandButton action="{!cancel}" value="{!$Label.Cancel}" />
force-app/main/default/pages/NewAndEditLead.page
@@ -414,7 +414,7 @@
                                <img src="/img/s.gif" alt="" class="minWidth" title="" width="1" height="1" />
                                <h2 class="mainTitle">意向编辑</h2>
                            </td>
                            <td class="pbButton" id="topButtonRow">
                            <td class="pbButton" id="topButtonRow" style="pointer-events: none; opacity: 0.4;">
                                <input class="btn" type="Button" value="保存" onclick="saveLeadProcess('Save')" />
                                <input class="btn" type="Button" value="保存并新建" onclick="saveLeadProcess('SaveAndNew')" />
                                <apex:commandButton action="{!cancel}" value="取消" />
@@ -437,8 +437,9 @@
                    <!--Each section has layoutFields, let's iterate them as well-->
                    <apex:repeat value="{!layoutSection.layoutFields}" var="layoutField">
                        <apex:inputField html-data-id="{!layoutField.fieldAPI}" value="{!Lead[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)}"
                            required="{!layoutField.isRequired}" />
                        <apex:inputField html-data-id="{!layoutField.fieldAPI}" value="{!Lead[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)&&isNewMode}" required="{!layoutField.isRequired}" />
                        <apex:inputField html-data-id="{!layoutField.fieldAPI}" value="{!Lead[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)&&layoutField.fieldAPI!='RecordTypeId'}" required="{!layoutField.isRequired}" />
                        <apex:outputField html-data-id="{!layoutField.fieldAPI}" value="{!Lead[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)&&layoutField.fieldAPI=='RecordTypeId'}"   />
                        <apex:pageblocksectionitem rendered="{!layoutField.isPlaceHolder}">
                        </apex:pageblocksectionitem>
                    </apex:repeat>
@@ -576,6 +577,9 @@
                    
                    unblockUI();
                }
                document.getElementById('topButtonRow').style = '';
           document.getElementById('bottomButtonRow').style = '';
                let previous_value = {};
                    jQuery(".lookupInput input").each(function(i,e){
                        let je =jQuery(e);
@@ -701,7 +705,7 @@
                        <tr>
                            <td class="pbTitle">
                                <img src="/img/s.gif" alt="" class="minWidth" title="" width="1" height="1" />&nbsp;</td>
                            <td class="pbButton" id="bottomButtonRow">
                            <td class="pbButton" id="bottomButtonRow" style="pointer-events: none; opacity: 0.4;">
                                <input class="btn" type="Button" value="保存" onclick="saveLeadProcess('Save')" />
                                <input class="btn" type="Button" value="保存并新建" onclick="saveLeadProcess('SaveAndNew')" />
                                <apex:commandButton action="{!cancel}" value="取消" />
force-app/main/default/pages/NewAndEditQIS.page
@@ -441,7 +441,7 @@
                                <img src="/img/s.gif" alt="" class="minWidth" title="" width="1" height="1" />
                                <h2 class="mainTitle">{! SobjectLabel}<apex:outputText rendered="{!isNewMode}">{!$Label.New}</apex:outputText><apex:outputText rendered="{!not(isNewMode)}">{!$Label.Edit}</apex:outputText></h2>
                            </td>
                            <td class="pbButton" id="topButtonRow">
                            <td class="pbButton" id="topButtonRow" style="pointer-events: none; opacity: 0.4;">
                                <input class="btn" type="Button" value="{!$Label.Save}" onclick="saveSobjectProcess()" />
                                <input class="btn" type="Button" value="{!$Label.SaveAndNew}" onclick="saveSobjectProcess(1)" />
                                <apex:commandButton action="{!cancel}" value="{!$Label.Cancel}" />
@@ -524,6 +524,8 @@
                            oi.value = '{!CurrentUserId}'
                        }
                    }
                document.getElementById('topButtonRow').style = '';
           document.getElementById('bottomButtonRow').style = '';
            });
            </script>
            <div class="pbBottomButtons">
@@ -532,7 +534,7 @@
                        <tr>
                            <td class="pbTitle">
                                <img src="/img/s.gif" alt="" class="minWidth" title="" width="1" height="1" />&nbsp;</td>
                            <td class="pbButtonb" id="bottomButtonRow">
                            <td class="pbButtonb" id="bottomButtonRow" style="pointer-events: none; opacity: 0.4;">
                                <input class="btn" type="Button" value="{!$Label.Save}" onclick="saveSobjectProcess()" />
                                <input class="btn" type="Button" value="{!$Label.SaveAndNew}" onclick="saveSobjectProcess()" />
                                <apex:commandButton action="{!cancel}" value="{!$Label.Cancel}" />
force-app/main/default/pages/NewAndEditRepairSubOrder.page
@@ -1,10 +1,3 @@
<!--
  @description       :
  @author            : ChangeMeIn@UserSettingsUnder.SFDoc
  @group             :
  @last modified on  : 03-23-2022
  @last modified by  : ChangeMeIn@UserSettingsUnder.SFDoc
-->
<apex:page standardController="RepairSubOrder__c" extensions="NewAndEditRepairSubOrderController" id="page">
    <apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }" />
    <script src="../../soap/ajax/53.0/connection.js" type="text/javascript"></script>
@@ -267,6 +260,9 @@
                } else {
                    result[field_api_name] = ele.value;
                }
            }
            if(api_id_map['AssetType__c']){
                result.AssetType__c= document.getElementById(api_id_map['AssetType__c']).value!='_\x01_'?document.getElementById(api_id_map['AssetType__c']).value:'';
            }
            return result;
        }
@@ -535,7 +531,7 @@
                                <img src="/img/s.gif" alt="" class="minWidth" title="" width="1" height="1" />
                                <h2 class="mainTitle">{! SobjectLabel}<apex:outputText rendered="{!isNewMode}">{!$Label.New}</apex:outputText><apex:outputText rendered="{!not(isNewMode)}">{!$Label.Edit}</apex:outputText></h2>
                            </td>
                            <td class="pbButton" id="topButtonRow">
                            <td class="pbButton" id="topButtonRow" style="pointer-events: none; opacity: 0.4;">
                                <input class="btn" type="Button" value="{!$Label.Save}" onclick="saveSobjectProcess()" />
                                <input class="btn" type="Button" value="{!$Label.SaveAndNew}" onclick="saveSobjectProcess(1)" />
                                <apex:commandButton action="{!cancel}" value="{!$Label.Cancel}" />
@@ -557,8 +553,12 @@
                    <!--Each section has layoutFields, let's iterate them as well-->
                    <apex:repeat value="{!layoutSection.layoutFields}" var="layoutField">
                        <apex:inputField styleClass="{!ApiPrefix} {!ApiPrefix}_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!RepairSubOrder__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)}"
                        <apex:inputField styleClass="PIBackApi PIBackApi_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!RepairSubOrder__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)&&isNewMode}"
                            required="{!layoutField.isRequired}" />
                        <apex:inputField styleClass="PIBackApi PIBackApi_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!RepairSubOrder__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)&&not(isNewMode)&&layoutField.fieldAPI!='RecordTypeId'}"
                            required="{!layoutField.isRequired}" />
                        <apex:outputField styleClass="PIBackApi PIBackApi_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!RepairSubOrder__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)&&not(isNewMode)&&layoutField.fieldAPI=='RecordTypeId'}"
                       />
                        <apex:pageblocksectionitem rendered="{!layoutField.isPlaceHolder}">
                        </apex:pageblocksectionitem>
                    </apex:repeat>
@@ -568,16 +568,16 @@
            <script>
                var init_nodes = document.getElementsByClassName("PIBackApi");
                var api_id_map={};
                for(let ei in init_nodes){
                    let e = init_nodes[ei];
                    if(IsFormElement(e)){
                        if(e.getAttribute("multiple") != 'multiple' || e.style.display == 'none' && e.id.indexOf('selected') < 0){
                            api_id_map[GetEleApiName(e)] = e.id;
                        }
                    }
                }
                console.log(api_id_map);
                for(let ei in init_nodes){
                    let e = init_nodes[ei];
                    if(IsFormElement(e)){
                        if(e.getAttribute("multiple") != 'multiple' || e.style.display == 'none' && e.id.indexOf('selected') < 0){
                            api_id_map[GetEleApiName(e)] = e.id;
                        }
                    }
                }
                console.log(api_id_map);
    
                sfdcPage.appendToOnloadQueue(function () {
                    var layoutSections = JSON.parse('{!layoutSectionsStr}');
@@ -611,7 +611,8 @@
                    replaceSearchContactLookup();
                    //3. Set Readonly Attribute
                    document.querySelectorAll("[data-id='OwnerId']")[0].classList.add("disabledbutton");
                    document.getElementById('topButtonRow').style = '';
                    document.getElementById('bottomButtonRow').style = '';
                    jQuery('a[data-id="OwnerId"]').remove();
                    /*
                    jQuery(".lookupInput").each(function(i,e){
@@ -669,7 +670,7 @@
                        <tr>
                            <td class="pbTitle">
                                <img src="/img/s.gif" alt="" class="minWidth" title="" width="1" height="1" />&nbsp;</td>
                            <td class="pbButtonb" id="bottomButtonRow">
                            <td class="pbButtonb" id="bottomButtonRow" style="pointer-events: none; opacity: 0.4;">
                                <input class="btn" type="Button" value="{!$Label.Save}" onclick="saveSobjectProcess()" />
                                <input class="btn" type="Button" value="{!$Label.SaveAndNew}" onclick="saveSobjectProcess()" />
                                <apex:commandButton action="{!cancel}" value="{!$Label.Cancel}" />
force-app/main/default/pages/NewAndEditReport.page
@@ -111,13 +111,22 @@
                }
            }
            //手术分类1
            result.Technical_Category1__c = document.getElementById('page:form:j_id5:j_id35:4:j_id36:j_id37:2:j_id38')!=null?document.getElementById('page:form:j_id5:j_id35:4:j_id36:j_id37:2:j_id38').value:'';
            //手术分类2
            result.Technical_Category2__c = document.getElementById('page:form:j_id5:j_id35:4:j_id36:j_id37:4:j_id38')!=null?document.getElementById('page:form:j_id5:j_id35:4:j_id36:j_id37:4:j_id38').value:'';
            //目的2
            if(document.getElementById('page:form:j_id5:j_id35:2:j_id36:j_id37:1:j_id38')){
                result.Purpose2__c = document.getElementById('page:form:j_id5:j_id35:2:j_id36:j_id37:1:j_id38').value;
            if(api_id_map['Technical_Category1__c']){
                result.Technical_Category1__c = document.getElementById(api_id_map['Technical_Category1__c']).value!='_\x01_'?document.getElementById(api_id_map['Technical_Category1__c']).value:'';
            }
            //result.Technical_Category1__c = document.getElementById('page:form:j_id5:j_id35:4:j_id36:j_id37:2:j_id38')!=null?document.getElementById('page:form:j_id5:j_id35:4:j_id36:j_id37:2:j_id38').value:'';
            //手术分类2
            if(api_id_map['Technical_Category2__c']){
                result.Technical_Category2__c = document.getElementById(api_id_map['Technical_Category2__c']).value!='_\x01_'?document.getElementById(api_id_map['Technical_Category2__c']).value:'';
            }
            //result.Technical_Category2__c = document.getElementById('page:form:j_id5:j_id35:4:j_id36:j_id37:4:j_id38')!=null?document.getElementById('page:form:j_id5:j_id35:4:j_id36:j_id37:4:j_id38').value:'';
            //目的2
            if(api_id_map['Purpose2__c']){
                result.Purpose2__c = document.getElementById(api_id_map['Purpose2__c']).value;
            }
            // if(document.getElementById('page:form:j_id5:j_id35:2:j_id36:j_id37:1:j_id38')){
            //     result.Purpose2__c = document.getElementById('page:form:j_id5:j_id35:2:j_id36:j_id37:1:j_id38').value;
            // }
            //富文本框赋值
            if(getCKEinstance('Customer_sigh_photo__c')){
                result.Customer_sigh_photo__c = getCKEinstance('Customer_sigh_photo__c').getData()
@@ -226,6 +235,33 @@
            return blankRequiredFields;
        }
        var GetEleByClass = function(class_name){
            let eles = document.getElementsByClassName(class_name);
            if(eles.length > 0) return eles[0];
            return null;
        }
        var GetEleApiName = function(ele){
            for(let ci in ele.classList){
                let c = ele.classList[ci];
                if(c.indexOf('{!ApiPrefix}'+'_')>-1){
                    return c.replace('{!ApiPrefix}'+'_','');
                }
            }
            return '';
        }
        function IsFormTag(tag_name){
            if (!tag_name) {
                return false;
            }
            return ['input','select','textarea'].indexOf(tag_name.toLowerCase())>-1;
        }
        function IsFormElement(e){
            return IsFormTag(e.tagName);
        }
        //4.获取要加密的字段
        function getPIPayload(reportJson) {
            let reportPayloadList = [];
@@ -254,7 +290,7 @@
        //5.新建或编辑
        function ProcessPI(reportJson, payloadForNewPI) {
            blockme();
            if ({!isNewMode} || {!isCloneMode}) {
            if ({!isNewMode} || {!isCloneMode} || !'{!AWSDataId}') {//Add by Li Jun for PIPL 20220413
                NewPIToAWS(reportJson, payloadForNewPI)
            }else {
                UpdatePIToAWS(reportJson, payloadForNewPI)
@@ -491,7 +527,7 @@
            payloadJson.age_Encrypted__c = result.object[0].ageEncrypt;
            payloadJson.Medical_History_Encrypted__c = result.object[0].medicalHistoryEncrypt;
            payloadJson.sex_Encrypted__c = result.object[0].sexEncrypt;
            if (isNewMode || {!isCloneMode}) {
            if (isNewMode || {!isCloneMode}||!'{!AWSDataId}') {//Add by Li Jun for PIPL 20220413
                payloadJson.AWS_Data_Id__c = result.object[0].dataId;
                delete payloadJson.OwnerId;
            } else {
@@ -577,7 +613,7 @@
                                <img src="/img/s.gif" alt="" class="minWidth" title="" width="1" height="1" />
                                <h2 class="mainTitle">报告书编辑</h2>
                            </td>
                            <td class="pbButton" id="topButtonRow">
                            <td class="pbButton" id="topButtonRow" style="pointer-events: none; opacity: 0.4;">
                                <input class="btn" type="Button" value="保存" onclick="saveReportProcess('Save')" />
                                <input class="btn" type="Button" value="保存并新建" onclick="saveReportProcess('SaveAndNew')" />
                                <apex:commandButton action="{!cancel}" value="取消" />
@@ -600,8 +636,9 @@
                    <!--Each section has layoutFields, let's iterate them as well-->
                    <apex:repeat value="{!layoutSection.layoutFields}" var="layoutField">
                        <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:inputField styleClass="{!ApiPrefix} {!ApiPrefix}_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!Report__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)&&isNewMode}" required="{!layoutField.isRequired}" />
                        <apex:inputField styleClass="{!ApiPrefix} {!ApiPrefix}_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!Report__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)&&not(isNewMode)&&layoutField.fieldAPI!='RecordTypeId'}" required="{!layoutField.isRequired}" />
                        <apex:outputField styleClass="{!ApiPrefix} {!ApiPrefix}_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!Report__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)&&not(isNewMode)&&layoutField.fieldAPI=='RecordTypeId'}" />
                        <apex:pageblocksectionitem rendered="{!layoutField.isPlaceHolder}">
                        </apex:pageblocksectionitem>
                    </apex:repeat>
@@ -609,6 +646,18 @@
                </apex:pageBlockSection>
            </apex:repeat>
            <script>
                var init_nodes = document.getElementsByClassName("PIBackApi");
                var api_id_map={};
                for(let ei in init_nodes){
                    let e = init_nodes[ei];
                    if(IsFormElement(e)){
                        if(e.getAttribute("multiple") != 'multiple' || e.style.display == 'none' && e.id.indexOf('selected') < 0){
                            api_id_map[GetEleApiName(e)] = e.id;
                        }
                    }
                }
                console.log(api_id_map);
                sfdcPage.appendToOnloadQueue(function () {
                    //判断是否为只读选项
                    var layoutSections = JSON.parse('{!layoutSectionsStr}');
@@ -650,7 +699,10 @@
                        document.querySelector("[data-id='Loaner_request_no1__c']").value = '{!no1Name}'
                        document.getElementById(document.querySelector("[data-id='Loaner_request_no1__c']").id + '_lkid').value = '{!no1Id}'
                    }
                    document.getElementById('topButtonRow').style = '';
             document.getElementById('bottomButtonRow').style = '';
                    let previous_value = {};
                    jQuery(".lookupInput input").each(function(i,e){
                        let je =jQuery(e);
@@ -706,7 +758,7 @@
                        <tr>
                            <td class="pbTitle">
                                <img src="/img/s.gif" alt="" class="minWidth" title="" width="1" height="1" />&nbsp;</td>
                            <td class="pbButtonb" id="bottomButtonRow">
                            <td class="pbButtonb" id="bottomButtonRow" style="pointer-events: none; opacity: 0.4;">
                                <input class="btn" type="Button" value="保存" onclick="saveReportProcess('Save')" />
                                <input class="btn" type="Button" value="保存并新建" onclick="saveReportProcess('SaveAndNew')" />
                                <apex:commandButton action="{!cancel}" value="取消" />
force-app/main/default/pages/NewAndEditTenderinformation.page
@@ -389,7 +389,7 @@
                                <img src="/img/s.gif" alt="" class="minWidth" title="" width="1" height="1" />
                                <h2 class="mainTitle">{! SobjectLabel}<apex:outputText rendered="{!isNewMode || isCloneMode}">{!$Label.New}</apex:outputText><apex:outputText rendered="{!not(isNewMode || isCloneMode)}">{!$Label.Edit}</apex:outputText></h2>
                            </td>
                            <td class="pbButton" id="topButtonRow">
                            <td class="pbButton" id="topButtonRow" style="pointer-events: none; opacity: 0.4;">
                                <input class="btn" type="Button" value="{!$Label.Save}" onclick="saveSobjectProcess()" />
                                <input class="btn" type="Button" value="{!$Label.SaveAndNew}" onclick="saveSobjectProcess(1)" />
                                <apex:commandButton action="{!cancel}" value="{!$Label.Cancel}" />
@@ -411,8 +411,9 @@
                    <!--Each section has layoutFields, let's iterate them as well-->
                    <apex:repeat value="{!layoutSection.layoutFields}" var="layoutField">
                        <apex:inputField styleClass="{!ApiPrefix} {!ApiPrefix}_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!Tender_information__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)}"
                            required="{!layoutField.isRequired}" />
                        <apex:inputField styleClass="{!ApiPrefix} {!ApiPrefix}_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!Tender_information__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)&&isNewMode}" required="{!layoutField.isRequired}" />
                        <apex:inputField styleClass="{!ApiPrefix} {!ApiPrefix}_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!Tender_information__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)&&not(isNewMode)&&layoutField.fieldAPI!='RecordTypeId'}" required="{!layoutField.isRequired}" />
                        <apex:outputField styleClass="{!ApiPrefix} {!ApiPrefix}_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!Tender_information__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)&&not(isNewMode)&&layoutField.fieldAPI=='RecordTypeId'}" />
                        <apex:pageblocksectionitem rendered="{!layoutField.isPlaceHolder}">
                        </apex:pageblocksectionitem>
                    </apex:repeat>
@@ -464,11 +465,13 @@
                        }
                    }  
                    //Replace Contact Vlookup Field
                    replaceSearchContactLookup();
                    //replaceSearchContactLookup();
                    //Replace Lead Vlookup Field
                    replaceSearchLeadLookup();
                    //replaceSearchLeadLookup();
                    document.querySelectorAll("[data-id='OwnerId']")[0].classList.add("disabledbutton");
                    // document.querySelectorAll("[data-id='OwnerId']")[1].classList.add("disabledbutton");
                    document.getElementById('topButtonRow').style = '';
             document.getElementById('bottomButtonRow').style = '';
                    
                    jQuery('a[data-id="OwnerId"]').remove();
@@ -496,7 +499,7 @@
                    //         clearVlookup('Hospital__c');
                    //     }
                    // });
                    /*
                    jQuery("body").on("change","input[data-id='Hospital_Name__c']",function(){
                        setTimeout(() => {
                            console.log(document.getElementById(this.id+'_lkid').value);
@@ -511,7 +514,8 @@
                                clearVlookup('Hospital__c');
                            }
                        }, 50);
                    });
                    });
                    */
                });
                
@@ -523,7 +527,7 @@
                        <tr>
                            <td class="pbTitle">
                                <img src="/img/s.gif" alt="" class="minWidth" title="" width="1" height="1" />&nbsp;</td>
                            <td class="pbButtonb" id="bottomButtonRow">
                            <td class="pbButtonb" id="bottomButtonRow" style="pointer-events: none; opacity: 0.4;">
                                <input class="btn" type="Button" value="{!$Label.Save}" onclick="saveSobjectProcess()" />
                                <input class="btn" type="Button" value="{!$Label.SaveAndNew}" onclick="saveSobjectProcess()" />
                                <apex:commandButton action="{!cancel}" value="{!$Label.Cancel}" />
force-app/main/default/pages/NewConsumApply.page
@@ -381,7 +381,7 @@
                                <img src="/img/s.gif" alt="" class="minWidth" title="" width="1" height="1" />
                                <h2 class="mainTitle">耗材备品申请编辑</h2>
                            </td>
                            <td class="pbButton" id="topButtonRow">
                            <td class="pbButton" id="topButtonRow" style="pointer-events: none; opacity: 0.4;">
                                <input class="btn" type="Button" value="保存" onclick="saveConsumApplyProcess('Save')" />
                                <input class="btn" type="Button" value="保存并新建" onclick="saveConsumApplyProcess('SaveAndNew')" />
                                <apex:commandButton action="{!cancel}" value="取消" />
@@ -402,8 +402,12 @@
                    <!--Each section has layoutFields, let's iterate them as well-->
                    <apex:repeat value="{!layoutSection.layoutFields}" var="layoutField">
                        <apex:inputField html-data-id="{!layoutField.fieldAPI}" value="{!Consum_Apply__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)}"
                        <apex:inputField styleClass="PIBackApi PIBackApi_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!Consum_Apply__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)&&isNewMode}"
                            required="{!layoutField.isRequired}" />
                        <apex:inputField styleClass="PIBackApi PIBackApi_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!Consum_Apply__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)&&not(isNewMode)&&layoutField.fieldAPI!='RecordTypeId'}"
                            required="{!layoutField.isRequired}" />
                        <apex:outputField styleClass="PIBackApi PIBackApi_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!Consum_Apply__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)&&not(isNewMode)&&layoutField.fieldAPI=='RecordTypeId'}"
                       />
                        <apex:pageblocksectionitem rendered="{!layoutField.isPlaceHolder}">
                        </apex:pageblocksectionitem>
                    </apex:repeat>
@@ -456,6 +460,9 @@
                    //Replace Vlookup Field
                    replaceSearchContactLookup();
                    document.querySelector("[data-id='OwnerId']").classList.add("disabledbutton");
                    document.getElementById('topButtonRow').style = '';
             document.getElementById('bottomButtonRow').style = '';
                    let previous_value = {};
                    jQuery(".lookupInput input").each(function(i,e){
@@ -513,7 +520,7 @@
                        <tr>
                            <td class="pbTitle">
                                <img src="/img/s.gif" alt="" class="minWidth" title="" width="1" height="1" />&nbsp;</td>
                            <td class="pbButtonb" id="bottomButtonRow">
                            <td class="pbButtonb" id="bottomButtonRow" style="pointer-events: none; opacity: 0.4;">
                                <input class="btn" type="Button" value="保存" onclick="saveConsumApplyProcess('Save')" />
                                <input class="btn" type="Button" value="保存并新建" onclick="saveConsumApplyProcess('SaveAndNew')" />
                                <apex:commandButton action="{!cancel}" value="取消" />
force-app/main/default/pages/NewConsumApplyEquipmentSetDetail.page
@@ -246,7 +246,7 @@
                                <img src="/img/s.gif" alt="" class="minWidth" title="" width="1" height="1" />
                                <h2 class="mainTitle">耗材备品配套一览明细编辑</h2>
                            </td>
                            <td class="pbButton" id="topButtonRow">
                            <td class="pbButton" id="topButtonRow" style="pointer-events: none; opacity: 0.4;">
                                <input class="btn" type="Button" value="保存" onclick="saveConsumApplyProcess('Save')" />
                                <input class="btn" type="Button" value="保存并新建" onclick="saveConsumApplyProcess('SaveAndNew')" />
                                <apex:commandButton action="{!cancel}" value="取消" />
@@ -261,8 +261,12 @@
                    <!--Each section has layoutFields, let's iterate them as well-->
                    <apex:repeat value="{!layoutSection.layoutFields}" var="layoutField">
                        <apex:inputField html-data-id="{!layoutField.fieldAPI}" value="{!Consum_Apply_Equipment_Set_Detail__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)}"
                        <apex:inputField styleClass="PIBackApi PIBackApi_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!Consum_Apply_Equipment_Set_Detail__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)&&isNewMode}"
                            required="{!layoutField.isRequired}" />
                        <apex:inputField styleClass="PIBackApi PIBackApi_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!Consum_Apply_Equipment_Set_Detail__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)&&not(isNewMode)&&layoutField.fieldAPI!='RecordTypeId'}"
                            required="{!layoutField.isRequired}" />
                        <apex:outputField styleClass="PIBackApi PIBackApi_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!Consum_Apply_Equipment_Set_Detail__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)&&not(isNewMode)&&layoutField.fieldAPI=='RecordTypeId'}"
                       />
                        <apex:pageblocksectionitem rendered="{!layoutField.isPlaceHolder}">
                        </apex:pageblocksectionitem>
                    </apex:repeat>
@@ -298,8 +302,10 @@
                        blockme();
                        QueryConsumApplyFromAWS();
                    };
                    document.querySelector("[data-id='OwnerId']").classList.add("disabledbutton");
                    //document.querySelector("[data-id='OwnerId']").classList.add("disabledbutton");
                    document.getElementById('topButtonRow').style = '';
             document.getElementById('bottomButtonRow').style = '';
                    //zhj 2022/04/11 start
                    // jQuery(".lookupInput").each(function(i,e){
                    //     let je =jQuery(e).find('input');
@@ -339,7 +345,7 @@
                        <tr>
                            <td class="pbTitle">
                                <img src="/img/s.gif" alt="" class="minWidth" title="" width="1" height="1" />&nbsp;</td>
                            <td class="pbButtonb" id="bottomButtonRow">
                            <td class="pbButtonb" id="bottomButtonRow" style="pointer-events: none; opacity: 0.4;">
                                <input class="btn" type="Button" value="保存" onclick="saveConsumApplyProcess('Save')" />
                                <input class="btn" type="Button" value="保存并新建" onclick="saveConsumApplyProcess('SaveAndNew')" />
                                <apex:commandButton action="{!cancel}" value="取消" />
force-app/main/default/pages/NewOnCall.page
@@ -37,7 +37,7 @@
        var queryBack = function queryBack(data) {
            console.log('data = ' + data);
            //document.querySelector("[id='page:form:pageBlock:pageBlockSection:j_id1:0:j_id2']").value = data.object.callerPhone;
            document.querySelector("[id='page:form:block:j_id34:0:j_id35:j_id36:5:j_id37']").value = data.object.callerPhone;    //20220404  By Chen Yanan
            document.getElementById(api_id_map['Caller_phone__c']).value = data.object.callerPhone;    //20220404  By Chen Yanan
            document.querySelector("[data-id='Responsible_Person_HP__c']").value = data.object.responsiblePersonHP;
            unblockUI();
        };
@@ -54,7 +54,7 @@
            payloadJson.Caller_Phone_Encrypt__c = r.object[0].callerPhoneEncrypt;
            payloadJson.Responsible_PersonHP_Encrypt__c = r.object[0].responsiblePersonHPEncrypt;
            payloadJson.AWS_Data_Id__c = '{!AWSDataId}';
            if (isNewMode|| {!isCloneMode}) {
            if (isNewMode|| {!isCloneMode} ||!'{!AWSDataId}') {//Add by Li Jun for PIPL 20220413
                payloadJson.AWS_Data_Id__c = r.object[0].dataId;
                delete payloadJson.OwnerId;
            } else {
@@ -67,7 +67,7 @@
        // New Or Edit
        function ProcessPI(onCallJson, payloadForNewPI) {
            blockme();
            if ({!isNewMode} || {!isCloneMode}) {
            if ({!isNewMode} || {!isCloneMode} ||!'{!AWSDataId}') {//Add by Li Jun for PIPL 20220413
                NewPIToAWS(onCallJson, payloadForNewPI)
            }else {
                UpdatePIToAWS(onCallJson, payloadForNewPI)
@@ -208,6 +208,26 @@
            errorMsgNode.innerText = '';
            errorMsgNode.className = '';
        }
        var GetEleApiName = function(ele){
            for(let ci in ele.classList){
                let c = ele.classList[ci];
                if(c.indexOf('PIBackApi'+'_')>-1){
                    return c.replace('PIBackApi'+'_','');
                }
            }
            return '';
        }
        function IsFormTag(tag_name){
            if (!tag_name) {
                return false;
            }
            return ['input','select','textarea'].indexOf(tag_name.toLowerCase())>-1;
        }
        function IsFormElement(e){
            return IsFormTag(e.tagName);
        }
    </script>
    <div class="bPageTitle">
        <div class="ptBody">
@@ -239,7 +259,7 @@
                                <img src="/img/s.gif" alt="" class="minWidth" title="" width="1" height="1" />
                                <h2 class="mainTitle">OnCall编辑</h2>
                            </td>
                            <td class="pbButton" id="topButtonRow">
                            <td class="pbButton" id="topButtonRow" style="pointer-events: none; opacity: 0.4;">
                                <input class="btn" type="Button" value="保存" onclick="saveOnCallProcess('Save')" />
                                <input class="btn" type="Button" value="保存并新建" onclick="saveOnCallProcess('SaveAndNew')" />
                                <apex:commandButton action="{!cancel}" value="取消" />
@@ -260,8 +280,12 @@
                    <!--Each section has layoutFields, let's iterate them as well-->
                    <apex:repeat value="{!layoutSection.layoutFields}" var="layoutField">
                        <apex:inputField html-data-id="{!layoutField.fieldAPI}" value="{!On_Call__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)}"
                       <apex:inputField styleClass="PIBackApi PIBackApi_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!On_Call__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)&&isNewMode}"
                            required="{!layoutField.isRequired}" />
                        <apex:inputField styleClass="PIBackApi PIBackApi_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!On_Call__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)&&not(isNewMode)&&layoutField.fieldAPI!='RecordTypeId'}"
                            required="{!layoutField.isRequired}" />
                        <apex:outputField styleClass="PIBackApi PIBackApi_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!On_Call__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)&&not(isNewMode)&&layoutField.fieldAPI=='RecordTypeId'}"
                       />
                        <apex:pageblocksectionitem rendered="{!layoutField.isPlaceHolder}">
                        </apex:pageblocksectionitem>
                    </apex:repeat>
@@ -269,6 +293,17 @@
                </apex:pageBlockSection>
            </apex:repeat>
            <script>
                var init_nodes = document.getElementsByClassName("PIBackApi");
                var api_id_map={};
                for(let ei in init_nodes){
                    let e = init_nodes[ei];
                    if(IsFormElement(e)){
                        if(e.getAttribute("multiple") != 'multiple' || e.style.display == 'none' && e.id.indexOf('selected') < 0){
                            api_id_map[GetEleApiName(e)] = e.id;
                        }
                    }
                }
                //Append Page
                sfdcPage.appendToOnloadQueue(function () {
                    var layoutSections = JSON.parse('{!layoutSectionsStr}');
@@ -297,6 +332,9 @@
                        QueryOnCallFromAWS();
                    };
                    document.querySelector("[data-id='OwnerId']").classList.add("disabledbutton");
                    document.getElementById('topButtonRow').style = '';
               document.getElementById('bottomButtonRow').style = '';
                    jQuery(".lookupInput").each(function(i,e){
                        let je =jQuery(e).find('input');
@@ -335,7 +373,7 @@
                        <tr>
                            <td class="pbTitle">
                                <img src="/img/s.gif" alt="" class="minWidth" title="" width="1" height="1" />&nbsp;</td>
                            <td class="pbButtonb" id="bottomButtonRow">
                            <td class="pbButtonb" id="bottomButtonRow" style="pointer-events: none; opacity: 0.4;">
                                <input class="btn" type="Button" value="保存" onclick="saveOnCallProcess('Save')" />
                                <input class="btn" type="Button" value="保存并新建" onclick="saveOnCallProcess('SaveAndNew')" />
                                <apex:commandButton action="{!cancel}" value="取消" />
force-app/main/default/pages/NewRentalApply.page
@@ -42,6 +42,7 @@
            document.querySelector("[data-id='Phone_number__c']").value = data.object.phoneNumber;
            document.querySelector("[data-id='direct_shippment_address__c']").value = data.object.directShippmentAddress;
            unblockUI();
            enableButtonStatus();//Add by Li Jun 20220418
        };
        //Check If Insert Or Update
@@ -65,7 +66,30 @@
            debugger
            return payloadJson;
        }
        //Add Button status start 20220418
        function enableButton(obj) {
            obj.classList.remove("btnDisabled");
        }
        function disableButton(obj) {
            obj.classList.add("btnDisabled");
        }
        function disableButtonStatus() {
            let btnList = document.getElementsByClassName('btn');
            for (let i = 0; i < btnList.length; i++) {
                disableButton(btnList[i]);
            }
        }
        function enableButtonStatus() {
            let btnList = document.getElementsByClassName('btn');
            for (let i = 0; i < btnList.length; i++) {
                enableButton(btnList[i]);
            }
        }
        disableButtonStatus();
        //Add Button status end 20220418
        // New Or Edit
        function ProcessPI(rentalApplyJson, payloadForNewPI) {
            blockme();
@@ -98,8 +122,8 @@
            }
            return ['input','select','textarea'].indexOf(tag_name.toLowerCase())>-1;
        }
        function IsFormElement(e){
        function IsFormElement(e){
            return IsFormTag(e.tagName);
        }
@@ -142,15 +166,17 @@
            // }
            // result.HP_received_sign_rich__c = CKEDITOR.instances["page:form:block:j_id34:12:j_id35:j_id36:1:j_id37:textAreaDelegate_HP_received_sign_rich__c"].getData();
            // if(document.querySelector("[aria-describedby = 'cke_71']")){
            //     result.    Extension_List_RentalApply__c = document.querySelector("[aria-describedby = 'cke_71']").contentWindow.document.getElementsByTagName('body')[0].innerHTML
            //     result.  Extension_List_RentalApply__c = document.querySelector("[aria-describedby = 'cke_71']").contentWindow.document.getElementsByTagName('body')[0].innerHTML
            // }
            for (let index = 0; index < nodelist.length; index++) {
                if (VLookUpFields.has(nodelist[index].getAttribute("data-id"))) {
                    console.log(nodelist[index].id.indexOf('lkwgt'));
                    if (nodelist[index].id.indexOf('lkwgt') == -1) {
                        let vlookUpNodeId = nodelist[index].id + '_lkid';
                        let vlookUpNodeValue = document.getElementById(vlookUpNodeId).value;
                        result[nodelist[index].getAttribute("data-id")] = vlookUpNodeValue;
                        if(document.getElementById(vlookUpNodeId)){
                            let vlookUpNodeValue = document.getElementById(vlookUpNodeId).value;
                            result[nodelist[index].getAttribute("data-id")] = vlookUpNodeValue;
                        }
                    }
                } else if (nodelist[index].type == 'checkbox') {
                    result[nodelist[index].getAttribute("data-id")] = nodelist[index].checked;
@@ -178,20 +204,21 @@
                    }
                }             
            }
            if(document.querySelector("[id='page:form:block:j_id34:2:j_id35:j_id36:2:j_id37']")!=null){
                result.demo_purpose2__c = document.querySelector("[id='page:form:block:j_id34:2:j_id35:j_id36:2:j_id37']").value;
            if(api_id_map['demo_purpose2__c']){
                result.demo_purpose2__c = document.getElementById(api_id_map['demo_purpose2__c']).value!='_\x01_'?document.getElementById(api_id_map['demo_purpose2__c']).value:'';
            }            
            if(document.querySelector("[id='page:form:block:j_id34:0:j_id35:j_id36:18:j_id37']")!=null){
                result.ToAgency__c = document.querySelector("[id='page:form:block:j_id34:0:j_id35:j_id36:18:j_id37']").value;
            if(api_id_map['ToAgency__c']){
                result.ToAgency__c = document.getElementById(api_id_map['ToAgency__c']).value!='_\x01_'?document.getElementById(api_id_map['ToAgency__c']).value:'';
            }            
            //document.querySelector("[id='page:form:block:j_id34:0:j_id35:j_id36:18:j_id37']").disabled =true; // Commented By Li Jun 20220304
            if(document.querySelector("[id='page:form:block:j_id34:13:j_id35:j_id36:1:j_id37']")!=null){
                result.Loaner_cancel_reason__c = document.querySelector("[id='page:form:block:j_id34:13:j_id35:j_id36:1:j_id37']").value;
            }else{
                if(document.querySelector("[id='page:form:block:j_id34:11:j_id35:j_id36:1:j_id37']")!=null){
                    result.Loaner_cancel_reason__c = document.querySelector("[id='page:form:block:j_id34:11:j_id35:j_id36:1:j_id37']").value;
                }
            if(api_id_map['Loaner_cancel_reason__c']){
                result.Loaner_cancel_reason__c = document.getElementById(api_id_map['Loaner_cancel_reason__c']).value!='_\x01_'?document.getElementById(api_id_map['Loaner_cancel_reason__c']).value:'';
            }
            // else{
            //     if(document.querySelector("[id='page:form:block:j_id34:11:j_id35:j_id36:1:j_id37']")!=null){
            //         result.Loaner_cancel_reason__c = document.querySelector("[id='page:form:block:j_id34:11:j_id35:j_id36:1:j_id37']").value;
            //     }
            // }
            // //格式化时间
            // if(result.HP_received_sign_day__c){
            //     result.HP_received_sign_day__c = result.HP_received_sign_day__c.replace(/\//g, '-')+':00';
@@ -204,9 +231,13 @@
            if(e){
                    result.Extension_List_RentalApply__c = e.getData();
                }
            if(document.getElementById('page:form:block:j_id34:0:j_id35:j_id36:13:j_id37' + '_lkid')!=null){
            if(document.getElementById(api_id_map['Office_Assistant1__c'] + '_lkid')!=null){
                // result.ToAgency__c = document.getElementById('page:form:block:j_id34:0:j_id35:j_id36:18:j_id37').value;
                result.Office_Assistant1__c = document.getElementById('page:form:block:j_id34:0:j_id35:j_id36:13:j_id37' + '_lkid').value;
                result.Office_Assistant1__c = document.getElementById(api_id_map['Office_Assistant1__c'] + '_lkid').value;
            }
            if(document.getElementById(api_id_map['Office_Assistant2__c'] + '_lkid')!=null){
                // result.ToAgency__c = document.getElementById('page:form:block:j_id34:0:j_id35:j_id36:18:j_id37').value;
                result.Office_Assistant2__c = document.getElementById(api_id_map['Office_Assistant2__c'] + '_lkid').value;
            }
            console.log(JSON.stringify(result));
            return result;
@@ -392,7 +423,7 @@
                                <img src="/img/s.gif" alt="" class="minWidth" title="" width="1" height="1" />
                                <h2 class="mainTitle">备品借出申请编辑</h2>
                            </td>
                            <td class="pbButton" id="topButtonRow">
                            <td class="pbButton" id="topButtonRow" style="pointer-events: none; opacity: 0.4;">
                                <input class="btn" type="Button" value="保存" onclick="saveRentalApplyProcess('Save')" />
                                <input class="btn" type="Button" value="保存并新建" onclick="saveRentalApplyProcess('SaveAndNew')" />
                                <apex:commandButton action="{!cancel}" value="取消" />
@@ -413,8 +444,12 @@
                    <!--Each section has layoutFields, let's iterate them as well-->
                    <apex:repeat value="{!layoutSection.layoutFields}" var="layoutField">
                        <apex:inputField styleClass="PIBackApi PIBackApi_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!Rental_Apply__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)}"
                        <apex:inputField styleClass="PIBackApi PIBackApi_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!Rental_Apply__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)&&isNewMode}"
                            required="{!layoutField.isRequired}" />
                        <apex:inputField styleClass="PIBackApi PIBackApi_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!Rental_Apply__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)&&not(isNewMode)&&layoutField.fieldAPI!='RecordTypeId'}"
                            required="{!layoutField.isRequired}" />
                        <apex:outputField styleClass="PIBackApi PIBackApi_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!Rental_Apply__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)&&not(isNewMode)&&layoutField.fieldAPI=='RecordTypeId'}"
                       />
                        <apex:pageblocksectionitem rendered="{!layoutField.isPlaceHolder}">
                        </apex:pageblocksectionitem>
                    </apex:repeat>
@@ -430,7 +465,14 @@
                        if(e.getAttribute("multiple") != 'multiple' || e.style.display == 'none' && e.id.indexOf('selected') < 0){
                            api_id_map[GetEleApiName(e)] = e.id;
                        }
                    }else{
                        let eid = jQuery(e).find(".lookupInput input").attr("id")
                        if(eid){
                            eid += '_lkid';
                            if(document.getElementById(eid)){
                                api_id_map[GetEleApiName(e)] = eid;
                            }
                        }
                    }
                }
                console.log(api_id_map);
@@ -464,7 +506,9 @@
                    var onlyReadFields = ['ExtensionStatus__c','ExtensionApplicationTime_Initial__c','ExtensionApprovalTime_Initial__c','ExtensionApplicationTime_Final__c','ExtensionApprovalTime_Final__c','ExtensionSuccessTimes__c','ZongjianApprovalManager__c','BuchangApprovalManager__c','JingliApprovalManager__c','BuchangApprovalManagerSales__c','SalesManager__c'];
                    console.log(onlyReadFields);
                    for(let i=0;i<onlyReadFields.length;i++){
                        document.querySelector('[data-id='+onlyReadFields[i]+']').parentNode.remove();
                        if(document.querySelector('[data-id='+onlyReadFields[i]+']')){
                            document.querySelector('[data-id='+onlyReadFields[i]+']').parentNode.remove();
                        }
                    }
                    
                    //2. Query AWS Data by dataId 
@@ -472,11 +516,16 @@
                    if (!{!isNewMode}) {
                        blockme();
                        QueryRentalApplyFromAWS();
                    }else{
                        enableButtonStatus();//Add by Li Jun 20220418
                    };
                    //Replace Vlookup Field
                    replaceSearchContactLookup();
                    document.querySelector("[data-id='OwnerId']").classList.add("disabledbutton");
                    document.getElementById('topButtonRow').style = '';
             document.getElementById('bottomButtonRow').style = '';
                    let previous_value = {};
                    jQuery(".lookupInput input").each(function(i,e){
                        let je =jQuery(e);
@@ -536,7 +585,7 @@
                        <tr>
                            <td class="pbTitle">
                                <img src="/img/s.gif" alt="" class="minWidth" title="" width="1" height="1" />&nbsp;</td>
                            <td class="pbButtonb" id="bottomButtonRow">
                            <td class="pbButtonb" id="bottomButtonRow" style="pointer-events: none; opacity: 0.4;">
                                <input class="btn" type="Button" value="保存" onclick="saveRentalApplyProcess('Save')" />
                                <input class="btn" type="Button" value="保存并新建" onclick="saveRentalApplyProcess('SaveAndNew')" />
                                <apex:commandButton action="{!cancel}" value="取消" />
force-app/main/default/pages/NewRepair.page
@@ -37,7 +37,7 @@
                   function (result, event) {
                       console.log(result);
                       if(result.message){
                           alert(result.message);
                        alert(result.message);
                       }
                        if (redirectMode == 'Save') {
                            window.open('/' + sfId, '_self');
@@ -224,11 +224,9 @@
            result.Repair_Determine_result_ConfirmationUser__c = e.value;
           }
           //未修理归还理由
           //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=='_\x01_'?'':document.getElementById('page:form:block:j_id34:17:j_id35:j_id36:2:j_id37').value;
           }
            if(api_id_map['Return_Without_Repair_Reason__c']){
                result.Return_Without_Repair_Reason__c = document.getElementById(api_id_map['Return_Without_Repair_Reason__c']).value!='_\x01_'?document.getElementById(api_id_map['Return_Without_Repair_Reason__c']).value:'';
            }
            console.log(JSON.stringify(result));
            return result;
        }
@@ -366,7 +364,7 @@
                                <img src="/img/s.gif" alt="" class="minWidth" title="" width="1" height="1" />
                                <h2 class="mainTitle">修理编辑</h2>
                            </td>
                            <td class="pbButton" id="topButtonRow">
                            <td class="pbButton" id="topButtonRow" style="pointer-events: none; opacity: 0.4;">
                                <input class="btn" type="Button" value="保存" onclick="saveRepairProcess('Save')" />
                                <input class="btn" type="Button" value="保存并新建" onclick="saveRepairProcess('SaveAndNew')" />
                                <apex:commandButton action="{!cancel}" value="取消" />
@@ -387,8 +385,12 @@
                    <!--Each section has layoutFields, let's iterate them as well-->
                    <apex:repeat value="{!layoutSection.layoutFields}" var="layoutField">
                        <apex:inputField html-title="{!layoutField.fieldAPI}" styleClass="PIBackApi PIBackApi_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!Repair__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)}"
                        <apex:inputField styleClass="PIBackApi PIBackApi_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!Repair__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)&&isNewMode}"
                            required="{!layoutField.isRequired}" />
                        <apex:inputField styleClass="PIBackApi PIBackApi_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!Repair__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)&&not(isNewMode)&&layoutField.fieldAPI!='RecordTypeId'}"
                            required="{!layoutField.isRequired}" />
                        <apex:outputField styleClass="PIBackApi PIBackApi_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!Repair__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)&&not(isNewMode)&&layoutField.fieldAPI=='RecordTypeId'}"
                       />
                        <apex:pageblocksectionitem rendered="{!layoutField.isPlaceHolder}">
                        </apex:pageblocksectionitem>
                    </apex:repeat>
@@ -447,7 +449,10 @@
                        unblockUI();
                    };
                    if(document.querySelector("[data-id='OwnerId']") != null)
                        document.querySelector("[data-id='OwnerId']").classList.add("disabledbutton");
                        document.querySelector("[data-id='OwnerId']").classList.add("disabledbutton");
                    document.getElementById('topButtonRow').style = '';
                    document.getElementById('bottomButtonRow').style = '';
                    let previous_value = {};
                    jQuery(".lookupInput input").each(function(i,e){
@@ -469,7 +474,7 @@
                    //维修中心
                    if('{!workLocationSelect}' != ''){
                        let wlNode = document.getElementById('page:form:block:j_id34:1:j_id35:j_id36:18:j_id37');
                        let wlNode = document.getElementById(api_id_map['work_location_select__c']);
                        if(wlNode){
                           wlNode.removeAttribute("disabled")
                            var o = new Option()
@@ -525,7 +530,7 @@
                        <tr>
                            <td class="pbTitle">
                                <img src="/img/s.gif" alt="" class="minWidth" title="" width="1" height="1" />&nbsp;</td>
                            <td class="pbButtonb" id="bottomButtonRow">
                            <td class="pbButtonb" id="bottomButtonRow" style="pointer-events: none; opacity: 0.4;">
                                <input class="btn" type="Button" value="保存" onclick="saveRepairProcess('Save')" />
                                <input class="btn" type="Button" value="保存并新建" onclick="saveRepairProcess('SaveAndNew')" />
                                <apex:commandButton action="{!cancel}" value="取消" />
force-app/main/default/pages/XinDailyReport.page
@@ -62,6 +62,7 @@
            var tempActId = '';
            var tempRecordTypeName = '';
            var tempBtnIdHidden = '';
            var OPDId = '';
            var tempRedId = '';
            var tempReportId = '';
            var hiddenDivShowFlg = false;
@@ -69,79 +70,79 @@
            sforce.connection.sessionId = '{!$Api.Session_ID}';
            
            //Add By Li Jun 20220225 for PIPL Start
            AWSService.sfSessionId = '{!GETSESSIONID()}';
            var staticResources = JSON.parse('{!staticResource}');
            var contactAWSIds = JSON.parse('{!contactAWSIds}');
            console.log('contactAWSIds:'+JSON.stringify(contactAWSIds));
            var sfIdToContactInfo = {};
            function preparePayloadForSearchContact(){
                let searchPayload = new Object();
                searchPayload.dataIds = contactAWSIds;
                searchPayload.contactName = '';
                return JSON.stringify(searchPayload);
            }
            // AWSService.sfSessionId = '{!GETSESSIONID()}';
            // var staticResources = JSON.parse('{!staticResource}');
            // var contactAWSIds = JSON.parse('{!contactAWSIds}');
            // console.log('contactAWSIds:'+JSON.stringify(contactAWSIds));
            // var sfIdToContactInfo = {};
            // function preparePayloadForSearchContact(){
            //     let searchPayload = new Object();
            //     searchPayload.dataIds = contactAWSIds;
            //     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){
                    let contacts = result.object;
                    if(contacts == null){
                        return;
                    }
                    for(var i=0;i<contacts.length;i++){
                        let temp = {}
                        temp.lastName = contacts[i].lastName?contacts[i].lastName:'';
                        if(contacts[i].sfRecordId){
                            sfIdToContactInfo[contacts[i].sfRecordId] = temp;
                        }
                    }
                    console.log('AWS Result:'+JSON.stringify(sfIdToContactInfo));
                    // 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++){
                            let contactIdForVis = document.getElementById("Page:mainForm:idDayEdit:idActivities:"+i+":idVisitor"+j+"_IdHidden").value;
                            if(contactIdForVis){
                                console.log('SFId for Contact:'+contactIdForVis);
                                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 = '';
                            }
                        }
                    }
                };
                AWSService.search(staticResources.searchUrl,data,searchCallBack,staticResources.token);
            }
            // 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){
            //         let contacts = result.object;
            //         if(contacts == null){
            //             return;
            //         }
            //         for(var i=0;i<contacts.length;i++){
            //             let temp = {}
            //             temp.lastName = contacts[i].lastName?contacts[i].lastName:'';
            //             if(contacts[i].sfRecordId){
            //                 sfIdToContactInfo[contacts[i].sfRecordId] = temp;
            //             }
            //         }
            //         console.log('AWS Result:'+JSON.stringify(sfIdToContactInfo));
            //         // 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++){
            //                 let contactIdForVis = document.getElementById("Page:mainForm:idDayEdit:idActivities:"+i+":idVisitor"+j+"_IdHidden").value;
            //                 if(contactIdForVis){
            //                     console.log('SFId for Contact:'+contactIdForVis);
            //                     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 = '';
            //                 }
            //             }
            //         }
            //     };
            //     AWSService.search(staticResources.searchUrl,data,searchCallBack,staticResources.token);
            // }
            //Add By Li Jun 20220225 for PIPL End 
            //window.document.onkeydown= onKeyEvent;
            function initSetPage() {
@@ -1157,7 +1158,7 @@
                                        <th>{!$Label.Free_Input}&nbsp;&nbsp;<apex:inputField id="idFree_Input__c" value="{!a.act.Free_Input__c}" onClick="if(vpChack({!a.index})) return false;setVisitorPlaceDisabled();"/>&nbsp;&nbsp;</th>
                                    </tr>                                   
                                    <tr>  
                                        <th>拜访目的</th>
                                        <th >拜访目的</th>
                                        <td></td>
                                        <apex:outputPanel rendered="{!IF(reportOwner.Job_Category__c == '销售服务', 'true', 'false')}" layout="none">
                                            <td colspan="3"><span><div class="requiredInput"><div class="requiredBlock"></div><apex:inputField id="idActivityPurposeFSEDiv" value="{!a.act.Activity_PurposeFSE__c}" ></apex:inputField>
@@ -1338,23 +1339,23 @@
                                    <td><input type="button" class="btn" id="idOpds{!a.index}" name="reportBtn" value="新建OPD计划" style="width:110px" onclick="addOpdNew('{!a.index}', '{!a.act.Id}');"/></td>
                                    <!--SWAG-BUF6R8  20201020 youchang end -->
                                        <td>&nbsp;</td>
                                        <td><input type="button" class="{!If(a.act.OPD_ID__c != '' || a.act.OPDPlan_Flag__c,'btnRed','btn')}" id="idOPD{!a.index}" name="reportBtn" value="{!$Label.OPD_Taiwan}" style="width:110px;{!If(a.act.OPD_ID__c != '','color:red;','color:black;')}" onclick="openPDNew('{!a.index}','{!a.act.id}','OPD','idOPD_IdHidden','idOPD','{!report.id}');"/><apex:inputText id="idOPD_IdHidden" value="{!a.act.OPD_ID__c}" style="display:none" disabled="true"/></td>
                                        <td><input type="button" class="{!If(a.act.OPD_ID__c != '' || a.act.OPDPlan_Flag__c,'btnRed','btn')}" id="idOPD{!a.index}" name="reportBtn" value="{!$Label.OPD_Taiwan}" style="width:110px;{!If(a.act.OPD_ID__c != '','color:red;','color:black;')}" onclick="openPDNew('{!a.index}','{!a.act.id}','OPD','idOPD_IdHidden','idOPD','{!report.id}','{!a.act.Opd_Plan__c}');"/><apex:inputText id="idOPD_IdHidden" value="{!a.act.OPD_ID__c}" style="display:none" disabled="true"/></td>
                <!--                                     <td><input type="button" class="{!If(a.act.OPD_ID__c != '','btnRed','btn')}" id="idOPD{!a.index}" name="reportBtn" value="{!$Label.OPD_Taiwan}" style="width:110px;{!If(a.act.OPD_ID__c != '','color:red;','color:black;')}" onclick="selectOPDSISReportType('{!a.index}','{!a.act.id}','OPD','idOPD_IdHidden','idOPD','{!report.id}');"/><apex:inputText id="idOPD_IdHidden" value="{!a.act.OPD_ID__c}" style="display:none" disabled="true"/></td> -->
                                        <td>&nbsp;</td>
                                        <td><input type="button" class="{!If(a.act.NTC_ID__c != '','btnRed','btn')}" id="idNTC{!a.index}" name="reportBtn" value="NTC/CDS培训" style="width:110px;{!If(a.act.NTC_ID__c != '','color:red;','color:black;')}" onclick="openPDNew('{!a.index}','{!a.act.id}','NTC','idNTC_IdHidden','idNTC','{!report.id}');"/><apex:inputText id="idNTC_IdHidden" value="{!a.act.NTC_ID__c}" style="display:none" disabled="true"/></td>
                                        <td><input type="button" class="{!If(a.act.NTC_ID__c != '','btnRed','btn')}" id="idNTC{!a.index}" name="reportBtn" value="NTC/CDS培训" style="width:110px;{!If(a.act.NTC_ID__c != '','color:red;','color:black;')}" onclick="openPDNew('{!a.index}','{!a.act.id}','NTC','idNTC_IdHidden','idNTC','{!report.id}','{!a.act.Opd_Plan__c}');"/><apex:inputText id="idNTC_IdHidden" value="{!a.act.NTC_ID__c}" style="display:none" disabled="true"/></td>
                                        <td>&nbsp;</td>
                                        <td><input type="button" class="{!If(a.act.OnCall_ID__c != '','btnRed','btn')}" id="idONCALL{!a.index}" name="reportBtn" value="ON CALL" style="width:110px;{!If(a.act.OnCall_ID__c != '','color:red;','color:black;')}" onclick="openPDNew('{!a.index}','{!a.act.id}','On_Call','idONCALL_IdHidden','idONCALL','{!report.id}');"/><apex:inputText id="idONCALL_IdHidden" value="{!a.act.OnCall_ID__c}" style="display:none" disabled="true"/></td>
                                        <td><input type="button" class="{!If(a.act.OnCall_ID__c != '','btnRed','btn')}" id="idONCALL{!a.index}" name="reportBtn" value="ON CALL" style="width:110px;{!If(a.act.OnCall_ID__c != '','color:red;','color:black;')}" onclick="openPDNew('{!a.index}','{!a.act.id}','On_Call','idONCALL_IdHidden','idONCALL','{!report.id}','{!a.act.Opd_Plan__c}');"/><apex:inputText id="idONCALL_IdHidden" value="{!a.act.OnCall_ID__c}" style="display:none" disabled="true"/></td>
                                        <td>&nbsp;</td>
                                        <td><input type="button" class="{!If(a.act.ReportAccompanied_ID__c != '','btnRed','btn')}" id="idReportAccompanied{!a.index}" name="reportBtn" value="{!$Label.Report_Accompanied}" style="width:110px;{!If(a.act.ReportAccompanied_ID__c != '','color:red;','color:black;')}" onclick="openPDNew('{!a.index}','{!a.act.id}','Visit_With','idReportAccompanied_IdHidden','idReportAccompanied','{!report.id}');"/><apex:inputText id="idReportAccompanied_IdHidden" value="{!a.act.ReportAccompanied_ID__c}" style="display:none" disabled="true"/></td>
                                        <td><input type="button" class="{!If(a.act.ReportAccompanied_ID__c != '','btnRed','btn')}" id="idReportAccompanied{!a.index}" name="reportBtn" value="{!$Label.Report_Accompanied}" style="width:110px;{!If(a.act.ReportAccompanied_ID__c != '','color:red;','color:black;')}" onclick="openPDNew('{!a.index}','{!a.act.id}','Visit_With','idReportAccompanied_IdHidden','idReportAccompanied','{!report.id}','{!a.act.Opd_Plan__c}');"/><apex:inputText id="idReportAccompanied_IdHidden" value="{!a.act.ReportAccompanied_ID__c}" style="display:none" disabled="true"/></td>
                                        <td>&nbsp;</td>
                                        <td><input type="button" class="{!If(a.act.CityStatus_ID__c != '','btnRed','btn')}" id="idCityStatus{!a.index}" name="reportBtn" value="{!$Label.City_Status_Report}" style="width:110px;{!If(a.act.CityStatus_ID__c != '','color:red;','color:black;')}" onclick="openPDNew('{!a.index}','{!a.act.id}','MarketCondition','idCityStatus_IdHidden','idCityStatus','{!report.id}');"/><apex:inputText id="idCityStatus_IdHidden" value="{!a.act.CityStatus_ID__c}" style="display:none" disabled="true"/></td>
                                        <td><input type="button" class="{!If(a.act.CityStatus_ID__c != '','btnRed','btn')}" id="idCityStatus{!a.index}" name="reportBtn" value="{!$Label.City_Status_Report}" style="width:110px;{!If(a.act.CityStatus_ID__c != '','color:red;','color:black;')}" onclick="openPDNew('{!a.index}','{!a.act.id}','MarketCondition','idCityStatus_IdHidden','idCityStatus','{!report.id}','{!a.act.Opd_Plan__c}');"/><apex:inputText id="idCityStatus_IdHidden" value="{!a.act.CityStatus_ID__c}" style="display:none" disabled="true"/></td>
                                        <td>&nbsp;</td>
                                        <!-- <td>
                                            <input type="button" class="{!If(a.act.Claim_ID__c != '','btnRed','btn')}" id="idClaim{!a.index}" name="reportBtn" value="{!$Label.Claim_Input}" style="width:110px;{!If(a.act.Claim_ID__c != '','color:red;','color:black;')}" onclick="openPDNew('{!a.index}','{!a.act.id}','Complaint','idClaim_IdHidden','idClaim','{!report.id}');"/>
                                            <apex:inputText id="idClaim_IdHidden" value="{!a.act.Claim_ID__c}" style="display:none" disabled="true"/>
                                        </td> -->
                                        <td>&nbsp;</td>
                                        <td><input type="button" class="{!If(a.act.Conflict_ID__c != '','btnRed','btn')}" id="idConflict{!a.index}" name="reportBtn" value="{!$Label.Competitor_Information}" style="width:110px;{!If(a.act.Conflict_ID__c != '','color:red;','color:black;')}" onclick="openPDNew('{!a.index}','{!a.act.id}','Competitor','idConflict_IdHidden','idConflict','{!report.id}');"/><apex:inputText id="idConflict_IdHidden" value="{!a.act.Conflict_ID__c}" style="display:none" disabled="true"/></td>
                                        <td><input type="button" class="{!If(a.act.Conflict_ID__c != '','btnRed','btn')}" id="idConflict{!a.index}" name="reportBtn" value="{!$Label.Competitor_Information}" style="width:110px;{!If(a.act.Conflict_ID__c != '','color:red;','color:black;')}" onclick="openPDNew('{!a.index}','{!a.act.id}','Competitor','idConflict_IdHidden','idConflict','{!report.id}','{!a.act.Opd_Plan__c}');"/><apex:inputText id="idConflict_IdHidden" value="{!a.act.Conflict_ID__c}" style="display:none" disabled="true"/></td>
                                    </tr>
                                    <tr>
                                    <td style="text-align:left;"><apex:commandButton styleClass="idSaveComment" value="{!$Label.SaveComment}" onclick="blockme();" style="width:80px" action="{!saveComment}" rerender="dummy" disabled="{!ministerCommentEditFlg && managerCommentEditFlg}"/></td>