19626
2023-04-21 2768cebeb80753586dcc25b352913c3b5b5b6cd1
force-app/main/default/lwc/lexPCLLostReportPage/lexPCLLostReportPage.js
@@ -4,7 +4,7 @@
 * @Author: chen jing wu
 * @Date: 2023-04-20 15:04:03
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-04-20 17:15:06
 * @LastEditTime: 2023-04-20 18:01:37
 */
/*
 * @Description: 
@@ -16,10 +16,41 @@
 */
import { LightningElement } from 'lwc';
import save from '@salesforce/apex/lexPCLLostReportLwcController.save';
import unblockui from '@sa';
import jquery from '@salesforce/resourceUrl/jquery183minjs';
import blockUIcss from '@salesforce/resourceUrl/blockUIcss';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import { loadStyle, loadScript } from 'lightning/platformResourceLoader';
import setBrand from '@salesforce/apex/lexPCLLostReportLwcController.setBrand';
export default class LexPCLLostReportPage extends LightningElement {
    connectedCallback(){
        Promise.all([
           loadScript(this,jquery),
           loadStyle(this,blockUIcss)
        ]).then(() =>{
            save().then(result=>{
                if(result){
                    this.showToast(result,"success");
                    window.unblockUI();
                    this.clearBrandMannualName();
                }
            setBrand({
            }).then({
            });
            })
        }).catch(error=>{
            console.log(error);
        });
    }
    showToast(msg,type) {
        const event = new ShowToastEvent({
            title: '',
            message: msg,
            variant: type
        });
        this.dispatchEvent(event);
        this.dispatchEvent(new CloseActionScreenEvent());
    }
    saveJs() {
        blockme();