From dc6cc6f10fe0a5718ea71033dd39898471eabc3e Mon Sep 17 00:00:00 2001
From: twysparks <twysparks@163.com>
Date: 星期四, 20 四月 2023 14:07:25 +0800
Subject: [PATCH] TT
---
force-app/main/default/classes/buttonMaintenanceContractEstimateCtl.cls-meta.xml | 5
force-app/main/default/lwc/lexAddress/lexAddress.html | 6
force-app/main/default/lwc/lexAddress/lexAddress.js-meta.xml | 11
force-app/main/default/lwc/lexCustomDelete/lexCustomDelete.html | 5
force-app/main/default/classes/otherButtonRepairController.cls | 231 ++++++++++++
force-app/main/default/lwc/lexASACEditorRepair/lexASACEditorRepair.js-meta.xml | 11
force-app/main/default/lwc/lexASACEditorRepair/__tests__/lexASACEditorRepair.test.js | 25 +
force-app/main/default/lwc/lexCopyRepair/lexCopyRepair.html | 6
force-app/main/default/lwc/lexCustomDelete/lexCustomDelete.js-meta.xml | 11
force-app/main/default/classes/buttonOnCallCtl.cls-meta.xml | 5
force-app/main/default/lwc/lexCopyRepair/__tests__/lexCopyRepair.test.js | 25 +
force-app/main/default/classes/buttonRepairQuotationCtl.cls-meta.xml | 5
force-app/main/default/lwc/lexASACEditorRepair/lexASACEditorRepair.js | 73 ++++
force-app/main/default/lwc/lexCustomDelete/lexCustomDelete.js | 89 ++++
force-app/main/default/classes/buttonMaintenanceContractEstimateCtl.cls | 44 ++
force-app/main/default/lwc/lexAddress/__tests__/lexAddress.test.js | 25 +
force-app/main/default/classes/buttonRepairQuotationCtl.cls | 62 +++
force-app/main/default/lwc/lexCopyRepair/lexCopyRepair.js | 218 ++++++++++++
force-app/main/default/lwc/lexCustomDelete/__tests__/lexCustomDelete.test.js | 25 +
force-app/main/default/lwc/lexCopyRepair/lexCopyRepair.js-meta.xml | 11
force-app/main/default/lwc/lexASACEditorRepair/lexASACEditorRepair.html | 5
force-app/main/default/lwc/lexAddress/lexAddress.js | 80 ++++
force-app/main/default/classes/buttonOnCallCtl.cls | 25 +
force-app/main/default/classes/otherButtonMaintenanceContractCtl.cls | 29 +
24 files changed, 1,029 insertions(+), 3 deletions(-)
diff --git a/force-app/main/default/classes/buttonMaintenanceContractEstimateCtl.cls b/force-app/main/default/classes/buttonMaintenanceContractEstimateCtl.cls
new file mode 100644
index 0000000..93f292b
--- /dev/null
+++ b/force-app/main/default/classes/buttonMaintenanceContractEstimateCtl.cls
@@ -0,0 +1,44 @@
+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;
+ }
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/buttonMaintenanceContractEstimateCtl.cls-meta.xml b/force-app/main/default/classes/buttonMaintenanceContractEstimateCtl.cls-meta.xml
new file mode 100644
index 0000000..9bbf7b4
--- /dev/null
+++ b/force-app/main/default/classes/buttonMaintenanceContractEstimateCtl.cls-meta.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
+ <apiVersion>56.0</apiVersion>
+ <status>Active</status>
+</ApexClass>
\ No newline at end of file
diff --git a/force-app/main/default/classes/buttonOnCallCtl.cls b/force-app/main/default/classes/buttonOnCallCtl.cls
new file mode 100644
index 0000000..2622b4f
--- /dev/null
+++ b/force-app/main/default/classes/buttonOnCallCtl.cls
@@ -0,0 +1,25 @@
+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;
+ }
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/buttonOnCallCtl.cls-meta.xml b/force-app/main/default/classes/buttonOnCallCtl.cls-meta.xml
new file mode 100644
index 0000000..9bbf7b4
--- /dev/null
+++ b/force-app/main/default/classes/buttonOnCallCtl.cls-meta.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
+ <apiVersion>56.0</apiVersion>
+ <status>Active</status>
+</ApexClass>
\ No newline at end of file
diff --git a/force-app/main/default/classes/buttonRepairQuotationCtl.cls b/force-app/main/default/classes/buttonRepairQuotationCtl.cls
new file mode 100644
index 0000000..061b409
--- /dev/null
+++ b/force-app/main/default/classes/buttonRepairQuotationCtl.cls
@@ -0,0 +1,62 @@
+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;
+ }
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/buttonRepairQuotationCtl.cls-meta.xml b/force-app/main/default/classes/buttonRepairQuotationCtl.cls-meta.xml
new file mode 100644
index 0000000..9bbf7b4
--- /dev/null
+++ b/force-app/main/default/classes/buttonRepairQuotationCtl.cls-meta.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
+ <apiVersion>56.0</apiVersion>
+ <status>Active</status>
+</ApexClass>
\ No newline at end of file
diff --git a/force-app/main/default/classes/otherButtonMaintenanceContractCtl.cls b/force-app/main/default/classes/otherButtonMaintenanceContractCtl.cls
index 32661b4..771838e 100644
--- a/force-app/main/default/classes/otherButtonMaintenanceContractCtl.cls
+++ b/force-app/main/default/classes/otherButtonMaintenanceContractCtl.cls
@@ -7,8 +7,15 @@
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;
@@ -38,6 +45,18 @@
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);
}
@@ -83,5 +102,13 @@
public String ContractQuotationOrNotC;
@AuraEnabled
public Double PaymentPlanSumFirstC;
+ @AuraEnabled
+ public String StatusC;
+ @AuraEnabled
+ public Boolean IsRecognitionModelC;
+ @AuraEnabled
+ public String RecordTypeId;
+ @AuraEnabled
+ public Boolean URFContractC;
}
}
\ No newline at end of file
diff --git a/force-app/main/default/classes/otherButtonRepairController.cls b/force-app/main/default/classes/otherButtonRepairController.cls
index f244964..7e007a7 100644
--- a/force-app/main/default/classes/otherButtonRepairController.cls
+++ b/force-app/main/default/classes/otherButtonRepairController.cls
@@ -7,13 +7,40 @@
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;
@@ -233,8 +260,208 @@
}
}
+ //閫氳繃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鍜孉sset__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锛孲tatus1__c鍜孌elivered_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鍜孖d瀛楁鏌ヨ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鍜孧aintenanceContractType__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;
diff --git a/force-app/main/default/lwc/lexASACEditorRepair/__tests__/lexASACEditorRepair.test.js b/force-app/main/default/lwc/lexASACEditorRepair/__tests__/lexASACEditorRepair.test.js
new file mode 100644
index 0000000..4116118
--- /dev/null
+++ b/force-app/main/default/lwc/lexASACEditorRepair/__tests__/lexASACEditorRepair.test.js
@@ -0,0 +1,25 @@
+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);
+ });
+});
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexASACEditorRepair/lexASACEditorRepair.html b/force-app/main/default/lwc/lexASACEditorRepair/lexASACEditorRepair.html
new file mode 100644
index 0000000..d044dbb
--- /dev/null
+++ b/force-app/main/default/lwc/lexASACEditorRepair/lexASACEditorRepair.html
@@ -0,0 +1,5 @@
+<template>
+ <div class="exampleHolder" if:true={IsLoading}>
+ <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
+ </div>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexASACEditorRepair/lexASACEditorRepair.js b/force-app/main/default/lwc/lexASACEditorRepair/lexASACEditorRepair.js
new file mode 100644
index 0000000..a2468cb
--- /dev/null
+++ b/force-app/main/default/lwc/lexASACEditorRepair/lexASACEditorRepair.js
@@ -0,0 +1,73 @@
+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);
+ })
+ }
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexASACEditorRepair/lexASACEditorRepair.js-meta.xml b/force-app/main/default/lwc/lexASACEditorRepair/lexASACEditorRepair.js-meta.xml
new file mode 100644
index 0000000..3392981
--- /dev/null
+++ b/force-app/main/default/lwc/lexASACEditorRepair/lexASACEditorRepair.js-meta.xml
@@ -0,0 +1,11 @@
+<?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>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexAddress/__tests__/lexAddress.test.js b/force-app/main/default/lwc/lexAddress/__tests__/lexAddress.test.js
new file mode 100644
index 0000000..668985d
--- /dev/null
+++ b/force-app/main/default/lwc/lexAddress/__tests__/lexAddress.test.js
@@ -0,0 +1,25 @@
+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);
+ });
+});
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexAddress/lexAddress.html b/force-app/main/default/lwc/lexAddress/lexAddress.html
new file mode 100644
index 0000000..87f391a
--- /dev/null
+++ b/force-app/main/default/lwc/lexAddress/lexAddress.html
@@ -0,0 +1,6 @@
+<template>
+ <div class="exampleHolder" if:true={IsLoading}>
+ <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
+ <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button>
+ </div>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexAddress/lexAddress.js b/force-app/main/default/lwc/lexAddress/lexAddress.js
new file mode 100644
index 0000000..553708e
--- /dev/null
+++ b/force-app/main/default/lwc/lexAddress/lexAddress.js
@@ -0,0 +1,80 @@
+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);
+ }
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexAddress/lexAddress.js-meta.xml b/force-app/main/default/lwc/lexAddress/lexAddress.js-meta.xml
new file mode 100644
index 0000000..3392981
--- /dev/null
+++ b/force-app/main/default/lwc/lexAddress/lexAddress.js-meta.xml
@@ -0,0 +1,11 @@
+<?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>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexCopyRepair/__tests__/lexCopyRepair.test.js b/force-app/main/default/lwc/lexCopyRepair/__tests__/lexCopyRepair.test.js
new file mode 100644
index 0000000..4f5bab3
--- /dev/null
+++ b/force-app/main/default/lwc/lexCopyRepair/__tests__/lexCopyRepair.test.js
@@ -0,0 +1,25 @@
+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);
+ });
+});
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexCopyRepair/lexCopyRepair.html b/force-app/main/default/lwc/lexCopyRepair/lexCopyRepair.html
new file mode 100644
index 0000000..87f391a
--- /dev/null
+++ b/force-app/main/default/lwc/lexCopyRepair/lexCopyRepair.html
@@ -0,0 +1,6 @@
+<template>
+ <div class="exampleHolder" if:true={IsLoading}>
+ <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
+ <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button>
+ </div>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexCopyRepair/lexCopyRepair.js b/force-app/main/default/lwc/lexCopyRepair/lexCopyRepair.js
new file mode 100644
index 0000000..170a510
--- /dev/null
+++ b/force-app/main/default/lwc/lexCopyRepair/lexCopyRepair.js
@@ -0,0 +1,218 @@
+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);
+ }
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexCopyRepair/lexCopyRepair.js-meta.xml b/force-app/main/default/lwc/lexCopyRepair/lexCopyRepair.js-meta.xml
new file mode 100644
index 0000000..3392981
--- /dev/null
+++ b/force-app/main/default/lwc/lexCopyRepair/lexCopyRepair.js-meta.xml
@@ -0,0 +1,11 @@
+<?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>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexCustomDelete/__tests__/lexCustomDelete.test.js b/force-app/main/default/lwc/lexCustomDelete/__tests__/lexCustomDelete.test.js
new file mode 100644
index 0000000..fcc78ff
--- /dev/null
+++ b/force-app/main/default/lwc/lexCustomDelete/__tests__/lexCustomDelete.test.js
@@ -0,0 +1,25 @@
+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);
+ });
+});
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexCustomDelete/lexCustomDelete.html b/force-app/main/default/lwc/lexCustomDelete/lexCustomDelete.html
new file mode 100644
index 0000000..d044dbb
--- /dev/null
+++ b/force-app/main/default/lwc/lexCustomDelete/lexCustomDelete.html
@@ -0,0 +1,5 @@
+<template>
+ <div class="exampleHolder" if:true={IsLoading}>
+ <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
+ </div>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexCustomDelete/lexCustomDelete.js b/force-app/main/default/lwc/lexCustomDelete/lexCustomDelete.js
new file mode 100644
index 0000000..4ae611c
--- /dev/null
+++ b/force-app/main/default/lwc/lexCustomDelete/lexCustomDelete.js
@@ -0,0 +1,89 @@
+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("涓嶆槸鎵�鏈変汉銆佸垱寤轰汉鎴朏SE涓昏礋璐d汉锛屼笉鑳藉垹闄�");
+ } else {
+ if (confirm("鏄惁纭畾锛�")) {
+ deleteRepair({
+ rid: rp.Id
+ }).then(rtn => {
+ if (rtn == "OK") {
+ window.location.href = "/a0J/o";
+ } else {
+ alert(rtn);
+ }
+ })
+ }
+ }
+ }
+ })
+ }
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexCustomDelete/lexCustomDelete.js-meta.xml b/force-app/main/default/lwc/lexCustomDelete/lexCustomDelete.js-meta.xml
new file mode 100644
index 0000000..3392981
--- /dev/null
+++ b/force-app/main/default/lwc/lexCustomDelete/lexCustomDelete.js-meta.xml
@@ -0,0 +1,11 @@
+<?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>
\ No newline at end of file
--
Gitblit v1.9.1