From bbc7c47e3eadfe0ae3ac57419b1c9b8b2ed3e3d4 Mon Sep 17 00:00:00 2001
From: 19626 <1962676589@qq.com>
Date: 星期四, 06 四月 2023 17:30:41 +0800
Subject: [PATCH] 修改按钮 4.6

---
 force-app/main/default/lwc/lexOSHSubmit/lexOSHSubmit.js                                             |    6 
 force-app/main/default/lwc/lexUploadToSap/lexUploadToSap.html                                       |    1 
 force-app/main/default/lwc/lexCancel/lexCancel.js                                                   |   20 +
 force-app/main/default/lwc/oshRecieved/oshRecieved.js                                               |    2 
 force-app/main/default/lwc/lexCreateNotesEmail/lexCreateNotesEmail.js                               |   16 
 force-app/main/default/classes/QISReportController.cls                                              |  328 +++++++++++++++++-
 force-app/main/default/lwc/lexVOCAnswer/lexVOCAnswer.js                                             |   16 
 force-app/main/default/lwc/lexCopyPIInspectionReport/lexCopyPIInspectionReport.js                   |    1 
 force-app/main/default/classes/LightingButtonConstant.cls                                           |    1 
 force-app/main/default/lwc/lexOCSMToReport/lexOCSMToReport.js                                       |   15 
 force-app/main/default/lwc/lexVOCSubmit/lexVOCSubmit.js                                             |   16 
 force-app/main/default/lwc/lexRCSubmit/lexRCSubmit.js                                               |   16 
 force-app/main/default/lwc/lexSIStoOPD/lexSIStoOPD.js                                               |   25 +
 force-app/main/default/lwc/lexVOCFinish/lexVOCFinish.js                                             |   16 
 force-app/main/default/lwc/lexOCSMNoToReportForReport/lexOCSMNoToReportForReport.js                 |   16 
 force-app/main/default/lwc/lexDispatchOCSMQARA/lexDispatchOCSMQARA.js                               |   16 
 force-app/main/default/lwc/lexCancelSubmit/lexCancelSubmit.js                                       |   18 +
 force-app/main/default/lwc/lexPreContractSubmit/lexPreContractSubmit.html                           |    1 
 force-app/main/default/lwc/lexOCMSubmit/lexOCMSubmit.js                                             |   10 
 force-app/main/default/lwc/lexCreateReportMaintenanceContract/lexCreateReportMaintenanceContract.js |    1 
 force-app/main/default/lwc/lexSubmitForApproval/lexSubmitForApproval.js                             |    1 
 force-app/main/default/classes/QISReportController.cls-meta.xml                                     |    2 
 force-app/main/default/classes/otherButtonRepairController.cls                                      |  281 +++++++++++++++
 force-app/main/default/lwc/lexUploadToSap/lexUploadToSap.js                                         |   88 ++--
 force-app/main/default/lwc/lexComplete/lexComplete.js                                               |   16 
 force-app/main/default/lwc/lexInsPageBtn/lexInsPageBtn.js                                           |    1 
 force-app/main/default/lwc/lexPreContractSubmit/lexPreContractSubmit.js                             |   36 +
 force-app/main/default/lwc/lexVOCCheck/lexVOCCheck.js                                               |   18 +
 force-app/main/default/lwc/lexSubmitCompetitorReport/lexSubmitCompetitorReport.js                   |   16 
 force-app/main/default/classes/otherButtonMaintenanceContractCtl.cls                                |    2 
 force-app/main/default/lwc/lexOPDtoSIS/lexOPDtoSIS.js                                               |   23 +
 31 files changed, 909 insertions(+), 116 deletions(-)

diff --git a/force-app/main/default/classes/LightingButtonConstant.cls b/force-app/main/default/classes/LightingButtonConstant.cls
index aa8046b..de07222 100644
--- a/force-app/main/default/classes/LightingButtonConstant.cls
+++ b/force-app/main/default/classes/LightingButtonConstant.cls
@@ -69,5 +69,6 @@
     public static final String OK = 'OK';
     public static final String SOBJECT_NAME_OF_REPORT_SHARE ='Report__Share';
     public static final String  SOBJECT_NAME_OF_VOC_SHARE = 'VOCShare__c';
+
    
 }
\ No newline at end of file
diff --git a/force-app/main/default/classes/QISReportController.cls b/force-app/main/default/classes/QISReportController.cls
index 1239bb9..ea5f6a9 100644
--- a/force-app/main/default/classes/QISReportController.cls
+++ b/force-app/main/default/classes/QISReportController.cls
@@ -20,7 +20,7 @@
         String recordTypeId = LightingButtonConstant.DEVELOPER_NAME_ASAC_DECISION;
         try{
             PAE_DecisionRecord__c RCPAEDIdList = [SELECT LastModifiedDate, Id, Name, LastModifiedById,RecordType.DeveloperName FROM PAE_DecisionRecord__c where PAE_QIS__c = :qisReportId  And RecordType.DeveloperName =  :recordTypeId limit 1]; 
-            res.PAEid = RCPAEDIdList.id;
+            res.pAEid = RCPAEDIdList.id;
             System.debug(LoggingLevel.INFO, '*** res: ' + res);
         }catch(Exception e){
             System.debug(LoggingLevel.INFO, '*** e: ' + e);
@@ -49,7 +49,7 @@
         String recordTypeId = LightingButtonConstant.DEVELOPER_NAME_ASRC_DECISION;
         try{
             PAE_DecisionRecord__c ASRCDIdList = [SELECT LastModifiedDate, Id, Name, LastModifiedById,RecordType.DeveloperName FROM PAE_DecisionRecord__c where PAE_QIS__c = :qisReportId  And RecordType.DeveloperName =  :recordTypeId Limit 1]; 
-            res.PAEid = ASRCDIdList.id;
+            res.pAEid = ASRCDIdList.id;
             System.debug(LoggingLevel.INFO, '*** res: ' + res);
         }catch(Exception e){
             System.debug(LoggingLevel.INFO, '*** e: ' + e);
@@ -217,54 +217,344 @@
         }
          return re;
     }
+    // 鎻愪氦
+     @AuraEnabled
+    public static InitData initForOCMSubmitButton (String recordId){
+        InitData res = new initData();
+        try{
+            QIS_Report__c report = [SELECT  id,is_aohui_product__c,QIS_Status__c,OCM_Manager_Mail_F__c,QISInstallDate__c,contract_number__c FROM QIS_Report__c WHERE Id = :recordId LIMIT 1];  
+            res.Id = report.Id;
+            res.QIStatus = report.QIS_Status__c;
+            res.QISInstallDate = report.QISInstallDate__c;
+            res.contractnumber = report.contract_number__c;
+            res.isaohuiproduct = report.is_aohui_product__c;
+            System.debug(LoggingLevel.INFO, '*** res: ' + res);
+        }catch(Exception e){
+            System.debug(LoggingLevel.INFO, '*** e: ' + e);
+        }
+        return res;
+    }
 
