| | |
| | | import { updateRecord } from 'lightning/uiRecordApi'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | export default class lexBidAnnouncementRejectButton extends LightningElement { |
| | | @api recordId; |
| | | @api recordId;//OwnerId |
| | | IsLoading = true; |
| | | |
| | | @wire(CurrentPageReference) |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | connectedCallback(){ |
| | | this.IsLoading = false; |
| | | this.Consent(); |
| | |
| | | Consent(){ |
| | | ConSent({recordId:this.recordId}).then(res=>{ |
| | | if(res == '1'){ |
| | | this.showToast("同意请求成功","success"); |
| | | this.updateRecordView(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | if(res != "1"){ |
| | | 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({ |
| | |
| | | variant: type |
| | | }); |
| | | this.dispatchEvent(event); |
| | | if(type == 'success'){ |
| | | this.updateRecordView(); |
| | | } |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | updateRecordView() { |
| | | updateRecord({fields: { Id: this.recordId }}); |
| | | } |
| | | |
| | | } |
| | | } |