buli
2023-04-20 f0bccccbb88d93ac05010c17d4b2e0cb22a2ce9a
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
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
import { LightningElement,wire,track,api} from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
import { CloseActionScreenEvent } from 'lightning/actions';
import { NavigationMixin } from 'lightning/navigation';
import { updateRecord } from 'lightning/uiRecordApi';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import print from '@salesforce/apex/NewPaymentPlanLoadLWCController.print';
import init from '@salesforce/apex/NewPaymentPlanLoadLWCController.init';
import save from '@salesforce/apex/NewPaymentPlanLoadLWCController.save';
 
export default class newPaymentPlanLoadLWC extends LightningElement {
    @api recordId;
    PageMCEElement = {
        Id: '',
        Phone_Number__c: '',
        Status__c: '',
        old_Is_RecognitionModel__c: '',
        Engineer_Name__c: '',
        Is_Standard_Contract__c: '',
        Term_Of_Payment__c: '',
        one_off_payment_agreed_period__c: '',
        Total_Payment_Time__c: '',
        Payment_Plan_Date_First__c: '',
        Payment_Plan_Date_Second__c: '',
        Payment_Plan_Date_Third__c: '',
        Payment_Plan_Date_Forth__c: '',
        Payment_Plan_Date_Fivth__c: '',
        Payment_Plan_Date_Sixth__c: '',
        Payment_Plan_Sum_First__c: '',
        Payment_Plan_Sum_Second__c: '',
        Payment_Plan_Sum_Third__c: '',
        Payment_Plan_Sum_Forth__c: '',
        Payment_Plan_Sum_Fivth__c: '',
        Payment_Plan_Sum_Sixth__c: '',
        Small_Repair_Time__c: '',
        Big_Repair_Time__c: '',
        Live_Technical_Support_Time__c: '',
        Tour_Check__c: '',
        Dedust__c: '',
        First_Party_Contract_Number__c: '',
        Second_Party_Contract_Number__c: '',
        Contract_Amount__c: '',
        Total_Contract_Amount_In_Words__c: '',
        Payment_Plan_Sum_First_in_Word__c: '',
        Payment_Plan_Sum_Second_in_Word__c: '',
        Payment_Plan_Sum_Third_in_Word__c: '',
        Payment_Plan_Sum_Forth_in_Word__c: '',
        Payment_Plan_Sum_Fivth_in_Word__c: '',
        Payment_Plan_Sum_Sixth_in_Word__c: '',
        Negotiate_Mean__c: '',
        Amount_Warranty_Coverage_In_Word__c: '',
        Amount_Warranty_Coverage__c: '',
        Inspection_Time__c :''
    };
    printContract;
    printAgent;
    agreeUpperLimit;
    ContractAllMonth;
    statusSave;
    activeSections = ['paymentPlan', 'TextInformation'];
    showTabOne = true;
    showTabTwice = false;
    showTabOnce = true;
    // 页面disable
    dis1;
    dis2;
    dis3;
    dis4;
    dis5;
    dis6;
    dis7;
    dis8;
    dis9;
    dis10;
    dis11;
    dis12;
    dis13;
    dis14;
    dis15;
    dis16;
    dis17;
    dis18;
    dis19;
    dis21;
    dis22;
    dis23;
    dis24;
    dis25;
    dis26;
    dis27;
    dis28;
    dis29;
    dis30;
    //是否为标准合同
    get IsStandardContractoptions() {
        return[{ label: '--无--', value: '' },
                    { label: '是', value: '是' },
                    { label: '否', value: '否' }];
    }
    
     // 付款方式              
    TermOfPaymentoptions = [{ label: '一次性付款', value: '一次性付款' },
                    { label: '多次付款', value: '多次付款' }]; 
 
