| | |
| | | public static InitData init(String recordId){ |
| | | InitData res = new initData(); |
| | | try{ |
| | | Asset report = [SELECT Id,NoPartRiskDate_F__c,Product_ID__c,AccountId,HP_Id__c,Hospital__c,Hospital__r.Id,Department_Class__c,Department_Class__r.Id,Name FROM Asset WHERE Id =: recordId LIMIT 1]; |
| | | Asset report = [SELECT Order_No__c,SerialNumber,Asset_day__c,Posting_Date__c,InstallDate,Asset_Owner__c,AssetMark__c,Id,NoPartRiskDate_F__c,Product_ID__c,AccountId,HP_Id__c,Hospital__c,Hospital__r.Id,Department_Class__c,Department_Class__r.Id,Name FROM Asset WHERE Id =: recordId LIMIT 1]; |
| | | System.debug(LoggingLevel.INFO, '*** opp: ' + report); |
| | | |
| | | res.AssetMarkC = report.AssetMark__c; |
| | | res.AssetOwnerC = report.Asset_Owner__c; |
| | | res.InstallDate = report.InstallDate; |
| | | res.PostingDateC = report.Posting_Date__c; |
| | | res.AssetDayC = report.Asset_day__c; |
| | | res.SerialNumber = report.SerialNumber; |
| | | res.OrderNoC = report.Order_No__c; |
| | | |
| | | |
| | | res.Id = report.Id; |
| | | res.Name = report.Name; |
| | | res.NoPartRiskDateFC = report.NoPartRiskDate_F__c; |
| | |
| | | } |
| | | } |
| | | |
| | | @AuraEnabled |
| | | public static List<QIS_Report__c> selecctQISReportrByFomatToday(String AssetId, Date fomatToday){ |
| | | try { |
| | | List<QIS_Report__c> accounts = [SELECT id,QIS_Submit_day__c from QIS_Report__c where nonyushohin__c=:AssetId and QIS_Submit_day__c != null and QIS_Submit_day__c >=: fomatToday]; |
| | | return accounts; |
| | | } catch (Exception e) { |
| | | throw new AuraHandledException(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | //查询Repair__c |
| | | @AuraEnabled |
| | | public static List<Account> selecctAccountByAccountId(String AccountId){ |
| | |
| | | } |
| | | } |
| | | |
| | | @AuraEnabled |
| | | public static String selectCASE(String AssetOwnerC){ |
| | | String res=''; |
| | | if(AssetOwnerC.equals('病院資産')){ |
| | | res='病院資産'; |
| | | }else if(AssetOwnerC.equals('购买')){ |
| | | res='购买'; |
| | | } |
| | | else if(AssetOwnerC.equals('Olympus')){ |
| | | res='Olympus'; |
| | | } |
| | | else if(AssetOwnerC.equals('备品')){ |
| | | res='备品'; |
| | | } |
| | | else if(AssetOwnerC.equals('リース会社')){ |
| | | res='リース会社'; |
| | | } |
| | | else if(AssetOwnerC.equals('其他')){ |
| | | res='其他'; |
| | | } |
| | | else if(AssetOwnerC.equals('经销商资产')){ |
| | | res='经销商资产'; |
| | | }else{ |
| | | res=''; |
| | | } |
| | | return res; |
| | | } |
| | | |
| | | @AuraEnabled |
| | | public static String selectNullvalue(String InstallDate,String PostingDateC,String AssetDayC){ |
| | | String res=''; |
| | | if(InstallDate!=null){ |
| | | res=InstallDate; |
| | | }else { |
| | | if(PostingDateC!=null){ |
| | | res=PostingDateC; |
| | | }else { |
| | | res=AssetDayC; |
| | | } |
| | | } |
| | | return res; |
| | | } |
| | | |
| | | public class InitData{ |
| | | @AuraEnabled |
| | | public String AssetMarkC; |
| | | @AuraEnabled |
| | | public String AssetOwnerC; |
| | | @AuraEnabled |
| | | public Date InstallDate; |
| | | @AuraEnabled |
| | | public Date PostingDateC; |
| | | @AuraEnabled |
| | | public Date AssetDayC; |
| | | @AuraEnabled |
| | | public String SerialNumber; |
| | | @AuraEnabled |
| | | public String OrderNoC; |
| | | |
| | | @AuraEnabled |
| | | public String Id; |
| | | @AuraEnabled |
| | | public String userID; |
| | |
| | | List<User> user = new List<User>(); |
| | | user = [SELECT Id,Alias,Alias__c from User]; |
| | | |
| | | System.debug('The value of user is: ' + user); |
| | | |
| | | QIS_Report__c rac = new QIS_Report__c(); |
| | | rac.Id = QId; |
| | | rac.QIS_Status__c = 'RC检测中'; |
| | |
| | | public static InitData init(String recordId){ |
| | | InitData res = new initData(); |
| | | try{ |
| | | Repair__c report = [SELECT AWS_Data_Id__c,SAP_condition__c,DOJ_Status__c,DW_Sign__c,Incharge_Staff__r.Id,URF_Reapir__c,Recall_Correspondence__c,Day_later_30__c,Dealer__r.Id,Status__c,URFLimitSerial__c,Maintenance_Contract__r.Id,FSE_ApplyForRepair_time__c,Delivered_Product__r.Id,Asset_Owner__c,State_Hospital__c,is_aohui_product__c,Sales_Dept_HP__c,RCCD__c,Quick_Repair_Sign__c,RepairSource__c,FSE_State__c,VM_Maintenance_Contract__c,Maintenance_Contract__c,NewProductGuarante_Txt__c,Number_of_EffectiveContract__c,Detailed_Address__c,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__c report = [SELECT HP_active__c,AWS_Data_Id__c,SAP_condition__c,DOJ_Status__c,DW_Sign__c,Incharge_Staff__r.Id,URF_Reapir__c,Recall_Correspondence__c,Day_later_30__c,Dealer__r.Id,Status__c,URFLimitSerial__c,Maintenance_Contract__r.Id,FSE_ApplyForRepair_time__c,Delivered_Product__r.Id,Asset_Owner__c,State_Hospital__c,is_aohui_product__c,Sales_Dept_HP__c,RCCD__c,Quick_Repair_Sign__c,RepairSource__c,FSE_State__c,VM_Maintenance_Contract__c,Maintenance_Contract__c,NewProductGuarante_Txt__c,Number_of_EffectiveContract__c,Detailed_Address__c,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.HPActiveC = report.HP_active__c; |
| | | res.detailedAddress = report.Detailed_Address__c; |
| | | res.numberofEffectiveContract = report.Number_of_EffectiveContract__c; |
| | | res.newProductGuaranteTxt = report.NewProductGuarante_Txt__c; |
| | |
| | | |
| | | public class InitData{ |
| | | @AuraEnabled |
| | | public String HPActiveC; |
| | | @AuraEnabled |
| | | public String detailedAddress; |
| | | @AuraEnabled |
| | | public String numberofEffectiveContract; |
| | |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }).finally(() => { |
| | | |
| | | }); |
| | | }) |
| | | } |
| | | |
| | | //直返收货地址 |
| | |
| | | var status = this.StatusC; |
| | | if (status != '待处理') { |
| | | this.ShowToastEvent("报修子单的状态不是 待处理 无法申请修理", "error") |
| | | // alert('报修子单的状态不是 待处理 无法申请修理'); |
| | | return; |
| | | } |
| | | var url = '/apex/ChoiceAsset?Id=' + this.Id + '&Type=Repair'; |
| | |
| | | } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/otherButtonRepairController.init'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | import { |
| | | NavigationMixin |
| | | } from 'lightning/navigation'; |
| | | import { |
| | | encodeDefaultFieldValues |
| | | } from 'lightning/pageReferenceUtils'; |
| | | |
| | | export default class LexCopyRepair extends LightningElement { |
| | | export default class LexCopyRepair extends NavigationMixin(LightningElement) { |
| | | @api recordId; |
| | | str; |
| | | IsLoading = true; |
| | |
| | | this.Status1C = result.Status1C; |
| | | |
| | | this.CopyRepair(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | |
| | | CopyRepair() { |
| | | var Status = this.Status1C; |
| | | if (Status == '0.删除' || Status == '0.取消') { |
| | | var url = "/a0J/e?00N10000009H2fa=" + this.Name + "&CF00N10000002Dx1X=" + this.DeliveredProductC + |
| | | "&CF00N10000002Dx1X_lkid=" + this.DeliveredProductC + "&00N10000006P1dw=" + this.PaperRepairRequestNoC + |
| | | "&CF00N10000002Dx66=" + this.HospitalC + "&CF00N10000002Dx5t=" + this.DepartmentClassC + |
| | | "&CF00N10000002Dx5n=" + this.AccountC + "&00N10000008rG4p=" + this.RepairCostTypeC + |
| | | "&CF00N10000006P1eV=" + this.DealerC + "&CF00N10000002EMHw=" + this.InchargeStaffC + |
| | | "&CF00N10000005HDvq=" + this.InchargeStaffContactC + "&00N10000006P6SM=" + this.SalesOfficeCodeSelectionC + |
| | | "&00N10000002F6dW=" + this.OnSiteRepairC + "&00N10000006P6Rn=" + this.workLocationSelectC + |
| | | "&00N10000009i1Z2=" + this.ReturnsProductWayC + "&00N10000002Dx6I=" + this.RepairDetailC + |
| | | "&00N10000009H1rQ=" + this.RepairApplicantC + "&00N10000009H1rP=" + this.RepairApplicantHospitalC + |
| | | "&00N10000009H1rO=" + this.RepairApplicantDepartmentC + "&00N10000009H1rB=" + this.DeliveryLogisticsModeC + |
| | | "&00N10000009H1rk=" + this.engineerSendDateC + "&00N10000009H1rC=" + this.DeliveryLogisticsNoC + |
| | | "&00N10000009H1rA=" + this.DeliveryLogisticsAnnotationC + "&00N10000008rsVQ=" + this.DateReceiptQuestionsC + |
| | | "&00N10000008rsVN=" + this.BreakORFallOffC + "&00N10000008rsVS=" + this.DelayReportReasonC + |
| | | "&00N10000008rsW5=" + this.UseFailProductFinishC + "&00N10000008rsW7=" + this.ifDeadHurtC + |
| | | "&00N10000008rsW4=" + this.SupportingProductsC + "&00N10000008rsVv=" + this.ProblemOccurredC + |
| | | "&00N10000008rsVL=" + this.AfterFailureInformationC + "&00N10000009hsvI=" + this.ProblemOccurredSelectC + |
| | | "&00N10000008rsVR=" + this.Delay15MinC + "&00N10000008rsVw=" + this.ProductFailureRelatedC + |
| | | "&00N10000008rsVZ=" + this.InformationFromC + "&00N10000008rsW2=" + this.ReportAdverseEventsC + |
| | | "&00N10000008rsVT=" + this.FailureQInHospitalC + "&00N10000008rsW6=" + this.WhatProjectC + |
| | | "&00N10000008rsVk=" + this.OperationOrExaminationNameC + "&00N10000008rWce=" + this.MaintenanceContractTypeC + |
| | | "&00N10000002Dx5y=" + this.FailureOccurrenceDateC + "&00N10000002FH86=" + this.RepairSourceC + |
| | | "&CF00N10000009H1rR=" + this.RepairSubOrderC + "&CF00N10000002FIJU=" + this.OnCallIDC + |
| | | "&CF00N10000002FIJZ=" + this.QISIDC + "&CF00N10000006PRCp=" + this.InsReportC + |
| | | "&00N10000008rsVM=" + this.AwareDateC + "&00N10000009GmI6=" + this.OCSMAdministrativeReportNumberC + |
| | | "&00N10000009GmI4=" + this.MBCAwareDateC + "&00N10000009GmI5=" + this.OCSMAdministrativeReportDateC + |
| | | "&00N10000009GmI7=" + this.OCSMAdministrativeReportStatusC + "&00N100000095siE=" + this.CFDANoHandC + |
| | | "&00N100000095shz=" + this.ProduceCompanyHandC + "&00N100000098PV9=" + this.OfferRentalNewC + |
| | | "&00N100000098PVA=" + this.ifRentalApplyC + "&00N10000006gZ4g=" + this.LatestCollectDatePriorityC + |
| | | "&00N10000007MNFW=" + this.RentalApplyEquipmentSetDetailIdC + |
| | | "&CF00N10000007MNFX=" + this.RentalApplyEquipmentSetDetailC + "&retURL=%2F" + this.Id; |
| | | window.open(url); |
| | | const url = encodeDefaultFieldValues({ |
| | | Old_Name__c: this.Name, |
| | | Delivered_Product__c: this.DeliveredProductC, |
| | | PaperRepairRequestNo__c: this.PaperRepairRequestNoC, |
| | | Hospital__c: this.HospitalC, |
| | | Department_Class__c: this.DepartmentClassC, |
| | | Account__c: this.AccountC, |
| | | RepairCostType__c: this.RepairCostTypeC, |
| | | Dealer__c: this.DealerC, |
| | | Incharge_Staff__c: this.InchargeStaffC, |
| | | Incharge_Staff_Contact__c: this.InchargeStaffContactC, |
| | | SalesOfficeCode_selection__c: this.SalesOfficeCodeSelectionC, |
| | | On_site_repair__c: this.OnSiteRepairC, |
| | | work_location_select__c : this.workLocationSelectC, |
| | | Returns_Product_way__c : this.ReturnsProductWayC, |
| | | Repair_Detail__c : this.RepairDetailC, |
| | | RepairApplicant__c : this.RepairApplicantC, |
| | | RepairApplicantHospital__c : this.RepairApplicantHospitalC, |
| | | RepairApplicantDepartment__c : this.RepairApplicantDepartmentC, |
| | | DeliveryLogisticsMode__c : this.DeliveryLogisticsModeC, |
| | | engineerSendDate__c : this.engineerSendDateC, |
| | | DeliveryLogisticsNo__c : this.DeliveryLogisticsNoC, |
| | | DeliveryLogisticsAnnotation__c : this.DeliveryLogisticsAnnotationC, |
| | | DateReceiptQuestions__c : this.DateReceiptQuestionsC, |
| | | BreakORFallOff__c : this.BreakORFallOffC, |
| | | DelayReportReason__c : this.DelayReportReasonC, |
| | | UseFailProductFinish__c : this.UseFailProductFinishC, |
| | | ifDeadHurt__c : this.ifDeadHurtC, |
| | | SupportingProducts__c : this.SupportingProductsC, |
| | | ProblemOccurred__c : this.ProblemOccurredC, |
| | | AfterFailureInformation__c : this.AfterFailureInformationC, |
| | | ProblemOccurredSelect__c : this.ProblemOccurredSelectC, |
| | | Delay15Min__c: this.Delay15MinC, |
| | | ProductFailureRelated__c : this.ProductFailureRelatedC, |
| | | InformationFrom__c : this.InformationFromC, |
| | | ReportAdverseEvents__c : this.ReportAdverseEventsC, |
| | | FailureQInHospital__c : this.FailureQInHospitalC, |
| | | WhatProject__c : this.WhatProjectC, |
| | | OperationOrExaminationName__c : this.OperationOrExaminationNameC, |
| | | MaintenanceContractType__c : this.MaintenanceContractTypeC, |
| | | Failure_Occurrence_Date__c : this.FailureOccurrenceDateC, |
| | | Repair_Source__c : this.RepairSourceC, |
| | | RepairSubOrder__c : this.RepairSubOrderC, |
| | | On_Call_ID__c : this.OnCallIDC, |
| | | QIS_ID__c : this.QISIDC, |
| | | InsReport__c : this.InsReportC, |
| | | Aware_date__c : this.AwareDateC, |
| | | OCSMAdministrativeReportNumber__c : this.OCSMAdministrativeReportNumberC, |
| | | MBC_AwareDate__c : this.MBCAwareDateC, |
| | | OCSMAdministrativeReportDate__c : this.OCSMAdministrativeReportDateC, |
| | | OCSMAdministrativeReportStatus__c : this.OCSMAdministrativeReportStatusC, |
| | | CFDA_No_Hand__c : this.CFDANoHandC, |
| | | ProduceCompany_hand__c : this.ProduceCompanyHandC, |
| | | Offer_Rental_New__c : this.OfferRentalNewC, |
| | | if_Rental_Apply__c : this.ifRentalApplyC, |
| | | Latest_Collect_Date_Priority__c : this.LatestCollectDatePriorityC, |
| | | Rental_Apply_Equipment_Set_Detail_Id__c : this.RentalApplyEquipmentSetDetailIdC, |
| | | Rental_Apply_Equipment_Set_Detail__c : this.RentalApplyEquipmentSetDetailC, |
| | | }); |
| | | this[NavigationMixin.Navigate]({ |
| | | type: 'standard__objectPage', |
| | | attributes: { |
| | | objectApiName: 'Repair__c', |
| | | actionName: 'new' |
| | | }, |
| | | state: { |
| | | nooverride: '1', |
| | | defaultFieldValues: url |
| | | } |
| | | }); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | |
| | | // var url = "/a0J/e?00N10000009H2fa=" + this.Name + "&CF00N10000002Dx1X=" + this.DeliveredProductC + |
| | | // "&CF00N10000002Dx1X_lkid=" + this.DeliveredProductC + "&00N10000006P1dw=" + this.PaperRepairRequestNoC + |
| | | // "&CF00N10000002Dx66=" + this.HospitalC + "&CF00N10000002Dx5t=" + this.DepartmentClassC + |
| | | // "&CF00N10000002Dx5n=" + this.AccountC + "&00N10000008rG4p=" + this.RepairCostTypeC + |
| | | // "&CF00N10000006P1eV=" + this.DealerC + "&CF00N10000002EMHw=" + this.InchargeStaffC + |
| | | // "&CF00N10000005HDvq=" + this.InchargeStaffContactC + "&00N10000006P6SM=" + this.SalesOfficeCodeSelectionC + |
| | | // "&00N10000002F6dW=" + this.OnSiteRepairC + "&00N10000006P6Rn=" + this.workLocationSelectC + |
| | | // "&00N10000009i1Z2=" + this.ReturnsProductWayC + "&00N10000002Dx6I=" + this.RepairDetailC + |
| | | // "&00N10000009H1rQ=" + this.RepairApplicantC + "&00N10000009H1rP=" + this.RepairApplicantHospitalC + |
| | | // "&00N10000009H1rO=" + this.RepairApplicantDepartmentC + "&00N10000009H1rB=" + this.DeliveryLogisticsModeC + |
| | | // "&00N10000009H1rk=" + this.engineerSendDateC + "&00N10000009H1rC=" + this.DeliveryLogisticsNoC + |
| | | // "&00N10000009H1rA=" + this.DeliveryLogisticsAnnotationC + "&00N10000008rsVQ=" + this.DateReceiptQuestionsC + |
| | | // "&00N10000008rsVN=" + this.BreakORFallOffC + "&00N10000008rsVS=" + this.DelayReportReasonC + |
| | | // "&00N10000008rsW5=" + this.UseFailProductFinishC + "&00N10000008rsW7=" + this.ifDeadHurtC + |
| | | // "&00N10000008rsW4=" + this.SupportingProductsC + "&00N10000008rsVv=" + this.ProblemOccurredC + |
| | | // "&00N10000008rsVL=" + this.AfterFailureInformationC + "&00N10000009hsvI=" + this.ProblemOccurredSelectC + |
| | | // "&00N10000008rsVR=" + this.Delay15MinC + "&00N10000008rsVw=" + this.ProductFailureRelatedC + |
| | | // "&00N10000008rsVZ=" + this.InformationFromC + "&00N10000008rsW2=" + this.ReportAdverseEventsC + |
| | | // "&00N10000008rsVT=" + this.FailureQInHospitalC + "&00N10000008rsW6=" + this.WhatProjectC + |
| | | // "&00N10000008rsVk=" + this.OperationOrExaminationNameC + "&00N10000008rWce=" + this.MaintenanceContractTypeC + |
| | | // "&00N10000002Dx5y=" + this.FailureOccurrenceDateC + "&00N10000002FH86=" + this.RepairSourceC + |
| | | // "&CF00N10000009H1rR=" + this.RepairSubOrderC + "&CF00N10000002FIJU=" + this.OnCallIDC + |
| | | // "&CF00N10000002FIJZ=" + this.QISIDC + "&CF00N10000006PRCp=" + this.InsReportC + |
| | | // "&00N10000008rsVM=" + this.AwareDateC + "&00N10000009GmI6=" + this.OCSMAdministrativeReportNumberC + |
| | | // "&00N10000009GmI4=" + this.MBCAwareDateC + "&00N10000009GmI5=" + this.OCSMAdministrativeReportDateC + |
| | | // "&00N10000009GmI7=" + this.OCSMAdministrativeReportStatusC + "&00N100000095siE=" + this.CFDANoHandC + |
| | | // "&00N100000095shz=" + this.ProduceCompanyHandC + "&00N100000098PV9=" + this.OfferRentalNewC + |
| | | // "&00N100000098PVA=" + this.ifRentalApplyC + "&00N10000006gZ4g=" + this.LatestCollectDatePriorityC + |
| | | // "&00N10000007MNFW=" + this.RentalApplyEquipmentSetDetailIdC + |
| | | // "&CF00N10000007MNFX=" + this.RentalApplyEquipmentSetDetailC + "&retURL=%2F" + this.Id; |
| | | // window.open(url); |
| | | } else { |
| | | this.ShowToastEvent("该状态下不能复制", "error") |
| | | // alert("该状态下不能复制"); |
| | | this.ShowToastEvent("该状态下不能复制", "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | } |
| | | |
| New file |
| | |
| | | |
| | | .toast{ |
| | | border: 1px solid #c9c9c9; |
| | | border-radius: 10px; |
| | | width: 50%; |
| | | margin: 0 auto; |
| | | font-size: 18px; |
| | | font-weight: bold; |
| | | padding: 10px 20px; |
| | | background: #EA001E; |
| | | display: flex; |
| | | color: white; |
| | | } |
| | |
| | | <div class="exampleHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | </div> |
| | | </template> |
| | | <div if:false={IsLoading} class="toast"> |
| | | <span style="padding: 10px;">{msg}</span> |
| | | <button class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse" onclick={closeAction} title="Close" style="background-color: #e5e4e2;margin-top: 15px;"> |
| | | <lightning-icon class="greyIcon" icon-name="utility:close" alternative-text="Connected" variant="inverse" size="small" |
| | | title="Close" style="color: black;"></lightning-icon> |
| | | <span class="slds-assistive-text">Close</span> |
| | | </button> |
| | | </div> |
| | | </template> |
| | |
| | | IsLoading = true; |
| | | Id; |
| | | Status; |
| | | msg; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.Id = result.Id; |
| | | this.Status = result.Status; |
| | | |
| | |
| | | if (status == '公开中') { |
| | | window.open("/apex/AssessmentReport?camid=" + this.Id, "_top"); |
| | | } else { |
| | | alert("只有批准后才能创建报告!"); |
| | | this.msg = '只有批准后才能创建报告!'; |
| | | this.IsLoading = false; |
| | | } |
| | | } |
| | | |
| | | closeAction() { |
| | | window.history.go(-1); |
| | | } |
| | | } |
| New file |
| | |
| | | .toast{ |
| | | border: 1px solid #c9c9c9; |
| | | border-radius: 10px; |
| | | width: 50%; |
| | | margin: 0 auto; |
| | | font-size: 18px; |
| | | font-weight: bold; |
| | | padding: 10px 20px; |
| | | background: #EA001E; |
| | | display: flex; |
| | | color: white; |
| | | } |
| | |
| | | <div class="exampleHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | </div> |
| | | </template> |
| | | <div if:false={IsLoading} class="toast"> |
| | | <span style="padding: 10px;">{msg}</span> |
| | | <button class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse" onclick={closeAction} title="Close" style="background-color: #e5e4e2;margin-top: 15px;"> |
| | | <lightning-icon class="greyIcon" icon-name="utility:close" alternative-text="Connected" variant="inverse" size="small" |
| | | title="Close" style="color: black;"></lightning-icon> |
| | | <span class="slds-assistive-text">Close</span> |
| | | </button> |
| | | </div> |
| | | </template> |
| | |
| | | IsLoading = true; |
| | | Id; |
| | | Status; |
| | | msg; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.Id = result.Id; |
| | | this.Status = result.Status; |
| | | |
| | |
| | | if (status == '公开中') { |
| | | window.open("/apex/InstructReport?camid=" + this.Id, "_top"); |
| | | } else { |
| | | alert("只有批准后才能创建报告!") |
| | | this.msg = '只有批准后才能创建报告!'; |
| | | this.IsLoading = false; |
| | | } |
| | | } |
| | | |
| | | closeAction() { |
| | | window.history.go(-1); |
| | | } |
| | | } |
| | |
| | | CloseActionScreenEvent |
| | | } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/buttonAccountCtl.init'; |
| | | import { |
| | | NavigationMixin |
| | | } from 'lightning/navigation'; |
| | | import { |
| | | encodeDefaultFieldValues |
| | | } from 'lightning/pageReferenceUtils'; |
| | | |
| | | export default class LexCreateNewServiceContract extends LightningElement { |
| | | export default class LexCreateNewServiceContract extends NavigationMixin(LightningElement) { |
| | | @api recordId; |
| | | str; |
| | | IsLoading = true; |
| | |
| | | |
| | | // 新建新服务合同 |
| | | CreateNewServiceContract() { |
| | | var Hospital = this.HospitalC; |
| | | var Hospitalid = this.HospitalIdC; |
| | | var Department = this.DepartmentClassC; |
| | | var Departmentid = this.DepartmentClassIdC; |
| | | var accountname = this.Name; |
| | | var accountid = this.Id; |
| | | const url = encodeDefaultFieldValues({ |
| | | Hospital__c: this.HospitalC, |
| | | Department_Class__c: this.DepartmentClassC, |
| | | Department__c: this.Id |
| | | }); |
| | | this[NavigationMixin.Navigate]({ |
| | | type: 'standard__objectPage', |
| | | attributes: { |
| | | objectApiName: 'Maintenance_Contract__c', |
| | | actionName: 'new' |
| | | }, |
| | | state: { |
| | | nooverride: '1', |
| | | defaultFieldValues: url |
| | | } |
| | | }); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | |
| | | // var url = 'a0H/e?CF00N10000002Dx56=' + Hospital + '&CF00N10000002Dx56_lkid=' + |
| | | // Hospitalid + '&CF00N10000002Dx4p=' + Department + '&CF00N10000002Dx4p_lkid=' + |
| | | // Departmentid + '&CF00N10000002Dx4q=' + accountname + '&CF00N10000002Dx4q_lkid=' + |
| | | // accountid + '&RecordType=01210000000gTYq'; |
| | | |
| | | var url = 'a0H/e?CF00N10000002Dx56=' + Hospital + '&CF00N10000002Dx56_lkid=' + |
| | | Hospitalid + '&CF00N10000002Dx4p=' + Department + '&CF00N10000002Dx4p_lkid=' + |
| | | Departmentid + '&CF00N10000002Dx4q=' + accountname + '&CF00N10000002Dx4q_lkid=' + |
| | | accountid + '&RecordType=01210000000gTYq'; |
| | | // console.log(url); |
| | | |
| | | console.log(url); |
| | | |
| | | window.top.location.href = url; |
| | | // window.top.location.href = url; |
| | | } |
| | | } |
| | |
| | | <target>lightning__RecordAction</target> |
| | | <target>lightning__FlowScreen</target> |
| | | </targets> |
| | | <!-- 定义变量 --> |
| | | <targetConfigs> |
| | | <targetConfig targets="lightning__FlowScreen"> |
| | | <property name="recordId" type="String" label="recordId"/> |
| | | </targetConfig> |
| | | </targetConfigs> |
| | | </LightningComponentBundle> |
| | |
| | | .createEmailHolder{ |
| | | position: relative; |
| | | display: inline-block; |
| | | width: 80px; |
| | | height: 80px; |
| | | text-align: center; |
| | | } |
| | | .container .uiContainerManager{ |
| | | display: none !important; |
| | | .toast{ |
| | | border: 1px solid #c9c9c9; |
| | | border-radius: 10px; |
| | | width: 50%; |
| | | margin: 0 auto; |
| | | font-size: 18px; |
| | | font-weight: bold; |
| | | padding: 10px 20px; |
| | | background: #EA001E; |
| | | display: flex; |
| | | color: white; |
| | | } |
| | |
| | | <template> |
| | | <div class="createEmailHolder" if:true={IsLoading}> |
| | | <div class="exampleHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | <lightning-button onclick={handleConfirmClick} label="Open Confirm Modal"></lightning-button> |
| | | <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button> </div> |
| | | </div> |
| | | <div if:false={IsLoading} class="toast"> |
| | | <span style="padding: 10px;">{msg}</span> |
| | | <button class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse" onclick={closeAction} title="Close" style="background-color: #e5e4e2;margin-top: 15px;"> |
| | | <lightning-icon class="greyIcon" icon-name="utility:close" alternative-text="Connected" variant="inverse" size="small" |
| | | title="Close" style="color: black;"></lightning-icon> |
| | | <span class="slds-assistive-text">Close</span> |
| | | </button> |
| | | </div> |
| | | </template> |
| | |
| | | import { LightningElement,wire,track,api} from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import { NavigationMixin } from 'lightning/navigation'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | import init from '@salesforce/apex/QISReportController.initForlexCreateQISFromAssetButton'; |
| | | import UserInfo_Owner from '@salesforce/apex/TaskFeedbackController.UserInfo_Owner'; |
| | | import { updateRecord } from 'lightning/uiRecordApi'; |
| | | import { |
| | | LightningElement, |
| | | wire, |
| | | api |
| | | } from 'lwc'; |
| | | import { |
| | | CurrentPageReference |
| | | } from "lightning/navigation"; |
| | | import { |
| | | CloseActionScreenEvent |
| | | } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/buttonAssetCtl.init'; |
| | | import selecctRepairByFomatToday from '@salesforce/apex/buttonAssetCtl.selecctRepairByFomatToday'; |
| | | import selecctQISReportrByFomatToday from '@salesforce/apex/buttonAssetCtl.selecctQISReportrByFomatToday'; |
| | | import selectCASE from '@salesforce/apex/buttonAssetCtl.selectCASE'; |
| | | import selectNullvalue from '@salesforce/apex/buttonAssetCtl.selectNullvalue'; |
| | | import LightningConfirm from 'lightning/confirm'; |
| | | import { |
| | | NavigationMixin |
| | | } from 'lightning/navigation'; |
| | | import { |
| | | encodeDefaultFieldValues |
| | | } from 'lightning/pageReferenceUtils'; |
| | | import { |
| | | ShowToastEvent |
| | | } from 'lightning/platformShowToastEvent'; |
| | | |
| | | export default class lexCreateQISFromAsset extends LightningElement { |
| | | export default class lexCreateQISFromAsset extends NavigationMixin(LightningElement) { |
| | | @api recordId; |
| | | str; |
| | | IsLoading = true; |
| | | Old_Repair_Name; |
| | | Id; |
| | | day1; |
| | | AssetMarkC; |
| | | AssetOwnerC; |
| | | InstallDate; |
| | | PostingDateC; |
| | | AssetDayC; |
| | | SerialNumber; |
| | | OrderNoC; |
| | | ProductIDC; |
| | | HospitalId; |
| | | HospitalC; |
| | | DepartmentClassId; |
| | | DepartmentClassC; |
| | | Name; |
| | | AccountId; |
| | | msg; |
| | | Old_Repair_Name = ''; |
| | | Instration_date_consumable = null; |
| | | Customer_asset_or_loaner = ''; |
| | | fomatToday; |
| | | |
| | | @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({recordId:this.recordId}).then(result=>{ |
| | | console.log(result); |
| | | if(result!=null){ |
| | | if (result.id!=null) { |
| | | var boolday=confirm('请确认此件是否属于10天内重复报告,如果是,请使用原QIS里的复制功能重新提交。'); |
| | | if(!boolday){ |
| | | return; |
| | | } |
| | | } |
| | | if (result.repId!=null) { |
| | | var boolday=confirm('请确认此件是否属于10天内重复报告,如果是,需按照原先的维修信息填写。'); |
| | | if(!boolday){ |
| | | return; |
| | | } |
| | | } |
| | | |
| | | getStateParameters(currentPageReference) { |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | this.recordId = str; |
| | | } |
| | | }).catch(err=>{ |
| | | console.log("error:"); |
| | | console.log(err); |
| | | }).finally(()=>{ |
| | | |
| | | }); |
| | | } |
| | | } |
| | | |
| | | connectedCallback() { |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result != null) { |
| | | this.Id = result.Id; |
| | | this.day1 = result.day1; |
| | | this.AssetMarkC = result.AssetMarkC; |
| | | this.AssetOwnerC = result.AssetOwnerC; |
| | | this.InstallDate = result.InstallDate; |
| | | this.PostingDateC = result.PostingDateC; |
| | | this.AssetDayC = result.AssetDayC; |
| | | this.SerialNumber = result.SerialNumber; |
| | | this.OrderNoC = result.OrderNoC; |
| | | this.ProductIDC = result.ProductIDC; |
| | | this.HospitalId = result.HospitalId; |
| | | this.HospitalC = result.HospitalC; |
| | | this.DepartmentClassId = result.DepartmentClassId; |
| | | this.DepartmentClassC = result.DepartmentClassC; |
| | | this.Name = result.Name; |
| | | this.AccountId = result.AccountId; |
| | | |
| | | |
| | | this.CreateQISFromAsset(); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }) |
| | | } |
| | | |
| | | // 新建授课/考核报告 |
| | | CreateQISFromAsset() { |
| | | this.fomatToday = this.day1; |
| | | selecctQISReportrByFomatToday({ |
| | | AssetId: this.Id, |
| | | fomatToday: this.fomatToday |
| | | }).then(records => { |
| | | console.log(records); |
| | | if (this.AssetMarkC == null || this.AssetMarkC == undefined) { |
| | | this.ShowToastEvent('保有设备标记为空,请联系管理员补充。!', "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | if (records.length >= 1) { |
| | | this.handleConfirmClick01('请确认此件是否属于10天内重复报告,如果是,请使用原QIS里的复制功能重新提交。'); |
| | | } else { |
| | | this.ss(); |
| | | } |
| | | }) |
| | | } |
| | | |
| | | ss() { |
| | | selecctRepairByFomatToday({ |
| | | AssetId: this.Id, |
| | | fomatToday: this.fomatToday |
| | | }).then(records2 => { |
| | | if (this.AssetMarkC == '耗材') { |
| | | selectCASE({ |
| | | AssetOwnerC: this.AssetOwnerC |
| | | }).then(result => { |
| | | console.log(result); |
| | | this.Customer_asset_or_loaner = result; |
| | | }) |
| | | |
| | | selectNullvalue({ |
| | | InstallDate: this.InstallDate, |
| | | PostingDateC: this.PostingDateC, |
| | | AssetDayC: this.AssetDayC |
| | | }).then(result => { |
| | | console.log(result); |
| | | this.Instration_date_consumable = result; |
| | | |
| | | }) |
| | | } |
| | | if (records2.length >= 1) { |
| | | this.Old_Repair_Name = records2[0].Name; |
| | | } |
| | | if (records2.length >= 1) { |
| | | this.handleConfirmClick02('请确认此件是否属于10天内重复报告,如果是,需按照原先的维修信息填写。'); |
| | | } else { |
| | | this.ll(); |
| | | } |
| | | }) |
| | | } |
| | | |
| | | ll() { |
| | | |
| | | const url = encodeDefaultFieldValues({ |
| | | Name: "*", |
| | | Hospital__c: this.HospitalId, |
| | | Department_Class__c: this.DepartmentClassId, |
| | | nonyushohin__c: this.Id, |
| | | Generation_Source__c: "保有设备", |
| | | Lots_No__c: this.SerialNumber, |
| | | sell__c: this.Customer_asset_or_loaner, |
| | | Instration_date_consumable__c: this.Instration_date_consumable, |
| | | consumable__c: this.ProductIDC, |
| | | contract_number_ET__c: this.OrderNoC, |
| | | Hospital_Department__c: this.AccountId, |
| | | Old_Repair_Name__c: this.Old_Repair_Name |
| | | }); |
| | | this[NavigationMixin.Navigate]({ |
| | | type: 'standard__objectPage', |
| | | attributes: { |
| | | objectApiName: 'QIS_Report__c', |
| | | actionName: 'new' |
| | | }, |
| | | state: { |
| | | nooverride: '1', |
| | | defaultFieldValues: url |
| | | } |
| | | }); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | |
| | | async handleConfirmClick01(msg) { |
| | | const result = await LightningConfirm.open({ |
| | | message: msg, |
| | | variant: 'headerless', |
| | | label: 'this is the aria-label value' |
| | | }); |
| | | if (result) { |
| | | this.ss(); |
| | | } else { |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | } |
| | | |
| | | async handleConfirmClick02(msg) { |
| | | const result = await LightningConfirm.open({ |
| | | message: msg, |
| | | variant: 'headerless', |
| | | label: 'this is the aria-label value' |
| | | }); |
| | | if (result) { |
| | | this.ll(); |
| | | } else { |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | } |
| | | |
| | | ShowToastEvent(msg, type) { |
| | | const event = new ShowToastEvent({ |
| | | title: '', |
| | | message: msg, |
| | | variant: type |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | |
| | | closeAction() { |
| | | location.reload(); |
| | | } |
| | | } |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="lexCreateQISFromAsset"> |
| | | <apiVersion>51.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__RecordPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | <!-- 屏幕流配置 --> |
| | | <target>lightning__FlowScreen</target> |
| | | </targets> |
| | | <targetConfigs> |
| | | <targetConfig targets="lightning__FlowScreen"> |
| | | <!-- name js中使用的变量,从屏幕流中获取参数 label 在屏幕流的该LWC的设置中显示 --> |
| | | <property name="recordId" type="String" label="recordId"/> |
| | | </targetConfig> |
| | | </targetConfigs> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__RecordPage</target> |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | .toast{ |
| | | border: 1px solid #c9c9c9; |
| | | border-radius: 10px; |
| | | width: 50%; |
| | | margin: 0 auto; |
| | | font-size: 18px; |
| | | font-weight: bold; |
| | | padding: 10px 20px; |
| | | background: #EA001E; |
| | | display: flex; |
| | | color: white; |
| | | } |
| | |
| | | <template> |
| | | <div class="exampleHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | <lightning-button onclick={handleConfirmClick} label="Open Confirm Modal"></lightning-button> |
| | | <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button> </div> |
| | | </div> |
| | | <div if:false={IsLoading} class="toast"> |
| | | <span style="padding: 10px;">{msg}</span> |
| | | <button class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse" onclick={closeAction} title="Close" style="background-color: #e5e4e2;margin-top: 15px;"> |
| | | <lightning-icon class="greyIcon" icon-name="utility:close" alternative-text="Connected" variant="inverse" size="small" |
| | | title="Close" style="color: black;"></lightning-icon> |
| | | <span class="slds-assistive-text">Close</span> |
| | | </button> |
| | | </div> |
| | | </template> |
| | |
| | | import selecctProduct2ById from '@salesforce/apex/buttonAssetCtl.selecctProduct2ById'; |
| | | import selecctRepairByFomatToday from '@salesforce/apex/buttonAssetCtl.selecctRepairByFomatToday'; |
| | | import selecctQISReportByFomatToday from '@salesforce/apex/buttonAssetCtl.selecctQISReportByFomatToday'; |
| | | import { |
| | | NavigationMixin |
| | | } from 'lightning/navigation'; |
| | | import { |
| | | encodeDefaultFieldValues |
| | | } from 'lightning/pageReferenceUtils'; |
| | | import LightningConfirm from 'lightning/confirm'; |
| | | import { |
| | | ShowToastEvent |
| | | } from 'lightning/platformShowToastEvent'; |
| | | |
| | | export default class LexCreateRepairFromAsset extends LightningElement { |
| | | export default class LexCreateRepairFromAsset extends NavigationMixin(LightningElement) { |
| | | @api recordId; |
| | | str; |
| | | IsLoading = true; |
| | |
| | | RepairSalesPointProvinceChinaC; |
| | | notCreateRepairFromAssetButton; |
| | | notCreateRepairFromAssetButton02; |
| | | msg; |
| | | flag = false; |
| | | fomatToday; |
| | | QIS_Name = ''; |
| | | QIS_Id = ''; |
| | | Old_Repair_Name = ''; |
| | | Work_Location = ''; |
| | | FSE_GI_Main_Leader__id = ''; |
| | | FSE_GI_Main_Leader__name = ''; |
| | | FSE_SP_Main_Leader__id = ''; |
| | | FSE_SP_Main_Leader__name = ''; |
| | | Incharge_Staff = ''; |
| | | Incharge_Staff_id = ''; |
| | | |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.Id = result.Id; |
| | | this.userID = result.userID; |
| | | this.day = result.day; |
| | |
| | | } |
| | | this.CreateRepairFromAsset(); |
| | | }) |
| | | |
| | | |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | |
| | | var EmployeeNo = this.EmployeeNoC; |
| | | |
| | | if (nCRepairFromAssetBList.indexOf(EmployeeNo) != -1) { |
| | | alert("对不起,您无权使用此按钮创建修理!"); |
| | | this.ShowToastEvent("对不起,您无权使用此按钮创建修理!", "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | |
| | | var fomatToday = this.day1; |
| | | var QIS_Name = ''; |
| | | var QIS_Id = ''; |
| | | var url1 = ""; |
| | | var FSE_GI_Main_Leader__id = ''; |
| | | var FSE_GI_Main_Leader__name = ''; |
| | | var FSE_SP_Main_Leader__id = ''; |
| | | var FSE_SP_Main_Leader__name = ''; |
| | | var Incharge_Staff = ''; |
| | | var Incharge_Staff_id = ''; |
| | | var Work_Location = ''; |
| | | var Old_Repair_Name = ''; |
| | | this.fomatToday = this.day1; |
| | | |
| | | |
| | | selecctQISReportByFomatToday({ |
| | | AssetId: this.Id, |
| | | fomatToday: fomatToday |
| | | fomatToday: this.fomatToday |
| | | }).then(records => { |
| | | console.log(records); |
| | | if (records.length >= 1) { |
| | | var boolday = confirm('请确认此件是否属于10天内重复报告,如果是,请使用原QIS信息填写。'); |
| | | if (!boolday) { |
| | | return; |
| | | } |
| | | this.QIS_Name = records[0].Name; |
| | | this.QIS_Id = records[0].Id; |
| | | } |
| | | if (records.length >= 1) { |
| | | QIS_Name = records[0].Name; |
| | | QIS_Id = records[0].Id; |
| | | this.handleConfirmClick01('请确认此件是否属于10天内重复报告,如果是,请使用原QIS信息填写。'); |
| | | } else { |
| | | this.ss(); |
| | | } |
| | | |
| | | }) |
| | | } |
| | | |
| | | ss() { |
| | | selecctRepairByFomatToday({ |
| | | AssetId: this.Id, |
| | | fomatToday: fomatToday |
| | | fomatToday: this.fomatToday |
| | | }).then(records2 => { |
| | | console.log(records2); |
| | | if (records2.length >= 1) { |
| | | var boolday = confirm('此件设备如为10天内重复报告,建议回到原修理单使用复制功能提交。请确认是否继续新建修理? '); |
| | | if (!boolday) { |
| | | return; |
| | | } |
| | | |
| | | var partSupplyFinishDate = this.NoPartRiskDateFC; |
| | | if (this.day < this.NoPartRiskDateFC && this.NoPartRiskDateFC <= this.day2) { |
| | | this.ShowToastEvent('预计' + partSupplyFinishDate + '零件即将停产,请送修前与工厂及RC联络', "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | if (this.NoPartRiskDateFC != null && this.NoPartRiskDateFC != undefined && this.NoPartRiskDateFC <= this.day) { |
| | | this.ShowToastEvent('该型号零件已经停产,有特殊需求,请送修前与工厂RC联络', "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | if (records2.length >= 1) { |
| | | Old_Repair_Name = records2[0].Name; |
| | | this.Old_Repair_Name = records2[0].Name; |
| | | } |
| | | if (records2.length >= 1) { |
| | | this.handleConfirmClick02('此件设备如为10天内重复报告,建议回到原修理单使用复制功能提交。请确认是否继续新建修理? '); |
| | | } else { |
| | | this.ll(); |
| | | } |
| | | }) |
| | | var partSupplyFinishDate = this.NoPartRiskDateFC; |
| | | if (this.day < this.NoPartRiskDateFC && this.NoPartRiskDateFC <= this.day2) { |
| | | alert('预计' + partSupplyFinishDate + '零件即将停产,请送修前与工厂及RC联络'); |
| | | } |
| | | if (this.NoPartRiskDateFC != null && this.NoPartRiskDateFC != undefined && this.NoPartRiskDateFC <= this.day) { |
| | | alert('该型号零件已经停产,有特殊需求,请送修前与工厂RC联络'); |
| | | } |
| | | } |
| | | |
| | | ll() { |
| | | selecctProduct2ById({ |
| | | Id: this.ProductIDC |
| | | }).then(recordP => { |
| | |
| | | if (recordP != null && recordP.length > 0) { |
| | | var canRepair = recordP[0].Can_Repair__c; |
| | | if (canRepair == '第三方') { |
| | | alert('非我司修理对象,无法新建修理,如有不明请咨询CIC'); |
| | | this.ShowToastEvent('非我司修理对象,无法新建修理,如有不明请咨询CIC', "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | if (canRepair == '不' || canRepair == null) { |
| | | alert('本设备无法新建修理'); |
| | | this.ShowToastEvent('本设备无法新建修理', "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | if (canRepair == 'RC送修') { |
| | | url1 = "&00N10000009HAJl=TRUE" |
| | | this.flag = true; |
| | | } |
| | | } |
| | | }) |
| | | selecctAccountByAccountId({ |
| | | AccountId: this.AccountId |
| | | }).then(List => { |
| | | console.log(List); |
| | | if (List != null) { |
| | | var RecordTypeId = List[0]['Parent']['RecordType_DeveloperName__c'].substring(0, 15); |
| | | console.log(RecordTypeId); |
| | | if (RecordTypeId != 'Agency') { |
| | | if (List[0]['Parent']['Parent']['FSE_GI_Main_Leader__c'] != null) { |
| | | FSE_GI_Main_Leader__id = List[0]['Parent']['Parent']['FSE_GI_Main_Leader__c'].substring(0, 15); |
| | | FSE_GI_Main_Leader__name = List[0]['Parent']['Parent']['FSE_GI_Main_Leader__r']['Name']; |
| | | } |
| | | if (List[0]['Parent']['Parent']['FSE_SP_Main_Leader__c'] != null) { |
| | | FSE_SP_Main_Leader__id = List[0]['Parent']['Parent']['FSE_SP_Main_Leader__c'].substring(0, 15); |
| | | FSE_SP_Main_Leader__name = List[0]['Parent']['Parent']['FSE_SP_Main_Leader__r']['Name']; |
| | | } |
| | | if (List[0]['Parent']['RecordType_DeveloperName__c'] != null || List[0]['Parent']['RecordType_DeveloperName__c'] != undefined) { |
| | | var recordId = List[0]['Parent']['RecordType_DeveloperName__c'].substring(0, 15); |
| | | if (recordId == 'Department_Class_GI' || recordId == 'Department_Class_BF' || recordId == 'Department_Class_ET') { |
| | | if (List[0]['Parent']['Parent']['FSE_GI_Main_Leader__c'] != null) { |
| | | Work_Location = List[0]['Parent']['Parent']['FSE_GI_Main_Leader__r']['Work_Location__c']; |
| | | } |
| | | } else if (recordId == 'Department_Class_GS' || recordId == 'Department_Class_URO' || recordId == 'Department_Class_ENT' || recordId == 'Department_Class_GYN' || recordId == 'Department_Class_OTH') { |
| | | if (List[0]['Parent']['Parent']['FSE_SP_Main_Leader__c'] != null) { |
| | | Work_Location = List[0]['Parent']['Parent']['FSE_SP_Main_Leader__r']['Work_Location__c']; |
| | | } |
| | | selecctAccountByAccountId({ |
| | | AccountId: this.AccountId |
| | | }).then(List => { |
| | | console.log(List); |
| | | if (List != null) { |
| | | var RecordTypeId = List[0]['Parent']['RecordType_DeveloperName__c'].substring(0, 15); |
| | | console.log(RecordTypeId); |
| | | if (RecordTypeId != 'Agency') { |
| | | if (List[0]['Parent']['Parent']['FSE_GI_Main_Leader__c'] != null) { |
| | | this.FSE_GI_Main_Leader__id = List[0]['Parent']['Parent']['FSE_GI_Main_Leader__c'].substring(0, 15); |
| | | this.FSE_GI_Main_Leader__name = List[0]['Parent']['Parent']['FSE_GI_Main_Leader__r']['Name']; |
| | | } |
| | | if (List[0]['Parent']['Parent']['FSE_SP_Main_Leader__c'] != null) { |
| | | this.FSE_SP_Main_Leader__id = List[0]['Parent']['Parent']['FSE_SP_Main_Leader__c'].substring(0, 15); |
| | | this.FSE_SP_Main_Leader__name = List[0]['Parent']['Parent']['FSE_SP_Main_Leader__r']['Name']; |
| | | } |
| | | if (List[0]['Parent']['RecordType_DeveloperName__c'] != null || List[0]['Parent']['RecordType_DeveloperName__c'] != undefined) { |
| | | var recordId = List[0]['Parent']['RecordType_DeveloperName__c'].substring(0, 15); |
| | | if (recordId == 'Department_Class_GI' || recordId == 'Department_Class_BF' || recordId == 'Department_Class_ET') { |
| | | if (List[0]['Parent']['Parent']['FSE_GI_Main_Leader__c'] != null) { |
| | | this.Work_Location = List[0]['Parent']['Parent']['FSE_GI_Main_Leader__r']['this.Work_Location__c']; |
| | | } |
| | | } else if (recordId == 'Department_Class_GS' || recordId == 'Department_Class_URO' || recordId == 'Department_Class_ENT' || recordId == 'Department_Class_GYN' || recordId == 'Department_Class_OTH') { |
| | | if (List[0]['Parent']['Parent']['FSE_SP_Main_Leader__c'] != null) { |
| | | this.Work_Location = List[0]['Parent']['Parent']['FSE_SP_Main_Leader__r']['this.Work_Location__c']; |
| | | } |
| | | |
| | | } |
| | | } |
| | | if (RecordTypeId == 'Department_Class_GI') { |
| | | this.Incharge_Staff = this.FSE_GI_Main_Leader__name; |
| | | this.Incharge_Staff_id = this.FSE_GI_Main_Leader__id; |
| | | } |
| | | if (RecordTypeId == 'Department_Class_BF') { |
| | | this.Incharge_Staff = this.FSE_GI_Main_Leader__name; |
| | | this.Incharge_Staff_id = this.FSE_GI_Main_Leader__id; |
| | | } |
| | | if (RecordTypeId == 'Department_Class_ET') { |
| | | this.Incharge_Staff = this.FSE_GI_Main_Leader__name; |
| | | this.Incharge_Staff_id = this.FSE_GI_Main_Leader__id; |
| | | } |
| | | if (RecordTypeId == 'Department_Class_GS') { |
| | | this.Incharge_Staff = this.FSE_SP_Main_Leader__name; |
| | | this.Incharge_Staff_id = this.FSE_SP_Main_Leader__id; |
| | | } |
| | | if (RecordTypeId == 'Department_Class_URO') { |
| | | this.Incharge_Staff = this.FSE_SP_Main_Leader__name; |
| | | this.Incharge_Staff_id = this.FSE_SP_Main_Leader__id; |
| | | } |
| | | if (RecordTypeId == 'Department_Class_ENT') { |
| | | this.Incharge_Staff = this.FSE_SP_Main_Leader__name; |
| | | this.Incharge_Staff_id = this.FSE_SP_Main_Leader__id; |
| | | } |
| | | if (RecordTypeId == 'Department_Class_GYN') { |
| | | this.Incharge_Staff = this.FSE_SP_Main_Leader__name; |
| | | this.Incharge_Staff_id = this.FSE_SP_Main_Leader__id; |
| | | } |
| | | if (RecordTypeId == 'Department_Class_OTH') { |
| | | this.Incharge_Staff = this.FSE_SP_Main_Leader__name; |
| | | this.Incharge_Staff_id = this.FSE_SP_Main_Leader__id; |
| | | } |
| | | } |
| | | if (RecordTypeId == 'Department_Class_GI') { |
| | | Incharge_Staff = FSE_GI_Main_Leader__name; |
| | | Incharge_Staff_id = FSE_GI_Main_Leader__id; |
| | | } |
| | | if (RecordTypeId == 'Department_Class_BF') { |
| | | Incharge_Staff = FSE_GI_Main_Leader__name; |
| | | Incharge_Staff_id = FSE_GI_Main_Leader__id; |
| | | } |
| | | if (RecordTypeId == 'Department_Class_ET') { |
| | | Incharge_Staff = FSE_GI_Main_Leader__name; |
| | | Incharge_Staff_id = FSE_GI_Main_Leader__id; |
| | | } |
| | | if (RecordTypeId == 'Department_Class_GS') { |
| | | Incharge_Staff = FSE_SP_Main_Leader__name; |
| | | Incharge_Staff_id = FSE_SP_Main_Leader__id; |
| | | } |
| | | if (RecordTypeId == 'Department_Class_URO') { |
| | | Incharge_Staff = FSE_SP_Main_Leader__name; |
| | | Incharge_Staff_id = FSE_SP_Main_Leader__id; |
| | | } |
| | | if (RecordTypeId == 'Department_Class_ENT') { |
| | | Incharge_Staff = FSE_SP_Main_Leader__name; |
| | | Incharge_Staff_id = FSE_SP_Main_Leader__id; |
| | | } |
| | | if (RecordTypeId == 'Department_Class_GYN') { |
| | | Incharge_Staff = FSE_SP_Main_Leader__name; |
| | | Incharge_Staff_id = FSE_SP_Main_Leader__id; |
| | | } |
| | | if (RecordTypeId == 'Department_Class_OTH') { |
| | | Incharge_Staff = FSE_SP_Main_Leader__name; |
| | | Incharge_Staff_id = FSE_SP_Main_Leader__id; |
| | | } |
| | | } |
| | | |
| | | } |
| | | var url = "/a0J/e?CF00N10000002Dx66_lkid=" + this.HospitalId + "&CF00N10000002Dx66=" + this.HospitalC + "&CF00N10000002Dx5t_lkid=" + this.DepartmentClassId + "&CF00N10000002Dx5t=" + this.DepartmentClassC + "&CF00N10000002Dx5n_lkid=" + this.Id + "&CF00N10000002Dx5n=" + this.Name + "&CF00N10000002Dx1X_lkid=" + this.Id + "&CF00N10000002Dx1X=" + this.Name + "&CF00N10000002EMHw_lkid=" + Incharge_Staff_id + "&CF00N10000002EMHw=" + Incharge_Staff + "&00N10000002FH86=%e5%8f%aa%e4%bf%ae%e7%90%86&00N10000006P6Rn=" + this.RepairSalesPointProvinceChinaC + "&00N10000006P6SM=" + encodeURI(Work_Location) + "&CF00N10000009H7yM=" + QIS_Name + "&CF00N10000009H7yM_lkid=" + QIS_Id + "&00N10000009H2fa=" + Old_Repair_Name + "&retURL=%2F" + this.Id; |
| | | if (url1 != undefined) { |
| | | url = url + url1; |
| | | } |
| | | window.open(url); |
| | | const url = encodeDefaultFieldValues({ |
| | | Hospital__c: this.HospitalId, |
| | | Department_Class__c: this.DepartmentClassId, |
| | | Account__c: this.AccountId, |
| | | Delivered_Product__c: this.Id, |
| | | Incharge_Staff__c: this.Incharge_Staff_id, |
| | | Work_Location_select__c: this.RepairSalesPointProvinceChinaC, |
| | | SalesOfficeCode_selection__c: encodeURI(this.Work_Location), |
| | | Source_QIS__c: this.QIS_Id, |
| | | Old_Name__c: this.Old_Repair_Name, |
| | | Exc_Work_Location__c: this.flag |
| | | }); |
| | | this[NavigationMixin.Navigate]({ |
| | | type: 'standard__objectPage', |
| | | attributes: { |
| | | objectApiName: 'Repair__c', |
| | | actionName: 'new' |
| | | }, |
| | | state: { |
| | | nooverride: '1', |
| | | defaultFieldValues: url |
| | | } |
| | | }); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | async handleConfirmClick01(msg) { |
| | | const result = await LightningConfirm.open({ |
| | | message: msg, |
| | | variant: 'headerless', |
| | | label: 'this is the aria-label value' |
| | | }); |
| | | if (result) { |
| | | this.ss(); |
| | | } else { |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | } |
| | | |
| | | async handleConfirmClick02(msg) { |
| | | const result = await LightningConfirm.open({ |
| | | message: msg, |
| | | variant: 'headerless', |
| | | label: 'this is the aria-label value' |
| | | }); |
| | | if (result) { |
| | | this.ll(); |
| | | } else { |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | } |
| | | |
| | | ShowToastEvent(msg, type) { |
| | | const event = new ShowToastEvent({ |
| | | title: '', |
| | | message: msg, |
| | | variant: type |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | |
| | | closeAction() { |
| | | location.reload(); |
| | | } |
| | | } |
| | |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | <target>lightning__FlowScreen</target> |
| | | </targets> |
| | | <!-- 定义变量 --> |
| | | <targetConfigs> |
| | | <targetConfig targets="lightning__FlowScreen"> |
| | | <property name="recordId" type="String" label="recordId"/> |
| | | </targetConfig> |
| | | </targetConfigs> |
| | | </LightningComponentBundle> |
| | |
| | | import init from '@salesforce/apex/buttonAccountCtl.init'; |
| | | import initUserName from '@salesforce/apex/buttonAccountCtl.initUserName'; |
| | | import selecctAccountByAccountId from '@salesforce/apex/buttonAccountCtl.selecctAccountByAccountId'; |
| | | import { |
| | | NavigationMixin |
| | | } from 'lightning/navigation'; |
| | | import { |
| | | encodeDefaultFieldValues |
| | | } from 'lightning/pageReferenceUtils'; |
| | | |
| | | export default class LexCreateRepairFromDepartment extends LightningElement { |
| | | export default class LexCreateRepairFromDepartment extends NavigationMixin(LightningElement) { |
| | | @api recordId; |
| | | str; |
| | | IsLoading = true; |
| | |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.Id = result.Id; |
| | | this.HospitalC = result.HospitalC == undefined ? "" : result.HospitalC;; |
| | | this.HospitalId = result.HospitalId == undefined ? "" : result.HospitalId;; |
| | |
| | | } |
| | | this.CreateRepairFromDepartment(); |
| | | }) |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | |
| | | Incharge_Staff_id = FSE_SP_Main_Leader__id; |
| | | } |
| | | } |
| | | var url = "/a0J/e?CF00N10000002Dx66_lkid=" + this.HospitalId + "&CF00N10000002Dx66=" + this.HospitalC + "&CF00N10000002Dx5t_lkid=" + this.DepartmentClassId + "&CF00N10000002Dx5t=" + this.DepartmentClassC + "&CF00N10000002Dx5n_lkid=" + this.Id + "&CF00N10000002Dx5n=" + this.Name + "&CF00N10000002EMHw_lkid=" + Incharge_Staff_id + "&CF00N10000002EMHw=" + Incharge_Staff + "&00N10000002FH86=%e5%8f%aa%e4%bf%ae%e7%90%86&00N10000006P6Rn=" + this.RepairSalesPointProvinceChinaC + "&00N10000006P6SM=" + encodeURI(Work_Location) + "&retURL=%2F" + this.Id; |
| | | window.open(url); |
| | | const url = encodeDefaultFieldValues({ |
| | | Hospital__c: this.HospitalC, |
| | | Department_Class__c: this.DepartmentClassC, |
| | | Account__c: this.Id, |
| | | Incharge_Staff__c: Incharge_Staff_id, |
| | | SalesOfficeCode_selection__c: encodeURI(Work_Location), |
| | | work_location_select__c: this.RepairSalesPointProvinceChinaC |
| | | }); |
| | | this[NavigationMixin.Navigate]({ |
| | | type: 'standard__objectPage', |
| | | attributes: { |
| | | objectApiName: 'Repair__c', |
| | | actionName: 'new' |
| | | }, |
| | | state: { |
| | | nooverride: '1', |
| | | defaultFieldValues: url |
| | | } |
| | | }); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | |
| | | // var url = "/a0J/e?CF00N10000002Dx66_lkid=" + this.HospitalId + "&CF00N10000002Dx66=" + this.HospitalC + |
| | | // "&CF00N10000002Dx5t_lkid=" + this.DepartmentClassId + "&CF00N10000002Dx5t=" + this.DepartmentClassC + |
| | | // "&CF00N10000002Dx5n_lkid=" + this.Id + "&CF00N10000002Dx5n=" + this.Name + |
| | | // "&CF00N10000002EMHw_lkid=" + Incharge_Staff_id + "&CF00N10000002EMHw=" + Incharge_Staff + |
| | | // "&00N10000002FH86=%e5%8f%aa%e4%bf%ae%e7%90%86&00N10000006P6Rn=" + this.RepairSalesPointProvinceChinaC + |
| | | // "&00N10000006P6SM=" + encodeURI(Work_Location) + "&retURL=%2F" + this.Id; |
| | | |
| | | // window.open(url); |
| | | }) |
| | | } |
| | | } |
| | |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | <target>lightning__FlowScreen</target> |
| | | </targets> |
| | | <!-- 定义变量 --> |
| | | <targetConfigs> |
| | | <targetConfig targets="lightning__FlowScreen"> |
| | | <property name="recordId" type="String" label="recordId"/> |
| | | </targetConfig> |
| | | </targetConfigs> |
| | | </LightningComponentBundle> |
| | |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | <target>lightning__FlowScreen</target> |
| | | </targets> |
| | | <!-- 定义变量 --> |
| | | <targetConfigs> |
| | | <targetConfig targets="lightning__FlowScreen"> |
| | | <property name="recordId" type="String" label="recordId"/> |
| | | </targetConfig> |
| | | </targetConfigs> |
| | | </LightningComponentBundle> |
| | |
| | | <template> |
| | | <div class="exampleHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | </div> |
| | | <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button> </div> |
| | | </template> |
| | |
| | | import init from '@salesforce/apex/buttonQISReportCtl.init'; |
| | | import initUserName from '@salesforce/apex/buttonQISReportCtl.initUserName'; |
| | | import selecctAccountByAccountId from '@salesforce/apex/buttonQISReportCtl.selecctAccountByAccountId'; |
| | | import { |
| | | NavigationMixin |
| | | } from 'lightning/navigation'; |
| | | import { |
| | | encodeDefaultFieldValues |
| | | } from 'lightning/pageReferenceUtils'; |
| | | import { |
| | | ShowToastEvent |
| | | } from 'lightning/platformShowToastEvent'; |
| | | |
| | | export default class LexCreateRepairFromQIS extends LightningElement { |
| | | export default class LexCreateRepairFromQIS extends NavigationMixin(LightningElement) { |
| | | @api recordId; |
| | | str; |
| | | IsLoading = true; |
| | |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.Id = result.Id; |
| | | this.Name = result.Name; |
| | | this.SourceOnCallId = result.SourceOnCallId == undefined ? "" : result.SourceOnCallId; |
| | |
| | | this.CreateRepairFromQIS(); |
| | | }) |
| | | |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | |
| | | |
| | | //新建修理QIS |
| | | CreateRepairFromQIS() { |
| | | console.log("开始"); |
| | | var newflag = false; |
| | | if ((this.OCMJudgementC == '质量问题' && this.nextAction == '无偿维修' && this.SpecialFollow == '0') || (this.OCMJudgementC == '非质量问题' && this.nextAction == '无偿维修' && this.SpecialFollow == '1') || (this.OCMJudgementC == '非质量问题' && this.nextAction == '有偿维修' && this.SpecialFollow == '0') || (this.OCMJudgementC == '质量问题+非质量问题' && this.nextAction == '无偿维修' && this.SpecialFollow == '1') || (this.OCMJudgementC == '质量问题+非质量问题' && this.nextAction == '有偿维修+无偿维修' && this.SpecialFollow == '0')) { |
| | | newflag = true; |
| | |
| | | var Incharge_Staff = ''; |
| | | var Incharge_Staff_id = ''; |
| | | var Work_Location = ''; |
| | | if (List[0]['ParentId'] != null) { |
| | | RecordTypeId = List[0]['Parent']['RecordType_DeveloperName__c'].substring(0, 15); |
| | | console.log(RecordTypeId); |
| | | var FSE_GI_Main_Leader__id = ''; |
| | | var FSE_GI_Main_Leader__name = ''; |
| | | var FSE_SP_Main_Leader__id = ''; |
| | | var FSE_SP_Main_Leader__name = ''; |
| | | if (List[0]['Parent']['Parent']['FSE_GI_Main_Leader__c'] != null) { |
| | | FSE_GI_Main_Leader__id = List[0]['Parent']['Parent']['FSE_GI_Main_Leader__c'].substring(0, 15); |
| | | FSE_GI_Main_Leader__name = List[0]['Parent']['Parent']['FSE_GI_Main_Leader__r']['Name']; |
| | | } |
| | | if (List[0]['Parent']['Parent']['FSE_SP_Main_Leader__c'] != null) { |
| | | FSE_SP_Main_Leader__id = List[0]['Parent']['Parent']['FSE_SP_Main_Leader__c'].substring(0, 15); |
| | | FSE_SP_Main_Leader__name = List[0]['Parent']['Parent']['FSE_SP_Main_Leader__r']['Name']; |
| | | } |
| | | if (List[0]['Parent']['RecordType_DeveloperName__c'] != null || List[0]['Parent']['RecordType_DeveloperName__c'] != undefined) { |
| | | var recordId = List[0]['Parent']['RecordType_DeveloperName__c'].substring(0, 15); |
| | | if (recordId == 'Department_Class_GI' || recordId == 'Department_Class_BF' || recordId == 'Department_Class_ET') { |
| | | if (List[0]['Parent']['Parent']['FSE_GI_Main_Leader__c'] != null) { |
| | | Work_Location = List[0]['Parent']['Parent']['FSE_GI_Main_Leader__r']['Work_Location__c']; |
| | | } |
| | | } else if (recordId == 'Department_Class_GS' || recordId == 'Department_Class_URO' || recordId == 'Department_Class_ENT' || recordId == 'Department_Class_GYN' || recordId == 'Department_Class_OTH') { |
| | | if (List[0]['Parent']['Parent']['FSE_SP_Main_Leader__c'] != null) { |
| | | Work_Location = List[0]['Parent']['Parent']['FSE_SP_Main_Leader__r']['Work_Location__c']; |
| | | } |
| | | |
| | | if (List.length > 0) { |
| | | if (List[0]['ParentId'] != null) { |
| | | RecordTypeId = List[0]['Parent']['RecordType_DeveloperName__c'].substring(0, 15); |
| | | console.log(RecordTypeId); |
| | | var FSE_GI_Main_Leader__id = ''; |
| | | var FSE_GI_Main_Leader__name = ''; |
| | | var FSE_SP_Main_Leader__id = ''; |
| | | var FSE_SP_Main_Leader__name = ''; |
| | | if (List[0]['Parent']['Parent']['FSE_GI_Main_Leader__c'] != null) { |
| | | FSE_GI_Main_Leader__id = List[0]['Parent']['Parent']['FSE_GI_Main_Leader__c'].substring(0, 15); |
| | | FSE_GI_Main_Leader__name = List[0]['Parent']['Parent']['FSE_GI_Main_Leader__r']['Name']; |
| | | } |
| | | } |
| | | if (RecordTypeId == 'Department_Class_GI') { |
| | | Incharge_Staff = FSE_GI_Main_Leader__name; |
| | | Incharge_Staff_id = FSE_GI_Main_Leader__id; |
| | | } |
| | | if (RecordTypeId == 'Department_Class_BF') { |
| | | Incharge_Staff = FSE_GI_Main_Leader__name; |
| | | Incharge_Staff_id = FSE_GI_Main_Leader__id; |
| | | } |
| | | if (RecordTypeId == 'Department_Class_ET') { |
| | | Incharge_Staff = FSE_GI_Main_Leader__name; |
| | | Incharge_Staff_id = FSE_GI_Main_Leader__id; |
| | | } |
| | | if (RecordTypeId == 'Department_Class_GS') { |
| | | Incharge_Staff = FSE_SP_Main_Leader__name; |
| | | Incharge_Staff_id = FSE_SP_Main_Leader__id; |
| | | } |
| | | if (RecordTypeId == 'Department_Class_URO') { |
| | | Incharge_Staff = FSE_SP_Main_Leader__name; |
| | | Incharge_Staff_id = FSE_SP_Main_Leader__id; |
| | | } |
| | | if (RecordTypeId == 'Department_Class_ENT') { |
| | | Incharge_Staff = FSE_SP_Main_Leader__name; |
| | | Incharge_Staff_id = FSE_SP_Main_Leader__id; |
| | | } |
| | | if (RecordTypeId == 'Department_Class_GYN') { |
| | | Incharge_Staff = FSE_SP_Main_Leader__name; |
| | | Incharge_Staff_id = FSE_SP_Main_Leader__id; |
| | | } |
| | | if (RecordTypeId == 'Department_Class_OTH') { |
| | | Incharge_Staff = FSE_SP_Main_Leader__name; |
| | | Incharge_Staff_id = FSE_SP_Main_Leader__id; |
| | | if (List[0]['Parent']['Parent']['FSE_SP_Main_Leader__c'] != null) { |
| | | FSE_SP_Main_Leader__id = List[0]['Parent']['Parent']['FSE_SP_Main_Leader__c'].substring(0, 15); |
| | | FSE_SP_Main_Leader__name = List[0]['Parent']['Parent']['FSE_SP_Main_Leader__r']['Name']; |
| | | } |
| | | if (List[0]['Parent']['RecordType_DeveloperName__c'] != null || List[0]['Parent']['RecordType_DeveloperName__c'] != undefined) { |
| | | var recordId = List[0]['Parent']['RecordType_DeveloperName__c'].substring(0, 15); |
| | | if (recordId == 'Department_Class_GI' || recordId == 'Department_Class_BF' || recordId == 'Department_Class_ET') { |
| | | if (List[0]['Parent']['Parent']['FSE_GI_Main_Leader__c'] != null) { |
| | | Work_Location = List[0]['Parent']['Parent']['FSE_GI_Main_Leader__r']['Work_Location__c']; |
| | | } |
| | | } else if (recordId == 'Department_Class_GS' || recordId == 'Department_Class_URO' || recordId == 'Department_Class_ENT' || recordId == 'Department_Class_GYN' || recordId == 'Department_Class_OTH') { |
| | | if (List[0]['Parent']['Parent']['FSE_SP_Main_Leader__c'] != null) { |
| | | Work_Location = List[0]['Parent']['Parent']['FSE_SP_Main_Leader__r']['Work_Location__c']; |
| | | } |
| | | |
| | | } |
| | | } |
| | | if (RecordTypeId == 'Department_Class_GI') { |
| | | Incharge_Staff = FSE_GI_Main_Leader__name; |
| | | Incharge_Staff_id = FSE_GI_Main_Leader__id; |
| | | } |
| | | if (RecordTypeId == 'Department_Class_BF') { |
| | | Incharge_Staff = FSE_GI_Main_Leader__name; |
| | | Incharge_Staff_id = FSE_GI_Main_Leader__id; |
| | | } |
| | | if (RecordTypeId == 'Department_Class_ET') { |
| | | Incharge_Staff = FSE_GI_Main_Leader__name; |
| | | Incharge_Staff_id = FSE_GI_Main_Leader__id; |
| | | } |
| | | if (RecordTypeId == 'Department_Class_GS') { |
| | | Incharge_Staff = FSE_SP_Main_Leader__name; |
| | | Incharge_Staff_id = FSE_SP_Main_Leader__id; |
| | | } |
| | | if (RecordTypeId == 'Department_Class_URO') { |
| | | Incharge_Staff = FSE_SP_Main_Leader__name; |
| | | Incharge_Staff_id = FSE_SP_Main_Leader__id; |
| | | } |
| | | if (RecordTypeId == 'Department_Class_ENT') { |
| | | Incharge_Staff = FSE_SP_Main_Leader__name; |
| | | Incharge_Staff_id = FSE_SP_Main_Leader__id; |
| | | } |
| | | if (RecordTypeId == 'Department_Class_GYN') { |
| | | Incharge_Staff = FSE_SP_Main_Leader__name; |
| | | Incharge_Staff_id = FSE_SP_Main_Leader__id; |
| | | } |
| | | if (RecordTypeId == 'Department_Class_OTH') { |
| | | Incharge_Staff = FSE_SP_Main_Leader__name; |
| | | Incharge_Staff_id = FSE_SP_Main_Leader__id; |
| | | } |
| | | } |
| | | } |
| | | |
| | | window.open("/a0J/e?CF00N10000002FIJU_lkid=" + this.SourceOnCallId + "&CF00N10000002FIJU=" + this.SourceOnCall + "&CF00N10000002FIJZ_lkid=" + this.Id + "&CF00N10000002FIJZ=" + this.Name + "&CF00N10000002Dx66_lkid=" + this.HospitalId + "&CF00N10000002Dx66=" + this.Hospital + "&CF00N10000002Dx5t_lkid=" + this.DepartmentClassId + "&CF00N10000002Dx5t=" + this.DepartmentClass + "&CF00N10000002Dx5n_lkid=" + this.HospitalDepartmentId + "&CF00N10000002Dx5n=" + this.HospitalDepartment + "&CF00N10000002Dx1X_lkid=" + this.nonyushohinId + "&CF00N10000002Dx1X=" + this.nonyushohin + "&CF00N10000002EMHw_lkid=" + Incharge_Staff_id + "&CF00N10000002EMHw=" + Incharge_Staff + "&00N10000002Dx5y=" + this.TrableOccurDaYCollect + "&00N10000006P6SM=" + encodeURI(Work_Location) + "&00N10000002FH86=" + this.sourceForRepair + "&00N10000006P6Rn=" + this.RepairSalesPointProvinceChinaC + "&retURL=%2F" + this.Id); |
| | | const url = encodeDefaultFieldValues({ |
| | | On_Call_ID__c: this.SourceOnCall, |
| | | QIS_ID__c: this.Id, |
| | | Hospital__c: this.Hospital, |
| | | Department_Class__c: this.DepartmentClass, |
| | | Account__c: this.HospitalDepartment, |
| | | Delivered_Product__c: this.nonyushohin, |
| | | Incharge_Staff__c: Incharge_Staff_id, |
| | | Failure_Occurrence_Date__c: this.TrableOccurDaYCollect, |
| | | SalesOfficeCode_selection__c: encodeURI(Work_Location), |
| | | Repair_Source__c: this.sourceForRepair, |
| | | work_location_select__c: this.RepairSalesPointProvinceChinaC |
| | | }); |
| | | this[NavigationMixin.Navigate]({ |
| | | type: 'standard__objectPage', |
| | | attributes: { |
| | | objectApiName: 'Repair__c', |
| | | actionName: 'new' |
| | | }, |
| | | state: { |
| | | nooverride: '1', |
| | | defaultFieldValues: url |
| | | } |
| | | }); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | |
| | | // window.open("/a0J/e?CF00N10000002FIJU_lkid=" + this.SourceOnCallId + "&CF00N10000002FIJU=" + this.SourceOnCall + |
| | | // "&CF00N10000002FIJZ_lkid=" + this.Id + "&CF00N10000002FIJZ=" + this.Name + |
| | | // "&CF00N10000002Dx66_lkid=" + this.HospitalId + "&CF00N10000002Dx66=" + this.Hospital + |
| | | // "&CF00N10000002Dx5t_lkid=" + this.DepartmentClassId + "&CF00N10000002Dx5t=" + this.DepartmentClass + |
| | | // "&CF00N10000002Dx5n_lkid=" + this.HospitalDepartmentId + "&CF00N10000002Dx5n=" + this.HospitalDepartment + |
| | | // "&CF00N10000002Dx1X_lkid=" + this.nonyushohinId + "&CF00N10000002Dx1X=" + this.nonyushohin + |
| | | // "&CF00N10000002EMHw_lkid=" + Incharge_Staff_id + "&CF00N10000002EMHw=" + Incharge_Staff + |
| | | // "&00N10000002Dx5y=" + this.TrableOccurDaYCollect + "&00N10000006P6SM=" + encodeURI(Work_Location) + |
| | | // "&00N10000002FH86=" + this.sourceForRepair + "&00N10000006P6Rn=" + this.RepairSalesPointProvinceChinaC + |
| | | // "&retURL=%2F" + this.Id); |
| | | |
| | | }) |
| | | } else { |
| | | alert("不能新建修理"); |
| | | this.ShowToastEvent("不能新建修理", "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | } |
| | | |
| | | ShowToastEvent(msg, type) { |
| | | const event = new ShowToastEvent({ |
| | | title: '', |
| | | message: msg, |
| | | variant: type |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | } |
| | |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | <target>lightning__FlowScreen</target> |
| | | </targets> |
| | | <!-- 定义变量 --> |
| | | <targetConfigs> |
| | | <targetConfig targets="lightning__FlowScreen"> |
| | | <property name="recordId" type="String" label="recordId"/> |
| | | </targetConfig> |
| | | </targetConfigs> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | .toast{ |
| | | border: 1px solid #c9c9c9; |
| | | border-radius: 10px; |
| | | width: 50%; |
| | | margin: 0 auto; |
| | | font-size: 18px; |
| | | font-weight: bold; |
| | | padding: 10px 20px; |
| | | background: #EA001E; |
| | | display: flex; |
| | | color: white; |
| | | } |
| | |
| | | <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> |
| | | <div if:false={IsLoading} class="toast"> |
| | | <span style="padding: 10px;">{msg}</span> |
| | | <button class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse" onclick={closeAction} |
| | | title="Close" style="background-color: #e5e4e2;margin-top: 15px;"> |
| | | <lightning-icon class="greyIcon" icon-name="utility:close" alternative-text="Connected" variant="inverse" |
| | | size="small" title="Close" style="color: black;"></lightning-icon> |
| | | <span class="slds-assistive-text">Close</span> |
| | | </button> |
| | | </div> |
| | | </template> |
| | |
| | | CloseActionScreenEvent |
| | | } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/otherButtonMaintenanceContractCtl.init'; |
| | | import { |
| | | ShowToastEvent |
| | | } from 'lightning/platformShowToastEvent'; |
| | | import selectMaintenanceContractEstimate from '@salesforce/apex/otherButtonMaintenanceContractCtl.selectMaintenanceContractEstimate'; |
| | | |
| | | export default class LexCustomAnewMaintenance extends LightningElement { |
| | |
| | | StatusC; |
| | | RecordTypeDeveloperNameC; |
| | | URFContractC; |
| | | msg; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.Id = result.Id; |
| | | this.RecordTypeDeveloperNameC = result.RecordTypeDeveloperNameC; |
| | | this.StatusC = result.StatusC; |
| | |
| | | }) |
| | | } |
| | | |
| | | //中止 |
| | | //合同再报价 |
| | | CustomAnew() { |
| | | if (this.StatusC != "引合中") { |
| | | alert("维修合同不是询价中的状态,不能再报价") |
| | | this.msg = "维修合同不是询价中的状态,不能再报价"; |
| | | this.IsLoading = false; |
| | | return; |
| | | } else { |
| | | selectMaintenanceContractEstimate({ |
| | | recordId: this.Id |
| | |
| | | } else { |
| | | window.open("/apex/SelectAssetEstimate?copyid=" + ids[0].Id, "_top"); |
| | | } |
| | | |
| | | } else { |
| | | alert('请选择一个报价') |
| | | this.msg = '请选择一个报价'; |
| | | this.IsLoading = false; |
| | | return; |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | |
| | | closeAction() { |
| | | window.history.go(-1); |
| | | } |
| | | } |
| | |
| | | <template> |
| | | <div class="exampleHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | <lightning-button onclick={handleConfirmClick} label="Open Confirm Modal"></lightning-button> |
| | | </div> |
| | | </template> |
| | |
| | | import { |
| | | ShowToastEvent |
| | | } from 'lightning/platformShowToastEvent'; |
| | | import LightningConfirm from 'lightning/confirm'; |
| | | |
| | | export default class LexCustomDelete extends LightningElement { |
| | | @api recordId; |
| | |
| | | this.userID = result.userID; |
| | | |
| | | this.CustomDelete(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }).finally(() => { |
| | | |
| | | }); |
| | | }) |
| | | } |
| | | |
| | | // 删除 |
| | |
| | | if (repList != null && repList.length > 0) { |
| | | var rp = repList[0]; |
| | | if (rp.Status__c != "草案中" && rp.Status__c != "1.受理完毕(SAP待发送)" && rp.Status__c != "4.修理品返送阶段") { |
| | | this.ShowToastEvent("不是草案中,不能删除", "error") |
| | | this.ShowToastEvent("不是草案中,不能删除", "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } else if (rp.Status__c == "4.修理品返送阶段" && (rp.SAP_Transfer_time__c != undefined || rp.Repair_Ordered_Date__c != undefined)) { |
| | | this.ShowToastEvent("已经发送过SAP,不能删除", "error") |
| | | this.ShowToastEvent("已经发送过SAP,不能删除", "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } else if (this.userID.substring(0, 15) != rp.CreatedById.substring(0, 15) && this.userID.substring(0, 15) != rp.Acc_OwnerId__c.substring(0, 15) && this.userID.substring(0, 15) != rp.FSE_ownerid__c.substring(0, 15)) { |
| | | this.ShowToastEvent("不是所有人、创建人或FSE主负责人,不能删除", "error") |
| | | this.ShowToastEvent("不是所有人、创建人或FSE主负责人,不能删除", "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } else { |
| | | if (confirm("是否确定?")) { |
| | | deleteRepair({ |
| | | rid: rp.Id |
| | | }).then(rtn => { |
| | | if (rtn == "OK") { |
| | | window.location.href = "/a0J/o"; |
| | | } else { |
| | | alert(rtn); |
| | | } |
| | | }) |
| | | } |
| | | this.handleConfirmClick("是否确定?"); |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | ll() { |
| | | deleteRepair({ |
| | | rid: this.Id |
| | | }).then(rtn => { |
| | | if (rtn == "OK") { |
| | | window.location.href = "/a0J/o"; |
| | | } else { |
| | | this.ShowToastEvent(rtn, "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | }) |
| | | } |
| | |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | |
| | | async handleConfirmClick(msg) { |
| | | const result = await LightningConfirm.open({ |
| | | message: msg, |
| | | variant: 'headerless', |
| | | label: 'this is the aria-label value' |
| | | }); |
| | | |
| | | if (result) { |
| | | this.ll(); |
| | | } else { |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | .toast{ |
| | | border: 1px solid #c9c9c9; |
| | | border-radius: 10px; |
| | | width: 50%; |
| | | margin: 0 auto; |
| | | font-size: 18px; |
| | | font-weight: bold; |
| | | padding: 10px 20px; |
| | | background: #EA001E; |
| | | display: flex; |
| | | color: white; |
| | | } |
| | |
| | | <template> |
| | | <div class="toReportHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | <lightning-button onclick={handleConfirmClick} label="Open Confirm Modal"></lightning-button> |
| | | </div> |
| | | <div if:false={IsLoading} class="toast"> |
| | | <span style="padding: 10px;">{msg}</span> |
| | | <button class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse" onclick={closeAction} title="Close" style="background-color: #e5e4e2;margin-top: 15px;"> |
| | | <lightning-icon class="greyIcon" icon-name="utility:close" alternative-text="Connected" variant="inverse" size="small" |
| | | title="Close" style="color: black;"></lightning-icon> |
| | | <span class="slds-assistive-text">Close</span> |
| | | </button> |
| | | </div> |
| | | </template> |
| | |
| | | CloseActionScreenEvent |
| | | } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/otherButtonMaintenanceContractCtl.init'; |
| | | import LightningConfirm from 'lightning/confirm'; |
| | | |
| | | export default class LexCustomNewMCMaintenance extends LightningElement { |
| | | @api recordId; |
| | |
| | | IsRecognitionModelC; |
| | | URFContractC; |
| | | RecordTypeDeveloperNameC; |
| | | msg; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.Id = result.Id; |
| | | this.StatusC = result.StatusC; |
| | | this.IsRecognitionModelC = result.IsRecognitionModelC; |
| | |
| | | // 新建新服务合同报价 |
| | | CustomNewMC() { |
| | | if (this.StatusC != "引合中") { |
| | | alert("维修合同不是询价中的状态,不能新建报价"); |
| | | this.msg = "维修合同不是询价中的状态,不能新建报价"; |
| | | this.IsLoading = false; |
| | | } else { |
| | | if (this.IsRecognitionModelC == 1) { |
| | | if (!confirm("该经销商为先款对象,是否继续新建报价?")) { |
| | | return; |
| | | } |
| | | } |
| | | if (this.RecordTypeDeveloperNameC == "NewMaintenance_Contract") { |
| | | if (this.URFContractC == 0) { |
| | | window.open("/apex/SelectAssetEstimateVM?mcid=" + this.Id, "_top"); |
| | | } else { |
| | | window.open("/apex/SelectAssetEstimateURF?mcid=" + this.Id, "_top"); |
| | | } |
| | | this.handleConfirmClick("该经销商为先款对象,是否继续新建报价?") |
| | | } else { |
| | | window.open("/apex/SelectAssetEstimate?mcid=" + this.Id, "_top"); |
| | | this.ll(); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | ll() { |
| | | if (this.RecordTypeDeveloperNameC == "NewMaintenance_Contract") { |
| | | if (this.URFContractC == 0) { |
| | | window.open("/apex/SelectAssetEstimateVM?mcid=" + this.Id, "_top"); |
| | | } else { |
| | | window.open("/apex/SelectAssetEstimateURF?mcid=" + this.Id, "_top"); |
| | | } |
| | | } else { |
| | | window.open("/apex/SelectAssetEstimate?mcid=" + this.Id, "_top"); |
| | | } |
| | | } |
| | | |
| | | async handleConfirmClick(msg) { |
| | | const result = await LightningConfirm.open({ |
| | | message: msg, |
| | | variant: 'headerless', |
| | | label: 'this is the aria-label value' |
| | | }); |
| | | if (result) { |
| | | this.ll(); |
| | | } else { |
| | | window.history.go(-1); |
| | | } |
| | | } |
| | | |
| | | closeAction() { |
| | | window.history.go(-1); |
| | | } |
| | | } |
| New file |
| | |
| | | .toast{ |
| | | border: 1px solid #c9c9c9; |
| | | border-radius: 10px; |
| | | width: 50%; |
| | | margin: 0 auto; |
| | | font-size: 18px; |
| | | font-weight: bold; |
| | | padding: 10px 20px; |
| | | background: #EA001E; |
| | | display: flex; |
| | | color: white; |
| | | } |
| | |
| | | <div class="exampleHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | </div> |
| | | <div if:false={IsLoading} class="toast"> |
| | | <span style="padding: 10px;">{msg}</span> |
| | | <button class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse" onclick={closeAction} title="Close" style="background-color: #e5e4e2;margin-top: 15px;"> |
| | | <lightning-icon class="greyIcon" icon-name="utility:close" alternative-text="Connected" variant="inverse" size="small" |
| | | title="Close" style="color: black;"></lightning-icon> |
| | | <span class="slds-assistive-text">Close</span> |
| | | </button> |
| | | </div> |
| | | </template> |
| | |
| | | Id; |
| | | StatusC; |
| | | RecordTypeDeveloperNameC; |
| | | msg; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.Id = result.Id; |
| | | this.StatusC = result.StatusC; |
| | | this.RecordTypeDeveloperNameC = result.RecordTypeDeveloperNameC; |
| | |
| | | // 新建维修合同报价 |
| | | CustomNew() { |
| | | if (this.StatusC != "引合中") { |
| | | alert("维修合同不是询价中的状态,不能新建报价"); |
| | | this.msg = "维修合同不是询价中的状态,不能新建报价"; |
| | | this.IsLoading = false; |
| | | } else { |
| | | if (this.RecordTypeDeveloperNameC == "NewMaintenance_Contract") { |
| | | window.open("/apex/SelectAssetEstimateVM?mcid=" + this.Id, "_top"); |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | closeAction() { |
| | | window.history.go(-1); |
| | | } |
| | | } |
| | |
| | | this.RepairC = result.RepairC; |
| | | |
| | | this.DiscountRequest(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | |
| | | console.log(rp); |
| | | if (rp.Return_Without_Repair_IF__c == true) { |
| | | this.ShowToastEvent("未修理归还的修理不允许减价申请", "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } else { |
| | | if (rp.Return_Without_Repair__c == true) { |
| | | this.ShowToastEvent("已经申请未修理返回,如果需要继续修理请取消\"未修理归还申请\"的勾选后再进行减价申请操作", "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | } |
| | |
| | | console.log(result); |
| | | if (result.length > 0) { |
| | | var split = result.split(", "); |
| | | alert(split[1]); |
| | | this.ShowToastEvent(split[1], "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | }) |
| | |
| | | console.log(result); |
| | | if (result.length > 0) { |
| | | var split = result.split(", "); |
| | | alert(split[1]); |
| | | this.ShowToastEvent(split[1], "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | }) |
| | |
| | | |
| | | // 报价附件更新的邮件通知 |
| | | mailMessege() { |
| | | var Link = "https://ocsm--partial.sandbox.my.salesforce.com/" + this.Id; |
| | | // var Link = "https://ocsm--partial.sandbox.my.salesforce.com/" + this.Id; |
| | | |
| | | var origin = window.location.origin + "/" + this.Id; |
| | | |
| | | location.href = 'mailto:' + this.InchargeStaffEmailC + |
| | | '?bcc=' + this.userEmail + |
| | |
| | | '此次报价日:' + this.RepairEstimatedDateC + '%0D%0A' + |
| | | '%0D%0A' + |
| | | 'RC联络事项:' + this.RCInformationC + '%0D%0A' + |
| | | '%0D%0A' + Link + ''; |
| | | '%0D%0A' + origin; |
| | | } |
| | | } |
| | |
| | | <div class="exampleHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button> |
| | | <lightning-button onclick={handleConfirmClick} label="Open Confirm Modal"></lightning-button> |
| | | </div> |
| | | </template> |
| | |
| | | import { |
| | | ShowToastEvent |
| | | } from 'lightning/platformShowToastEvent'; |
| | | import LightningConfirm from 'lightning/confirm'; |
| | | |
| | | export default class LexOCSMNoToReportRepair extends LightningElement { |
| | | @api recordId; |
| | |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.Id = result.Id; |
| | | this.OCSMAdministrativeReportNumberC = result.OCSMAdministrativeReportNumberC; |
| | | this.OCSMAdministrativeReportDateC = result.OCSMAdministrativeReportDateC; |
| | | this.AwareDateC = result.AwareDateC; |
| | | |
| | | this.OCSMNoToReport(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | |
| | | |
| | | // OCSM不要报告 |
| | | OCSMNoToReport() { |
| | | if (!confirm("不要报告后无法撤回,是否继续?")) { |
| | | return; |
| | | } |
| | | if (this.OCSMAdministrativeReportNumberC != undefined || |
| | | this.OCSMAdministrativeReportDateC != undefined) { |
| | | this.ShowToastEvent("已经报告的QIS,不可以点击OCSM不要报告。", "error") |
| | | return; |
| | | } |
| | | if (this.AwareDateC != undefined) { |
| | | updateRepair({ |
| | | recordId: this.Id |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result.length > 0) { |
| | | var split = result.split(", "); |
| | | alert(split[1]); |
| | | } |
| | | window.location.reload(); |
| | | }) |
| | | } else { |
| | | this.ShowToastEvent("没有AwareDate或已经OCSM行政报告,请确认。", "error") |
| | | return; |
| | | } |
| | | this.handleConfirmClick("不要报告后无法撤回,是否继续?"); |
| | | } |
| | | |
| | | // 弹窗 |
| | |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | |
| | | async handleConfirmClick(msg) { |
| | | const result = await LightningConfirm.open({ |
| | | message: msg, |
| | | variant: 'headerless', |
| | | label: 'this is the aria-label value' |
| | | }); |
| | | |
| | | if (result) { |
| | | if (this.OCSMAdministrativeReportNumberC != undefined || |
| | | this.OCSMAdministrativeReportDateC != undefined) { |
| | | this.ShowToastEvent("已经报告的QIS,不可以点击OCSM不要报告。", "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | if (this.AwareDateC != undefined) { |
| | | updateRepair({ |
| | | recordId: this.Id |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result.length > 0) { |
| | | var split = result.split(", "); |
| | | this.ShowToastEvent(split[1], "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | window.location.reload(); |
| | | }) |
| | | } else { |
| | | this.ShowToastEvent("没有AwareDate或已经OCSM行政报告,请确认。", "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | } else { |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | } |
| | | } |
| | |
| | | this.isCNBuyC = result.isCNBuyC; |
| | | |
| | | this.OCSMNogoods(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | |
| | | OCSMNogoods() { |
| | | if (this.QISStatusC != 'RC检测申请') { |
| | | this.ShowToastEvent("OCM服务本部已经收到实物", "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } else { |
| | | if ((this.isAEProfileC == undefined || this.isPAEProfileC == undefined) && this.isCNBuyC != 'true') { |
| | | this.ShowToastEvent("安全信息未判定,请联系质量法规部", "error"); |
| | | var btns = document.getElementsByName('rc_recieved'); |
| | | for (var i = 0; i < btns.length; i++) { |
| | | btns[i].disabled = true; |
| | | btns[i].className = 'btnDisabled'; |
| | | } |
| | | this.ShowToastEvent("安全信息未判定,请联系质量法规部", "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } else { |
| | | updateQisForRCRecieved({ |
| | | QId: this.Id, |
| | |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result.length > 0) { |
| | | alert(result); |
| | | this.ShowToastEvent(result, "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | }) |
| | | } |
| | |
| | | <div class="exampleHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button> |
| | | <lightning-button onclick={handleConfirmClick} label="Open Confirm Modal"></lightning-button> |
| | | </div> |
| | | </template> |
| | |
| | | import { |
| | | ShowToastEvent |
| | | } from 'lightning/platformShowToastEvent'; |
| | | |
| | | import LightningConfirm from 'lightning/confirm'; |
| | | |
| | | export default class LexOCSMToReportRepair extends LightningElement { |
| | | @api recordId; |
| | |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.Id = result.Id; |
| | | this.AwareDateC = result.AwareDateC; |
| | | this.OCSMAdministrativeReportStatusC = result.OCSMAdministrativeReportStatusC; |
| | | |
| | | this.OCSMToReport(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | |
| | | |
| | | // OCSM要报告 |
| | | OCSMToReport() { |
| | | if (!confirm("报告后无法撤回,是否继续?")) { |
| | | return; |
| | | } |
| | | if (this.OCSMAdministrativeReportStatusC == undefined && this.AwareDateC != undefined) { |
| | | updateRepair({ |
| | | recordId: this.Id |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result.length > 0) { |
| | | var split = result.split(", "); |
| | | alert(split[1]); |
| | | } |
| | | location.reload(); |
| | | }) |
| | | } else { |
| | | this.ShowToastEvent("没有AwareDate或已经OCSM行政报告,请确认。", "error") |
| | | return; |
| | | } |
| | | this.handleConfirmClick("报告后无法撤回,是否继续?"); |
| | | } |
| | | |
| | | // 弹窗 |
| | |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | |
| | | async handleConfirmClick(msg) { |
| | | const result = await LightningConfirm.open({ |
| | | message: msg, |
| | | variant: 'headerless', |
| | | label: 'this is the aria-label value' |
| | | }); |
| | | if(result){ |
| | | if (this.OCSMAdministrativeReportStatusC == undefined && this.AwareDateC != undefined) { |
| | | updateRepair({ |
| | | recordId: this.Id |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result.length > 0) { |
| | | var split = result.split(", "); |
| | | this.ShowToastEvent(split[1], "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | location.reload(); |
| | | }) |
| | | } else { |
| | | this.ShowToastEvent("没有AwareDate或已经OCSM行政报告,请确认。", "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | } |
| | | else{ |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | } |
| | | } |
| | |
| | | this.email = result.email; |
| | | |
| | | this.OSHNogoods(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | |
| | | OSHNogoods() { |
| | | if (this.QISStatusC != 'OSH检测申请' && this.QISStatusC != '完毕') { |
| | | this.ShowToastEvent("OSH已经收到实物", "error") |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } else { |
| | | updateOSHNogoods({ |
| | | Id: this.Id, |
| | |
| | | console.log(result); |
| | | if (result.length > 0) { |
| | | var split = result.split(", "); |
| | | alert(split[1]); |
| | | this.ShowToastEvent(split[1], "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }) |
| | | } |
| | |
| | | <div class="exampleHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button> |
| | | <lightning-button onclick={handleConfirmClick} label="Open Confirm Modal"></lightning-button> |
| | | </div> |
| | | </template> |
| | |
| | | import { |
| | | ShowToastEvent |
| | | } from 'lightning/platformShowToastEvent'; |
| | | import LightningConfirm from 'lightning/confirm'; |
| | | |
| | | |
| | | export default class LexPreContractSubmit extends LightningElement { |
| | | @api recordId; |
| | |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.oldIsRecognitionModelC = result.oldIsRecognitionModelC; |
| | | this.uploadToRMTimeC = result.uploadToRMTimeC; |
| | | this.IsRecognitionModelTrueC = result.IsRecognitionModelTrueC; |
| | |
| | | this.Id = result.Id; |
| | | |
| | | this.preContractSubmit(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | |
| | | preContractSubmit() { |
| | | if (this.oldIsRecognitionModelC) { |
| | | if (this.uploadToRMTimeC == null) { |
| | | this.ShowToastEvent('当前维修合同的经销商是先款对象,需要先【上传认款合同】,然后完成认款以后才能复核。', "error") |
| | | this.ShowToastEvent('当前维修合同的经销商是先款对象,需要先【上传认款合同】,然后完成认款以后才能复核。', "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } else { |
| | | if (!this.IsRecognitionModelTrueC) { |
| | | this.ShowToastEvent('当前维修合同没有完成认款,不能进行复核。', "error") |
| | | this.ShowToastEvent('当前维修合同没有完成认款,不能进行复核。', "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | var status = this.MCApprovalStatusC; |
| | | if (status != 'Draft' && status != 'Reject' && status != undefined) { |
| | | this.ShowToastEvent('复核已经提交,请确认状态。', "error") |
| | | this.ShowToastEvent('复核已经提交,请确认状态。', "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | var con_no = this.ContractprintCompletedC; |
| | | if (con_no == undefined) { |
| | | this.ShowToastEvent('合同盖章完毕为空,不能提交合同复核申请。', "error") |
| | | this.ShowToastEvent('合同盖章完毕为空,不能提交合同复核申请。', "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | if (!confirm("一旦提交此记录以待批准,根据您的设置您可能不再能够编辑此记录或将他从批准过程中调回。是否继续?")) { |
| | | return; |
| | | } |
| | | processResults({ |
| | | recordId: this.recordId |
| | | }).catch(error => { |
| | | if (error.body.pageErrors[0] != null) { |
| | | var errmsg = error.body.pageErrors[0].message.toString(); |
| | | this.ShowToastEvent(errmsg + '_sys', "error") |
| | | return; |
| | | } |
| | | }) |
| | | this.handleConfirmClick("一旦提交此记录以待批准,根据您的设置您可能不再能够编辑此记录或将他从批准过程中调回。是否继续?"); |
| | | } |
| | | |
| | | // 弹窗 |
| | |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | |
| | | async handleConfirmClick(msg) { |
| | | const result = await LightningConfirm.open({ |
| | | message: msg, |
| | | variant: 'headerless', |
| | | label: 'this is the aria-label value' |
| | | }); |
| | | |
| | | if (result) { |
| | | processResults({ |
| | | recordId: this.Id |
| | | }).catch(error => { |
| | | if (error.body.pageErrors[0] != null) { |
| | | var errmsg = error.body.pageErrors[0].message.toString(); |
| | | this.ShowToastEvent(errmsg, "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | }) |
| | | } else { |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | } |
| | | } |
| | |
| | | }).then(result => { |
| | | this.DeliveredProductC = result; |
| | | window.open('/apex/ProductRepairQuote?productid=' + this.DeliveredProductC + '&flag=asset', '', 'height=250, width=500, top=300, left=350,location=no') |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }) |
| | | } |
| | | } |
| | |
| | | <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> |
| | |
| | | CloseActionScreenEvent |
| | | } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/buttonQISReportCtl.init'; |
| | | import { |
| | | NavigationMixin |
| | | } from 'lightning/navigation'; |
| | | import { |
| | | encodeDefaultFieldValues |
| | | } from 'lightning/pageReferenceUtils'; |
| | | import { |
| | | ShowToastEvent |
| | | } from 'lightning/platformShowToastEvent'; |
| | | |
| | | export default class LexQISMBCrequestNew extends LightningElement { |
| | | export default class LexQISMBCrequestNew extends NavigationMixin(LightningElement) { |
| | | @api recordId; |
| | | str; |
| | | IsLoading = true; |
| | |
| | | // 新建QIS M-BC申请. |
| | | QISMBCRequestNew() { |
| | | var status = this.QISStatusC; |
| | | |
| | | if (status != '完毕' && status != '已回答' && status != '取消') { |
| | | alert("QIS没有审批完毕或取消,不可以创建QIS M-BC!"); |
| | | this.ShowToastEvent("QIS没有审批完毕或取消,不可以创建QIS M-BC!", "error"); |
| | | return; |
| | | } |
| | | var url = "a20/e?retURL=%2Fa20%2Fo&Name=" + this.Name + "&CF00N10000006Q4NP_lkid=" + this.Id; |
| | | window.top.location.href = url; |
| | | const url = encodeDefaultFieldValues({ |
| | | Name: this.Name, |
| | | QIS_request_name__c: this.Id |
| | | }); |
| | | this[NavigationMixin.Navigate]({ |
| | | type: 'standard__objectPage', |
| | | attributes: { |
| | | objectApiName: 'QIS_M_BC__c', |
| | | actionName: 'new' |
| | | }, |
| | | state: { |
| | | nooverride: '1', |
| | | defaultFieldValues: url |
| | | } |
| | | }); |
| | | // var url = "a20/e?retURL=%2Fa20%2Fo&Name=" + this.Name + "&CF00N10000006Q4NP_lkid=" + this.Id; |
| | | // window.open(url); |
| | | } |
| | | |
| | | ShowToastEvent(msg, type) { |
| | | const event = new ShowToastEvent({ |
| | | title: '', |
| | | message: msg, |
| | | variant: type |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | } |
| | |
| | | <target>lightning__RecordAction</target> |
| | | <target>lightning__FlowScreen</target> |
| | | </targets> |
| | | <!-- 定义变量 --> |
| | | <targetConfigs> |
| | | <targetConfig targets="lightning__FlowScreen"> |
| | | <property name="recordId" type="String" label="recordId"/> |
| | | </targetConfig> |
| | | </targetConfigs> |
| | | </LightningComponentBundle> |
| | |
| | | this.RentalApplyDiscountApproval(); |
| | | } |
| | | }) |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | |
| | | |
| | | if (power != '2B2_备品中心检测&仓库管理') { |
| | | this.ShowToastEvent("对不起,您没有权限提交此申请!", "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | |
| | | var status = this.RentalApplyDiscountStatusC; |
| | | if (status == '审批中') { |
| | | this.ShowToastEvent("审批提交成功,当前正在审批请勿再提交!", "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | if (status == '批准') { |
| | | this.ShowToastEvent("审批已批准,请勿再提交!", "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | if (status == '草案中' || status == undefined || status == '驳回') { |
| | |
| | | console.log(result); |
| | | if (result.length > 0) { |
| | | var split = result.split(", "); |
| | | alert("提交失败 " + split[1]); |
| | | this.ShowToastEvent("提交失败 " + split[1], "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | }) |
| | | } else { |
| | | this.ShowToastEvent("提交失败", "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | } |
| | |
| | | <div class="exampleHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button> |
| | | <lightning-button onclick={handleConfirmClick} label="Open Confirm Modal"></lightning-button> |
| | | </div> |
| | | </template> |
| | |
| | | import { |
| | | ShowToastEvent |
| | | } from 'lightning/platformShowToastEvent'; |
| | | import LightningConfirm from 'lightning/confirm'; |
| | | |
| | | export default class LexSCSubmit extends LightningElement { |
| | | @api recordId; |
| | |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.Id = result.Id; |
| | | this.StatusC = result.StatusC; |
| | | |
| | | this.SCSubmit(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | |
| | | // 提交待审批 |
| | | SCSubmit() { |
| | | if (this.StatusC != '草案中') { |
| | | this.ShowToastEvent("已经提交审批", "error") |
| | | this.ShowToastEvent("已经提交审批", "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | |
| | | if (!confirm("一旦OCM提交此记录以待批准,根据您的设置您可能不再能够编辑此记录或将他从批准过程中调回。是否继续?")) { |
| | | return; |
| | | } |
| | | |
| | | updateQISSCReport({ |
| | | QId: this.Id |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result.length > 0) { |
| | | var split = result.split(", "); |
| | | alert(split[1]); |
| | | } else { |
| | | this.ShowToastEvent("已提交", "success") |
| | | window.location.reload(); |
| | | } |
| | | }) |
| | | this.handleConfirmClick("一旦OCM提交此记录以待批准,根据您的设置您可能不再能够编辑此记录或将他从批准过程中调回。是否继续?"); |
| | | } |
| | | |
| | | ShowToastEvent(msg, type) { |
| | |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | |
| | | async handleConfirmClick(msg) { |
| | | const result = await LightningConfirm.open({ |
| | | message: msg, |
| | | variant: 'headerless', |
| | | label: 'this is the aria-label value' |
| | | }); |
| | | |
| | | if(result){ |
| | | updateQISSCReport({ |
| | | QId: this.Id |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result.length > 0) { |
| | | var split = result.split(", "); |
| | | this.ShowToastEvent(split[1], "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } else { |
| | | this.ShowToastEvent("已提交", "success") |
| | | window.location.reload(); |
| | | } |
| | | }) |
| | | }else{ |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | // 新建CIC/产品 |
| | | SelectProduct2CIC() { |
| | | console.log(11111111); |
| | | var pathnames = window.location.pathname.split("/"); |
| | | if (pathnames[1] == "emptyHtmlDoc.html") { |
| | | window.open("/apex/SelectProduct2CIC?cicid=" + this.Id, "_parent"); |
| | |
| | | <template> |
| | | <div class="toReportHolder" if:true={IsLoading}> |
| | | <div class="exampleHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button> |
| | | <lightning-button onclick={handleConfirmClick} label="Open Confirm Modal"></lightning-button> |
| | | </div> |
| | | </template> |
| | |
| | | api, |
| | | wire |
| | | } from "lwc"; |
| | | import LightningConfirm from 'lightning/confirm'; |
| | | |
| | | |
| | | export default class LexSendNFM103 extends LightningElement { |
| | | @api recordId; |
| | | detailedAddress; |
| | | dealer; |
| | | numberofEffectiveContract; |
| | | newProductGuaranteTxt; |
| | |
| | | userName; |
| | | profileName; |
| | | Id; |
| | | DetailedAddress; |
| | | surplusCount = 0; |
| | | url; |
| | | HPActiveC; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | if (currentPageReference) { |
| | | this.url = currentPageReference.state.backgroundContext; |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | |
| | | btns[i].className = 'btnDisabled'; |
| | | } |
| | | this.Id = result.Id; |
| | | this.detailedAddress = result.detailedAddress; |
| | | this.HPActiveC = result.HPActiveC; |
| | | this.DetailedAddress = result.detailedAddress; |
| | | this.dealer = result.DealerC; |
| | | this.numberofEffectiveContract = result.numberofEffectiveContract; |
| | | this.newProductGuaranteTxt = result.newProductGuaranteTxt; |
| | |
| | | this.foo(); |
| | | } |
| | | }) |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }); |
| | | } |
| | | |
| | | foo() { |
| | | // queryForrecords3({ |
| | | // dealer: this.dealer |
| | | // }).then(result => { |
| | | // if (result.length > 0 && result[0].FirstParagraph__c == true) { |
| | | // if (!confirm("该经销商为先款对象,是否继续申请修理?")) { |
| | | // return; |
| | | // } |
| | | // } |
| | | // if ( |
| | | // this.numberofEffectiveContract == "无" && this.newProductGuaranteTxt != "2: 多年保修" && |
| | | // this.newProductGuaranteTxt != "2: 服务多年保修" && this.newProductGuaranteTxt != "8: 市场多年保修" && |
| | | // this.onSiteRepair == "直送SORC修理" |
| | | // ) { |
| | | // if (!confirm("设备为非维修合同且非多年保修对象品,请确认是否直送SORC修理?")) { |
| | | // return; |
| | | // } |
| | | // } |
| | | // if ((this.maintenanceContract != undefined || this.VMMaintenanceContract != undefined) && |
| | | // this.onSiteRepair == "RC修理" && this.FSEState == "山东省" |
| | | // ) { |
| | | // if (!confirm("该设备为维修合同或多年保修对象品,请确认是否送至RC修理?")) { |
| | | // return; |
| | | // } |
| | | // } |
| | | // var today = Date.now(); |
| | | // var dateReceiptQuestions = Date.parse(this.dateReceiptQuestions); |
| | | // var dates = (today - dateReceiptQuestions) / (24 * 60 * 60 * 1000); |
| | | // if (this.profileName != "系统管理员" && this.userName != "胡 玉成" && this.userName != "李 琪清" && |
| | | // this.userName != "郭 洋" && |
| | | // this.delayReportReason == undefined && dates > "1" && |
| | | // this.repairSource != "QIS转修理") { |
| | | // alert("申请修理时SAP修理申请日超过问题联络收到日1天,必须填写问超时报告的理由"); |
| | | // return; |
| | | // } |
| | | // if (this.quickRepairSign == true && (this.numberofEffectiveContract == "有" || this.newProductGuaranteTxt == "2: 多年保修" || |
| | | // this.newProductGuaranteTxt == "2: 服务多年保修" || this.newProductGuaranteTxt == "8: 市场多年保修") && |
| | | // (this.onSiteRepair == "RC修理" || this.onSiteRepair == "办事处修理" || this.onSiteRepair == "现场修理")) { |
| | | // if (this.RCCD == "2.东北" || this.RCCD == "3.西北") { |
| | | // if (!confirm("该型号对应为合同或多年保对象品。如确认为大修理故障,需要选择直送SORC修理,请确认是否继续。")) { |
| | | // return; |
| | | // } |
| | | // } else if (this.RCCD == "1.华北" || this.RCCD == "6.华南" || this.RCCD == "4.西南") { |
| | | // if (!confirm("该型号对应为合同或多年保对象品。如确认为大修理故障,需要选择直送OGZ修理,请确认是否继续。")) { |
| | | // return; |
| | | // } |
| | | // } |
| | | // } |
| | | // var returnsProductWay = this.returnsProductway; |
| | | // if (returnsProductWay == undefined) { |
| | | // if (!confirm("返品方式为空,是否继续申请修理!")) { |
| | | // return; |
| | | // } |
| | | // } |
| | | // var DetailedAddress = this.detailedAddress; |
| | | // if (this.assetOwner != "Olympus") { |
| | | // if (DetailedAddress != undefined) { |
| | | // var prompt = '当前直返收货地址为:' + DetailedAddress + ',您确认不修改了吗?'; |
| | | // if (!confirm(prompt)) { |
| | | // return; |
| | | // } |
| | | // } else { |
| | | // alert('当前修理没有录入直返收货的详细地址,不能申请修理!'); |
| | | // return; |
| | | // } |
| | | // } |
| | | // queryForEquipments({ |
| | | // deliveredProductId: this.deliveredProductId, |
| | | // }).then(equipments => { |
| | | // if (equipments != null && equipments.length > 0) { |
| | | // var equipment = equipments[0]; |
| | | // if (equipment.Status == "廃棄") { |
| | | // alert("设备废弃,不能提交申请!"); |
| | | // return; |
| | | // } |
| | | // } |
| | | // }); |
| | | // if (this.FSEApplyForRepairTime != undefined) { |
| | | // alert("已修理申请,不再修理申请了"); |
| | | // return; |
| | | // } |
| | | // var surplusCount = 0; |
| | | // if (this.URFReapir == false) { |
| | | // queryForUrfAsset({ |
| | | // maintenanceContractId: this.maintenanceContractId, |
| | | // deliveredProductId: this.deliveredProductId, |
| | | // }).then(urfAsset => { |
| | | // var seriesMaxRepairCount = 0; |
| | | // var seriesRepairCount = 0; |
| | | // if (urfAsset != null && urfAsset.length > 0) { |
| | | // seriesMaxRepairCount = urfAsset[0].Series_MaxRepairCount_F__c; |
| | | // seriesRepairCount = urfAsset[0].Series_RepairCount_F__c; |
| | | // surplusCount = seriesMaxRepairCount - seriesRepairCount; |
| | | // } |
| | | // }); |
| | | // queryForUrfSeriesInfo({ |
| | | // URFLimitSerial: this.URFLimitSerial, |
| | | // }).then(urfSeriesInfo => { |
| | | // var urfSeries = ""; |
| | | // if (urfSeriesInfo != null && urfSeriesInfo.length > 0) { |
| | | // urfSeries = urfSeriesInfo[0].URFLimitSerial__c; |
| | | // } |
| | | // queryForRepairCount({ |
| | | // maintenanceContractId: this.maintenanceContractId, |
| | | // status1: "1.受理完毕", |
| | | // URFLimitSerial: urfSeries, |
| | | // }).then(repairCount => { |
| | | // if (repairCount.length > 0 && surplusCount == 1) { |
| | | // alert("该设备关联限次合同,目前剩余次数小于送修设备。请等待进行中修理完成后再进行申请"); |
| | | // return; |
| | | // } |
| | | // }); |
| | | // }); |
| | | // } |
| | | // if (this.status != "草案中" && this.status != "1.受理完毕(SAP待发送)" && this.status != "4.修理品返送阶段") { |
| | | // alert("不是草案中不能申请"); |
| | | // } else { |
| | | // if (this.dealer != undefined) { |
| | | if (this.HPActiveC == '無効') { |
| | | this.ShowToastEvent("本医院已无效,无法进行申请。", "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | |
| | | // queryForFindInvalidLicense({ |
| | | // dealerId: this.dealerId, |
| | | // }).then(findInvalidLicense => { |
| | | // console.log(findInvalidLicense); |
| | | // if (findInvalidLicense.length > 0) { |
| | | // alert("经销商三证不在有效期,无法送修"); |
| | | // return; |
| | | // } |
| | | // }); |
| | | // } |
| | | // } |
| | | // if (this.ifDeadHurt == "有") { |
| | | // if (!confirm("是否确认AE要提交?")) { |
| | | // return; |
| | | // } |
| | | // } |
| | | // if (this.dayLater30 == "是") { |
| | | // alert("创建后超过30天,不能申请了"); |
| | | // return; |
| | | // } |
| | | // var prompt11 = "合同内大修次数已用完,当前修理为合同外的修理,是否继续?"; |
| | | // if (this.URFReapir == false && surplusCount == 0) { |
| | | // if (!confirm(prompt11)) { |
| | | // return; |
| | | // } |
| | | // } |
| | | // updateForRepair1({ |
| | | // recordId: this.Id |
| | | // }).then(result => { |
| | | // if (result != null && result.length > 0) { |
| | | // var split = result.split(", "); |
| | | // alert(split[1]); |
| | | // } else { |
| | | // queryForReocrds({ |
| | | // inchargeStaffId: this.inchargeStaffId, |
| | | // }).then(records => { |
| | | // if (records != null && records.length > 0) { |
| | | // var staff = records[0]; |
| | | // console.log(staff); |
| | | // updateRepair2({ |
| | | // recordId: this.Id, |
| | | // staff: staff, |
| | | // DWSign: this.DWSign, |
| | | // statusc: "1.受理完毕", |
| | | // DOJStatus: this.DOJStatus, |
| | | // SAPcondition: this.SAPcondition, |
| | | // }).then(result => { |
| | | // console.log(result); |
| | | // if (result != null && result.length > 0) { |
| | | // var split = result.split(", "); |
| | | // alert(split[1]); |
| | | // } else { |
| | | // if (this.salesOfficeCodeSelection == "成都RC") { |
| | | // alert("现阶段,成都RC仅受理四川(西藏)内镜、西南全域CV/CLV,其余实物请发至广州RC。"); |
| | | // } |
| | | // } |
| | | // }); |
| | | // queryForRds({ |
| | | // recordId: this.Id, |
| | | // }).then(rds => { |
| | | // if (rds != null && rds.length > 0) { |
| | | // var repairAft = rds[0]; |
| | | // if (repairAft.NewProductGuarante_Formula__c != repairAft.ProductGuarante_Create__c) { |
| | | // alert("该设备保修信息已发生变化,请了解"); |
| | | // } |
| | | // } |
| | | // }); |
| | | // } else { |
| | | // alert("没有找到 修理委托者"); |
| | | // } |
| | | // }); |
| | | // } |
| | | // }); |
| | | // }); |
| | | queryForrecords3({ |
| | | dealer: this.dealer |
| | | }).then(result => { |
| | | if (result.length > 0 && result[0].FirstParagraph__c == true) { |
| | | this.handleConfirmClick01("该经销商为先款对象,是否继续申请修理?"); |
| | | } else { |
| | | this.ll01(); |
| | | } |
| | | }); |
| | | |
| | | var staticResource; |
| | | var DetailedAddress = this.detailedAddress; |
| | | |
| | | getStaticResource({ |
| | | sobj: "Repair__c" |
| | | }).then(result => { |
| | |
| | | function (data) { |
| | | console.log(data); |
| | | if (data && data.object) { |
| | | DetailedAddress = data.object.detailedAddress; |
| | | this.DetailedAddress = data.object.detailedAddress; |
| | | } |
| | | this.foo(); |
| | | }, |
| | | staticResource.token); |
| | | }); |
| | | }) |
| | | } |
| | | |
| | | ll01() { |
| | | console.log(1); |
| | | if (this.numberofEffectiveContract == "无" && this.newProductGuaranteTxt != "2: 多年保修" && |
| | | this.newProductGuaranteTxt != "2: 服务多年保修" && this.newProductGuaranteTxt != "8: 市场多年保修" && |
| | | this.onSiteRepair == "直送SORC修理") { |
| | | this.handleConfirmClick02("设备为非维修合同且非多年保修对象品,请确认是否直送SORC修理?"); |
| | | } else { |
| | | this.ll02(); |
| | | } |
| | | } |
| | | |
| | | ll02() { |
| | | console.log(2); |
| | | if ((this.maintenanceContract != undefined || this.VMMaintenanceContract != undefined) && |
| | | this.onSiteRepair == "RC修理" && this.FSEState == "山东省" |
| | | ) { |
| | | this.handleConfirmClick03("该设备为维修合同或多年保修对象品,请确认是否送至RC修理?"); |
| | | } else { |
| | | this.ll03(); |
| | | } |
| | | } |
| | | |
| | | ll03() { |
| | | console.log(3); |
| | | var today = Date.now(); |
| | | var dateReceiptQuestions = Date.parse(this.dateReceiptQuestions); |
| | | var dates = (today - dateReceiptQuestions) / (24 * 60 * 60 * 1000); |
| | | if (this.profileName != "系统管理员" && this.userName != "胡 玉成" && this.userName != "李 琪清" && |
| | | this.userName != "郭 洋" && |
| | | this.delayReportReason == undefined && dates > "1" && |
| | | this.repairSource != "QIS转修理") { |
| | | this.ShowToastEvent("申请修理时SAP修理申请日超过问题联络收到日1天,必须填写问超时报告的理由", "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | if (this.quickRepairSign == true && (this.numberofEffectiveContract == "有" || this.newProductGuaranteTxt == "2: 多年保修" || |
| | | this.newProductGuaranteTxt == "2: 服务多年保修" || this.newProductGuaranteTxt == "8: 市场多年保修") && |
| | | (this.onSiteRepair == "RC修理" || this.onSiteRepair == "办事处修理" || this.onSiteRepair == "现场修理")) { |
| | | if (this.RCCD == "2.东北" || this.RCCD == "3.西北") { |
| | | this.handleConfirmClick04("该型号对应为合同或多年保对象品。如确认为大修理故障,需要选择直送SORC修理,请确认是否继续。"); |
| | | } else if (this.RCCD == "1.华北" || this.RCCD == "6.华南" || this.RCCD == "4.西南") { |
| | | this.handleConfirmClick04("该型号对应为合同或多年保对象品。如确认为大修理故障,需要选择直送OGZ修理,请确认是否继续。"); |
| | | } else { |
| | | if (this.returnsProductway == undefined) { |
| | | this.handleConfirmClick06("返品方式为空,是否继续申请修理!"); |
| | | } else { |
| | | this.ll06(); |
| | | } |
| | | } |
| | | } else { |
| | | if (this.returnsProductway == undefined) { |
| | | this.handleConfirmClick06("返品方式为空,是否继续申请修理!"); |
| | | } else { |
| | | this.ll06(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | ll06() { |
| | | console.log(6); |
| | | if (this.assetOwner != "Olympus") { |
| | | if (this.DetailedAddress != undefined) { |
| | | this.handleConfirmClick07('当前直返收货地址为:' + this.DetailedAddress + ',您确认不修改了吗?'); |
| | | } else { |
| | | this.ShowToastEvent('当前修理没有录入直返收货的详细地址,不能申请修理!', "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | } else { |
| | | this.ll07(); |
| | | } |
| | | } |
| | | |
| | | ll07() { |
| | | console.log(7); |
| | | queryForEquipments({ |
| | | deliveredProductId: this.deliveredProductId, |
| | | }).then(equipments => { |
| | | if (equipments != null && equipments.length > 0) { |
| | | var equipment = equipments[0]; |
| | | if (equipment.Status == "廃棄") { |
| | | this.ShowToastEvent("设备废弃,不能提交申请!", "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | } |
| | | }); |
| | | console.log(701); |
| | | if (this.FSEApplyForRepairTime != undefined) { |
| | | this.ShowToastEvent("已修理申请,不再修理申请了", "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | console.log(702); |
| | | if (this.URFReapir == false) { |
| | | queryForUrfAsset({ |
| | | maintenanceContractId: this.maintenanceContractId, |
| | | deliveredProductId: this.deliveredProductId, |
| | | }).then(urfAsset => { |
| | | var seriesMaxRepairCount = 0; |
| | | var seriesRepairCount = 0; |
| | | if (urfAsset != null && urfAsset.length > 0) { |
| | | seriesMaxRepairCount = urfAsset[0].Series_MaxRepairCount_F__c; |
| | | seriesRepairCount = urfAsset[0].Series_RepairCount_F__c; |
| | | this.surplusCount = seriesMaxRepairCount - seriesRepairCount; |
| | | } |
| | | }); |
| | | console.log(703); |
| | | |
| | | queryForUrfSeriesInfo({ |
| | | URFLimitSerial: this.URFLimitSerial, |
| | | }).then(urfSeriesInfo => { |
| | | var urfSeries = ""; |
| | | if (urfSeriesInfo != null && urfSeriesInfo.length > 0) { |
| | | urfSeries = urfSeriesInfo[0].URFLimitSerial__c; |
| | | } |
| | | console.log(704); |
| | | |
| | | queryForRepairCount({ |
| | | maintenanceContractId: this.maintenanceContractId, |
| | | status1: "1.受理完毕", |
| | | URFLimitSerial: urfSeries, |
| | | }).then(repairCount => { |
| | | if (repairCount.length > 0 && this.surplusCount == 1) { |
| | | this.ShowToastEvent("该设备关联限次合同,目前剩余次数小于送修设备。请等待进行中修理完成后再进行申请", "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | }); |
| | | }); |
| | | } |
| | | console.log(705); |
| | | |
| | | if (this.status != "草案中" && this.status != "1.受理完毕(SAP待发送)" && this.status != "4.修理品返送阶段") { |
| | | this.ShowToastEvent("不是草案中不能申请", "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } else { |
| | | if (this.dealer != undefined) { |
| | | queryForFindInvalidLicense({ |
| | | dealerId: this.dealerId, |
| | | }).then(findInvalidLicense => { |
| | | console.log(findInvalidLicense); |
| | | if (findInvalidLicense.length > 0) { |
| | | this.ShowToastEvent("经销商三证不在有效期,无法送修", "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | if (this.ifDeadHurt == "有") { |
| | | this.handleConfirmClick08("是否确认AE要提交?"); |
| | | } else { |
| | | this.ll08(); |
| | | } |
| | | } |
| | | |
| | | ll08() { |
| | | console.log(8); |
| | | if (this.dayLater30 == "是") { |
| | | this.ShowToastEvent("创建后超过30天,不能申请了", "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | if (this.URFReapir == true && this.surplusCount == 0) { |
| | | this.handleConfirmClick09("合同内大修次数已用完,当前修理为合同外的修理,是否继续?"); |
| | | } else { |
| | | this.ll09(); |
| | | } |
| | | } |
| | | |
| | | ll09() { |
| | | console.log(9); |
| | | updateForRepair1({ |
| | | recordId: this.Id |
| | | }).then(result => { |
| | | if (result != null && result.length > 0) { |
| | | var split = result.split(", "); |
| | | this.ShowToastEvent(split[1], "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } else { |
| | | console.log(901); |
| | | queryForReocrds({ |
| | | inchargeStaffId: this.inchargeStaffId, |
| | | }).then(records => { |
| | | if (records != null && records.length > 0) { |
| | | var staff = records[0]; |
| | | console.log(staff); |
| | | console.log(902); |
| | | updateRepair2({ |
| | | recordId: this.Id, |
| | | staff: staff, |
| | | DWSign: this.DWSign, |
| | | statusc: "1.受理完毕", |
| | | DOJStatus: this.DOJStatus, |
| | | SAPcondition: this.SAPcondition, |
| | | }).then(result => { |
| | | console.log(result); |
| | | console.log(903); |
| | | if (result != null && result.length > 0) { |
| | | var split = result.split(", "); |
| | | this.ShowToastEvent(split[1], "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } else { |
| | | if (this.salesOfficeCodeSelection == "成都RC") { |
| | | this.ShowToastEvent("现阶段,成都RC仅受理四川(西藏)内镜、西南全域CV/CLV,其余实物请发至广州RC。", "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | } |
| | | console.log(904); |
| | | queryForRds({ |
| | | recordId: this.Id, |
| | | }).then(rds => { |
| | | console.log(rds); |
| | | if (rds != null && rds.length > 0) { |
| | | var repairAft = rds[0]; |
| | | if (repairAft.NewProductGuarante_Formula__c != repairAft.ProductGuarante_Create__c) { |
| | | this.ShowToastEvent("该设备保修信息已发生变化,请了解", "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | } |
| | | }); |
| | | window.open(this.url, "_self"); |
| | | }); |
| | | } else { |
| | | this.ShowToastEvent("没有找到 修理委托者", "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | ShowToastEvent(msg, type) { |
| | |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | |
| | | async handleConfirmClick01(msg) { |
| | | const result = await LightningConfirm.open({ |
| | | message: msg, |
| | | variant: 'headerless', |
| | | label: 'this is the aria-label value' |
| | | }); |
| | | if (result) { |
| | | this.ll01(); |
| | | } else { |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | } |
| | | |
| | | async handleConfirmClick02(msg) { |
| | | const result = await LightningConfirm.open({ |
| | | message: msg, |
| | | variant: 'headerless', |
| | | label: 'this is the aria-label value' |
| | | }); |
| | | if (result) { |
| | | this.ll02(); |
| | | } else { |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | } |
| | | |
| | | async handleConfirmClick03(msg) { |
| | | const result = await LightningConfirm.open({ |
| | | message: msg, |
| | | variant: 'headerless', |
| | | label: 'this is the aria-label value' |
| | | }); |
| | | if (result) { |
| | | this.ll03(); |
| | | } else { |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | } |
| | | |
| | | async handleConfirmClick04(msg) { |
| | | const result = await LightningConfirm.open({ |
| | | message: msg, |
| | | variant: 'headerless', |
| | | label: 'this is the aria-label value' |
| | | }); |
| | | if (result) { |
| | | if (this.returnsProductway == undefined) { |
| | | this.handleConfirmClick06("返品方式为空,是否继续申请修理!"); |
| | | } else { |
| | | this.ll06(); |
| | | } |
| | | } else { |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | } |
| | | |
| | | async handleConfirmClick05(msg) { |
| | | const result = await LightningConfirm.open({ |
| | | message: msg, |
| | | variant: 'headerless', |
| | | label: 'this is the aria-label value' |
| | | }); |
| | | if (result) { |
| | | if (this.returnsProductway == undefined) { |
| | | this.handleConfirmClick06("返品方式为空,是否继续申请修理!"); |
| | | } else { |
| | | this.ll06(); |
| | | } |
| | | } else { |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | } |
| | | |
| | | async handleConfirmClick06(msg) { |
| | | const result = await LightningConfirm.open({ |
| | | message: msg, |
| | | variant: 'headerless', |
| | | label: 'this is the aria-label value' |
| | | }); |
| | | if (result) { |
| | | this.ll06(); |
| | | } else { |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | } |
| | | |
| | | async handleConfirmClick07(msg) { |
| | | const result = await LightningConfirm.open({ |
| | | message: msg, |
| | | variant: 'headerless', |
| | | label: 'this is the aria-label value' |
| | | }); |
| | | if (result) { |
| | | this.ll07(); |
| | | } else { |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | } |
| | | |
| | | async handleConfirmClick08(msg) { |
| | | const result = await LightningConfirm.open({ |
| | | message: msg, |
| | | variant: 'headerless', |
| | | label: 'this is the aria-label value' |
| | | }); |
| | | if (result) { |
| | | this.ll08(); |
| | | } else { |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | } |
| | | |
| | | async handleConfirmClick09(msg) { |
| | | const result = await LightningConfirm.open({ |
| | | message: msg, |
| | | variant: 'headerless', |
| | | label: 'this is the aria-label value' |
| | | }); |
| | | if (result) { |
| | | this.ll09(); |
| | | } else { |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | } |
| | | } |
| | |
| | | <div class="toReportHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button> |
| | | <lightning-button onclick={handleConfirmClick} label="Open Confirm Modal"></lightning-button> |
| | | </div> |
| | | </template> |
| | |
| | | import { |
| | | ShowToastEvent |
| | | } from 'lightning/platformShowToastEvent'; |
| | | import LightningConfirm from 'lightning/confirm'; |
| | | |
| | | export default class LexSendQISToEtQ extends LightningElement { |
| | | @api recordId; |
| | |
| | | ETQUPLOADSTATUSC; |
| | | AEDetermineResultC; |
| | | profileName; |
| | | statu = ''; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.Id = result.Id; |
| | | this.userId = result.userId; |
| | | this.profileId = result.profileId; |
| | |
| | | this.myReload(); |
| | | } |
| | | }) |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | |
| | | |
| | | // 发送QIS到EtQ |
| | | SendQISToEtQ() { |
| | | console.log(this.profileName); |
| | | var QId = this.Id; |
| | | var uid = this.userId; |
| | | |
| | | if (this.profileName != "2F7_OSH担当" && this.profileName != "2F7_OSH质量法规") { |
| | | alert("您没有发送QIS到EtQ的权限。"); |
| | | this.ShowToastEvent("您没有发送QIS到EtQ的权限。", "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | if (this.PAEDetermineC == undefined) { |
| | | alert("OCSM QARA的PAE判定是空的时候,不可以发送到EtQ。"); |
| | | this.ShowToastEvent("OCSM QARA的PAE判定是空的时候,不可以发送到EtQ。", "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | if (this.AEDetermineResultC == "nonAE" && this.PAEDetermineC == "nonPAE" && this.PAEDetermineACC == "nonPAE" && this.OCMJudgementC == undefined && this.QISFinalJudgementC == undefined) { |
| | | alert("nonAE并nonPAE的QIS同步到EtQ的时候,检测结论(OCSM)是必填的。不可以发送到EtQ。"); |
| | | this.ShowToastEvent("nonAE并nonPAE的QIS同步到EtQ的时候,检测结论(OCSM)是必填的。不可以发送到EtQ。", "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | if (this.ETQUPLOADSTATUSC == "3") { |
| | | if (!confirm("是否清空EtQ同步状态,重新同步数据?")) { |
| | | return; |
| | | } |
| | | this.handleConfirmClick("是否清空EtQ同步状态,重新同步数据?"); |
| | | } else { |
| | | this.ll(); |
| | | } |
| | | } |
| | | |
| | | var statu = ''; |
| | | myReload() { |
| | | selectQISReportC({ |
| | | QId: this.Id |
| | | }).then(record => { |
| | | console.log(record); |
| | | if (record[0].AsyncData__c == 'true' && record[0].ETQ_UPLOAD_STATUS__c != '3' || record[0].Complaint_Number__c != null) { |
| | | var btns = document.getElementsByName("sendqistoetq"); |
| | | for (var i = 0; i < btns.length; i++) { |
| | | btns[i].disabled = true; |
| | | btns[i].className = 'btnDisabled'; |
| | | } |
| | | this.ShowToastEvent('该QIS之前已经发送过了', "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } else { |
| | | this.SendQISToEtQ(); |
| | | } |
| | | }) |
| | | } |
| | | |
| | | ll() { |
| | | if (this.AEDetermineResultC != undefined && this.PAEDetermineC != undefined && this.PAEDetermineACC == undefined) { |
| | | statu = "Q1"; |
| | | this.statu = "Q1"; |
| | | } else if ( |
| | | (this.AEDetermineResultC != undefined && this.PAEDetermineC != undefined && this.PAEDetermineACC != "nonPAE" && this.PAEDetermineACC != undefined) || |
| | | (this.AEDetermineResultC == "nonAE" && this.PAEDetermineC == "nonPAE" && this.PAEDetermineACC == "nonPAE") && |
| | |
| | | (this.QISFinalJudgementC == undefined || this.QISFinalJudgementC == "质量问题")) || |
| | | (this.OCMJudgementC == "非质量问题" || this.OCMJudgementC == "现象未发现") && |
| | | this.QISFinalJudgementC == "质量问题")) { |
| | | statu = "Q2"; |
| | | this.statu = "Q2"; |
| | | } else if ((this.AEDetermineResultC == "nonAE" && this.PAEDetermineC == "nonPAE" && this.PAEDetermineACC == "nonPAE") && |
| | | ((this.OCMJudgementC == undefined || this.OCMJudgementC == "质量问题" || this.OCMJudgementC == "质量问题+非质量问题") && this.QISFinalJudgementC == "非质量问题") || |
| | | ((this.OCMJudgementC == "非质量问题" || this.OCMJudgementC == "现象未发现") && (this.QISFinalJudgementC == undefined || this.QISFinalJudgementC == "非质量问题"))) { |
| | | statu = "Q3"; |
| | | this.statu = "Q3"; |
| | | } |
| | | try { |
| | | updateQISReportC({ |
| | | QId: QId, |
| | | uid: uid |
| | | }) |
| | | updateQISReportC({ |
| | | QId: this.Id, |
| | | uid: this.userId |
| | | }) |
| | | |
| | | var qisreports = new Array() |
| | | qisreports[0] = this.Id; |
| | | var qisreports = new Array() |
| | | qisreports[0] = this.Id; |
| | | |
| | | var statuArr = new Array(); |
| | | statuArr.push(statu); |
| | | var statuArr = new Array(); |
| | | statuArr.push(this.statu); |
| | | |
| | | sendToETQ({ |
| | | iflog_Id: "", |
| | | rowDataSFDC: "", |
| | | repairIds: qisreports, |
| | | statu: statuArr[0] |
| | | }).then(result => { |
| | | alert(result); |
| | | }) |
| | | |
| | | alert("发送成功!") |
| | | var btns = document.getElementsByName("sendqistoetq"); |
| | | for (var i = 0; i < btns.length; i++) { |
| | | btns[i].disabled = true; |
| | | btns[i].className = 'btnDisabled'; |
| | | } |
| | | location.reload(); |
| | | } catch (error) { |
| | | alert("发送QIS到EtQ失败" + error.faultstring + ' code:' + error.faultcode) |
| | | } |
| | | } |
| | | |
| | | myReload() { |
| | | selectQISReportC({ |
| | | QId: this.Id |
| | | }).then(record => { |
| | | console.log(record); |
| | | if (record[0].AsyncData__c == 'true' && record[0].ETQ_UPLOAD_STATUS__c != '3' || record[0].Complaint_Number__c != null) { |
| | | var btns = document.getElementsByName("sendqistoetq"); |
| | | for (var i = 0; i < btns.length; i++) { |
| | | btns[i].disabled = true; |
| | | btns[i].className = 'btnDisabled'; |
| | | } |
| | | alert('该QIS之前已经发送过了') |
| | | sendToETQ({ |
| | | iflog_Id: "", |
| | | rowDataSFDC: "", |
| | | repairIds: qisreports, |
| | | statu: statuArr[0] |
| | | }).then(result => { |
| | | if (result == "发送成功!") { |
| | | this.ShowToastEvent(result, "success"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } else { |
| | | this.SendQISToEtQ(); |
| | | this.ShowToastEvent("发送QIS到EtQ失败," + result, "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }) |
| | | |
| | | var btns = document.getElementsByName("sendqistoetq"); |
| | | for (var i = 0; i < btns.length; i++) { |
| | | btns[i].disabled = true; |
| | | btns[i].className = 'btnDisabled'; |
| | | } |
| | | } |
| | | |
| | | // 弹窗 |
| | |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | |
| | | async handleConfirmClick(msg) { |
| | | const result = await LightningConfirm.open({ |
| | | message: msg, |
| | | variant: 'headerless', |
| | | label: 'this is the aria-label value' |
| | | }); |
| | | |
| | | if (result) { |
| | | this.ll(); |
| | | } else { |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | } |
| | | } |
| | |
| | | <div class="exampleHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button> |
| | | <lightning-button onclick={handleConfirmClick} label="Open Confirm Modal"></lightning-button> |
| | | </div> |
| | | </template> |
| | |
| | | import { |
| | | ShowToastEvent |
| | | } from 'lightning/platformShowToastEvent'; |
| | | import LightningConfirm from 'lightning/confirm'; |
| | | |
| | | export default class LexSendRepairsToEtQ extends LightningElement { |
| | | @api recordId; |
| | |
| | | profileId; |
| | | profileName; |
| | | userName; |
| | | msg; |
| | | statu = ''; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.Id = result.Id; |
| | | this.PAEDetermineC = result.PAEDetermineC; |
| | | this.ETQUPLOADSTATUSC = result.ETQUPLOADSTATUSC; |
| | |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.userName = result[0].Name; |
| | | } |
| | | }) |
| | |
| | | profileId: this.profileId |
| | | }).then(result => { |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.profileName = result[0].Name; |
| | | |
| | | this.myDate(); |
| | |
| | | } |
| | | }) |
| | | |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | |
| | | selectRecords({ |
| | | recordId: this.Id |
| | | }).then(result => { |
| | | if (result[0].AsyncData__c == 'true' && result[0].ETQ_UPLOAD_STATUS__c != '3' || result[0].Complaint_Number__c != null) { |
| | | if (result[0].AsyncData__c == true && result[0].ETQ_UPLOAD_STATUS__c != '3' || result[0].Complaint_Number__c != null) { |
| | | var btns = document.getElementsByName("sendrepairstoetq"); |
| | | for (var i = 0; i < btns.length; i++) { |
| | | btns[i].disabled = true; |
| | | btns[i].className = 'btnDisabled'; |
| | | } |
| | | alert('该修理之前已经发送过了'); |
| | | this.ShowToastEvent('该修理之前已经发送过了', "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } else { |
| | | this.SendRepairsToEtQ(); |
| | | } |
| | |
| | | // 发送ETQ |
| | | SendRepairsToEtQ() { |
| | | if (this.profileName != "2F7_OSH担当" && this.profileName != "2F7_OSH质量法规" && this.profileName != '系统管理员') { |
| | | alert("您没有发送修理到EtQ的权限。"); |
| | | this.ShowToastEvent("您没有发送修理到EtQ的权限。", "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | var statu = ''; |
| | | if (this.PAEDetermineC == undefined) { |
| | | alert("OCSM QARA的PAE判定是空的时候,不可以发送到EtQ。"); |
| | | this.ShowToastEvent("OCSM QARA的PAE判定是空的时候,不可以发送到EtQ。", "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | if (this.PAEDetermineC == "nonPAE" && this.AEDetermineResultC == "nonAE" && this.PAEDetermineACC == "nonPAE" && this.userName != "雷 新建") { |
| | | this.ShowToastEvent("Close Complait的时候,不可以发送到EtQ", "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | if (this.ETQUPLOADSTATUSC == "3") { |
| | | if (!confirm("是否清空EtQ同步状态,重新同步数据?")) { |
| | | return; |
| | | } |
| | | this.handleConfirmClick("是否清空EtQ同步状态,重新同步数据?"); |
| | | } else { |
| | | this.ll(); |
| | | } |
| | | if (this.PAEDetermineC == "nonPAE" && this.AEDetermineResultC == "nonAE" && this.PAEDetermineACC == "nonPAE" && this.userName != "雷 新建") { |
| | | alert("Close Complait的时候,不可以发送到EtQ"); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | ll() { |
| | | if (this.PAEDetermineC != undefined && this.AEDetermineResultC != undefined && this.PAEDetermineACC == undefined) { |
| | | statu = "R1"; |
| | | this.statu = "R1"; |
| | | } else if ((this.AEDetermineResultC != undefined && this.PAEDetermineC != undefined && this.PAEDetermineACC != undefined) && |
| | | !(this.PAEDetermineC == "nonPAE" && this.AEDetermineResultC == "nonAE" && this.PAEDetermineACC == "nonPAE")) { |
| | | statu = "R2"; |
| | | this.statu = "R2"; |
| | | if (this.RepairInspectionDateC == undefined) { |
| | | alert("5.修理检测日是空的时候,不可以发送到EtQ。"); |
| | | this.ShowToastEvent("5.修理检测日是空的时候,不可以发送到EtQ。", "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | if (this.ContainUseRSAC == 1) { |
| | | alert("Final universal code为空,或者包含UseRSA,请确认。"); |
| | | this.ShowToastEvent("Final universal code为空,或者包含UseRSA,请确认。", "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | } |
| | | try { |
| | | var repairids = new Array() |
| | | repairids[0] = this.Id; |
| | | |
| | | var statuArr = new Array(); |
| | | statuArr.push(statu); |
| | | var repairids = new Array() |
| | | repairids[0] = this.Id; |
| | | |
| | | sendToETQ({ |
| | | iflog_Id: "", |
| | | rowDataSFDC: "", |
| | | repairIds: repairids, |
| | | statu: statuArr[0] |
| | | }).then(result => { |
| | | alert(result); |
| | | location.reload(); |
| | | }) |
| | | var statuArr = new Array(); |
| | | statuArr.push(this.statu); |
| | | |
| | | var btns = document.getElementsByName("sendrepairstoetq"); |
| | | for (var i = 0; i < btns.length; i++) { |
| | | btns[i].disabled = true; |
| | | btns[i].className = 'btnDisabled'; |
| | | sendToETQ({ |
| | | iflog_Id: "", |
| | | rowDataSFDC: "", |
| | | repairIds: repairids, |
| | | statu: statuArr[0] |
| | | }).then(result => { |
| | | console.log("result:" + result); |
| | | if (result == "发送成功!") { |
| | | this.ShowToastEvent(result, "success"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } else { |
| | | this.ShowToastEvent("发送修理到EtQ失败," + result, "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | } catch (error) { |
| | | alert("发送修理到EtQ失败" + error.faultstring + ' code:' + error.faultcode); |
| | | }) |
| | | |
| | | var btns = document.getElementsByName("sendrepairstoetq"); |
| | | for (var i = 0; i < btns.length; i++) { |
| | | btns[i].disabled = true; |
| | | btns[i].className = 'btnDisabled'; |
| | | } |
| | | } |
| | | |
| | |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | |
| | | async handleConfirmClick(msg) { |
| | | const result = await LightningConfirm.open({ |
| | | message: msg, |
| | | variant: 'headerless', |
| | | label: 'this is the aria-label value' |
| | | }); |
| | | |
| | | if (result) { |
| | | this.ll(); |
| | | } else { |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | this.ServiceCutPriceApply(); |
| | | } |
| | | }) |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | |
| | | |
| | | if (power != '2F2A_RC' && power != '2F4_技术推进部' && power != '2F4_技术推进部_非SSO') { |
| | | this.ShowToastEvent("对不起,您没有权限提交此申请!", "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | var status = this.CutPriceStatusServiceC; |
| | | if (status == '审批中') { |
| | | this.ShowToastEvent("审批提交成功,当前正在审批请勿再提交!", "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | if (status == '批准') { |
| | | this.ShowToastEvent("审批已批准,请勿再提交!", "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | if (status == '草案中' || status == undefined || status == '驳回') { |
| | |
| | | console.log(result); |
| | | if (result.length > 0) { |
| | | var split = result.split(", "); |
| | | alert(split[1]); |
| | | this.ShowToastEvent(split[1], "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | }) |
| | |
| | | console.log(result); |
| | | if (result.length > 0) { |
| | | var split = result.split(", "); |
| | | alert("提交失败 " + split[1]); |
| | | this.ShowToastEvent("提交失败 " + split[1], "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } else { |
| | | this.ShowToastEvent("审批提交成功!", "success"); |
| | | location.reload(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }) |
| | | } |
| | |
| | | <div class="exampleHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button> |
| | | <lightning-button onclick={handleConfirmClick} label="Open Confirm Modal"></lightning-button> |
| | | </div> |
| | | </template> |
| | |
| | | import init from '@salesforce/apex/otherButtonMaintenanceContractCtl.init'; |
| | | import updateColunm from '@salesforce/apex/MaintenanceContractSetColunmWebService.updateColunm'; |
| | | import up2sap from '@salesforce/apex/MaintenanceContractWebService.up2sap'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | import { |
| | | ShowToastEvent |
| | | } from 'lightning/platformShowToastEvent'; |
| | | import LightningConfirm from 'lightning/confirm'; |
| | | |
| | | export default class LexUploadToRecognitionModel extends LightningElement { |
| | | @api recordId; |
| | |
| | | this.PaymentPlanSumFirstC = result.PaymentPlanSumFirstC; |
| | | |
| | | this.uploadToRecognitionModel(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }).finally(() => { |
| | | |
| | | }); |
| | | }) |
| | | } |
| | | |
| | | // 上传认款合同 |
| | | uploadToRecognitionModel() { |
| | | if (this.ContractQuotationOrNotC == '还没做报价') { |
| | | this.ShowToastEvent("您还没有做合同报价,不能上传认款合同。", "error") |
| | | this.ShowToastEvent("您还没有做合同报价,不能上传认款合同。", "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } else if (this.MaintenanceContractNoC == undefined) { |
| | | this.ShowToastEvent('合同号码为空,不能上传认款合同。', "error") |
| | | this.ShowToastEvent('合同号码为空,不能上传认款合同。', "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } else if (this.uploadToSapTimeC != undefined) { |
| | | this.ShowToastEvent('已经上传SAP,不能再次上传认款合同。', "error") |
| | | this.ShowToastEvent('已经上传SAP,不能再次上传认款合同。', "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } else if (this.uploadToRMTimeC != undefined) { |
| | | this.ShowToastEvent('已经上传认款合同,不能再次上传认款合同。', "error") |
| | | this.ShowToastEvent('已经上传认款合同,不能再次上传认款合同。', "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } else { |
| | | if (!this.oldIsRecognitionModelC) { |
| | | this.ShowToastEvent('经销商为空或经销商不是先款对象,不需要上传认款合同。', "error") |
| | | this.ShowToastEvent('经销商为空或经销商不是先款对象,不需要上传认款合同。', "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } else if (this.PaymentPlanSumFirstC == undefined) { |
| | | this.ShowToastEvent('第一次计划付款金额不能为空。', "error") |
| | | this.ShowToastEvent('第一次计划付款金额不能为空。', "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } else { |
| | | if (!confirm('请确认是否要上传认款合同。')) { |
| | | return; |
| | | } |
| | | updateColunm({ |
| | | mcid: this.Id |
| | | }).then(result => { |
| | | if (result != '1') { |
| | | alert('上传认款合同失败,因为 来年合同相关信息修改失败') |
| | | location.href = "/" + this.Id; |
| | | } |
| | | }) |
| | | up2sap({ |
| | | mcid: this.Id |
| | | }).then(rtn => { |
| | | if (rtn == '1') { |
| | | alert("上传认款合同成功") |
| | | location.href = "/" + this.Id; |
| | | } else { |
| | | alert(rtn) |
| | | } |
| | | }) |
| | | this.handleConfirmClick('请确认是否要上传认款合同。'); |
| | | } |
| | | } |
| | | } |
| | | |
| | | ll() { |
| | | updateColunm({ |
| | | mcid: this.Id |
| | | }).then(result => { |
| | | if (result != '1') { |
| | | this.ShowToastEvent('上传认款合同失败,因为 来年合同相关信息修改失败', "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | window.reload(); |
| | | } |
| | | }) |
| | | up2sap({ |
| | | mcid: this.Id |
| | | }).then(rtn => { |
| | | if (rtn == '1') { |
| | | this.ShowToastEvent("上传认款合同成功", "success"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | window.reload(); |
| | | } else { |
| | | this.ShowToastEvent(rtn, "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // 弹窗 |
| | |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | |
| | | async handleConfirmClick(msg) { |
| | | const result = await LightningConfirm.open({ |
| | | message: msg, |
| | | variant: 'headerless', |
| | | label: 'this is the aria-label value' |
| | | }); |
| | | |
| | | if (result) { |
| | | this.ll(); |
| | | } else { |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | } |
| | | } |
| | |
| | | this.Id = result.Id; |
| | | |
| | | this.YanshoudanRequest(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | |
| | | if (result != null) { |
| | | if (result.length > 0) { |
| | | var split = result.split(", "); |
| | | alert(split[1]); |
| | | this.ShowToastEvent(split[1], "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | } |
| | | alert("已经申请过了,不允许重新申请"); |
| | | this.ShowToastEvent("已经申请过了,不允许重新申请", "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | }) |
| | | } |
| | | |
| | |
| | | <template> |
| | | <div class="sisToOPDHolder" if:true={IsLoading}> |
| | | <div class="sisToOPDHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button> |
| | | </div> |
| | | </template> |
| | |
| | | if (this.QISStatusC != '取消') { |
| | | this.ShowToastEvent('状态为取消的QIS才可以被复制并新建', 'error'); |
| | | return; |
| | | } |
| | | } |
| | | var url = "/" + this.Id + "/e?newclone=1&retURL=%2F" + this.Id + " &CF00N100000073PA0=" + this.Name + "&CF00N100000073PA0_lkid=" + this.Id; |
| | | window.open(url); |
| | | } |