19626
2023-10-07 988f9735377909b6310301e582c15804e004783f
force-app/main/default/lwc/lexSubmitReport/lexSubmitReport.js
@@ -4,7 +4,7 @@
 * @Author: chen jing wu
 * @Date: 2023-09-11 09:20:29
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-09-11 10:00:40
 * @LastEditTime: 2023-09-26 09:32:55
 */
import { api, wire,LightningElement, track } from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
@@ -16,14 +16,15 @@
import { refreshApex } from '@salesforce/apex';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import LightningConfirm from 'lightning/confirm';
import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
import {loadStyle} from 'lightning/platformResourceLoader';
export default class LexSubmitReport extends LightningElement {
    @wire(getRecord, { recordId: '$recordId', fields: [STATUS_FIELD] })
    record;
    @api recordId;
    cntLostCancelReport;
    cntLostCancelDraft;
    IsLoading = true;
    IsLoading;
    @wire(CurrentPageReference)
    getStateParameters(currentPageReference) {
            console.log(111);
@@ -55,6 +56,9 @@
    }
    connectedCallback(){
        Promise.all([
            loadStyle(this, lwcCSS)
           ]);
        init({
            recordId: this.recordId
        }).then(result=>{
@@ -80,6 +84,7 @@
            label: 'this is the aria-label value'
        });
        console.log(result);
        this.IsLoading = true;
        if(result){
            updateSubmitReportButton({
                recordId: this.recordId
@@ -89,9 +94,9 @@
                }else{
                    setTimeout(() => {
                        this.IsLoading = false;
                        refreshApex(this.record);
                        window.location = '/' + this.recordId;
                        this.dispatchEvent(new CloseActionScreenEvent());
                    }, 2000);
                    }, 1000);
                }
            });
        }else{