     //一次性付款
     oneoffpaymentagreedperiodOptions = [{ label: '15', value: '15' },
                    { label: '30', value: '30' },
                    { label: '60', value: '60' }]; 
      //多次付款                 
    TotalPaymentTimeOption = [
                    { label: '1', value: '1' },
                    { label: '2', value: '2' },
                    { label: '3', value: '3' },
                    { label: '4', value: '4' },
                    { label: '5', value: '5' },
                    { label: '6', value: '6' }];                
      //小修理时限:             
    SmallRepairTimeOptions = [{ label: '5', value: '5' },
                    { label: '7', value: '7' },
                    { label: '10', value: '10' }]; 
       //大修理时限:             
    BigRepairTimeOptions = [{ label: '7', value: '7' },
                    { label: '10', value: '10' },
                    { label: '15', value: '15' },
                    { label: '20', value: '20' },
                    { label: '25', value: '25' },
                    { label: '30', value: '30' }];
       //现场技术支持时限:             
    LiveTechnicalSupportTimeOptions = [{ label: '24', value: '24' },
                    { label: '48', value: '48' },
                    { label: '72', value: '72' }];
      //巡回:                 
    TourCheckOptions = [{ label: '0', value: '0' },
                    { label: '1', value: '1' },
                    { label: '2', value: '2' },
                    { label: '3', value: '3' },
                    { label: '4', value: '4' }];
   //点检1                 
    InspectionTimeOptions = [
                    { label: '1', value: '1' },
                    { label: '2', value: '2' },
                    { label: '3', value: '3' },
                    { label: '4', value: '4' }];
 
    //除尘                 
    DedustOptions = [{ label: '0', value: '0' },
                    { label: '1', value: '1' },
                    { label: '2', value: '2' }];
     //合同份数:甲方:                 
    FirstPartyContractNumberOptions = [
                    { label: '1', value: '1' },
                    { label: '2', value: '2' },
                    { label: '3', value: '3' },
                    { label: '4', value: '4' },
                    { label: '5', value: '5' },
                    { label: '6', value: '6' },
                    { label: '7', value: '7' },
                    { label: '8', value: '8' },
                    { label: '9', value: '9' },
                    { label: '10', value: '10' }];  
    //合同份数:乙方:                 
    SecondPartyContractNumberOptions = [
                    { label: '1', value: '1' },
                    { label: '2', value: '2' },
                    { label: '3', value: '3' },
                    { label: '4', value: '4' },
                    { label: '5', value: '5' },
                    { label: '6', value: '6' },
                    { label: '7', value: '7' },
                    { label: '8', value: '8' },
                    { label: '9', value: '9' },
                    { label: '10', value: '10' }];  
    // 协商方式
    NegotiateMeanOptions = [
                    { label: '1', value: '1' },
                    { label: '2', value: '2' },
                    { label: '3', value: '3' }];                                                                                           
     @wire(CurrentPageReference)
    getStateParameters(currentPageReference) {
        if (currentPageReference) {
          const urlValue = currentPageReference.state.recordId;
          if (urlValue) {
            let str = `${urlValue}`;
            this.recordId = str;
          }
        }
    }
 
