| force-app/main/default/classes/LexReturnDeliverySlipController.cls | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| force-app/main/default/classes/LexReturnDeliverySlipController.cls-meta.xml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| force-app/main/default/lwc/lexReturnDeliverySlip/lexReturnDeliverySlip.js | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
force-app/main/default/classes/LexReturnDeliverySlipController.cls
New file @@ -0,0 +1,44 @@ /** * * ODescription: GAuthor: sun xia @Date: 2023-07-11 15:31:56 GIastEditors: sun xia @IastEditTime: 2023-07-11 15:31:56 * */ public with sharing class LexReturnDeliverySlipController { @AuraEnabled public static InitData init(String recordId){ InitData res = new InitData(); try { List<Rental_Apply__c> raList = [SELECT Id, Name, Rental_Apply_Equipment_Set_Cnt__c, Loaner_received_ng_num__c from Rental_Apply__c where Id = :recordId]; if(raList.size()>0){ Rental_Apply__c ra = raList[0]; if(ra.Rental_Apply_Equipment_Set_Cnt__c > 0){ List<Rental_Apply_Equipment_Set_Detail__c> raSet = [SELECT Id, Name from Rental_Apply_Equipment_Set_Detail__c WHERE Received_Confirm_F__c = 'NG' AND Cancel_Select__c = false AND Rental_Apply__c = :recordId]; res.raeSet = raSet; } res.name = ra.Name; res.rentalApplyEquipmentSetCnt = Integer.valueOf(ra.Rental_Apply_Equipment_Set_Cnt__c); res.loanerReceivedNgNum = Integer.valueOf(ra.Loaner_received_ng_num__c); } } catch (Exception e) { system.debug('INFO****' + e); } return res; } public class InitData{ @AuraEnabled public Integer rentalApplyEquipmentSetCnt; @AuraEnabled public Integer loanerReceivedNgNum; @AuraEnabled public String name; @AuraEnabled public List<Rental_Apply_Equipment_Set_Detail__c> raeSet; } } force-app/main/default/classes/LexReturnDeliverySlipController.cls-meta.xml
New file @@ -0,0 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> <apiVersion>50.0</apiVersion> <status>Active</status> </ApexClass> force-app/main/default/lwc/lexReturnDeliverySlip/lexReturnDeliverySlip.js
@@ -5,7 +5,7 @@ import { ShowToastEvent } from 'lightning/platformShowToastEvent'; import { updateRecord } from 'lightning/uiRecordApi'; import init from '@salesforce/apex/ReturnDeliverySlipController.init'; import init from '@salesforce/apex/LexReturnDeliverySlipController.init'; export default class lexReturnDeliverySlip extends LightningElement { @api recordId; @@ -28,13 +28,17 @@ init({ recordId: this.recordId }).then(result =>{ console.log(JSON.stringify(result.raeSet)); var check = result.raeSet && result.raeSet.length>0; if((check || result.rentalApplyEquipmentSetCnt - result.loanerReceivedNgNum > 0) && result.rentalApplyEquipmentSetCnt > 0){ this.dispatchEvent(new CloseActionScreenEvent()); window.open("/apex/EquipmentSetShippmentReceived4?id=" + result.name); console.log('result==='+JSON.stringify(result)); if(result){ var check = result.raeSet && result.raeSet.length>0; if((check || result.rentalApplyEquipmentSetCnt - result.loanerReceivedNgNum > 0) && result.rentalApplyEquipmentSetCnt > 0){ this.dispatchEvent(new CloseActionScreenEvent()); window.open("/apex/EquipmentSetShippmentReceived4?id=" + result.name); }else{ this.showToast("没有申请者收到确认的借出备品", 'error'); } }else{ this.showToast("没有申请者收到确认的借出备品", 'error'); this.showToast("未查到数据", 'error'); } }).catch(err=>{ this.dispatchEvent(new CloseActionScreenEvent());