KKbes
2023-08-07 492f744d9d84289e27b2ddac9a9b4a2137fd11d6
force-app/main/default/lwc/lexNoReportApplication/lexNoReportApplication.js
@@ -10,9 +10,9 @@
import { CloseActionScreenEvent } from 'lightning/actions';
 const event = new ShowToastEvent({
            title: '检查状态',
            message:
                '只有状态为待提交报告的OPD计划才能进行无报告申请',
            variant: 'error'
        });
export default class lexNoReportApplication extends LightningElement {
@@ -35,6 +35,22 @@
            } else if (error) {
                this.error = error ;
            }
        init({
            recordId: this.recordId
        }).then(result=>{
            this.OPDPlan__c=result;
            this.NoReportApplication().then(result=>{
                this.IsLoading=false;
                this.dispatchEvent(new CloseActionScreenEvent());
            });
        }).catch(error=>{
            const eventError = new ShowToastEvent({
                title: '页面初始化错误',
                message:
                error.message,
            });
            this.dispatchEvent(eventError);
        });
    }
    @wire(CurrentPageReference)
@@ -51,23 +67,8 @@
    
    async connectedCallback(){
        await init({
            recordId: this.recordId
        }).then(result=>{
            this.OPDPlan__c=result;
            this.NoReportApplication().then(result=>{
                this.IsLoading=false;
                this.dispatchEvent(new CloseActionScreenEvent());
            });
        }).catch(error=>{
            const eventError = new ShowToastEvent({
                title: '页面初始化错误',
                message:
                error.message,
            });
            this.dispatchEvent(eventError);
        });
    connectedCallback(){
    }