+    @AuraEnabled
+    public static String updateQisWithOCM (String recordId){
+        String re = '鎴愬姛';
+        QIS_Report__c report = [SELECT  id,QIS_Status__c,QISInstallDate__c,contract_number__c,OCM_Manager_Mail_F__c
+                                ,OCM_Member_Mail_F__c,OCM_Repair_Mail_F__c,OCM_Repair_Mail1_F__c,FSE_Special_Mail_F__c,FSE_Special_Manager_Mail_F__c
+                                    ,WorkLocation_CC_Mail_F__c,is_aohui_product__c,QuolityApproveResult__c
+                                FROM QIS_Report__c WHERE Id = :recordId LIMIT 1]; 
+        try{
+            QIS_Report__c rac  = new QIS_Report__c();   
+            rac.id = recordId;
+            rac.QIS_Status__c = LightingButtonConstant.STATUS_QIS_FSE_COMPLATED;
+            rac.OCM_Manager_Mail__c = report.OCM_Manager_Mail_F__c;
+            rac.OCM_Member_Mail__c = report.OCM_Member_Mail_F__c;
+            rac.OCM_Repair_Mail__c = report.OCM_Repair_Mail_F__c;
+            rac.OCM_Repair_Mail1__c = report.OCM_Repair_Mail1_F__c;
+            rac.FSE_Special_Mail__c = report.FSE_Special_Mail_F__c;
+            rac.FSE_Special_Manager_Mail__c = report.FSE_Special_Manager_Mail_F__c;
+            rac.WorkLocation_CC_Mail__c = report.WorkLocation_CC_Mail_F__c;
+            rac.Cancel_QIS_Reason__c = null;
+            if (report.is_aohui_product__c == true) {
+                    rac.OCM_judgement__c = '璐ㄩ噺闂';
+                    rac.next_action__c = '鏃犲伩缁翠慨';
+                    rac.RecordTypeId = Schema.SObjectType.QIS_Report__c.getRecordTypeInfosByName().get(LightingButtonConstant.RECORD_TYPE_NAME_BY_OSH).getRecordTypeId();
+                    rac.QIS_Status__c = LightingButtonConstant.STATUS_QIS_OSH_TESTING_APP;
+            }
+            if (report.QuolityApproveResult__c == null || report.QuolityApproveResult__c == '') {
+                rac.QuolityApproveResult__c = '3.宸插鏍革紝涓�鑸川閲忛棶棰�';
+            }
+            update rac;
+        }catch(Exception e){
+            System.debug(LoggingLevel.INFO, '*** e: ' + e);
+            re = e.getMessage();
+        }
+         return re;
+    }
+
+    // QIS缁撴灉璺熻繘瀹屾瘯
+     @AuraEnabled
+    public static InitData initForQisAgreeButton (String recordId){
+        InitData res = new initData();
+        try{
+            QIS_Report__c report = [SELECT  id ,OwnerId FROM QIS_Report__c WHERE Id = :recordId LIMIT 1];  
+            res.Id = report.Id;
+            res.ownerId = report.OwnerId;
+            System.debug(LoggingLevel.INFO, '*** res: ' + res);
+        }catch(Exception e){
+            System.debug(LoggingLevel.INFO, '*** e: ' + e);
+        }
+        return res;
+    }
+
+    @AuraEnabled
+    public static String updateQisForQisAgree (String recordId){
+        String re = '鎴愬姛';
+        ID myUserID = UserInfo.getUserId();
+        
+        String answerComp = Schema.SObjectType.QIS_Report__c.getRecordTypeInfosByName().get(LightingButtonConstant.RECORD_TYPE_NAME_BY_OSH_FINASH).getRecordTypeId();
+        String fina = Schema.SObjectType.QIS_Report__c.getRecordTypeInfosByName().get(LightingButtonConstant.RECORD_TYPE_NAME_BY_FINAL).getRecordTypeId();
+        String comp = Schema.SObjectType.QIS_Report__c.getRecordTypeInfosByName().get(LightingButtonConstant.RECORD_TYPE_NAME_BY_COMP).getRecordTypeId();
+        // RecordType rectyp = [SELECT id ,name FROM RecordType where  id = '01210000000gFTH'];
+        QIS_Report__c report = [SELECT  id,OwnerId,RecordTypeId FROM QIS_Report__c WHERE Id = :recordId LIMIT 1];
+        try{
+            if (report.ownerid == myUserID) {
+                QIS_Report__c rac  = new QIS_Report__c();   
+                rac.id = recordId;
+                rac.QIS_Status__c = LightingButtonConstant.STATUS_QIS_COMPLATED;
+                if (report.RecordTypeId == answerComp) {
+                    rac.RecordTypeId = fina;
+                }else{
+                    rac.RecordTypeId = comp;
+                }
+                rac.QIS_Complete_Day__c  = Date.today();
+                update rac;
+            }
+            
+        }catch(Exception e){
+            System.debug(LoggingLevel.INFO, '*** e: ' + e);
+            re = e.getMessage();
+        }
+         return re;
+    }
+    //OCSM鏈嶅姟鏈儴CDS瀹屾瘯
+    @AuraEnabled
+    public static InitData initForRCCDScompleteButton (String recordId){
+        InitData res = new initData();
+        try{
+            QIS_Report__c report = [SELECT  id ,CDS_date__c,QIS_Status__c FROM QIS_Report__c WHERE Id = :recordId LIMIT 1];  
+            res.Id = report.Id;
+            res.cdsdate = report.CDS_date__c;
+            res.QIStatus = report.QIS_Status__c;
+            System.debug(LoggingLevel.INFO, '*** res: ' + res);
+        }catch(Exception e){
+            System.debug(LoggingLevel.INFO, '*** e: ' + e);
+        }
+        return res;
+    }
+
+    @AuraEnabled
+    public static String updateQisForRCCDScomplete (String recordId){
+        String re = '鎴愬姛';
+        ID myUserID = UserInfo.getUserId();
+        User userinfo = [SELECT id,Alias__c FROM User WHERE Id = :myUserID LIMIT 1];  
+        QIS_Report__c report = [SELECT  id FROM QIS_Report__c WHERE Id = :recordId LIMIT 1];
+        try{
+                QIS_Report__c rac  = new QIS_Report__c();   
+                rac.id = recordId;
+                rac.CDS_date__c  = Date.today();
+                rac.RC_CDS_staff__c  = userinfo.Alias__c;
+                update rac;        
+        }catch(Exception e){
+            System.debug(LoggingLevel.INFO, '*** e: ' + e);
+            re = e.getMessage();
+        }
+         return re;
+    }
+    //OCSM涓嶈鎶ュ憡
+    @AuraEnabled
+    public static InitData initForlexOCSMNoToReportLightingButton (String recordId){
+        InitData res = new initData();
+        try{
+            QIS_Report__c report = [SELECT  id ,OCSMAdministrativeReportNumber__c,OCSMAdministrativeReportDate__c,Aware_date__c FROM QIS_Report__c WHERE Id = :recordId LIMIT 1];  
+            res.Id = report.Id;
+            res.oCSMAdministrativeReportNumber = report.OCSMAdministrativeReportNumber__c;
+            res.oCSMAdministrativeReportDate = report.OCSMAdministrativeReportDate__c;
+            res.Awaredate = report.Aware_date__c;
+            System.debug(LoggingLevel.INFO, '*** res: ' + res);
+        }catch(Exception e){
+            System.debug(LoggingLevel.INFO, '*** e: ' + e);
+        }
+        return res;
+    }
+    @AuraEnabled
+    public static String updateQisForlexOCSMNoToReportLighting (String recordId){
+        String re = '鎴愬姛'; 
+        QIS_Report__c report = [SELECT  id FROM QIS_Report__c WHERE Id = :recordId LIMIT 1];
+        try{
+                QIS_Report__c rac  = new QIS_Report__c();   
+                rac.id = recordId;
+                rac.OCSMAdministrativeReportStatus__c = '鏃犻渶鎶ュ憡';
+                update rac;        
+        }catch(Exception e){
+            System.debug(LoggingLevel.INFO, '*** e: ' + e);
+            re = e.getMessage();
+        }
+         return re;
+    }
+    //OCSM瑕佹姤鍛�
+    @AuraEnabled
+    public static InitData initForlexOCSMToReportLightingButton (String recordId){
+        InitData res = new initData();
+        try{
+            QIS_Report__c report = [SELECT  id ,OCSMAdministrativeReportStatus__c,Aware_date__c FROM QIS_Report__c WHERE Id = :recordId LIMIT 1];  
+            res.Id = report.Id;
+            res.oCSMAdministrativeReportStatus = report.OCSMAdministrativeReportStatus__c;
+            res.Awaredate = report.Aware_date__c;
+            System.debug(LoggingLevel.INFO, '*** res: ' + res);
+        }catch(Exception e){
+            System.debug(LoggingLevel.INFO, '*** e: ' + e);
+        }
+        return res;
+    }
+
+    @AuraEnabled
+    public static String updateQisForlexOCSMToReportLighting (String recordId){
+        String re = '鎴愬姛'; 
+        QIS_Report__c report = [SELECT  id FROM QIS_Report__c WHERE Id = :recordId LIMIT 1];
+        try{
+                QIS_Report__c rac  = new QIS_Report__c();   
+                rac.id = recordId;
+                rac.OCSMAdministrativeReportStatus__c  = '寰呮姤鍛�';
+                update rac;        
+        }catch(Exception e){
+            System.debug(LoggingLevel.INFO, '*** e: ' + e);
+            re = e.getMessage();
+        }
+         return re;
+    }
+
+    //鍙戦�丵IS鍒癝PO
+    @AuraEnabled
+    public static InitData initForlexSendQISButton (String recordId){
+        InitData res = new initData();
+        ID myUserID = UserInfo.getUserId();
+        User userinfo = [SELECT id,Profile.name FROM User WHERE Id = :myUserID LIMIT 1];
+        try{
+            QIS_Report__c report = [SELECT  id ,RecordTypeId,IsSendQIS__c FROM QIS_Report__c WHERE Id = :recordId LIMIT 1];
+            RecordType rec = [SELECT id,name FROM RecordType where  Id = :report.RecordTypeId];
+            res.Id = report.Id;
+            res.qisRecordTypeId = report.RecordTypeId;
+            res.qisRecordName = rec.name;
+            res.profileName = userinfo.Profile.name;
+            res.IsSendQIS = report.IsSendQIS__c;
+            System.debug(LoggingLevel.INFO, '*** res: ' + res);
+        }catch(Exception e){
+            System.debug(LoggingLevel.INFO, '*** e: ' + e);
+        }
+        return res;
+    }
+
+    @AuraEnabled
+    public static String updateQisForSendQIS (String recordId){
+        String re = '鎴愬姛'; 
+        QIS_Report__c report = [SELECT Id,Name,IsSendQIS__c FROM QIS_Report__c WHERE Id = :recordId LIMIT 1];
+        if(report == null ){
+            return '娌℃湁QIS锛�' + recordId + '鐨勬暟鎹��';
+        }
+        Savepoint sp = Database.setSavepoint(); 
+        try{    
+                
+                QIS_Report__c rac  = new QIS_Report__c();   
+                rac.id = recordId;
+                rac.IsSendQIS__c = true;
+                update rac;
+        }catch(Exception e){
+            Database.rollback(sp);
+            System.debug(LoggingLevel.INFO, '*** e: ' + e);
+            re = e.getMessage();
+        }
+         return re;
+    }
+    // OCSM鏈嶅姟鏈儴鏀跺埌瀹炵墿
+    @AuraEnabled
+    public static InitData initForlexRCRecievedButton (String recordId){
+        InitData res = new initData();
+        ID myUserID = UserInfo.getUserId();
+        User userinfo = [SELECT id,Profile.name FROM User WHERE Id = :myUserID LIMIT 1];
+        try{
+            QIS_Report__c report = [SELECT  id ,isAE_Profile__c,QIS_Status__c,isPAE_Profile__c,is_CNBuy__c FROM QIS_Report__c WHERE Id = :recordId LIMIT 1];
+            res.Id = report.Id;
+            res.isAEProfile = report.isAE_Profile__c;
+            res.isPAEProfile = report.isPAE_Profile__c;
+            res.QIStatus = report.QIS_Status__c;
+            res.isCNBuy = report.is_CNBuy__c;
+            System.debug(LoggingLevel.INFO, '*** res: ' + res);
+        }catch(Exception e){
+            System.debug(LoggingLevel.INFO, '*** e: ' + e);
+        }
+        return res;
+    }
+
+    @AuraEnabled
+    public static String updateQisForRCRecieved (String recordId){
+        String re = '鎴愬姛'; 
+        ID myUserID = UserInfo.getUserId();
+        User userinfo = [SELECT id,Alias,BuchangApprovalManagerSales__c,JingliApprovalManager__c, BuchangApprovalManager__c, ZongjianApprovalManager__c FROM User WHERE Id = :myUserID LIMIT 1];
+
+        try{    
+                QIS_Report__c rac  = new QIS_Report__c();   
+                rac.id = recordId;
+
+                rac.QIS_Status__c = 'RC妫�娴嬩腑';
+                rac.OCM_RC_RecievedDate__c = Date.today();
+                rac.RC__c = myUserID;
+                rac.RC_Receive_staff__c = userinfo.Alias;
+
+                if (userinfo != null  && userinfo.BuchangApprovalManagerSales__c!= null) {
+                    rac.RC_Manager__c = userinfo.BuchangApprovalManagerSales__c;
+                } else {
+                    rac.RC_Manager__c = myUserID;
+                }
+                update rac;
+        }catch(Exception e){
+            System.debug(LoggingLevel.INFO, '*** e: ' + e);
+            re = e.getMessage();
+        }
+         return re;
+    }
     public class InitData{
         @AuraEnabled
         public String Id;
         @AuraEnabled
-        public String OwnerId;
+        public String ownerId;
         @AuraEnabled
         public String qisRecordTypeId;
         @AuraEnabled
         public String qisRecordName;
         @AuraEnabled
-        public String ProfileName;
+        public String profileName;
         @AuraEnabled
-        public String PAEid;
+        public String isAEProfile;
         @AuraEnabled
-        public String OCSMAdministrativeReportNumber;
+        public String isPAEProfile;
         @AuraEnabled
-        public String OCSMAdministrativeReportStatus;
+        public String isCNBuy;
         @AuraEnabled
-        public String QIStatus;
+        public String pAEid;
         @AuraEnabled
-        public String OSHstaff;
+        public String oCSMAdministrativeReportNumber;
         @AuraEnabled
-        public String OSHstaffEmail;
+        public String oCSMAdministrativeReportStatus;
         @AuraEnabled
-        public String CancelQISReason;
+        public String qIStatus;
         @AuraEnabled
-        public String RCid;
+        public String oSHstaff;
+        @AuraEnabled
+        public String oSHstaffEmail;
+        @AuraEnabled
+        public String cancelQISReason;
+        @AuraEnabled
+        public String rCid;
         @AuraEnabled
         public String contractnumber;
         @AuraEnabled
-        public Date RCinspectionDate;
+        public Date rCinspectionDate;
         @AuraEnabled
-        public Date QISReplyDay;
+        public Date qISReplyDay;
         @AuraEnabled
-        public Date QISInstallDate;
+        public Date qISInstallDate;
         @AuraEnabled
         public Date cdsdate;
         @AuraEnabled
-        public Date Aware_date;
+        public Date awaredate;
         @AuraEnabled
-        public Date OCSMAdministrativeReportDate;
+        public Date oCSMAdministrativeReportDate;
         @AuraEnabled
-        public Boolean RCproblemnotfound;
+        public Boolean rCproblemnotfound;
         @AuraEnabled
         public Boolean isaohuiproduct;
         @AuraEnabled
-        public Boolean IsSendQIS;
+        public Boolean isSendQIS;
     }
 
 }
