FUYU
2023-12-13 4488f711dbc01a8db6753907cae2ef4021dede68
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
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);
    }
}