    connectedCallback(){
        this.recordId = 'a0H1000001DV1cp';
        init({
            recordId: this.recordId
        }).then(result => {
            if (result.PageMCE == null) {
                    const event = new ShowToastEvent({
                             title: 'warning',
                             message: result.status,
                             variant:'warning',
                            });
                    this.dispatchEvent(event);
             }
             this.PageMCEElement.Status__c                          = result.PageMCE.Status__c;
             this.ContractAllMonth                                  = result.Contract_validMonth;
             this.statusSave                                        = result.statusSave;
             this.PageMCEElement.old_Is_RecognitionModel__c         = result.PageMCE.old_Is_RecognitionModel__c;
             this.PageMCEElement.Engineer_Name__c                   = result.PageMCE.Engineer_Name__c;
             this.PageMCEElement.Is_Standard_Contract__c            = result.PageMCE.Is_Standard_Contract__c;
             this.PageMCEElement.Term_Of_Payment__c                 = result.PageMCE.Term_Of_Payment__c;
             this.PageMCEElement.one_off_payment_agreed_period__c   = result.PageMCE.one_off_payment_agreed_period__c;
             this.PageMCEElement.Total_Payment_Time__c              = result.PageMCE.Total_Payment_Time__c;
             this.PageMCEElement.Payment_Plan_Date_First__c         = result.PageMCE.Payment_Plan_Date_First__c;
             this.PageMCEElement.Payment_Plan_Date_Second__c        = result.PageMCE.Payment_Plan_Date_Second__c;
             this.PageMCEElement.Payment_Plan_Date_Third__c         = result.PageMCE.Payment_Plan_Date_Third__c;
             this.PageMCEElement.Payment_Plan_Date_Forth__c         = result.PageMCE.Payment_Plan_Date_Forth__c;
             this.PageMCEElement.Payment_Plan_Date_Fivth__c         = result.PageMCE.Payment_Plan_Date_Fivth__c;
             this.PageMCEElement.Payment_Plan_Date_Sixth__c         = result.PageMCE.Payment_Plan_Date_Sixth__c;
             this.PageMCEElement.Payment_Plan_Sum_First__c          = result.PageMCE.Payment_Plan_Sum_First__c;
             this.PageMCEElement.Payment_Plan_Sum_Second__c         = result.PageMCE.Payment_Plan_Sum_Second__c;
             this.PageMCEElement.Payment_Plan_Sum_Third__c          = result.PageMCE.Payment_Plan_Sum_Third__c;
             this.PageMCEElement.Payment_Plan_Sum_Forth__c          = result.PageMCE.Payment_Plan_Sum_Forth__c;
             this.PageMCEElement.Payment_Plan_Sum_Fivth__c          = result.PageMCE.Payment_Plan_Sum_Fivth__c;
             this.PageMCEElement.Payment_Plan_Sum_Sixth__c          = result.PageMCE.Payment_Plan_Sum_Sixth__c;
             this.PageMCEElement.Small_Repair_Time__c               = result.PageMCE.Small_Repair_Time__c;
             this.PageMCEElement.Big_Repair_Time__c                 = result.PageMCE.Big_Repair_Time__c;
             this.PageMCEElement.Live_Technical_Support_Time__c     = result.PageMCE.Live_Technical_Support_Time__c;
             this.PageMCEElement.Tour_Check__c                      = result.PageMCE.Tour_Check__c;
             this.PageMCEElement.Phone_Number__c                    = result.PageMCE.Phone_Number__c;
             this.PageMCEElement.Dedust__c                          = result.PageMCE.Dedust__c;
             this.PageMCEElement.First_Party_Contract_Number__c     = result.PageMCE.First_Party_Contract_Number__c;
             this.PageMCEElement.Second_Party_Contract_Number__c    = result.PageMCE.Second_Party_Contract_Number__c;
             this.PageMCEElement.Contract_Amount__c                 = result.PageMCE.Contract_Amount__c;
             this.PageMCEElement.Total_Contract_Amount_In_Words__c  = result.PageMCE.Total_Contract_Amount_In_Words__c;
             this.PageMCEElement.Payment_Plan_Sum_First_in_Word__c  = result.PageMCE.Payment_Plan_Sum_First_in_Word__c;
             this.PageMCEElement.Payment_Plan_Sum_Second_in_Word__c = result.PageMCE.Payment_Plan_Sum_Second_in_Word__c;
             this.PageMCEElement.Payment_Plan_Sum_Third_in_Word__c  = result.PageMCE.Payment_Plan_Sum_Third_in_Word__c;
             this.PageMCEElement.Payment_Plan_Sum_Forth_in_Word__c  = result.PageMCE.Payment_Plan_Sum_Forth_in_Word__c;
             this.PageMCEElement.Payment_Plan_Sum_Fivth_in_Word__c  = result.PageMCE.Payment_Plan_Sum_Fivth_in_Word__c;
             this.PageMCEElement.Payment_Plan_Sum_Sixth_in_Word__c  = result.PageMCE.Payment_Plan_Sum_Sixth_in_Word__c;
             this.PageMCEElement.Negotiate_Mean__c                  = result.PageMCE.Negotiate_Mean__c;
             this.PageMCEElement.Inspection_Time__c                 = result.PageMCE.Inspection_Time__c;
             this.PageMCEElement.Amount_Warranty_Coverage__c    = (result.PageMCE.Contract_Amount__c*1.3).toString();
             this.PageMCEElement.Amount_Warranty_Coverage_In_Word__c = this.smalltoBIG(this.PageMCEElement.Amount_Warranty_Coverage__c);
             this.AllChecktime();
             this.Initdisabled();
        }).catch(error => {
            console.log("error");
            console.log(error.message());
        });
    }
    handleIsStandardContract(event) {
        console.log('执行');
        this.PageMCEElement.Is_Standard_Contract__c = event.detail.value;
        if (this.PageMCEElement.Is_Standard_Contract__c == '否') {
            this.showTabOne = false;
        }else{
            this.showTabOne = true;
        }
        this.AllChecktime();
    }
    handleTermOfPayment(event) {
        this.PageMCEElement.Term_Of_Payment__c  = event.detail.value;
        if (this.PageMCEElement.Term_Of_Payment__c  == '多次付款') {
            this.showTabOnce = false;
            this.showTabTwice = true;
        }else{
            this.showTabOnce = true;
            this.showTabTwice = false;
        }
    }
    handleOneoff(event) {
        this.PageMCEElement.one_off_payment_agreed_period__c = event.detail.value;
    }
    handleSmallRepairTime(event) {
        this.PageMCEElement.Small_Repair_Time__c = event.detail.value;
    }
    handleBigRepairTime(event) {
        this.PageMCEElement.Big_Repair_Time__c = event.detail.value;
    }
    handleLiveTechnicalSupportTime(event) {
        this.PageMCEElement.Live_Technical_Support_Time__c = event.detail.value;
    }
    handleTourCheck(event) {
        this.PageMCEElement.Tour_Check__c = event.detail.value;
    }
    handleInspectionTime(event) {
         this.PageMCEElement.Inspection_Time__c = event.detail.value;
        this.AllChecktime();
    }
    handleDedust(event) {
        this.PageMCEElement.Dedust__c  = event.detail.value;
    }
    handleFirstPartyContractNumber(event) {
        this.PageMCEElement.First_Party_Contract_Number__c = event.detail.value;
    }
    handleSecondPartyContractNumber(event) {
        this.PageMCEElement.Second_Party_Contract_Number__c = event.detail.value;
    }
 