\ No newline at end of file
diff --git a/force-app/main/default/classes/QISReportController.cls-meta.xml b/force-app/main/default/classes/QISReportController.cls-meta.xml
index 9662499..541584f 100644
--- a/force-app/main/default/classes/QISReportController.cls-meta.xml
+++ b/force-app/main/default/classes/QISReportController.cls-meta.xml
@@ -2,4 +2,4 @@
 <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
     <apiVersion>50.0</apiVersion>
     <status>Active</status>
-</ApexClass>
\ No newline at end of file
+</ApexClass>
diff --git a/force-app/main/default/classes/otherButtonMaintenanceContractCtl.cls b/force-app/main/default/classes/otherButtonMaintenanceContractCtl.cls
index 2538a48..32661b4 100644
--- a/force-app/main/default/classes/otherButtonMaintenanceContractCtl.cls
+++ b/force-app/main/default/classes/otherButtonMaintenanceContractCtl.cls
@@ -32,6 +32,7 @@
         return res;
     }   
 
+    // 缁翠慨鍚堝悓澶卞崟鎶ュ憡
     @AuraEnabled
     public static List<Lost_Report__c> selectRecords(String recordId){
         List<Lost_Report__c> res = new List<Lost_Report__c>();
@@ -43,6 +44,7 @@
         return res;
     }
 
