19626
2023-10-31 fd9df05c48c09b4d7f39a3b401882bda226dedea
force-app/main/default/lwc/tenderDeletePage/tenderDeletePage.js
@@ -1,8 +1,12 @@
import { LightningElement } from 'lwc';
import { LightningElement,api } from 'lwc';
import GetTenderinformationcData from '@salesforce/apex/TenderDeleteLwcController.GetTenderinformationcData';
import saveData from '@salesforce/apex/TenderDeleteLwcController.saveData';
import searchTender from '@salesforce/apex/TenderDeleteLwcController.searchTender';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import tnederDeletePageCss from '@salesforce/resourceUrl/tnederDeletePageCss';
import {loadStyle} from 'lightning/platformResourceLoader'
export default class TenderDeletePage extends LightningElement {
    @api recordid;
    ParamIdStr = '';
    //页面初始化加载数据
    ScreenWidth = ''
@@ -15,9 +19,13 @@
    Tenderinformationc={};
    
    connectedCallback() {
        Promise.all([
            loadStyle(this, tnederDeletePageCss)
        ]);
    console.log(this)
        this.onLoadin(true);
        debugger
        var paramId = this.getQueryVariable('id');
        var paramId = this.recordid
        if (paramId == null || paramId == '') {
            return;
        }
@@ -121,13 +129,33 @@
                debugger
                console.warn(result);
                if(result=="成功"){
                    alert('保存成功');
                    window.location.hash = "Refresh"+"=="+this.ParamIdStr;
                    debugger
                    this.showToast('保存成功','success');
                    setTimeout(() => {
                        window.location.href = '/'+this.recordid
                        // window.open('/'+this.recordid,)
                    },2000)
                    // window.location.hash = "Refresh"+"=="+this.ParamIdStr;
                    // debugger
                    this.onLoadin(false);
                }
            });
        }
    }
    showToast(msg,type) {
        if(type == "success"){
            const event = new ShowToastEvent({
                message: msg,
                variant: type
            });
            this.dispatchEvent(event);
        }else{
            const event = new ShowToastEvent({
                message: msg,
                variant: type,
                mode:"sticky"
            });
            this.dispatchEvent(event);
        }
    }
    // 2022-03-31 更换了控件类型 end
}