    handleTotalPaymentTime(event) {
        this.PageMCEElement.Total_Payment_Time__c = event.detail.value;
    }
    // 多次付款列
    handleDateFirst(event){
        this.PageMCEElement.Payment_Plan_Date_First__c = event.detail.value;
    }
    handleDateSecond(event){
        this.PageMCEElement.Payment_Plan_Date_Second__c = event.detail.value;
    }
    handleDateThird(event){
        this.PageMCEElement.Payment_Plan_Date_Third__c = event.detail.value;
    }
    handleDateForth(event){
        this.PageMCEElement.Payment_Plan_Date_Forth__c = event.detail.value;
    }
    handleDateFivth(event){
        this.PageMCEElement.Payment_Plan_Date_Fivth__c  = event.detail.value;
    }
    handleDateSixth(event){
        this.PageMCEElement.Payment_Plan_Date_Sixth__c = event.detail.value;
    }
    handleSumFirst(event){
        this.PageMCEElement.Payment_Plan_Sum_First__c = event.detail.value;
        this.PageMCEElement.Payment_Plan_Sum_First_in_Word__c = this.smalltoBIG(this.PageMCEElement.Payment_Plan_Sum_First__c);
    }
    handleSumSecond(event){
        this.PageMCEElement.Payment_Plan_Sum_Second__c  = event.detail.value;
        this.PageMCEElement.Payment_Plan_Sum_Second_in_Word__c = this.smalltoBIG(this.PageMCEElement.Payment_Plan_Sum_Second__c);
    }
    handleSumThird(event){
        this.PageMCEElement.Payment_Plan_Sum_Third__c = event.detail.value;
        this.PageMCEElement.Payment_Plan_Sum_Third_in_Word__c = this.smalltoBIG(this.PageMCEElement.Payment_Plan_Sum_Third__c);
    }
    handleSumForth(event){
        this.PageMCEElement.Payment_Plan_Sum_Forth__c  = event.detail.value;
        this.PageMCEElement.Payment_Plan_Sum_Forth_in_Word__c = this.smalltoBIG(this.PageMCEElement.Payment_Plan_Sum_Forth__c);
    }
    handleSumFivth(event){
        this.PageMCEElement.Payment_Plan_Sum_Fivth__c = event.detail.value;
        this.PageMCEElement.Payment_Plan_Sum_Fivth_in_Word__c = this.smalltoBIG(this.PageMCEElement.Payment_Plan_Sum_Fivth__c);
    }
    handleSumSixth(event){
        this.PageMCEElement.Payment_Plan_Sum_Sixth__c = event.detail.value;
        this.PageMCEElement.Payment_Plan_Sum_Sixth_in_Word__c = this.smalltoBIG(this.PageMCEElement.Payment_Plan_Sum_Sixth__c);
    }
    handleNegotiateMean(event){
        this.PageMCEElement.Negotiate_Mean__c  = event.detail.value;
    }
    handleEngineerName(event){
        this.PageMCEElement.Engineer_Name__c  = event.detail.value;
    }
    handlephoneNumber(event){
        // this.phoneNumber = event.detail.value;
        this.PageMCEElement.Phone_Number__c = event.detail.value;
    }
    handlePrint(event){
        print().then(result =>{
                 this.printContract = result.printContract;
                 this.printAgent = result.printAgent;
                 this.agreeUpperLimit = result.agreeUpperLimit;
                 if (result.statusSave == 'Denied') {
                    const event = new ShowToastEvent({
                             title: 'warning',
                             message: result.status,
                             variant:'warning',
                            });
                    this.dispatchEvent(event);
                 }
        }).catch(error => {
            console.log("error");
            console.log(error.message());
        });;
    }
     handlesave(event){
       
        save({
            PageMCEElement:this.PageMCEElement
         }).then(result =>{
                 if (result.statusSave == 'Denied') {
                    const event = new ShowToastEvent({
                             title: 'warning',
                             message: result.status,
                             variant:'warning',
                            });
                    this.dispatchEvent(event);
                 }
        }).catch(error => {
            console.log("error"+error.message());
        });
    }
 
 
    /** 数字金额大写转换(可以处理整数,小数,负数) */    
    smalltoBIG(n)
    {    
 
        var fraction = ['角', '分'];    
        var digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];    
        var unit = [ ['元', '万', '亿'], ['', '拾', '佰', '仟']  ];    
        var head = n < 0? '欠': ''; 
        n = n.replace(/\,/g,"");
        n = Math.abs(n);   
        var s = '';    
        for (var i = 0; i < fraction.length; i++){
            s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');    
        }    
        s = s || '整';    
        n = Math.floor(n);  
        for (var i = 0; i < unit[0].length && n > 0; i++)     {    
            var p = '';    
            for (var j = 0; j < unit[1].length && n > 0; j++)     {    
                p = digit[n % 10] + unit[1][j] + p;    
                n = Math.floor(n / 10);    
            }    
            s = p.replace(/(零.)*零$/, '').replace(/^$/, '零')  + unit[0][i] + s;    
        }  
        return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整');    
    }
    Initdisabled(){
        if(this.PageMCEElement.Status__c != '引合中'){
            this.dis1 = true;
            this.dis2 = true;
            this.dis3 = true;
            this.dis4 = true;
            this.dis5 = true;
            this.dis6 = true;
            this.dis7 = true;
            this.dis8 = true;
            this.dis9 = true;
            this.dis10 = true;
            this.dis11 = true;
            this.dis12 = true;
            this.dis13 = true;
            this.dis14 = true;
            this.dis15 = true;
            this.dis16 = true;
            this.dis17 = true;
            this.dis18 = true;
            this.dis19 = true;
            this.dis20 = true;
            this.dis21 = true;
            this.dis22 = true;
            this.dis23 = true;
            this.dis24 = true;
            this.dis25 = true;
            this.dis26 = true;
            this.dis27 = true;
            this.dis28 = true;
            this.dis29 = true;
            this.dis30 = true;
        }
        if (this.PageMCEElement.old_Is_RecognitionModel__c == 'true' && this.PageMCEElement.Term_Of_Payment__c == '多次付款') {
            this.dis28 = true;
        }
    } 
 
    CloseJs() {
        if(this.statusSave == 'Fin'){
            window.opener.top.location.href = '/'+this.recordId;
            window.close();
            this.dispatchEvent(new CloseActionScreenEvent());
        }else{
            this.dispatchEvent(new CloseActionScreenEvent());
        }
    }
 
    // 新增点检总次数(只在页面中显示)fxk 2021/9/2 Star
    AllChecktime(){
        var Allchecks;
        if(( this.PageMCEElement.Inspection_Time__c == '1' && this.ContractAllMonth < 9) 
            || ( this.PageMCEElement.Inspection_Time__c == '2' && this.ContractAllMonth < 6) 
            || ( this.PageMCEElement.Inspection_Time__c == '3' && this.ContractAllMonth < 4)
            || ( this.PageMCEElement.Inspection_Time__c == '4' && this.ContractAllMonth < 3)){
            Allchecks = '1';
        }else{
            if (this.ContractAllMonth - parseInt(this.ContractAllMonth / 12) * 12 >= 6 &&  this.PageMCEElement.Inspection_Time__c == '1'){
                Allchecks = ((this.ContractAllMonth * Number( this.PageMCEElement.Inspection_Time__c))/12+1).toString();
            }else{
                Allchecks =((this.ContractAllMonth * Number( this.PageMCEElement.Inspection_Time__c))/12).toString();
            }
        }
        if (Allchecks!=null) {
             this.PageMCEElement.Inspection_Time__c = Allchecks;  
        }
    }
 
 
    PrintJs() {    
        if(this.statusSave == 'Fin'){
            this.dispatchEvent(new CloseActionScreenEvent());
            if (this.printContract == 'true') {
                //HWAG-BHT7XX 2019/11/26 START
                if(this.agreeUpperLimit == 'true'){
                // 打印医院限次合同配置
                window.open('/apex/NewMCHPDFLimit?id='+this.recordId, 'MCHLimitPDF');
                window.close();
                }else{
                // 打印医院合同配置
                window.open('/apex/NewMCHPDF?id='+this.recordId, 'MCHPDF');
                window.close();
                }
                //HWAG-BHT7XX 2019/11/26 END
            }else if (this.printAgent == 'true') {
                if(this.agreeUpperLimit == 'true'){
                //打印经销商限次合同
                window.open('/apex/NewMCAgentPDFLimit?id='+this.recordId, 'MCAgentLimitPDF');
                window.close()
                }else{
                //打印经销商合同
                window.open('/apex/NewMCAgentPDF?id='+this.recordId, 'MCHPDF');
                window.close();
                }
            }else {
                alert('1');
            }
        }else{
            this.dispatchEvent(new CloseActionScreenEvent());
        }
    }
 
 
}