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);
|
}
|
}
|