| | |
| | | import { CurrentPageReference,NavigationMixin } from 'lightning/navigation'; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | import { updateRecord } from 'lightning/uiRecordApi'; |
| | | |
| | | import init from '@salesforce/apex/AllReceivedFseController.init'; |
| | | import getRaeSet from '@salesforce/apex/AllReceivedFseController.getRaeSet'; |
| | |
| | | recordId: this.recordId |
| | | }).then(res=>{ |
| | | if(res == 'SUCCESS'){ |
| | | const evt = new ShowToastEvent({ |
| | | title : '现场已全部收货', |
| | | message: '', |
| | | variant: 'success' |
| | | }); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | this.dispatchEvent(evt); |
| | | this.showToast('现场已全部收货','success'); |
| | | return; |
| | | }else{ |
| | | const errToast = new ShowToastEvent({ |
| | | title : res, |
| | | message: '', |
| | | variant: 'error' |
| | | }); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | this.dispatchEvent(errToast); |
| | | |
| | | console.log(res); |
| | | this.showToast(res,'warning'); |
| | | return; |
| | | } |
| | | |
| | | }) |
| | |
| | | console.log('init==='+err); |
| | | }) |
| | | } |
| | | |
| | | showToast(msg,type) { |
| | | const event = new ShowToastEvent({ |
| | | message: msg, |
| | | variant: type |
| | | }); |
| | | if(type == 'success'){ |
| | | this.updateRecordView(this.recordId); |
| | | } |
| | | this.dispatchEvent(event); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | |
| | | updateRecordView(recordId) { |
| | | updateRecord({fields: { Id: recordId }}); |
| | | } |
| | | } |