黄千龙
2023-08-09 626f3c3bb25e204568019e8d568e2d7547d1037a
force-app/main/default/lwc/lexQisUniversalFailureCode/lexQisUniversalFailureCode.js
@@ -1,17 +1,20 @@
import { LightningElement,wire,track,api} from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
import { CloseActionScreenEvent } from 'lightning/actions';
import { NavigationMixin } from 'lightning/navigation';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import { CurrentPageReference } from 'lightning/navigation';
import init  from '@salesforce/apex/QISReportController.initForQisUniversalFailureCodeButton';
import sqlForPAE  from '@salesforce/apex/QISReportController.sqlForPAE';
/*
 * @Description: Final universal code编辑
 * @Author: hql
 * @Date: 2023-07-12 09:45:19
 * @LastEditTime: 2023-07-12 15:44:33
 * @LastEditors:
 */
export default class lexQisUniversalFailureCode extends LightningElement {
   @api recordId;
   IsLoading = true;
   qisReportId;
   paeId;
    @wire(CurrentPageReference)
    @api recordId;
    IsLoading = true;
    qisReportId;
    paeId;
     @wire(CurrentPageReference)
     getStateParameters(currentPageReference) {
             console.log(111);
             console.log(currentPageReference);
@@ -37,22 +40,22 @@
                this.qisReportId = result.Id;
                var RecordTypeId = "ASACDecision";
                sqlForPAE({
                   qisReportId: this.qisReportId
                  }).then(result => {
                  if (result!=null) {
                     this.paeId = result.pAEid;
                     console.log('result='+this.paeId);
                  }
                  var url = '';
               if (result!=null){
                  url = "/apex/PAEDecisionRecord?Id="+this.paeId+"&QISReportId="+this.qisReportId +"&RecordTypeIds="+RecordTypeId ;
               } else {
                  url = "/apex/PAEDecisionRecord?QISReportId="+this.qisReportId +"&RecordTypeIds="+RecordTypeId;
               }
               console.log('url='+url);
               // window.open(url,'_self');
                    qisReportId: this.qisReportId
                 }).then(result => {
                    if (result!=null) {
                        this.paeId = result.pAEid;
                        console.log('result='+this.paeId);
                    }
                    var url = '';
                    if (result!=null&& this.paeId!=null){
                        url = "/apex/PAEDecisionRecord?Id="+this.paeId+"&QISReportId="+this.qisReportId +"&RecordTypeIds="+RecordTypeId ;
                    } else {
                        url = "/apex/PAEDecisionRecord?QISReportId="+this.qisReportId +"&RecordTypeIds="+RecordTypeId;
                    }
                    console.log('url='+url);
                    // window.open(url,'_self');
                    window.location.replace(url);
              });
                });
            }
        }).catch(error => {
            console.log('error='+error);