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'; } 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; } //发送QIS到SPO @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; } } 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> </ApexClass> 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(); 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; } } 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 => { 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({ 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); force-app/main/default/lwc/lexCopyPIInspectionReport/lexCopyPIInspectionReport.js
@@ -50,6 +50,7 @@ }); } // 复制 CopyPI() { window.location.href = '/' + this.Id + '/e?newclone=1'; } 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(){ force-app/main/default/lwc/lexCreateReportMaintenanceContract/lexCreateReportMaintenanceContract.js
@@ -52,6 +52,7 @@ }); } // 制作报告书 CreateReport() { var MaintenanceContractId = this.Id; var RecordTypeName = this.RecordTypeDeveloperNameC; 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; force-app/main/default/lwc/lexInsPageBtn/lexInsPageBtn.js
@@ -49,6 +49,7 @@ }); } // 报告书明细编辑 insPageBtn() { var url; if (this.RecordTypeId == '01210000000aLii') { 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); 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; } } } 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); 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; } } 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); 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> 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 //判断是否需要先上传认款合同吗,如果需要那么判断他是否已经上传,如果上传,那么判断他是否完成认款,如果都满足,那么才能正常走接口上传SAP //判断是认款合同吗 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); } } 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 : '已经提交审批', 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; }); } 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 }}); } force-app/main/default/lwc/lexSubmitForApproval/lexSubmitForApproval.js
@@ -49,6 +49,7 @@ }); } // 关闭询价/关闭续签 SubmitForApproval() { var url = ''; selectRecords({ 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> 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('维修合同管理编码为空,不能上传SAP。'); this.ShowToastEvent('维修合同管理编码为空,不能上传SAP。', "error") // alert('维修合同管理编码为空,不能上传SAP。'); } else if (this.uploadToSapTimeC != undefined) { alert('已经上传SAP,不能重复上传。'); this.ShowToastEvent('已经上传SAP,不能重复上传。', "error") // alert('已经上传SAP,不能重复上传。'); } else { //update wangweipeng 2021/11/20 start //判断是否需要先上传认款合同吗,如果需要那么判断他是否已经上传,如果上传,那么判断他是否完成认款,如果都满足,那么才能正常走接口上传SAP //判断是认款合同吗 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('当前维修合同没有完成认款,不能上传SAP。'); this.ShowToastEvent('当前维修合同没有完成认款,不能上传SAP。', "error") // alert('当前维修合同没有完成认款,不能上传SAP。'); 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); } } 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({ 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; 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({ 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); 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({