+    // 宸ヤ綔娴佺姸鎬�
     @AuraEnabled
     public static void processResults(String recordId){
         Approval.ProcessSubmitRequest psr = new Approval.ProcessSubmitRequest();
diff --git a/force-app/main/default/classes/otherButtonRepairController.cls b/force-app/main/default/classes/otherButtonRepairController.cls
index 76a3a39..f244964 100644
--- a/force-app/main/default/classes/otherButtonRepairController.cls
+++ b/force-app/main/default/classes/otherButtonRepairController.cls
@@ -7,13 +7,68 @@
     public static InitData init(String recordId){
         InitData res = new initData();
         try{
-            Repair__c report =  [SELECT OCSMAdministrativeReportStatus__c,Incharge_Staff_Email__c,Name,HP_Name__c,Delivered_Product__c,
+            Repair__c report =  [SELECT Status1__c,Rental_Apply_Equipment_Set_Detail__c,Rental_Apply_Equipment_Set_Detail_Id__c,Latest_Collect_Date_Priority__c,if_Rental_Apply__c,Offer_Rental_New__c,ProduceCompany_hand__c,CFDA_No_Hand__c,MBC_AwareDate__c,InsReport__c,QIS_ID__c,On_Call_ID__c,RepairSubOrder__c,ProductFailureRelated__c,Delay15Min__c,ProblemOccurredSelect__c,Repair_Source__c ,Failure_Occurrence_Date__c ,MaintenanceContractType__c ,OperationOrExaminationName__c ,WhatProject__c ,FailureQInHospital__c ,ReportAdverseEvents__c ,InformationFrom__c ,AfterFailureInformation__c ,ProblemOccurred__c ,SupportingProducts__c ,ifDeadHurt__c ,UseFailProductFinish__c ,DelayReportReason__c ,BreakORFallOff__c ,DateReceiptQuestions__c ,DeliveryLogisticsAnnotation__c ,DeliveryLogisticsNo__c ,engineerSendDate__c ,DeliveryLogisticsMode__c ,RepairApplicantDepartment__c ,RepairApplicantHospital__c ,RepairApplicant__c ,Repair_Detail__c ,Returns_Product_way__c ,work_location_select__c ,On_site_repair__c ,SalesOfficeCode_selection__c ,Incharge_Staff_Contact__c ,Incharge_Staff__c ,Dealer__c ,RepairCostType__c ,Account__c,Department_Class__c ,Hospital__c ,PaperRepairRequestNo__c ,part_arrangement_complete__c,Repair_Shipped_Date__c,OCSMAdministrativeReportStatus__c,Incharge_Staff_Email__c,Name,HP_Name__c,Delivered_Product__c,
             Repair_Product_Serial_No__c,Service_Repair_No__c,Repair_Firstestimated_Date__c,
             Repair_Estimated_Date__c,RC_information__c,Id,OCSMAdministrativeReportNumber__c,
             OCSMAdministrativeReportDate__c,Aware_date__c,PAE_Determine__c,ETQ_UPLOAD_STATUS__c,
             AE_DetermineResult__c,PAE_DetermineAC__c,Repair_Inspection_Date__c,Contain_UseRSA__c FROM Repair__c WHERE Id =: recordId LIMIT 1];
             System.debug(LoggingLevel.INFO, '*** opp: ' + report);
+            
+            res.Status1C = report.Status1__c;
+            res.ProblemOccurredSelectC = report.ProblemOccurredSelect__c;
+            res.Delay15MinC = report.Delay15Min__c;
+            res.ProductFailureRelatedC = report.ProductFailureRelated__c;
+            res.RepairSubOrderC = report.RepairSubOrder__c;
+            res.OnCallIDC = report.On_Call_ID__c;
+            res.QISIDC = report.QIS_ID__c;
+            res.InsReportC = report.InsReport__c;
+            res.MBCAwareDateC = report.MBC_AwareDate__c;
+            res.CFDANoHandC = report.CFDA_No_Hand__c;
+            res.ProduceCompanyHandC = report.ProduceCompany_hand__c;
+            res.OfferRentalNewC = report.Offer_Rental_New__c;
+            res.ifRentalApplyC = report.if_Rental_Apply__c;
+            res.LatestCollectDatePriorityC = report.Latest_Collect_Date_Priority__c;
+            res.RentalApplyEquipmentSetDetailIdC = report.Rental_Apply_Equipment_Set_Detail_Id__c;
+            res.RentalApplyEquipmentSetDetailC = report.Rental_Apply_Equipment_Set_Detail__c;
+            res.PaperRepairRequestNoC = report.PaperRepairRequestNo__c;
+            res.HospitalC = report.Hospital__c;
+            res.DepartmentClassC = report.Department_Class__c;
+            res.AccountC = report.Account__c;
+            res.RepairCostTypeC = report.RepairCostType__c;
+            res.DealerC  = report.Dealer__c ;
+            res.InchargeStaffC  = report.Incharge_Staff__c ;
+            res.InchargeStaffContactC  = report.Incharge_Staff_Contact__c ;
+            res.SalesOfficeCodeSelectionC  = report.SalesOfficeCode_selection__c ;
+            res.OnSiteRepairC  = report.On_site_repair__c ;
+            res.workLocationSelectC  = report.work_location_select__c ;
+            res.ReturnsProductWayC  = report.Returns_Product_way__c ;
+            res.RepairDetailC  = report.Repair_Detail__c ;
+            res.RepairApplicantC  = report.RepairApplicant__c ;
+            res.RepairApplicantHospitalC  = report.RepairApplicantHospital__c ;
+            res.RepairApplicantDepartmentC  = report.RepairApplicantDepartment__c ;
+            res.DeliveryLogisticsModeC  = report.DeliveryLogisticsMode__c ;
+            res.engineerSendDateC  = report.engineerSendDate__c ;
+            res.DeliveryLogisticsNoC  = report.DeliveryLogisticsNo__c ;
+            res.DeliveryLogisticsAnnotationC  = report.DeliveryLogisticsAnnotation__c ;
+            res.DateReceiptQuestionsC  = report.DateReceiptQuestions__c ;
+            res.BreakORFallOffC  = report.BreakORFallOff__c ;
+            res.DelayReportReasonC  = report.DelayReportReason__c ;
+            res.UseFailProductFinishC  = report.UseFailProductFinish__c ;
+            res.ifDeadHurtC = report.ifDeadHurt__c ;
+            res.SupportingProductsC = report.SupportingProducts__c ;
+            res.ProblemOccurredC = report.ProblemOccurred__c ;
+            res.AfterFailureInformationC = report.AfterFailureInformation__c ;
+            res.InformationFromC = report.InformationFrom__c ;
+            res.ReportAdverseEventsC = report.ReportAdverseEvents__c ;
+            res.FailureQInHospitalC = report.FailureQInHospital__c ;
+            res.WhatProjectC = report.WhatProject__c ;
+            res.OperationOrExaminationNameC = report.OperationOrExaminationName__c ;
+            res.MaintenanceContractTypeC = report.MaintenanceContractType__c ;
+            res.FailureOccurrenceDateC = report.Failure_Occurrence_Date__c ;
+            res.RepairSourceC = report.Repair_Source__c ;
             res.Id = report.Id;
+            res.partArrangementCompleteC = report.part_arrangement_complete__c;
+            res.RepairShippedDateC = report.Repair_Shipped_Date__c;
             res.OCSMAdministrativeReportNumberC = report.OCSMAdministrativeReportNumber__c;
             res.OCSMAdministrativeReportDateC = report.OCSMAdministrativeReportDate__c;
             res.AwareDateC = report.Aware_date__c;
@@ -23,7 +78,6 @@
             res.PAEDetermineACC = report.PAE_DetermineAC__c;
             res.RepairInspectionDateC = report.Repair_Inspection_Date__c;
             res.ContainUseRSAC = report.Contain_UseRSA__c;
-
             res.InchargeStaffEmailC = report.Incharge_Staff_Email__c;
             res.Name = report.Name;
             res.HPNameC = report.HP_Name__c;
@@ -34,6 +88,10 @@
             res.RepairEstimatedDateC = report.Repair_Estimated_Date__c;
             res.RCInformationC = report.RC_information__c;
             res.OCSMAdministrativeReportStatusC = report.OCSMAdministrativeReportStatus__c;
+            res.userID = UserInfo.getUserId();
+            res.profileId = UserInfo.getProfileId();
+            res.userEmail = UserInfo.getUserEmail();
+
 
             System.debug(LoggingLevel.INFO, '*** res: ' + res);
         }catch(Exception e){
@@ -42,6 +100,7 @@
         return res;
     }   
 
+    // 鏍规嵁ID鏌ユ壘淇悊琛�
     @AuraEnabled
     public static List<Repair__c> selectRecords(String recordId){
         List<Repair__c> res = new List<Repair__c>();
@@ -53,6 +112,7 @@
         return res;
     }
 
+    // 鏍规嵁ID淇敼淇悊
     @AuraEnabled
     public static void updateRepair(String recordId){
         try {
@@ -65,18 +125,147 @@
         }
     }
 
+    // 淇敼楠屾敹鍗�
+    @AuraEnabled
+    public static String updateYanshoudan(String recordId){
+        String res;
+        try {
+            Repair__c repair = new Repair__c();
+            repair.Id = recordid;
+            repair.Request_yanshoudan_PDF__c = true;
+            repair.Facility_Return_Receipt_Collection_reque__c = Datetime.now().date();
+            
+            update repair;
+        } catch (Exception e) {
+            System.debug(LoggingLevel.INFO, '*** e: ' + e);
+            res = e.getMessage();
+        }
+        return res;
+    }
+
+    // 鏌ユ壘PAE鍒ゅ畾璁板綍
     @AuraEnabled
     public static List<PAE_DecisionRecord__c> selectPAEDecisionRecord(String recordId,String recordTypeId){
-        List<PAE_DecisionRecord__c> res = new List<PAE_DecisionRecord__c>();
+        List<PAE_DecisionRecord__c > res = new List<PAE_DecisionRecord__c >();
         try{
-            res = [SELECT LastModifiedDate, Id, Name, LastModifiedById,RecordType.DeveloperName FROM PAE_DecisionRecord__c where PAE_Repair__c =: recordId And RecordType.DeveloperName =: recordTypeId Order by LastModifiedDate desc];
+            res = [SELECT LastModifiedDate, Id, Name, LastModifiedById,RecordType.DeveloperName FROM PAE_DecisionRecord__c  where PAE_Repair__c =: recordId And RecordType.DeveloperName =: recordTypeId Order by LastModifiedDate desc];
         }catch(Exception e){
             System.debug(LoggingLevel.INFO, '*** e: ' + e);
         }
         return res;
     }
 
+    // 鍙戦�侀偖浠�
+    @AuraEnabled
+    public static String sendToETQ(String iflog_Id,BatchIF_Log__c rowDataSFDC, List<String> repairIds,String statu){
+        List<QIS_Report__c> temp = [select id from QIS_Report__c where id in :repairIds ];
+        if(temp != null && temp.size() > 0){
+            try {
+                Database.executeBatch(new QISToPDFBatch(iflog_Id, rowDataSFDC,repairIds,statu),50); //鐢熸垚PDF
+            }
+            catch (Exception e) {
+                return '鏇存柊QIS鎶ラ敊:'+ e.getMessage();
+            }
+        }else{
+            BatchIF_Log__c iflog = new BatchIF_Log__c();
+            iflog.Type__c = 'sendToETQ';
+            iflog.ErrorLog__c = '';
+            iflog.Log__c = 'NFM401WebService start--';
+
+            Repair__c updateRe = new Repair__c();
+            updateRe.Id = repairIds[0];
+            updateRe.INTERFACE_RECORD_ID__c = null; 
+            updateRe.ETQ_UPLOAD_STATUS__c = null; 
+            updateRe.ETQ_UPLOAD_MESSAGE__c = null; 
+            updateRe.OSH_ConfirmationDate__c = Date.today(); 
+            updateRe.OSH_Affirmant__c = UserInfo.getUserId(); 
+            updateRe.AWS_Interface_Time__c = Datetime.now();
+            updateRe.AsyncData__c = true; 
+            try{
+                update updateRe;
+                Database.executeBatch(new RepairToPDFBatch(iflog_Id, rowDataSFDC,repairIds,statu)); //鐢熸垚PDF
+                iflog.Log__c += '\n淇悊:'+updateRe+' 鏇存柊鎴愬姛';
+                iflog.Log__c = '\nNFM401WebService end--';
+                insert iflog;
+            }catch(Exception ex){
+                iflog.ErrorLog__c += '淇悊:'+updateRe+' 鏇存柊澶辫触,鍥犱负::'+ex.getMessage();
+                iflog.Log__c = '\nNFM401WebService end--';
+                insert iflog;
+                return '鏇存柊淇悊鎶ラ敊:'+ ex.getMessage();
+            }
+        }
+        return '鍙戦�佹垚鍔�!';
+    }
+
+    // 鏌ユ壘AssetID
+    @AuraEnabled
+    public static String selectAssetID(String recordId){
+        List<Repair__c> res = new List<Repair__c>();
+        try{
+            res = [SELECT Delivered_Product__c from Repair__c WHERE Id =: recordId];
+        }catch(Exception e){
+            System.debug(LoggingLevel.INFO, '*** e: ' + e);
+        }
+        return res[0].Delivered_Product__c;
+    }
+
+    // 鏌ユ壘鍒犻櫎ID
+    @AuraEnabled
+    public static List<Repair__c> selectCustomDeleteById(String recordId){
+        List<Repair__c > res = new List<Repair__c >();
+        try{
+            res = [SELECT Id, Status__c,SAP_Transfer_time__c, Repair_Ordered_Date__c, CreatedById, Acc_OwnerId__c,FSE_ownerid__c FROM Repair__c WHERE Id =: recordId];
+        }catch(Exception e){
+            System.debug(LoggingLevel.INFO, '*** e: ' + e);
+        }
+        return res;
+    }
+
+     // 鏌ユ壘鍒犻櫎ID
+     @AuraEnabled
+     public static String deleteRepair(String rid) {
+        try {
+            Repair__c r = new Repair__c(Id = rid);
+            delete r;
+            return 'OK';
+        } catch (Exception e) {
+            return e.getMessage();
+        }
+    }
+
     public class InitData{
+        @AuraEnabled
+        public String Status1C;
+        @AuraEnabled
+        public String RepairSubOrderC;
+        @AuraEnabled
+        public String OnCallIDC;
+        @AuraEnabled
+        public String QISIDC;
+        @AuraEnabled
+        public String InsReportC;
+        @AuraEnabled
+        public Datetime MBCAwareDateC;
+        @AuraEnabled
+        public String CFDANoHandC;
+        @AuraEnabled
+        public String ProduceCompanyHandC;
+        @AuraEnabled
+        public Boolean OfferRentalNewC;
+        @AuraEnabled
+        public Boolean ifRentalApplyC;
+        @AuraEnabled
+        public Datetime LatestCollectDatePriorityC;
+        @AuraEnabled
+        public String RentalApplyEquipmentSetDetailIdC;
+        @AuraEnabled
+        public String RentalApplyEquipmentSetDetailC;
+        @AuraEnabled
+        public String ProblemOccurredSelectC;
+         @AuraEnabled
+        public String Delay15MinC;
+         @AuraEnabled
+        public String ProductFailureRelatedC;
         @AuraEnabled
         public String Id;
         @AuraEnabled
@@ -97,7 +286,6 @@
         public Datetime RepairInspectionDateC;
         @AuraEnabled
         public boolean ContainUseRSAC;
-
          @AuraEnabled
         public String InchargeStaffEmailC;
          @AuraEnabled
@@ -118,6 +306,87 @@
         public String RCInformationC;
         @AuraEnabled
         public String OCSMAdministrativeReportStatusC;
-
+        @AuraEnabled
+        public Datetime RepairShippedDateC;
+        @AuraEnabled
+        public Datetime partArrangementCompleteC;
+        @AuraEnabled
+        public String userID;
+        @AuraEnabled
+        public String profileId;
+        @AuraEnabled
+        public String userEmail;
+        @AuraEnabled
+        public String PaperRepairRequestNoC;
+        @AuraEnabled
+        public String HospitalC;
+        @AuraEnabled
+        public String AccountC;
+        @AuraEnabled
+        public String DepartmentClassC;
+        @AuraEnabled
+        public String RepairCostTypeC;
+        @AuraEnabled
+        public String DealerC;
+        @AuraEnabled
+        public String InchargeStaffC;
+        @AuraEnabled
+        public String InchargeStaffContactC;
+        @AuraEnabled
+        public String SalesOfficeCodeSelectionC;
+        @AuraEnabled
+        public String OnSiteRepairC;
+        @AuraEnabled
+        public String workLocationSelectC;
+        @AuraEnabled
+        public String ReturnsProductWayC;
+        @AuraEnabled
+        public String RepairDetailC;
+        @AuraEnabled
+        public String RepairApplicantC;
+        @AuraEnabled
+        public String RepairApplicantHospitalC;
+        @AuraEnabled
+        public String RepairApplicantDepartmentC;
+        @AuraEnabled
+        public String DeliveryLogisticsModeC;
+        @AuraEnabled
+        public Datetime engineerSendDateC;
+        @AuraEnabled
+        public String DeliveryLogisticsNoC;
+        @AuraEnabled
+        public String DeliveryLogisticsAnnotationC;
+        @AuraEnabled
+        public Datetime DateReceiptQuestionsC;
+        @AuraEnabled
+        public String BreakORFallOffC;
+        @AuraEnabled
+        public String DelayReportReasonC;
+        @AuraEnabled
+        public String UseFailProductFinishC;
+        @AuraEnabled
+        public String ifDeadHurtC;
+        @AuraEnabled
+        public String SupportingProductsC;
+        @AuraEnabled
+        public String ProblemOccurredC;
+        @AuraEnabled
+        public String AfterFailureInformationC;
+        @AuraEnabled
+        public String InformationFromC;
+        @AuraEnabled
+        public String ReportAdverseEventsC;
+        @AuraEnabled
+        public String FailureQInHospitalC;
+        @AuraEnabled
+        public String WhatProjectC;
+        @AuraEnabled
+        public String OperationOrExaminationNameC;
+        @AuraEnabled
+        public String MaintenanceContractTypeC;
+        @AuraEnabled
+        public Datetime FailureOccurrenceDateC;
+        @AuraEnabled
+        public String RepairSourceC;
      }
 }
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexCancel/lexCancel.js b/force-app/main/default/lwc/lexCancel/lexCancel.js
index d98fdef..302de36 100644
--- a/force-app/main/default/lwc/lexCancel/lexCancel.js
+++ b/force-app/main/default/lwc/lexCancel/lexCancel.js
@@ -9,7 +9,23 @@
     @api recordId;
     status;
     IsLoading = true;
-   
+    @wire(CurrentPageReference)
+    getStateParameters(currentPageReference) {
+            console.log(111);
+            console.log(currentPageReference);
+
+        if (currentPageReference) {
+          const urlValue = currentPageReference.state.recordId;
+          if (urlValue) {
+            let str = `${urlValue}`;
+            console.log("str");
+            console.log(str);
+            this.recordId = str;
+          }
+        }
+    }
+
+
 
     connectedCallback(){
         console.log(this.recordId);
@@ -18,10 +34,10 @@
         }).then(result => {
             console.log(result);
             if (result != null) {
-                this.IsLoading = false;
                 this.status = result.status;
                 console.log(this.status);
                 this.cancel();
+                this.IsLoading = false;
 
             }
         }).catch(error => {
diff --git a/force-app/main/default/lwc/lexCancelSubmit/lexCancelSubmit.js b/force-app/main/default/lwc/lexCancelSubmit/lexCancelSubmit.js
index c3eb560..85014ed 100644
--- a/force-app/main/default/lwc/lexCancelSubmit/lexCancelSubmit.js
+++ b/force-app/main/default/lwc/lexCancelSubmit/lexCancelSubmit.js
@@ -12,6 +12,24 @@
     ownerId;
     monthlyReportId;
     IsLoading = true;
+
+
+    @wire(CurrentPageReference)
+    getStateParameters(currentPageReference) {
+            console.log(111);
+            console.log(currentPageReference);
+
+        if (currentPageReference) {
+          const urlValue = currentPageReference.state.recordId;
+          if (urlValue) {
+            let str = `${urlValue}`;
+            console.log("str");
+            console.log(str);
+            this.recordId = str;
+          }
+        }
+    }
+
     connectedCallback () {
         console.log(this.recordId);
         init({
diff --git a/force-app/main/default/lwc/lexComplete/lexComplete.js b/force-app/main/default/lwc/lexComplete/lexComplete.js
index 89131c9..11e315a 100644
--- a/force-app/main/default/lwc/lexComplete/lexComplete.js
+++ b/force-app/main/default/lwc/lexComplete/lexComplete.js
@@ -11,6 +11,22 @@
     profileId;
     status;
     IsLoading = true;
+
+    @wire(CurrentPageReference)
+    getStateParameters(currentPageReference) {
+            console.log(111);
+            console.log(currentPageReference);
+
+        if (currentPageReference) {
+          const urlValue = currentPageReference.state.recordId;
+          if (urlValue) {
+            let str = `${urlValue}`;
+            console.log("str");
+            console.log(str);
+            this.recordId = str;
+          }
+        }
+    }
     
     connectedCallback () {
         console.log(this.recordId);
diff --git a/force-app/main/default/lwc/lexCopyPIInspectionReport/lexCopyPIInspectionReport.js b/force-app/main/default/lwc/lexCopyPIInspectionReport/lexCopyPIInspectionReport.js
index afc128d..44d87fb 100644
--- a/force-app/main/default/lwc/lexCopyPIInspectionReport/lexCopyPIInspectionReport.js
+++ b/force-app/main/default/lwc/lexCopyPIInspectionReport/lexCopyPIInspectionReport.js
@@ -50,6 +50,7 @@
         });
     }
 
+    // 澶嶅埗
     CopyPI() {
         window.location.href = '/' + this.Id + '/e?newclone=1';
     }
diff --git a/force-app/main/default/lwc/lexCreateNotesEmail/lexCreateNotesEmail.js b/force-app/main/default/lwc/lexCreateNotesEmail/lexCreateNotesEmail.js
index ff0e10a..3eb1154 100644
--- a/force-app/main/default/lwc/lexCreateNotesEmail/lexCreateNotesEmail.js
+++ b/force-app/main/default/lwc/lexCreateNotesEmail/lexCreateNotesEmail.js
@@ -18,6 +18,22 @@
     IsLoading = true;
     url;
 
+    @wire(CurrentPageReference)
+    getStateParameters(currentPageReference) {
+            console.log(111);
+            console.log(currentPageReference);
+
+        if (currentPageReference) {
+          const urlValue = currentPageReference.state.recordId;
+          if (urlValue) {
+            let str = `${urlValue}`;
+            console.log("str");
+            console.log(str);
+            this.recordId = str;
+          }
+        }
+    }
+
 
 
     connectedCallback(){
diff --git a/force-app/main/default/lwc/lexCreateReportMaintenanceContract/lexCreateReportMaintenanceContract.js b/force-app/main/default/lwc/lexCreateReportMaintenanceContract/lexCreateReportMaintenanceContract.js
index 9c7fadd..04d05e5 100644
--- a/force-app/main/default/lwc/lexCreateReportMaintenanceContract/lexCreateReportMaintenanceContract.js
+++ b/force-app/main/default/lwc/lexCreateReportMaintenanceContract/lexCreateReportMaintenanceContract.js
@@ -52,6 +52,7 @@
         });
     }
 
+    // 鍒朵綔鎶ュ憡涔�
     CreateReport() {
         var MaintenanceContractId = this.Id;
         var RecordTypeName = this.RecordTypeDeveloperNameC;
diff --git a/force-app/main/default/lwc/lexDispatchOCSMQARA/lexDispatchOCSMQARA.js b/force-app/main/default/lwc/lexDispatchOCSMQARA/lexDispatchOCSMQARA.js
index 62dbcda..04d513c 100644
--- a/force-app/main/default/lwc/lexDispatchOCSMQARA/lexDispatchOCSMQARA.js
+++ b/force-app/main/default/lwc/lexDispatchOCSMQARA/lexDispatchOCSMQARA.js
@@ -10,6 +10,22 @@
     
 
 
+    @wire(CurrentPageReference)
+    getStateParameters(currentPageReference) {
+            console.log(111);
+            console.log(currentPageReference);
+
+        if (currentPageReference) {
+          const urlValue = currentPageReference.state.recordId;
+          if (urlValue) {
+            let str = `${urlValue}`;
+            console.log("str");
+            console.log(str);
+            this.recordId = str;
+          }
+        }
+    }
+
     connectedCallback(){
         console.log(this.recordId);
         this.IsLoading = false;
diff --git a/force-app/main/default/lwc/lexInsPageBtn/lexInsPageBtn.js b/force-app/main/default/lwc/lexInsPageBtn/lexInsPageBtn.js
index 38e1d2b..e0c1dbd 100644
--- a/force-app/main/default/lwc/lexInsPageBtn/lexInsPageBtn.js
+++ b/force-app/main/default/lwc/lexInsPageBtn/lexInsPageBtn.js
@@ -49,6 +49,7 @@
         });
     }
 
+    // 鎶ュ憡涔︽槑缁嗙紪杈�
     insPageBtn() {
         var url;
         if (this.RecordTypeId == '01210000000aLii') {
diff --git a/force-app/main/default/lwc/lexOCMSubmit/lexOCMSubmit.js b/force-app/main/default/lwc/lexOCMSubmit/lexOCMSubmit.js
index d6c2e68..814dd7b 100644
--- a/force-app/main/default/lwc/lexOCMSubmit/lexOCMSubmit.js
+++ b/force-app/main/default/lwc/lexOCMSubmit/lexOCMSubmit.js
@@ -16,6 +16,7 @@
 	qisStatus;
 	contractnumber;
 	isaohuiproduct;
+    err;
 	@wire(CurrentPageReference)
      getStateParameters(currentPageReference) {
              console.log(111);
@@ -38,12 +39,10 @@
         }).then(result => {
             this.IsLoading = false;
             this.qisReportId = result.Id;
-            this.qisStatus = result.QIStatus;
-            this.QISInstallDate = result.QISInstallDate;
+            this.qisStatus = result.qIStatus;
+            this.QISInstallDate = result.qISInstallDate;
             this.contractnumber = result.contractnumber;
             this.isaohuiproduct = result.isaohuiproduct;
-            console.log('this.qisStatus='+this.qisStatus);
-            console.log('this.isaohuiproduct='+this.isaohuiproduct);
          	if (this.qisStatus!='鑽夋涓�' && this.qisStatus!='鍙栨秷') {
          		const evt = new ShowToastEvent({
                         title : '宸茬粡鎻愪氦',
@@ -116,9 +115,10 @@
         		}).then(result =>{
         			console.log('result'+result);
         			if (result!='鎴愬姛') {
+                        this.err = result;
         				const evt = new ShowToastEvent({
 	                        title : '鏇存柊澶辫触',
-	                        message: result,
+	                        message: this.err,
 	                        variant: 'error'
                     	});
                     	this.dispatchEvent(evt);
diff --git a/force-app/main/default/lwc/lexOCSMNoToReportForReport/lexOCSMNoToReportForReport.js b/force-app/main/default/lwc/lexOCSMNoToReportForReport/lexOCSMNoToReportForReport.js
index 0680b20..06e8cda 100644
--- a/force-app/main/default/lwc/lexOCSMNoToReportForReport/lexOCSMNoToReportForReport.js
+++ b/force-app/main/default/lwc/lexOCSMNoToReportForReport/lexOCSMNoToReportForReport.js
@@ -12,6 +12,22 @@
     OCSMAdministrativeReportDate;
     AwareDate;
 
+    @wire(CurrentPageReference)
+    getStateParameters(currentPageReference) {
+            console.log(111);
+            console.log(currentPageReference);
+
+        if (currentPageReference) {
+          const urlValue = currentPageReference.state.recordId;
+          if (urlValue) {
+            let str = `${urlValue}`;
+            console.log("str");
+            console.log(str);
+            this.recordId = str;
+          }
+        }
+    }
+
 
 
 
diff --git a/force-app/main/default/lwc/lexOCSMToReport/lexOCSMToReport.js b/force-app/main/default/lwc/lexOCSMToReport/lexOCSMToReport.js
index 916ab25..4f69994 100644
--- a/force-app/main/default/lwc/lexOCSMToReport/lexOCSMToReport.js
+++ b/force-app/main/default/lwc/lexOCSMToReport/lexOCSMToReport.js
@@ -12,6 +12,21 @@
     awareDate;
 
 
+    @wire(CurrentPageReference)
+    getStateParameters(currentPageReference) {
+            console.log(111);
+            console.log(currentPageReference);
+
+        if (currentPageReference) {
+          const urlValue = currentPageReference.state.recordId;
+          if (urlValue) {
+            let str = `${urlValue}`;
+            console.log("str");
+            console.log(str);
+            this.recordId = str;
+          }
+        }
+    }
 
     connectedCallback(){
         console.log(this.recordId);
diff --git a/force-app/main/default/lwc/lexOPDtoSIS/lexOPDtoSIS.js b/force-app/main/default/lwc/lexOPDtoSIS/lexOPDtoSIS.js
index 0052ac3..c283bb6 100644
--- a/force-app/main/default/lwc/lexOPDtoSIS/lexOPDtoSIS.js
+++ b/force-app/main/default/lwc/lexOPDtoSIS/lexOPDtoSIS.js
@@ -14,7 +14,21 @@
     status;
     userId;
 
-  
+    @wire(CurrentPageReference)
+    getStateParameters(currentPageReference) {
+            console.log(111);
+            console.log(currentPageReference);
+
+        if (currentPageReference) {
+          const urlValue = currentPageReference.state.recordId;
+          if (urlValue) {
+            let str = `${urlValue}`;
+            console.log("str");
+            console.log(str);
+            this.recordId = str;
+          }
+        }
+    }
 
 
     connectedCallback(){
@@ -23,13 +37,12 @@
             recordId: this.recordId
         }).then(result => {
             console.log(result);
+            console.log("123");
             if (result != null) {
-                this.IsLoading = false;
                 this.ownerId = result.ownerId;
                 this.status = result.status;
                 this.userId = result.userId;
                 this.OPDtoSIS();
-                this.dispatchEvent(new CloseActionScreenEvent());
             }
         }).catch(error => {
             console.log("error");
@@ -60,11 +73,13 @@
             }).then(result =>{
                 this.updateRecordView(this.recordId);
                 this.showToast("鎴愬姛锛�","success");
+                this.dispatchEvent(new CloseActionScreenEvent());
                 });
             } else {
                 this.showToast("鍙崏妗堜腑鐘舵�佸強OPD/SIS鎶ュ憡涔︾殑鎵�鏈変汉鍙互鎻愪氦","error");
+                this.dispatchEvent(new CloseActionScreenEvent());
             }
-
+            this.IsLoading = false;
         
     }
 }
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexOSHSubmit/lexOSHSubmit.js b/force-app/main/default/lwc/lexOSHSubmit/lexOSHSubmit.js
index 65d0f97..0e82f06 100644
--- a/force-app/main/default/lwc/lexOSHSubmit/lexOSHSubmit.js
+++ b/force-app/main/default/lwc/lexOSHSubmit/lexOSHSubmit.js
@@ -37,9 +37,9 @@
         }).then(result => {
             this.IsLoading = false;
             this.qisReportId = result.Id;
-            this.qisStatus = result.QIStatus;
-            this.OSHstaff = result.OSHstaff;
-            this.OSHstaffEmail = result.OSHstaffEmail;
+            this.qisStatus = result.qIStatus;
+            this.OSHstaff = result.oSHstaff;
+            this.OSHstaffEmail = result.oSHstaffEmail;
             console.log('this.qisStatus='+this.qisStatus);
             console.log('this.OSHstaff='+this.OSHstaff);
             console.log('this.OSHstaffEmail='+this.OSHstaffEmail);
diff --git a/force-app/main/default/lwc/lexPreContractSubmit/lexPreContractSubmit.html b/force-app/main/default/lwc/lexPreContractSubmit/lexPreContractSubmit.html
index d044dbb..87f391a 100644
--- a/force-app/main/default/lwc/lexPreContractSubmit/lexPreContractSubmit.html
+++ b/force-app/main/default/lwc/lexPreContractSubmit/lexPreContractSubmit.html
@@ -1,5 +1,6 @@
 <template>
     <div class="exampleHolder" if:true={IsLoading}>
         <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
+        <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button>
     </div>
 </template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexPreContractSubmit/lexPreContractSubmit.js b/force-app/main/default/lwc/lexPreContractSubmit/lexPreContractSubmit.js
index ed6e02c..1340680 100644
--- a/force-app/main/default/lwc/lexPreContractSubmit/lexPreContractSubmit.js
+++ b/force-app/main/default/lwc/lexPreContractSubmit/lexPreContractSubmit.js
@@ -11,6 +11,9 @@
 } from 'lightning/actions';
 import init from '@salesforce/apex/otherButtonMaintenanceContractCtl.init';
 import processResults from '@salesforce/apex/otherButtonMaintenanceContractCtl.processResults';
+import {
+    ShowToastEvent
+} from 'lightning/platformShowToastEvent';
 
 export default class LexPreContractSubmit extends LightningElement {
     @api recordId;
@@ -59,31 +62,31 @@
         });
     }
 
+    // 鍚堝悓澶嶆牳
     preContractSubmit() {
-        //update wangweipeng 2022/01/04 start
-        //鍒ゆ柇鏄惁闇�瑕佸厛涓婁紶璁ゆ鍚堝悓鍚楋紝濡傛灉闇�瑕侀偅涔堝垽鏂粬鏄惁宸茬粡涓婁紶锛屽鏋滀笂浼狅紝閭d箞鍒ゆ柇浠栨槸鍚﹀畬鎴愯娆撅紝濡傛灉閮芥弧瓒筹紝閭d箞鎵嶈兘姝e父璧版帴鍙d笂浼燬AP
-        //鍒ゆ柇鏄娆惧悎鍚屽悧
         if (this.oldIsRecognitionModelC) {
-            if (this.uploadToRMTimeC == null) { //鍒ゆ柇鏄惁宸茬粡涓婁紶璁ゆ鍚堝悓
-                alert('褰撳墠缁翠慨鍚堝悓鐨勭粡閿�鍟嗘槸鍏堟瀵硅薄锛岄渶瑕佸厛銆愪笂浼犺娆惧悎鍚屻�戯紝鐒跺悗瀹屾垚璁ゆ浠ュ悗鎵嶈兘澶嶆牳銆�');
+            if (this.uploadToRMTimeC == null) {
+                this.ShowToastEvent('褰撳墠缁翠慨鍚堝悓鐨勭粡閿�鍟嗘槸鍏堟瀵硅薄锛岄渶瑕佸厛銆愪笂浼犺娆惧悎鍚屻�戯紝鐒跺悗瀹屾垚璁ゆ浠ュ悗鎵嶈兘澶嶆牳銆�', "error")
+                // alert('褰撳墠缁翠慨鍚堝悓鐨勭粡閿�鍟嗘槸鍏堟瀵硅薄锛岄渶瑕佸厛銆愪笂浼犺娆惧悎鍚屻�戯紝鐒跺悗瀹屾垚璁ゆ浠ュ悗鎵嶈兘澶嶆牳銆�');
                 return;
             } else {
-                //鍒ゆ柇鏄惁瀹屾垚璁ゆ
                 if (!this.IsRecognitionModelTrueC) {
-                    alert('褰撳墠缁翠慨鍚堝悓娌℃湁瀹屾垚璁ゆ锛屼笉鑳借繘琛屽鏍搞��');
+                    this.ShowToastEvent('褰撳墠缁翠慨鍚堝悓娌℃湁瀹屾垚璁ゆ锛屼笉鑳借繘琛屽鏍搞��', "error")
+                    // alert('褰撳墠缁翠慨鍚堝悓娌℃湁瀹屾垚璁ゆ锛屼笉鑳借繘琛屽鏍搞��');
                     return;
                 }
             }
         }
-        //update wangweipeng 2022/01/04 end
         var status = this.MCApprovalStatusC;
         if (status != 'Draft' && status != 'Reject' && status != undefined) {
-            alert('澶嶆牳宸茬粡鎻愪氦锛岃纭鐘舵�併��');
+            this.ShowToastEvent('澶嶆牳宸茬粡鎻愪氦锛岃纭鐘舵�併��', "success")
+            // alert('澶嶆牳宸茬粡鎻愪氦锛岃纭鐘舵�併��');
             return;
         }
         var con_no = this.ContractprintCompletedC;
         if (con_no == '') {
-            alert('鍚堝悓鐩栫珷瀹屾瘯涓虹┖锛屼笉鑳芥彁浜ゅ悎鍚屽鏍哥敵璇枫��');
+            this.ShowToastEvent('鍚堝悓鐩栫珷瀹屾瘯涓虹┖锛屼笉鑳芥彁浜ゅ悎鍚屽鏍哥敵璇枫��', "error")
+            // alert('鍚堝悓鐩栫珷瀹屾瘯涓虹┖锛屼笉鑳芥彁浜ゅ悎鍚屽鏍哥敵璇枫��');
             return;
         }
         if (!confirm("涓�鏃︽彁浜ゆ璁板綍浠ュ緟鎵瑰噯锛屾牴鎹偍鐨勮缃偍鍙兘涓嶅啀鑳藉缂栬緫姝よ褰曟垨灏嗕粬浠庢壒鍑嗚繃绋嬩腑璋冨洖銆傛槸鍚︾户缁紵")) {
@@ -94,9 +97,20 @@
         }).catch(error => {
             if (error.body.pageErrors[0] != null) {
                 var errmsg = error.body.pageErrors[0].message.toString();
-                alert(errmsg + '_sys');
+                // alert(errmsg + '_sys');
+                this.ShowToastEvent(errmsg + '_sys', "error")
                 return;
             }
         })
     }
+
+    // 寮圭獥
+    ShowToastEvent(msg, type) {
+        const event = new ShowToastEvent({
+            title: '',
+            message: msg,
+            variant: type
+        });
+        this.dispatchEvent(event);
+    }
 }
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexRCSubmit/lexRCSubmit.js b/force-app/main/default/lwc/lexRCSubmit/lexRCSubmit.js
index d548720..a65405b 100644
--- a/force-app/main/default/lwc/lexRCSubmit/lexRCSubmit.js
+++ b/force-app/main/default/lwc/lexRCSubmit/lexRCSubmit.js
@@ -44,14 +44,14 @@
         }).then(result => {
             this.IsLoading = false;
             this.qisReportId = result.Id;
-            this.qisStatus = result.QIStatus;
-            this.OSHstaff = result.OSHstaff;
-            this.OSHstaffEmail = result.OSHstaffEmail;
-            this.CancelQISReason = result.CancelQISReason;
-            this.Rcid = result.RCid;
-            this.RCinspectionDate = result.RCinspectionDate;
-            this.QISReplyDay = result.QISReplyDay;
-            this.RCproblemnotfound = result.RCproblemnotfound;
+            this.qisStatus = result.qIStatus;
+            this.OSHstaff = result.oSHstaff;
+            this.OSHstaffEmail = result.oSHstaffEmail;
+            this.CancelQISReason = result.cancelQISReason;
+            this.Rcid = result.rCid;
+            this.RCinspectionDate = result.rCinspectionDate;
+            this.QISReplyDay = result.qISReplyDay;
+            this.RCproblemnotfound = result.rCproblemnotfound;
          	if (this.qisStatus!='RC妫�娴嬩腑') {
                 const evt = new ShowToastEvent({
                         title : '宸茬粡鎻愪氦瀹℃壒',
diff --git a/force-app/main/default/lwc/lexSIStoOPD/lexSIStoOPD.js b/force-app/main/default/lwc/lexSIStoOPD/lexSIStoOPD.js
index b85d07d..94f34b3 100644
--- a/force-app/main/default/lwc/lexSIStoOPD/lexSIStoOPD.js
+++ b/force-app/main/default/lwc/lexSIStoOPD/lexSIStoOPD.js
@@ -12,7 +12,22 @@
     ownerId;
     status;
     userId;
-    errorMsg;
+    @wire(CurrentPageReference)
+    getStateParameters(currentPageReference) {
+            console.log(111);
+            console.log(currentPageReference);
+
+        if (currentPageReference) {
+          const urlValue = currentPageReference.state.recordId;
+          if (urlValue) {
+            let str = `${urlValue}`;
+            console.log("str");
+            console.log(str);
+            this.recordId = str;
+          }
+        }
+    }
+
 
     connectedCallback(){
         console.log(this.recordId);
@@ -21,7 +36,6 @@
         }).then(result => {
             console.log(result);
             if (result != null) {
-                this.IsLoading = false;
                 this.ownerId = result.ownerId;
                 this.status = result.status;
                 this.userId = result.userId;
@@ -31,10 +45,6 @@
             console.log("error");
             console.log(error);
         }).finally(() => {
-            console.log(this.errorMsg);
-            if(this.errorMsg){
-                this.showToast(this.errorMsg,"error");
-            }  
         });
 
     }
@@ -58,12 +68,15 @@
             updateForSIStoOPDButton({
                 recordId: this.recordId
             }).then(result=>{
+                console.log(result);
                 if(result){
                     this.showToast(result,"error");
                 }else{
+                    this.showToast("鎴愬姛","success");
                     this.updateRecordView(this.recordId);
                 } 
                 this.dispatchEvent(new CloseActionScreenEvent());
+                this.IsLoading = false;
             });              
     }
     
diff --git a/force-app/main/default/lwc/lexSubmitCompetitorReport/lexSubmitCompetitorReport.js b/force-app/main/default/lwc/lexSubmitCompetitorReport/lexSubmitCompetitorReport.js
index 025a150..4406dc9 100644
--- a/force-app/main/default/lwc/lexSubmitCompetitorReport/lexSubmitCompetitorReport.js
+++ b/force-app/main/default/lwc/lexSubmitCompetitorReport/lexSubmitCompetitorReport.js
@@ -10,6 +10,22 @@
     @api recordId;
     IsLoading = true;
 
+    @wire(CurrentPageReference)
+    getStateParameters(currentPageReference) {
+            console.log(111);
+            console.log(currentPageReference);
+
+        if (currentPageReference) {
+          const urlValue = currentPageReference.state.recordId;
+          if (urlValue) {
+            let str = `${urlValue}`;
+            console.log("str");
+            console.log(str);
+            this.recordId = str;
+          }
+        }
+    }
+
     updateRecordView(recordId) {
       updateRecord({fields: { Id: recordId }});
   }
diff --git a/force-app/main/default/lwc/lexSubmitForApproval/lexSubmitForApproval.js b/force-app/main/default/lwc/lexSubmitForApproval/lexSubmitForApproval.js
index a601b08..9de188b 100644
--- a/force-app/main/default/lwc/lexSubmitForApproval/lexSubmitForApproval.js
+++ b/force-app/main/default/lwc/lexSubmitForApproval/lexSubmitForApproval.js
@@ -49,6 +49,7 @@
         });
     }
 
