现场统一收货
备品借出申请-现场统一收货(按钮)修改
| | |
| | | public with sharing class AllReceivedFseController { |
| | | public AllReceivedFseController() { |
| | | |
| | | } |
| | | |
| | | @AuraEnabled |
| | | public static InitData init(String recordId){ |
| | | InitData res = new InitData(); |
| | | Rental_Apply__c ra = [SELECT Id, Loaner_received_ng_num__c from Rental_Apply__c where Id = :recordId]; |
| | | res.Id = ra.Id; |
| | | res.LoanerReceivedNgNum = Integer.valueOf(ra.Loaner_received_ng_num__c); |
| | | res.id = ra.Id; |
| | | res.loanerReceivedNgNum = Integer.valueOf(ra.Loaner_received_ng_num__c); |
| | | |
| | | return res; |
| | | } |
| | |
| | | |
| | | if(updateList.size()>0){ |
| | | try { |
| | | update updateList; |
| | | Update updateList; |
| | | return 'SUCCESS'; |
| | | } |
| | | catch (Exception e) { |
| | |
| | | |
| | | public Class InitData{ |
| | | @AuraEnabled |
| | | public String Id; |
| | | public String id; |
| | | @AuraEnabled |
| | | public Integer LoanerReceivedNgNum; |
| | | public Integer loanerReceivedNgNum; |
| | | } |
| | | } |
| | |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(res=>{ |
| | | if(res.LoanerReceivedNgNum == 0){ |
| | | console.log('loanerReceivedNgNum==='+ res.loanerReceivedNgNum); |
| | | if(res.loanerReceivedNgNum == 0){ |
| | | const evt = new ShowToastEvent({ |
| | | title : '现场已经全部收到实物了', |
| | | message: '', |
| | | variant: 'success' |
| | | variant: 'error' |
| | | }); |
| | | this.dispatchEvent(evt); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | }else{ |
| | | getRaeSet({ |
| | | recordId: this.recordId |
| | |
| | | } |
| | | |
| | | }) |
| | | .catch(err=>{ |
| | | console.log('getRaeSet==='+err); |
| | | }) |
| | | } |
| | | }).catch(err=>{ |
| | | console.log(err); |
| | | console.log('init==='+err); |
| | | }) |
| | | } |
| | | } |