19626
2023-05-15 f6a201e215d929bda9815e1689907d166a603519
force-app/main/default/lwc/lexOCSMToReport/lexOCSMToReport.js
@@ -1,3 +1,11 @@
/*
 * @Description:
 * @version:
 * @Author: chen jing wu
 * @Date: 2023-04-07 09:02:03
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-05-15 09:17:27
 */
import { api, wire,LightningElement } from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
import { CloseActionScreenEvent } from 'lightning/actions';
@@ -8,8 +16,9 @@
export default class LexOCSMToReport extends LightningElement {
    @api recordId;
    IsLoading = true;
    OCSMAdministrativeReportStatus;
    theOCSMAdministrativeReportStatus;
    awareDate;
    @wire(CurrentPageReference)
    getStateParameters(currentPageReference) {
@@ -27,8 +36,6 @@
        }
    }
    connectedCallback(){
        console.log(this.recordId);
        init({
@@ -36,16 +43,13 @@
        }).then(result => {
            console.log(result);
            if (result != null) {
                this.IsLoading = false;
                this.OCSMAdministrativeReportStatus = result.OCSMAdministrativeReportStatus;
                this.theOCSMAdministrativeReportStatus = result.theOCSMAdministrativeReportStatus;
                this.awareDate = result.awareDate;
                this.toReport();
            }
        }).catch(error => {
            console.log("error");
            console.log(error);
        }).finally(() => {
        });
    }
@@ -71,12 +75,17 @@
            return;
            }
        if(this.OCSMAdministrativeReportStatus == undefined && this.awareDate != undefined ){
        if(this.theOCSMAdministrativeReportStatus == undefined && this.awareDate != undefined ){
            updateForOCSMToReportButton({
                recordId: this.recordId
            }).then(result =>{
                this.showToast("成功","success");
                this.updateRecordView(this.recordId);
                if(result){
                    this.showToast(result,"error");
                }else{
                    this.showToast("成功","success");
                    this.updateRecordView(this.recordId);
                    this.IsLoading = false;
                }
                this.dispatchEvent(new CloseActionScreenEvent());
                });
        }else{