19626
2023-04-06 bbc7c47e3eadfe0ae3ac57419b1c9b8b2ed3e3d4
force-app/main/default/lwc/lexSubmitCompetitorReport/lexSubmitCompetitorReport.js
@@ -5,7 +5,7 @@
import  otherButtonInSubmitCompetitorReport  from '@salesforce/apex/ReportController.updateForSubmitCompetitorReportButton';
import { updateRecord } from 'lightning/uiRecordApi';
import init  from '@salesforce/apex/ReportController.initForSubmitCompetitorReportButton';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
export default class LexSubmitCompetitorReport extends LightningElement {
    @api recordId;
    IsLoading = true;
@@ -35,18 +35,28 @@
            recordId: this.recordId
          }).then(result=>{
            this.submit();
            this.dispatchEvent(new CloseActionScreenEvent());
            this.IsLoading = false;  
          });
          
    }
    showToast(msg,type) {
      const event = new ShowToastEvent({
          title: '',
          message: msg,
          variant: type
      });
      this.dispatchEvent(event);
  }
    
    submit(){
      otherButtonInSubmitCompetitorReport({
        recordId: this.recordId
    }).then(result=>{
      this.showToast("提交对手竞争报告成功","success")
      this.updateRecordView(this.recordId);
      this.dispatchEvent(new CloseActionScreenEvent());
    });
    }
}