| | |
| | | import { CurrentPageReference,NavigationMixin } from 'lightning/navigation'; |
| | | import { updateRecord } from 'lightning/uiRecordApi'; |
| | | import LightningConfirm from 'lightning/confirm'; |
| | | import init from '@salesforce/apex/AddSubmitApprovalProcessController.init'; |
| | | import submitApproval from '@salesforce/apex/AddSubmitApprovalProcessController.submitApproval'; |
| | | import init from '@salesforce/apex/LexAddSubmitApprovalProcessController.init'; |
| | | import submitApproval from '@salesforce/apex/LexAddSubmitApprovalProcessController.submitApproval'; |
| | | import setSObjectShare from '@salesforce/apex/ControllerUtil.setSObjectShare'; |
| | | import changeAddApprovalStatus from '@salesforce/apex/AddSubmitApprovalProcessController.changeAddApprovalStatus'; |
| | | import changeAddApprovalStatus from '@salesforce/apex/LexAddSubmitApprovalProcessController.changeAddApprovalStatus'; |
| | | |
| | | export default class lexAddSubmitApprovalProcess extends LightningElement { |
| | | @api recordId; |
| | |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result=>{ |
| | | console.log('result==='+JSON.stringify(result)); |
| | | if(JSON.stringify(result) == '{}'){ |
| | | this.ToastShow('没有查到需要的数据','warning'); |
| | | return; |
| | | } |
| | | |
| | | if(result.addApprovalStatus != '草案中' || result.detailSize == 0){ |
| | | this.ToastShow('没有需要审批的追加附属品','warning'); |
| | | return; |
| | |
| | | // this.dispatchEvent(new CloseActionScreenEvent()); |
| | | // return; |
| | | // } |
| | | const SUBMIT = LightningConfirm.open({ |
| | | LightningConfirm.open({ |
| | | message: "一旦提交此记录以待批准,根据您的设置您可能不再能够编辑此记录或将他从批准过程中调回。是否继续?", |
| | | variant: 'headerless', |
| | | label: '提示信息', |
| | | // setting theme would have no effect |
| | | }); |
| | | |
| | | if(SUBMIT==false){ |
| | | }).then(submit=>{ |
| | | if(!submit){ |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | }else{ |
| | | |
| | | // 希望到货日不能早于申请提交日-0418追加 |
| | | //if ('{!Rental_Apply__c.Request_shipping_day__c}' < '{!TODAY()}') { |
| | |
| | | recordId: this.recordId |
| | | }).then(submitApprovalRes=>{ |
| | | if(submitApprovalRes == 'OK'){ |
| | | this.ToastShow('提交追加待审批','success'); |
| | | this.ToastShow('提交追加待审批成功','success'); |
| | | this.updateRecordView(this.recordId); |
| | | }else{ |
| | | this.ToastShow('追加待审批失败','ERROR'); |
| | |
| | | }).catch(err=>{ |
| | | console.log('setSObjectShareErr===='+err); |
| | | }) |
| | | |
| | | } |
| | | }) |
| | | }).catch(err=>{ |
| | | console.log('====1111====',err); |
| | | }) |
| | |
| | | |
| | | ToastShow(msg,type){ |
| | | const evt = new ShowToastEvent({ |
| | | title : msg, |
| | | message: '', |
| | | //title : msg, |
| | | message: msg, |
| | | variant: type |
| | | }); |
| | | this.dispatchEvent(evt); |
| | |
| | | updateRecordView(recordId) { |
| | | updateRecord({fields: { Id: recordId }}); |
| | | } |
| | | |
| | | async handleConfirmClick(msg) { |
| | | const result = await LightningConfirm.open({ |
| | | message: msg, |
| | | variant: 'headerless', |
| | | label: 'this is the aria-label value' |
| | | }); |
| | | if (result) { |
| | | this.ll(); |
| | | } else { |
| | | window.history.go(-1); |
| | | } |
| | | } |
| | | } |