黄千龙
2023-08-09 626f3c3bb25e204568019e8d568e2d7547d1037a
force-app/main/default/lwc/lexBidAnnouncementApplyForButton/lexBidAnnouncementApplyForButton.js
@@ -5,8 +5,9 @@
import { updateRecord } from 'lightning/uiRecordApi';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
export default class lexBidAnnouncementApplyForButton extends LightningElement {
    @api recordId;//
    @api recordId;//OwnerId
    IsLoading = true;
    arrMessage = [];
    @wire(CurrentPageReference)
     getStateParameters(currentPageReference) {
@@ -27,16 +28,24 @@
    ApplyFor(){
        ApplyFor({recordId:this.recordId}).then(res=>{
            if(res == '1'){
                this.showToast('请求申请成功,申请中。。。','success');
                this.updateRecordView();
                this.dispatchEvent(new CloseActionScreenEvent());
            }else{
                var messageage = "";
                messageage = res.split(',')[1];
                if(res.split(',')[1].slice(-2) == '[]'){
                    messageage = res.split(',')[1].slice(0,-4);
                }else{
                    messageage = res;
                }
                this.showToast(messageage,'error');
            }
        })
    }
    updateRecordView() {
        updateRecord({fields: { Id: this.recordId }});
    }
    showToast(msg,type) {
        const event = new ShowToastEvent({
            message: msg,
@@ -45,9 +54,4 @@
        this.dispatchEvent(event);
        this.dispatchEvent(new CloseActionScreenEvent());
    }
    updateRecordView() {
        updateRecord({fields: { Id: this.recordId }});
    }
}
}