+    // 鍏抽棴璇环/鍏抽棴缁
     SubmitForApproval() {
         var url = '';
         selectRecords({
diff --git a/force-app/main/default/lwc/lexUploadToSap/lexUploadToSap.html b/force-app/main/default/lwc/lexUploadToSap/lexUploadToSap.html
index d044dbb..87f391a 100644
--- a/force-app/main/default/lwc/lexUploadToSap/lexUploadToSap.html
+++ b/force-app/main/default/lwc/lexUploadToSap/lexUploadToSap.html
@@ -1,5 +1,6 @@
 <template>
     <div class="exampleHolder" if:true={IsLoading}>
         <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
+        <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button>
     </div>
 </template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexUploadToSap/lexUploadToSap.js b/force-app/main/default/lwc/lexUploadToSap/lexUploadToSap.js
index 82f0cd4..5bd9188 100644
--- a/force-app/main/default/lwc/lexUploadToSap/lexUploadToSap.js
+++ b/force-app/main/default/lwc/lexUploadToSap/lexUploadToSap.js
@@ -14,6 +14,10 @@
 import updateFirstContract from '@salesforce/apex/updateFirstServiceContractWebService.updateFirstContract';
 import Check_plan from '@salesforce/apex/MaintenanceContractWebService.Check_plan';
 import up2sap from '@salesforce/apex/MaintenanceContractWebService.up2sap';
+import {
+    ShowToastEvent
+} from 'lightning/platformShowToastEvent';
+
 export default class LexUploadToSap extends LightningElement {
     @api recordId;
     str;
@@ -67,101 +71,85 @@
         });
     }
 
+    // 涓婁紶SAP
     uploadToSap() {
         if (this.MCApprovalStatusC != 'Pass') {
-            alert("鍚堝悓澶嶆牳鎵瑰噯鍚庢墠鍙互涓婁紶SAP銆�");
+            this.ShowToastEvent("鍚堝悓澶嶆牳鎵瑰噯鍚庢墠鍙互涓婁紶SAP銆�", "error")
+            // alert("鍚堝悓澶嶆牳鎵瑰噯鍚庢墠鍙互涓婁紶SAP銆�");
         } else if (this.MaintenanceContractNoC == undefined) {
-            alert('缁翠慨鍚堝悓绠$悊缂栫爜涓虹┖锛屼笉鑳戒笂浼燬AP銆�');
+            this.ShowToastEvent('缁翠慨鍚堝悓绠$悊缂栫爜涓虹┖锛屼笉鑳戒笂浼燬AP銆�', "error")
+            // alert('缁翠慨鍚堝悓绠$悊缂栫爜涓虹┖锛屼笉鑳戒笂浼燬AP銆�');
         } else if (this.uploadToSapTimeC != undefined) {
-            alert('宸茬粡涓婁紶SAP锛屼笉鑳介噸澶嶄笂浼犮��');
+            this.ShowToastEvent('宸茬粡涓婁紶SAP锛屼笉鑳介噸澶嶄笂浼犮��', "error")
+            // alert('宸茬粡涓婁紶SAP锛屼笉鑳介噸澶嶄笂浼犮��');
         } else {
-            //update wangweipeng 2021/11/20 start
-            //鍒ゆ柇鏄惁闇�瑕佸厛涓婁紶璁ゆ鍚堝悓鍚楋紝濡傛灉闇�瑕侀偅涔堝垽鏂粬鏄惁宸茬粡涓婁紶锛屽鏋滀笂浼狅紝閭d箞鍒ゆ柇浠栨槸鍚﹀畬鎴愯娆撅紝濡傛灉閮芥弧瓒筹紝閭d箞鎵嶈兘姝e父璧版帴鍙d笂浼燬AP
-            //鍒ゆ柇鏄娆惧悎鍚屽悧
             if (this.oldIsRecognitionModelC) {
-                //鍒ゆ柇鏄惁宸茬粡涓婁紶璁ゆ鍚堝悓
                 if (this.uploadToRMTimeC == undefined) {
-                    console.log("a");
-                    alert('褰撳墠缁翠慨鍚堝悓鐨勭粡閿�鍟嗘槸鍏堟瀵硅薄锛岄渶瑕佸厛銆愪笂浼犺娆惧悎鍚屻�戯紝鐒跺悗瀹屾垚璁ゆ浠ュ悗鎵嶈兘涓婁紶SAP銆�');
+                    this.ShowToastEvent('褰撳墠缁翠慨鍚堝悓鐨勭粡閿�鍟嗘槸鍏堟瀵硅薄锛岄渶瑕佸厛銆愪笂浼犺娆惧悎鍚屻�戯紝鐒跺悗瀹屾垚璁ゆ浠ュ悗鎵嶈兘涓婁紶SAP銆�', "error")
+                    // alert('褰撳墠缁翠慨鍚堝悓鐨勭粡閿�鍟嗘槸鍏堟瀵硅薄锛岄渶瑕佸厛銆愪笂浼犺娆惧悎鍚屻�戯紝鐒跺悗瀹屾垚璁ゆ浠ュ悗鎵嶈兘涓婁紶SAP銆�');
                     return;
                 } else {
-                    //鍒ゆ柇鏄惁瀹屾垚璁ゆ
                     if (!this.IsRecognitionModelTrueC) {
-                        console.log("b");
-                        alert('褰撳墠缁翠慨鍚堝悓娌℃湁瀹屾垚璁ゆ锛屼笉鑳戒笂浼燬AP銆�');
+                        this.ShowToastEvent('褰撳墠缁翠慨鍚堝悓娌℃湁瀹屾垚璁ゆ锛屼笉鑳戒笂浼燬AP銆�', "error")
+                        // alert('褰撳墠缁翠慨鍚堝悓娌℃湁瀹屾垚璁ゆ锛屼笉鑳戒笂浼燬AP銆�');
                         return;
                     }
                 }
             }
-            //update wangweipeng 2021/11/20 end
-            // sforce.connection.sessionId = this.api.sessionId;
-            // var mcid = this.Id;
-            // var result = sforce.apex.execute("MaintenanceContractSetColunmWebService", "updateColunm", {
-            //     mcid: mcid
-            // });
             updateColunm({
                 mcid: this.Id
-            }).then(result=>{
-                console.log("updateColunm" + result);
+            }).then(result => {
                 if (result != '1') {
-                    console.log("c");
-                    alert('涓婁紶SAP澶辫触,鍥犱负 鏉ュ勾鍚堝悓鐩稿叧淇℃伅淇敼澶辫触');
-                    //location.href = "/" + this.Id;
+                    this.ShowToastEvent('涓婁紶SAP澶辫触,鍥犱负 鏉ュ勾鍚堝悓鐩稿叧淇℃伅淇敼澶辫触', "error")
+                    // alert('涓婁紶SAP澶辫触,鍥犱负 鏉ュ勾鍚堝悓鐩稿叧淇℃伅淇敼澶辫触');
                 }
             });
-            
-            //棣栨鏈嶅姟鍚堝悓璧嬪��
-            // var updateResult = sforce.apex.execute("updateFirstServiceContractWebService", "updateFirstContract", {
-            //     mcid: mcid
-            // });
             updateFirstContract({
                 mcid: this.Id
-            }).then(result=>{
-                console.log("updateFirstContract:" + result);
+            }).then(result => {
                 if (result != '1') {
-                    alert(result);
+                    this.ShowToastEvent(result, "error")
+                    // alert(result);
                 }
             });
-            
-            //URF闄愭鍚堝悓2鏈� LY 20220811 start
             this.urfFlag = this.URFContractFC;
             this.rtn1 = '1';
             this.rtn = '1';
             if (this.urfFlag == 'false') {
-                // rtn1 = sforce.apex.execute("MaintenanceContractWebService", "Check_plan", {
-                //     mcidList: mcid
-                // });
                 Check_plan({
                     mcidList: this.Id
-                }).then(result=>{
-                    console.log("Check_plan:" + result);
+                }).then(result => {
                     this.rtn1 = result;
                 });
             }
-            console.log("rtn1" + this.rtn1);
-            //URF闄愭鍚堝悓2鏈� LY 20220811 end
             if (this.rtn1 == '1') {
-                // var rtn = sforce.apex.execute("MaintenanceContractWebService", "up2sap", {
-                //     mcid: mcid
-                // });
                 up2sap({
                     mcid: this.Id
-                }).then(result=>{
-                    console.log("up2sap:" + result);
+                }).then(result => {
                     this.rtn = result;
                 });
-                console.log("rtn" + this.rtn);
                 if (this.rtn == '1') {
-                    alert("涓婁紶SAP鎴愬姛");
+                    this.ShowToastEvent("涓婁紶SAP鎴愬姛", "success")
+                    // alert("涓婁紶SAP鎴愬姛");
                     window.location.replace("https://ocsm--partial.sandbox.lightning.force.com/lightning/r/Maintenance_Contract__c/" + this.recordId + "/view");
-                    //window.location.href = "/" + this.Id;
                 } else {
-                    alert(this.rtn);
+                    this.ShowToastEvent(this.rtn, "error")
+                    // alert(this.rtn);
                 }
             } else {
-                alert(this.rtn1);
+                this.ShowToastEvent(this.rtn1, "error")
+                // alert(this.rtn1);
             }
         }
     }
 
+    // 寮圭獥
+    ShowToastEvent(msg, type) {
+        const event = new ShowToastEvent({
+            title: '',
+            message: msg,
+            variant: type
+        });
+        this.dispatchEvent(event);
+    }
 }
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexVOCAnswer/lexVOCAnswer.js b/force-app/main/default/lwc/lexVOCAnswer/lexVOCAnswer.js
index 7915a17..8e9882e 100644
--- a/force-app/main/default/lwc/lexVOCAnswer/lexVOCAnswer.js
+++ b/force-app/main/default/lwc/lexVOCAnswer/lexVOCAnswer.js
@@ -11,6 +11,22 @@
   status;
   Isloading = true;
 
