| New file |
| | |
| | | public with sharing class buttonMaintenanceContractEstimateCtl { |
| | | public buttonMaintenanceContractEstimateCtl() { |
| | | |
| | | } |
| | | |
| | | @AuraEnabled |
| | | public static InitData init(String recordId){ |
| | | InitData res = new initData(); |
| | | try{ |
| | | Maintenance_Contract_Estimate__c report = [SELECT Process_Status__c,Id FROM Maintenance_Contract_Estimate__c WHERE Id =: recordId LIMIT 1]; |
| | | System.debug(LoggingLevel.INFO, '*** opp: ' + report); |
| | | res.ProcessStatusC = report.Process_Status__c; |
| | | res.Id = report.Id; |
| | | res.sessionId = UserInfo.getSessionId(); |
| | | |
| | | System.debug(LoggingLevel.INFO, '*** res: ' + res); |
| | | }catch(Exception e){ |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | | } |
| | | return res; |
| | | } |
| | | |
| | | // 根据ID修改维修合同 |
| | | @AuraEnabled |
| | | public static void updateMaintenanceContract(String recordId){ |
| | | try { |
| | | Maintenance_Contract_Estimate__c maintenanceContract = new Maintenance_Contract_Estimate__c(); |
| | | maintenanceContract.Id = recordId; |
| | | maintenanceContract.Process_Status__c = '中止'; |
| | | update maintenanceContract; |
| | | } catch (Exception e) { |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | | } |
| | | } |
| | | |
| | | public class InitData{ |
| | | @AuraEnabled |
| | | public String Id; |
| | | @AuraEnabled |
| | | public String ProcessStatusC; |
| | | @AuraEnabled |
| | | public String sessionId; |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>56.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | public with sharing class buttonOnCallCtl { |
| | | public buttonOnCallCtl() { |
| | | |
| | | } |
| | | |
| | | @AuraEnabled |
| | | public static InitData init(String recordId){ |
| | | InitData res = new initData(); |
| | | try{ |
| | | On_Call__c report = [SELECT Id FROM On_Call__c WHERE Id =: recordId LIMIT 1]; |
| | | System.debug(LoggingLevel.INFO, '*** opp: ' + report); |
| | | res.Id = report.Id; |
| | | |
| | | System.debug(LoggingLevel.INFO, '*** res: ' + res); |
| | | }catch(Exception e){ |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | | } |
| | | return res; |
| | | } |
| | | |
| | | public class InitData{ |
| | | @AuraEnabled |
| | | public String Id; |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>56.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | public with sharing class buttonRepairQuotationCtl { |
| | | public buttonRepairQuotationCtl() { |
| | | |
| | | } |
| | | |
| | | @AuraEnabled |
| | | public static InitData init(String recordId){ |
| | | InitData res = new initData(); |
| | | try{ |
| | | Repair_Quotation__c report = [SELECT Id,CutPriceStatus_Service__c FROM Repair_Quotation__c WHERE Id =: recordId LIMIT 1]; |
| | | System.debug(LoggingLevel.INFO, '*** opp: ' + report); |
| | | res.Id = report.Id; |
| | | res.CutPriceStatusServiceC = report.CutPriceStatus_Service__c; |
| | | res.profileId = UserInfo.getProfileId(); |
| | | |
| | | System.debug(LoggingLevel.INFO, '*** res: ' + res); |
| | | }catch(Exception e){ |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | | } |
| | | return res; |
| | | } |
| | | |
| | | // 根据ID修理报价 |
| | | @AuraEnabled |
| | | public static String updateRepairQuotation(String recordId){ |
| | | String res =''; |
| | | try { |
| | | Repair_Quotation__c repair = new Repair_Quotation__c(); |
| | | repair.Id = recordid; |
| | | update repair; |
| | | } catch (Exception e) { |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | | res = e.getMessage(); |
| | | } |
| | | return res; |
| | | } |
| | | |
| | | // 根据ID修理报价提交 |
| | | @AuraEnabled |
| | | public static String updateRepairQuotation02(String recordId){ |
| | | String res =''; |
| | | try { |
| | | Repair_Quotation__c repair = new Repair_Quotation__c(); |
| | | repair.Id = recordid; |
| | | repair.CutPriceStatus_Service__c = '已提交'; |
| | | update repair; |
| | | } catch (Exception e) { |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | | res = e.getMessage(); |
| | | } |
| | | return res; |
| | | } |
| | | |
| | | public class InitData{ |
| | | @AuraEnabled |
| | | public String Id; |
| | | @AuraEnabled |
| | | public String CutPriceStatusServiceC; |
| | | @AuraEnabled |
| | | public String profileId; |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>56.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| | |
| | | public static InitData init(String recordId){ |
| | | InitData res = new initData(); |
| | | try{ |
| | | Maintenance_Contract__c report = [SELECT MC_approval_status__c,Payment_Plan_Sum_First__c,Contract_quotation_or_not__c,Name,notRenew__c,Contract_print_completed__c,Maintenance_Contract_No__c,upload_to_sap_time__c,old_Is_RecognitionModel__c,upload_to_RM_time__c,Is_Recognition_Model_True__c,Id,URF_Contract_F__c,RecordType_DeveloperName__c,Estimate_Target__c FROM Maintenance_Contract__c WHERE Id =: recordId LIMIT 1]; |
| | | Maintenance_Contract__c report = [SELECT URF_Contract__c,RecordTypeId,Is_RecognitionModel__c,Status__c,MC_approval_status__c,Payment_Plan_Sum_First__c, |
| | | Contract_quotation_or_not__c,Name,notRenew__c,Contract_print_completed__c,Maintenance_Contract_No__c, |
| | | upload_to_sap_time__c,old_Is_RecognitionModel__c,upload_to_RM_time__c,Is_Recognition_Model_True__c, |
| | | Id,URF_Contract_F__c,RecordType_DeveloperName__c,Estimate_Target__c FROM Maintenance_Contract__c WHERE Id =: recordId LIMIT 1]; |
| | | System.debug(LoggingLevel.INFO, '*** opp: ' + report); |
| | | res.StatusC = report.Status__c; |
| | | res.IsRecognitionModelC = report.Is_RecognitionModel__c; |
| | | res.RecordTypeId = report.RecordTypeId; |
| | | res.URFContractC = report.URF_Contract__c; |
| | | res.MCApprovalStatusC = report.MC_approval_status__c; |
| | | res.MaintenanceContractNoC = report.Maintenance_Contract_No__c; |
| | | res.uploadToSapTimeC = report.upload_to_sap_time__c; |
| | |
| | | List<Lost_Report__c> res = new List<Lost_Report__c>(); |
| | | try{ |
| | | res = [SELECT Id,Status__c,Other_Reasons__c,Other__c,Third_Party_Company__c,Third_Party_Contract_Price__c,To_Where__c,Specific_Reasons__c,Maintenance_Contract__c from Lost_Report__c where Maintenance_Contract__c =: recordId ]; |
| | | }catch(Exception e){ |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | | } |
| | | return res; |
| | | } |
| | | |
| | | // 查找维修合同报价 |
| | | @AuraEnabled |
| | | public static List<Maintenance_Contract_Estimate__c> selectMaintenanceContractEstimate(String recordId){ |
| | | List<Maintenance_Contract_Estimate__c> res = new List<Maintenance_Contract_Estimate__c>(); |
| | | try{ |
| | | res = [SELECT RecordTypeId from Maintenance_Contract_Estimate__c ]; |
| | | }catch(Exception e){ |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | | } |
| | |
| | | public String ContractQuotationOrNotC; |
| | | @AuraEnabled |
| | | public Double PaymentPlanSumFirstC; |
| | | @AuraEnabled |
| | | public String StatusC; |
| | | @AuraEnabled |
| | | public Boolean IsRecognitionModelC; |
| | | @AuraEnabled |
| | | public String RecordTypeId; |
| | | @AuraEnabled |
| | | public Boolean URFContractC; |
| | | } |
| | | } |
| | |
| | | public static InitData init(String recordId){ |
| | | InitData res = new initData(); |
| | | try{ |
| | | Repair__c report = [SELECT Status1__c,Rental_Apply_Equipment_Set_Detail__c,Rental_Apply_Equipment_Set_Detail_Id__c,Latest_Collect_Date_Priority__c,if_Rental_Apply__c,Offer_Rental_New__c,ProduceCompany_hand__c,CFDA_No_Hand__c,MBC_AwareDate__c,InsReport__c,QIS_ID__c,On_Call_ID__c,RepairSubOrder__c,ProductFailureRelated__c,Delay15Min__c,ProblemOccurredSelect__c,Repair_Source__c ,Failure_Occurrence_Date__c ,MaintenanceContractType__c ,OperationOrExaminationName__c ,WhatProject__c ,FailureQInHospital__c ,ReportAdverseEvents__c ,InformationFrom__c ,AfterFailureInformation__c ,ProblemOccurred__c ,SupportingProducts__c ,ifDeadHurt__c ,UseFailProductFinish__c ,DelayReportReason__c ,BreakORFallOff__c ,DateReceiptQuestions__c ,DeliveryLogisticsAnnotation__c ,DeliveryLogisticsNo__c ,engineerSendDate__c ,DeliveryLogisticsMode__c ,RepairApplicantDepartment__c ,RepairApplicantHospital__c ,RepairApplicant__c ,Repair_Detail__c ,Returns_Product_way__c ,work_location_select__c ,On_site_repair__c ,SalesOfficeCode_selection__c ,Incharge_Staff_Contact__c ,Incharge_Staff__c ,Dealer__c ,RepairCostType__c ,Account__c,Department_Class__c ,Hospital__c ,PaperRepairRequestNo__c ,part_arrangement_complete__c,Repair_Shipped_Date__c,OCSMAdministrativeReportStatus__c,Incharge_Staff_Email__c,Name,HP_Name__c,Delivered_Product__c, |
| | | Repair__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_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.detailedAddress = report.Detailed_Address__c; |
| | | res.numberofEffectiveContract = report.Number_of_EffectiveContract__c; |
| | | res.newProductGuaranteTxt = report.NewProductGuarante_Txt__c; |
| | | res.maintenanceContract = report.Maintenance_Contract__c; |
| | | res.VMMaintenanceContract = report.VM_Maintenance_Contract__c; |
| | | res.FSEState = report.FSE_State__c; |
| | | res.repairSource = report.RepairSource__c; |
| | | res.quickRepairSign = report.Quick_Repair_Sign__c; |
| | | res.RCCD = report.RCCD__c; |
| | | res.salesDeptHP = report.Sales_Dept_HP__c; |
| | | res.isAohuiProduct = report.is_aohui_product__c; |
| | | res.stateHospital = report.State_Hospital__c; |
| | | res.assetOwner = report.Asset_Owner__c; |
| | | res.deliveredProductId = report.Delivered_Product__r.Id; |
| | | res.FSEApplyForRepairTime = report.FSE_ApplyForRepair_time__c; |
| | | res.maintenanceContractId = report.Maintenance_Contract__r.Id; |
| | | res.URFLimitSerial = report.URFLimitSerial__c; |
| | | res.status = report.Status__c; |
| | | res.dealerId = report.Dealer__r.Id; |
| | | res.dayLater30 = report.Day_later_30__c; |
| | | res.recallCorrespondence = report.Recall_Correspondence__c; |
| | | res.URFReapir = report.URF_Reapir__c; |
| | | res.inchargeStaffId = report.Incharge_Staff__r.Id; |
| | | res.DWSign = report.DW_Sign__c; |
| | | res.DOJStatus = report.DOJ_Status__c; |
| | | res.SAPcondition = report.SAP_condition__c; |
| | | res.AWSDataId = report.AWS_Data_Id__c; |
| | | |
| | | res.Status1C = report.Status1__c; |
| | | res.ProblemOccurredSelectC = report.ProblemOccurredSelect__c; |
| | | res.Delay15MinC = report.Delay15Min__c; |
| | |
| | | } |
| | | } |
| | | |
| | | //通过deliveredProductId作为Id查询Asset的记录并返回 |
| | | @AuraEnabled |
| | | public static List<Asset> queryForEquipments(String deliveredProductId){ |
| | | try { |
| | | List<Asset> assets = [SELECT Id, Status FROM Asset WHERE Id = :deliveredProductId]; |
| | | return assets; |
| | | } catch (Exception e) { |
| | | throw new AuraHandledException(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | //通过Maintenance_Contract__c和Asset__c字段查询Maintenance_Contract_Asset__c的记录并返回 |
| | | @AuraEnabled |
| | | public static List<Maintenance_Contract_Asset__c> queryForUrfAsset(String maintenanceContractId,String deliveredProductId){ |
| | | try { |
| | | List<Maintenance_Contract_Asset__c> assets = [SELECT Id,URF_Series_F__c,Series_MaxRepairCount_F__c,Series_RepairCount_F__c FROM Maintenance_Contract_Asset__c WHERE Maintenance_Contract__c =:maintenanceContractId and Asset__c=:deliveredProductId]; |
| | | return assets; |
| | | } catch (Exception e) { |
| | | throw new AuraHandledException(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | //通过URFLimitSerial作为Id查询ProductURF__c的记录并返回 |
| | | @AuraEnabled |
| | | public static List<ProductURF__c> queryForUrfSeriesInfo(String URFLimitSerial){ |
| | | try { |
| | | List<ProductURF__c> urfs = [SELECT Id,URFLimitSerial__c FROM ProductURF__c WHERE ID=:URFLimitSerial]; |
| | | return urfs; |
| | | } catch (Exception e) { |
| | | throw new AuraHandledException(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | //通过Maintenance_Contract__c,Status1__c和Delivered_Product__r.Product2.ProductURF__r.URFLimitSerial__c字段查询Repair__c中的记录并返回 |
| | | @AuraEnabled |
| | | public static List<Repair__c> queryForRepairCount(String maintenanceContractId,String status1,String URFLimitSerial){ |
| | | try { |
| | | List<Repair__c> repairs = [SELECT Id,name FROM Repair__c WHERE Maintenance_Contract__c=:maintenanceContractId AND Status1__c=:status1 AND Delivered_Product__r.Product2.ProductURF__r.URFLimitSerial__c = :URFLimitSerial]; |
| | | return repairs; |
| | | } catch (Exception e) { |
| | | throw new AuraHandledException(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | //通过Is_Validity__c和Id字段查询Account的记录并返回 |
| | | @AuraEnabled |
| | | public static List<Account> queryForFindInvalidLicense(Boolean isValidity,String dealerId){ |
| | | try { |
| | | List<Account> accounts = [select Id,Is_Validity__c from Account where Is_Validity__c = false And Id = :dealerId]; |
| | | return accounts; |
| | | } catch (Exception e) { |
| | | throw new AuraHandledException(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | //通过inchargeStaffId作为Id查询User中的记录并返回 |
| | | @AuraEnabled |
| | | public static List<User> queryForReocrds(String inchargeStaffId){ |
| | | try { |
| | | List<User> users = [SELECT Id, JingliApprovalManager__c, BuchangApprovalManager__c, ZongjianApprovalManager__c FROM User WHERE Id = :inchargeStaffId]; |
| | | return users; |
| | | } catch (Exception e) { |
| | | throw new AuraHandledException(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | //通过Id查询Repair__c中的记录并返回 |
| | | @AuraEnabled |
| | | public static List<Repair__c> queryForRds(String recordId){ |
| | | try { |
| | | List<Repair__c> res = [SELECT Id,NewProductGuarante_Formula__c,ProductGuarante_Create__c FROM Repair__c WHERE Id = :recordId]; |
| | | return res; |
| | | } catch (Exception e) { |
| | | throw new AuraHandledException(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | //通过Id查询Repair__c中的Dealer__c,再根据Dealer__c查询Account中的记录并返回 |
| | | @AuraEnabled |
| | | public static List<Account> queryForrecords3(String recordId){ |
| | | try { |
| | | Repair__c repair = [select Repair__c.Dealer__c from Repair__c where Id =:recordId]; |
| | | List<Account> accounts = [select id, FirstParagraph__c from Account where name =:repair.Dealer__c]; |
| | | return accounts; |
| | | } catch (Exception e) { |
| | | throw new AuraHandledException(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | //更新Repair__c中的记录,将Maintenance_Contract__c和MaintenanceContractType__c字段更新为空,若捕获到异常则返回错误信息 |
| | | @AuraEnabled |
| | | public static String updateForRepair1(String recordId){ |
| | | try { |
| | | Repair__c repair = new Repair__c(); |
| | | repair.ID = recordId; |
| | | repair.Maintenance_Contract__c = null; |
| | | repair.MaintenanceContractType__c = null; |
| | | update repair; |
| | | return null; |
| | | } catch (Exception e) { |
| | | String eMessage = e.getMessage(); |
| | | Integer left = eMessage.indexOf(',') + 1; |
| | | Integer right = eMessage.length(); |
| | | return eMessage.substring(left,right); |
| | | } |
| | | } |
| | | |
| | | //更新Repair__c中的记录,若捕获到异常则返回错误信息 |
| | | @AuraEnabled |
| | | public static String updateRepair2(String recordId,User staff,Boolean DWSign,String statusc,String DOJStatus,String SAPcondition){ |
| | | try { |
| | | Repair__c repair = new Repair__c(); |
| | | repair.Id = recordId; |
| | | repair.JingliApprovalManager__c = |
| | | staff.JingliApprovalManager__c == null |
| | | ? staff.Id |
| | | : staff.JingliApprovalManager__c; |
| | | repair.BuchangApprovalManager__c = |
| | | staff.BuchangApprovalManager__c == null |
| | | ? staff.Id |
| | | : staff.BuchangApprovalManager__c; |
| | | repair.ZongjianApprovalManager__c = |
| | | staff.ZongjianApprovalManager__c == null |
| | | ? staff.Id |
| | | : staff.ZongjianApprovalManager__c; |
| | | repair.FSE_ApplyForRepair_time__c = Datetime.now(); |
| | | repair.DW_Sign_Txt__c = DWSign; //20210608 ljh SFDC-C3CCN4 end |
| | | repair.Status__c = statusc; |
| | | repair.Service_contract_judege_day__c = Date.today(); |
| | | if ( |
| | | DOJStatus == LightingButtonConstant.REPAIR_FIELD_DOJ_STATUS_NOT_OBJECT && |
| | | SAPcondition == LightingButtonConstant.REPAIR_FIELD_SAP_CONDITION_IS_TRUE |
| | | ) { |
| | | repair.SAP_Transfer_time__c = Datetime.now(); |
| | | } |
| | | update repair; |
| | | return null; |
| | | } catch (Exception e) { |
| | | String eMessage = e.getMessage(); |
| | | Integer left = eMessage.indexOf(',') + 1; |
| | | Integer right = eMessage.length(); |
| | | return eMessage.substring(left,right); |
| | | } |
| | | } |
| | | |
| | | public class InitData{ |
| | | @AuraEnabled |
| | | public String detailedAddress; |
| | | @AuraEnabled |
| | | public String numberofEffectiveContract; |
| | | @AuraEnabled |
| | | public String newProductGuaranteTxt; |
| | | @AuraEnabled |
| | | public String maintenanceContract; |
| | | @AuraEnabled |
| | | public String VMMaintenanceContract; |
| | | @AuraEnabled |
| | | public String FSEState; |
| | | @AuraEnabled |
| | | public String repairSource; |
| | | @AuraEnabled |
| | | public Boolean quickRepairSign; |
| | | @AuraEnabled |
| | | public String RCCD; |
| | | @AuraEnabled |
| | | public String salesDeptHP; |
| | | @AuraEnabled |
| | | public Boolean isAohuiProduct; |
| | | @AuraEnabled |
| | | public String stateHospital; |
| | | @AuraEnabled |
| | | public String assetOwner; |
| | | @AuraEnabled |
| | | public String deliveredProductId; |
| | | @AuraEnabled |
| | | public Datetime FSEApplyForRepairTime; |
| | | @AuraEnabled |
| | | public String maintenanceContractId; |
| | | @AuraEnabled |
| | | public String URFLimitSerial; |
| | | @AuraEnabled |
| | | public String status; |
| | | @AuraEnabled |
| | | public String dealerId; |
| | | @AuraEnabled |
| | | public String dayLater30; |
| | | @AuraEnabled |
| | | public Boolean recallCorrespondence; |
| | | @AuraEnabled |
| | | public Boolean URFReapir; |
| | | @AuraEnabled |
| | | public String inchargeStaffId; |
| | | @AuraEnabled |
| | | public Boolean DWSign; |
| | | @AuraEnabled |
| | | public String DOJStatus; |
| | | @AuraEnabled |
| | | public String SAPcondition; |
| | | @AuraEnabled |
| | | public String AWSDataId; |
| | | |
| | | @AuraEnabled |
| | | public String Status1C; |
| | | @AuraEnabled |
| | | public String RepairSubOrderC; |
| New file |
| | |
| | | import { createElement } from 'lwc'; |
| | | import LexASACEditorRepair from 'c/lexASACEditorRepair'; |
| | | |
| | | describe('c-lex-asac-editor-repair', () => { |
| | | afterEach(() => { |
| | | // The jsdom instance is shared across test cases in a single file so reset the DOM |
| | | while (document.body.firstChild) { |
| | | document.body.removeChild(document.body.firstChild); |
| | | } |
| | | }); |
| | | |
| | | it('TODO: test case generated by CLI command, please fill in test logic', () => { |
| | | // Arrange |
| | | const element = createElement('c-lex-asac-editor-repair', { |
| | | is: LexASACEditorRepair |
| | | }); |
| | | |
| | | // Act |
| | | document.body.appendChild(element); |
| | | |
| | | // Assert |
| | | // const div = element.shadowRoot.querySelector('div'); |
| | | expect(1).toBe(1); |
| | | }); |
| | | }); |
| New file |
| | |
| | | <template> |
| | | <div class="exampleHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { |
| | | LightningElement, |
| | | wire, |
| | | api |
| | | } from 'lwc'; |
| | | import { |
| | | CurrentPageReference |
| | | } from "lightning/navigation"; |
| | | import { |
| | | CloseActionScreenEvent |
| | | } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/otherButtonRepairController.init'; |
| | | import selectPAEDecisionRecord from '@salesforce/apex/otherButtonRepairController.selectPAEDecisionRecord'; |
| | | |
| | | export default class LexASACEditorRepair extends LightningElement { |
| | | @api recordId; |
| | | str; |
| | | IsLoading = true; |
| | | Id;; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | connectedCallback() { |
| | | console.log(this.recordId); |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.Id = result.Id; |
| | | |
| | | this.ASACEditor(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }).finally(() => { |
| | | |
| | | }); |
| | | } |
| | | |
| | | //Final universal code编辑 |
| | | ASACEditor() { |
| | | var RepairId = this.Id; |
| | | var RecordTypeId = "ASACDecision"; |
| | | var url = ''; |
| | | selectPAEDecisionRecord({ |
| | | recordId: RepairId, |
| | | recordTypeId: RecordTypeId |
| | | }).then(result => { |
| | | if (result != null) { |
| | | if (result.length > 0) { |
| | | url = "/apex/PAEDecisionRecord?Id=" + result[0].Id + "&RepairId=" + RepairId + "&RecordTypeIds=" + RecordTypeId; |
| | | } else { |
| | | url = "/apex/PAEDecisionRecord?RepairId=" + RepairId + "&RecordTypeIds=" + RecordTypeId; |
| | | } |
| | | window.open(url, '_self'); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }) |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <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 |
| | |
| | | import { createElement } from 'lwc'; |
| | | import LexAddress from 'c/lexAddress'; |
| | | |
| | | describe('c-lex-address', () => { |
| | | afterEach(() => { |
| | | // The jsdom instance is shared across test cases in a single file so reset the DOM |
| | | while (document.body.firstChild) { |
| | | document.body.removeChild(document.body.firstChild); |
| | | } |
| | | }); |
| | | |
| | | it('TODO: test case generated by CLI command, please fill in test logic', () => { |
| | | // Arrange |
| | | const element = createElement('c-lex-address', { |
| | | is: LexAddress |
| | | }); |
| | | |
| | | // Act |
| | | document.body.appendChild(element); |
| | | |
| | | // Assert |
| | | // const div = element.shadowRoot.querySelector('div'); |
| | | expect(1).toBe(1); |
| | | }); |
| | | }); |
| New file |
| | |
| | | <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> |
| New file |
| | |
| | | import { |
| | | LightningElement, |
| | | wire, |
| | | api |
| | | } from 'lwc'; |
| | | import { |
| | | CurrentPageReference |
| | | } from "lightning/navigation"; |
| | | import { |
| | | CloseActionScreenEvent |
| | | } from 'lightning/actions'; |
| | | |
| | | import init from '@salesforce/apex/otherButtonRepairController.init'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | |
| | | export default class LexAddress extends LightningElement { |
| | | @api recordId; |
| | | str; |
| | | IsLoading = true; |
| | | Id; |
| | | RecordTypeId; |
| | | partArrangementCompleteC; |
| | | RepairShippedDateC; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | connectedCallback() { |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.Id = result.Id; |
| | | this.RecordTypeId = result.RecordTypeId; |
| | | this.RepairShippedDateC = result.RepairShippedDateC; |
| | | this.partArrangementCompleteC = result.partArrangementCompleteC; |
| | | |
| | | this.Address(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }).finally(() => { |
| | | |
| | | }); |
| | | } |
| | | |
| | | //直返收货地址 |
| | | Address() { |
| | | if (this.partArrangementCompleteC != undefined) { |
| | | this.ShowToastEvent( '零件已齐备完毕,直返收货地址不能修改!',"error") |
| | | // alert('零件已齐备完毕,直返收货地址不能修改!'); |
| | | } else if (this.RepairShippedDateC != undefined) { |
| | | this.ShowToastEvent('RC修理品已返送,直返收货地址不能修改!',"error") |
| | | // alert('RC修理品已返送,直返收货地址不能修改!'); |
| | | } else { |
| | | window.open("/apex/StraightBackAddress?id=" + this.Id, '_self'); |
| | | } |
| | | } |
| | | |
| | | //弹框 |
| | | ShowToastEvent(msg,type) { |
| | | const event = new ShowToastEvent({ |
| | | title: '', |
| | | message: msg, |
| | | variant: type |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <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 |
| | |
| | | import { createElement } from 'lwc'; |
| | | import LexCopyRepair from 'c/lexCopyRepair'; |
| | | |
| | | describe('c-lex-copy-repair', () => { |
| | | afterEach(() => { |
| | | // The jsdom instance is shared across test cases in a single file so reset the DOM |
| | | while (document.body.firstChild) { |
| | | document.body.removeChild(document.body.firstChild); |
| | | } |
| | | }); |
| | | |
| | | it('TODO: test case generated by CLI command, please fill in test logic', () => { |
| | | // Arrange |
| | | const element = createElement('c-lex-copy-repair', { |
| | | is: LexCopyRepair |
| | | }); |
| | | |
| | | // Act |
| | | document.body.appendChild(element); |
| | | |
| | | // Assert |
| | | // const div = element.shadowRoot.querySelector('div'); |
| | | expect(1).toBe(1); |
| | | }); |
| | | }); |
| New file |
| | |
| | | <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> |
| New file |
| | |
| | | import { |
| | | LightningElement, |
| | | wire, |
| | | api |
| | | } from 'lwc'; |
| | | import { |
| | | CurrentPageReference |
| | | } from "lightning/navigation"; |
| | | import { |
| | | CloseActionScreenEvent |
| | | } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/otherButtonRepairController.init'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | |
| | | export default class LexCopyRepair extends LightningElement { |
| | | @api recordId; |
| | | str; |
| | | IsLoading = true; |
| | | Id; |
| | | RecordTypeId; |
| | | Name; |
| | | DeliveredProductC; |
| | | DeliveredProductIdC; |
| | | PaperRepairRequestNoC; |
| | | HospitalC; |
| | | AccountC; |
| | | DepartmentClassC; |
| | | RepairCostTypeC; |
| | | DealerC; |
| | | InchargeStaffC; |
| | | InchargeStaffContactC; |
| | | SalesOfficeCodeSelectionC; |
| | | OnSiteRepairC; |
| | | workLocationSelectC; |
| | | ReturnsProductWayC; |
| | | RepairDetailC; |
| | | RepairApplicantC; |
| | | RepairApplicantHospitalC; |
| | | RepairApplicantDepartmentC; |
| | | DeliveryLogisticsModeC; |
| | | engineerSendDateC; |
| | | DeliveryLogisticsNoC; |
| | | DeliveryLogisticsAnnotationC; |
| | | DateReceiptQuestionsC; |
| | | BreakORFallOffC; |
| | | DelayReportReasonC; |
| | | UseFailProductFinishC; |
| | | ifDeadHurtC; |
| | | SupportingProductsC; |
| | | ProblemOccurredC; |
| | | AfterFailureInformationC; |
| | | InformationFromC; |
| | | ReportAdverseEventsC; |
| | | FailureQInHospitalC; |
| | | WhatProjectC; |
| | | OperationOrExaminationNameC; |
| | | MaintenanceContractTypeC; |
| | | FailureOccurrenceDateC; |
| | | RepairSourceC; |
| | | ProblemOccurredSelectC; |
| | | Delay15MinC; |
| | | ProductFailureRelatedC; |
| | | RepairSubOrderC; |
| | | OnCallIDC; |
| | | QISIDC; |
| | | InsReportC; |
| | | MBCAwareDateC; |
| | | CFDANoHandC; |
| | | ProduceCompanyHandC; |
| | | OfferRentalNewC; |
| | | ifRentalApplyC; |
| | | LatestCollectDatePriorityC; |
| | | RentalApplyEquipmentSetDetailIdC; |
| | | RentalApplyEquipmentSetDetailC; |
| | | AwareDateC; |
| | | OCSMAdministrativeReportNumberC; |
| | | OCSMAdministrativeReportStatusC; |
| | | OCSMAdministrativeReportDateC; |
| | | Status1C; |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | connectedCallback() { |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.Id = result.Id; |
| | | this.RecordTypeId = result.RecordTypeId; |
| | | this.Name = result.Name == undefined ? "" : result.Name; |
| | | this.DeliveredProductC = result.DeliveredProductC == undefined ? "" : result.DeliveredProductC; |
| | | this.PaperRepairRequestNoC = result.PaperRepairRequestNoC == undefined ? "" : result.PaperRepairRequestNoC; |
| | | this.HospitalC = result.HospitalC == undefined ? "" : result.HospitalC; |
| | | this.DepartmentClassC = result.DepartmentClassC == undefined ? "" : result.DepartmentClassC; |
| | | this.RepairCostTypeC = result.RepairCostTypeC == undefined ? "" : result.RepairCostTypeC; |
| | | this.DealerC = result.DealerC == undefined ? "" : result.DealerC; |
| | | this.InchargeStaffC = result.InchargeStaffC == undefined ? "" : result.InchargeStaffC; |
| | | this.InchargeStaffContactC = result.InchargeStaffContactC == undefined ? "" : result.InchargeStaffContactC; |
| | | this.SalesOfficeCodeSelectionC = result.SalesOfficeCodeSelectionC == undefined ? "" : result.SalesOfficeCodeSelectionC; |
| | | this.OnSiteRepairC = result.OnSiteRepairC == undefined ? "" : result.OnSiteRepairC; |
| | | this.workLocationSelectC = result.workLocationSelectC == undefined ? "" : result.workLocationSelectC; |
| | | this.ReturnsProductWayC = result.ReturnsProductWayC == undefined ? "" : result.ReturnsProductWayC; |
| | | this.RepairDetailC = result.RepairDetailC == undefined ? "" : result.RepairDetailC; |
| | | this.RepairApplicantC = result.RepairApplicantC == undefined ? "" : result.RepairApplicantC; |
| | | this.RepairApplicantHospitalC = result.RepairApplicantHospitalC == undefined ? "" : result.RepairApplicantHospitalC; |
| | | this.RepairApplicantDepartmentC = result.RepairApplicantDepartmentC == undefined ? "" : result.RepairApplicantDepartmentC; |
| | | this.DeliveryLogisticsModeC = result.DeliveryLogisticsModeC == undefined ? "" : result.DeliveryLogisticsModeC; |
| | | this.engineerSendDateC = result.engineerSendDateC == undefined ? "" : result.engineerSendDateC; |
| | | this.DeliveryLogisticsNoC = result.DeliveryLogisticsNoC == undefined ? "" : result.DeliveryLogisticsNoC; |
| | | this.DeliveryLogisticsAnnotationC = result.DeliveryLogisticsAnnotationC == undefined ? "" : result.DeliveryLogisticsAnnotationC; |
| | | this.DateReceiptQuestionsC = result.DateReceiptQuestionsC == undefined ? "" : result.DateReceiptQuestionsC; |
| | | this.BreakORFallOffC = result.BreakORFallOffC == undefined ? "" : result.BreakORFallOffC; |
| | | this.DelayReportReasonC = result.DelayReportReasonC == undefined ? "" : result.DelayReportReasonC; |
| | | this.UseFailProductFinishC = result.UseFailProductFinishC == undefined ? "" : result.UseFailProductFinishC; |
| | | this.ifDeadHurtC = result.ifDeadHurtC == undefined ? "" : result.ifDeadHurtC; |
| | | this.SupportingProductsC = result.SupportingProductsC == undefined ? "" : result.SupportingProductsC; |
| | | this.ProblemOccurredC = result.ProblemOccurredC == undefined ? "" : result.ProblemOccurredC; |
| | | this.AfterFailureInformationC = result.AfterFailureInformationC == undefined ? "" : result.AfterFailureInformationC; |
| | | this.InformationFromC = result.InformationFromC == undefined ? "" : result.InformationFromC; |
| | | this.ReportAdverseEventsC = result.ReportAdverseEventsC == undefined ? "" : result.ReportAdverseEventsC; |
| | | this.FailureQInHospitalC = result.FailureQInHospitalC == undefined ? "" : result.FailureQInHospitalC; |
| | | this.WhatProjectC = result.WhatProjectC == undefined ? "" : result.WhatProjectC; |
| | | this.OperationOrExaminationNameC = result.OperationOrExaminationNameC == undefined ? "" : result.OperationOrExaminationNameC; |
| | | this.MaintenanceContractTypeC = result.MaintenanceContractTypeC == undefined ? "" : result.MaintenanceContractTypeC; |
| | | this.FailureOccurrenceDateC = result.FailureOccurrenceDateC == undefined ? "" : result.FailureOccurrenceDateC; |
| | | this.RepairSourceC = result.RepairSourceC == undefined ? "" : result.RepairSourceC; |
| | | this.ProblemOccurredSelectC = result.ProblemOccurredSelectC == undefined ? "" : result.ProblemOccurredSelectC; |
| | | this.Delay15MinC = result.Delay15MinC == undefined ? "" : result.Delay15MinC; |
| | | this.ProductFailureRelatedC = result.ProductFailureRelatedC == undefined ? "" : result.ProductFailureRelatedC; |
| | | this.RepairSubOrderC = result.RepairSubOrderC == undefined ? "" : result.RepairSubOrderC; |
| | | this.OnCallIDC = result.OnCallIDC == undefined ? "" : result.OnCallIDC; |
| | | this.QISIDC = result.QISIDC == undefined ? "" : result.QISIDC; |
| | | this.InsReportC = result.InsReportC == undefined ? "" : result.InsReportC; |
| | | this.MBCAwareDateC = result.MBCAwareDateC == undefined ? "" : result.MBCAwareDateC; |
| | | this.CFDANoHandC = result.CFDANoHandC == undefined ? "" : result.CFDANoHandC; |
| | | this.ProduceCompanyHandC = result.ProduceCompanyHandC == undefined ? "" : result.ProduceCompanyHandC; |
| | | this.OfferRentalNewC = result.OfferRentalNewC == undefined ? "" : result.OfferRentalNewC; |
| | | this.ifRentalApplyC = result.ifRentalApplyC == undefined ? "" : result.AifRentalApplyCccountC; |
| | | this.LatestCollectDatePriorityC = result.LatestCollectDatePriorityC == undefined ? "" : result.LatestCollectDatePriorityC; |
| | | this.RentalApplyEquipmentSetDetailIdC = result.RentalApplyEquipmentSetDetailIdC == undefined ? "" : result.RentalApplyEquipmentSetDetailIdC; |
| | | this.RentalApplyEquipmentSetDetailC = result.RentalApplyEquipmentSetDetailC == undefined ? "" : result.RentalApplyEquipmentSetDetailC; |
| | | this.AwareDateC = result.AwareDateC == undefined ? "" : result.AwareDateC; |
| | | this.OCSMAdministrativeReportNumberC = result.OCSMAdministrativeReportNumberC == undefined ? "" : result.OCSMAdministrativeReportNumberC; |
| | | this.OCSMAdministrativeReportStatusC = result.OCSMAdministrativeReportStatusC == undefined ? "" : result.OCSMAdministrativeReportStatusC; |
| | | this.AccountC = result.AccountC == undefined ? "" : result.AccountC; |
| | | this.OCSMAdministrativeReportDateC = result.OCSMAdministrativeReportDateC == undefined ? "" : result.OCSMAdministrativeReportDateC; |
| | | this.Status1C = result.Status1C; |
| | | |
| | | this.CopyRepair(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }).finally(() => { |
| | | |
| | | }); |
| | | } |
| | | |
| | | // 复制 |
| | | 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); |
| | | } else { |
| | | this.ShowToastEvent("该状态下不能复制", "error") |
| | | // alert("该状态下不能复制"); |
| | | } |
| | | } |
| | | |
| | | ShowToastEvent(msg, type) { |
| | | const event = new ShowToastEvent({ |
| | | title: '', |
| | | message: msg, |
| | | variant: type |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <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 |
| | |
| | | import { createElement } from 'lwc'; |
| | | import LexCustomDelete from 'c/lexCustomDelete'; |
| | | |
| | | describe('c-lex-custom-delete', () => { |
| | | afterEach(() => { |
| | | // The jsdom instance is shared across test cases in a single file so reset the DOM |
| | | while (document.body.firstChild) { |
| | | document.body.removeChild(document.body.firstChild); |
| | | } |
| | | }); |
| | | |
| | | it('TODO: test case generated by CLI command, please fill in test logic', () => { |
| | | // Arrange |
| | | const element = createElement('c-lex-custom-delete', { |
| | | is: LexCustomDelete |
| | | }); |
| | | |
| | | // Act |
| | | document.body.appendChild(element); |
| | | |
| | | // Assert |
| | | // const div = element.shadowRoot.querySelector('div'); |
| | | expect(1).toBe(1); |
| | | }); |
| | | }); |
| New file |
| | |
| | | <template> |
| | | <div class="exampleHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { |
| | | LightningElement, |
| | | wire, |
| | | api |
| | | } from 'lwc'; |
| | | import { |
| | | CurrentPageReference |
| | | } from "lightning/navigation"; |
| | | import { |
| | | CloseActionScreenEvent |
| | | } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/otherButtonRepairController.init'; |
| | | import selectCustomDeleteById from '@salesforce/apex/otherButtonRepairController.selectCustomDeleteById'; |
| | | import deleteRepair from '@salesforce/apex/otherButtonRepairController.deleteRepair'; |
| | | |
| | | |
| | | export default class LexCustomDelete extends LightningElement { |
| | | @api recordId; |
| | | str; |
| | | IsLoading = true; |
| | | Id; |
| | | userID; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | connectedCallback() { |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.Id = result.Id; |
| | | this.userID = result.userID; |
| | | |
| | | this.CustomDelete(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }).finally(() => { |
| | | |
| | | }); |
| | | } |
| | | |
| | | // 删除 |
| | | CustomDelete() { |
| | | selectCustomDeleteById({ |
| | | recordId: this.Id |
| | | }).then(repList => { |
| | | if (repList != null && repList.length > 0) { |
| | | var rp = repList[0]; |
| | | if (rp.Status__c != "草案中" && |
| | | rp.Status__c != "1.受理完毕(SAP待发送)" && |
| | | rp.Status__c != "4.修理品返送阶段" |
| | | ) { |
| | | alert("不是草案中,不能删除"); |
| | | } else if (rp.Status__c == "4.修理品返送阶段" && |
| | | (rp.SAP_Transfer_time__c != "" || rp.Repair_Ordered_Date__c != "") |
| | | ) { |
| | | alert("已经发送过SAP,不能删除"); |
| | | } 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)) { |
| | | alert("不是所有人、创建人或FSE主负责人,不能删除"); |
| | | } else { |
| | | if (confirm("是否确定?")) { |
| | | deleteRepair({ |
| | | rid: rp.Id |
| | | }).then(rtn => { |
| | | if (rtn == "OK") { |
| | | window.location.href = "/a0J/o"; |
| | | } else { |
| | | alert(rtn); |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <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> |