| | |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils'; |
| | | |
| | | export default class LexConsumApply_FromOPDPlan extends LightningElement { |
| | | // 新建耗材申请(OPD计划) |
| | | export default class LexConsumApply_FromOPDPlan extends NavigationMixin(LightningElement) { |
| | | @api recordId; |
| | | IsLoading = true; |
| | | |
| | |
| | | recordId: this.recordId |
| | | }).then(result=>{ |
| | | UserInfo_Owner({}).then(res=>{ |
| | | if(res.isFormalStuff == 'true'){ |
| | | this.showToast('试用期内,不能申请','warning'); |
| | | console.log("-----UserInfo_Owner--",res) |
| | | if(res.isFormalStuff){ |
| | | this.showToast('试用期内,不能申请','error'); |
| | | return; |
| | | }else{ |
| | | |
| | |
| | | Account__c:result.accountLab, |
| | | Name:'*', |
| | | demo_purpose2__c:'OPD试用', |
| | | Person_In_Charge__c:res.lastName + res.firstName, |
| | | applyUser__c:res.lastName + res.firstName |
| | | Person_In_Charge__c:res.id, |
| | | applyUser__c:res.id |
| | | }); |
| | | |
| | | console.log("defaultValues====> ",defaultValues); |
| | | this[NavigationMixin.Navigate]({ |
| | | type: 'standard__objectPage', |
| | | attributes: { |
| | |
| | | actionName: 'new' |
| | | }, |
| | | state:{ |
| | | defaultFieldValues: this.defaultValues |
| | | defaultFieldValues: defaultValues |
| | | } |
| | | }) |
| | | }); |
| | | } |
| | | }) |
| | | .catch(error => { |
| | | console.log("error"); |
| | | console.log(error); |
| | | console.log("error ---> ",error); |
| | | }) |
| | | }) |
| | | |
| | | .catch(error => { |
| | | console.log("error"); |
| | | console.log("error----"); |
| | | console.log(error); |
| | | }).finally(() => { |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | |
| | | variant: type |
| | | }); |
| | | this.dispatchEvent(evt); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | |
| | | } |