| | |
| | | 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) { |
| | |
| | | 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, |
| | |
| | | this.dispatchEvent(event); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | |
| | | updateRecordView() { |
| | | updateRecord({fields: { Id: this.recordId }}); |
| | | } |
| | | |
| | | } |
| | | } |