+  @wire(CurrentPageReference)
+  getStateParameters(currentPageReference) {
+          console.log(111);
+          console.log(currentPageReference);
+
+      if (currentPageReference) {
+        const urlValue = currentPageReference.state.recordId;
+        if (urlValue) {
+          let str = `${urlValue}`;
+          console.log("str");
+          console.log(str);
+          this.recordId = str;
+        }
+      }
+  }
+
   connectedCallback() {
     console.log(this.recordId);
     init({
diff --git a/force-app/main/default/lwc/lexVOCCheck/lexVOCCheck.js b/force-app/main/default/lwc/lexVOCCheck/lexVOCCheck.js
index 2ba7b50..6d8e5b0 100644
--- a/force-app/main/default/lwc/lexVOCCheck/lexVOCCheck.js
+++ b/force-app/main/default/lwc/lexVOCCheck/lexVOCCheck.js
@@ -16,6 +16,22 @@
     profileId;
     Isloading = true;
 
+    @wire(CurrentPageReference)
+    getStateParameters(currentPageReference) {
+            console.log(111);
+            console.log(currentPageReference);
+
+        if (currentPageReference) {
+          const urlValue = currentPageReference.state.recordId;
+          if (urlValue) {
+            let str = `${urlValue}`;
+            console.log("str");
+            console.log(str);
+            this.recordId = str;
+          }
+        }
+    }
+
 
     connectedCallback(){
         console.log(this.recordId);
@@ -63,11 +79,13 @@
                 return;
             }
             if (this.status != "璺熻繘涓�") {
+                alert("涓嶆槸璺熻繘涓笉鑳界偣鍑�");
                 this.showToast("涓嶆槸璺熻繘涓笉鑳界偣鍑�","error");
                 this.dispatchEvent(new CloseActionScreenEvent());
                 return;
             }
             if (this.isVOC == undefined) {
+                alert("蹇呴』閫夋嫨鏄惁VOC");
                 this.showToast("蹇呴』閫夋嫨鏄惁VOC","error");
                 this.dispatchEvent(new CloseActionScreenEvent());
                 return;
diff --git a/force-app/main/default/lwc/lexVOCFinish/lexVOCFinish.js b/force-app/main/default/lwc/lexVOCFinish/lexVOCFinish.js
index 97c426c..032beec 100644
--- a/force-app/main/default/lwc/lexVOCFinish/lexVOCFinish.js
+++ b/force-app/main/default/lwc/lexVOCFinish/lexVOCFinish.js
@@ -12,6 +12,22 @@
     IsLoading = true;
     profileId;
 
+    @wire(CurrentPageReference)
+    getStateParameters(currentPageReference) {
+            console.log(111);
+            console.log(currentPageReference);
+
+        if (currentPageReference) {
+          const urlValue = currentPageReference.state.recordId;
+          if (urlValue) {
+            let str = `${urlValue}`;
+            console.log("str");
+            console.log(str);
+            this.recordId = str;
+          }
+        }
+    }
+
     connectedCallback(){
         console.log(this.recordId);
         init({
diff --git a/force-app/main/default/lwc/lexVOCSubmit/lexVOCSubmit.js b/force-app/main/default/lwc/lexVOCSubmit/lexVOCSubmit.js
index e95386d..491c418 100644
--- a/force-app/main/default/lwc/lexVOCSubmit/lexVOCSubmit.js
+++ b/force-app/main/default/lwc/lexVOCSubmit/lexVOCSubmit.js
@@ -11,6 +11,22 @@
     createdById;
     status;
     IsLoading = true;
+
+    @wire(CurrentPageReference)
+    getStateParameters(currentPageReference) {
+            console.log(111);
+            console.log(currentPageReference);
+
+        if (currentPageReference) {
+          const urlValue = currentPageReference.state.recordId;
+          if (urlValue) {
+            let str = `${urlValue}`;
+            console.log("str");
+            console.log(str);
+            this.recordId = str;
+          }
+        }
+    }
     
     connectedCallback () {
         console.log(this.recordId);
diff --git a/force-app/main/default/lwc/oshRecieved/oshRecieved.js b/force-app/main/default/lwc/oshRecieved/oshRecieved.js
index e32ff18..12ad641 100644
--- a/force-app/main/default/lwc/oshRecieved/oshRecieved.js
+++ b/force-app/main/default/lwc/oshRecieved/oshRecieved.js
@@ -33,7 +33,7 @@
         }).then(result => {
             this.IsLoading = false;
             this.qisReportId = result.Id;
-            this.qisStatus = result.QIStatus;
+            this.qisStatus = result.qIStatus;
             console.log('this.qisStatus='+this.qisStatus);
          	if (this.qisStatus!='OSH妫�娴嬬敵璇�' && this.qisStatus!='瀹屾瘯') {
                 const evt = new ShowToastEvent({

--
Gitblit v1.9.1