| force-app/main/default/classes/LexCommitNeedApprovalController.cls | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| force-app/main/default/classes/LexCommitNeedApprovalController.cls-meta.xml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| force-app/main/default/classes/OpdPlanWebService.cls | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| force-app/main/default/lwc/lexCommitNeedApproval/lexCommitNeedApproval.html | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| force-app/main/default/lwc/lexCommitNeedApproval/lexCommitNeedApproval.js | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| force-app/main/default/lwc/lexCommitNeedApproval/lexCommitNeedApproval.js-meta.xml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| force-app/main/default/lwc/lexMeetingCosts/lexMeetingCosts.js | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
force-app/main/default/classes/LexCommitNeedApprovalController.cls
New file @@ -0,0 +1,30 @@ public with sharing class LexCommitNeedApprovalController { @AuraEnabled public static meeting_delay_apply__c init(String recordId){ meeting_delay_apply__c res = new meeting_delay_apply__c(); try{ res = [Select Id,status__c,campaign__c FROM meeting_delay_apply__c WHERE Id = : recordId]; } catch(Exception e){ System.debug(LoggingLevel.INFO, '*** e: ' + e); } return res; } @AuraEnabled public static void newUpdateMeetingDelayApply(String Id){ meeting_delay_apply__c res = new meeting_delay_apply__c(); try{ res.Id=Id; res.Status__c ='提交'; update res; } catch (Exception e) { System.debug(LoggingLevel.INFO, '*** e: ' + e); } } } force-app/main/default/classes/LexCommitNeedApprovalController.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>51.0</apiVersion> <status>Active</status> </ApexClass> force-app/main/default/classes/OpdPlanWebService.cls
@@ -1,3 +1,10 @@ /** * @description : * @author : ChangeMeIn@UserSettingsUnder.SFDoc * @group : * @last modified on : 07-19-2023 * @last modified by : ChangeMeIn@UserSettingsUnder.SFDoc **/ global class OpdPlanWebService { //按钮调用 SWAG-BUF6J5 20201110 youchang @AuraEnabled @@ -20,6 +27,7 @@ return rtn; } @AuraEnabled WebService static String changeCampaign(String campaignId) { //学会取消得窗口调用 List<Rental_Apply__c> raList = [select Yi_loaner_arranged__c, Shipment_request_Cnt__c from Rental_Apply__c where Campaign__c = :campaignId]; String rtn = 'OK'; @@ -146,365 +154,7 @@ @TestVisible public static void test() { Integer i = 0; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; } } force-app/main/default/lwc/lexCommitNeedApproval/lexCommitNeedApproval.html
New file @@ -0,0 +1,5 @@ <template> <div class="Attachment" if:true={IsLoading}> <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> </div> </template> force-app/main/default/lwc/lexCommitNeedApproval/lexCommitNeedApproval.js
New file @@ -0,0 +1,116 @@ //kkbes //增加LexCommitNeedApprovalController 更改OpdPlanWebService import LightningConfirm from 'lightning/confirm'; import { LightningElement, track, wire,api } from 'lwc'; import { CurrentPageReference } from "lightning/navigation"; import { CloseActionScreenEvent } from 'lightning/actions'; import { ShowToastEvent } from 'lightning/platformShowToastEvent'; import init from '@salesforce/apex/LexCommitNeedApprovalController.init'; import newUpdateMeetingDelayApply from '@salesforce/apex/LexCommitNeedApprovalController.newUpdateMeetingDelayApply'; import changeCampaign from '@salesforce/apex/OpdPlanWebService.changeCampaign'; const event1 = new ShowToastEvent({ message: "只有状态为草案中或者驳回时才可以进行提交审批!", variant : 'error' }); export default class lexCommitNeedApproval extends LightningElement { @api recordId; MeetingDelayApply; IsLoading=true; @wire(CurrentPageReference) getStateParameters(currentPageReference) { if (currentPageReference) { const urlValue = currentPageReference.state.recordId; if (urlValue) { let str = `${urlValue}`; this.recordId = str; } } } connectedCallback(){ init({ recordId: this.recordId }).then(result => { if (result != null) { this.MeetingDelayApply = result; this.commitNeedApproval().then(result=>{ this.IsLoading=false; this.dispatchEvent(new CloseActionScreenEvent()); }); } }).catch(error => { const event3 = new ShowToastEvent({ message: error.message, variant : 'error' }); this.dispatchEvent(event3); }); } async commitNeedApproval(){ var NowStatus = this.MeetingDelayApply.status__c; if(NowStatus == "草案中" || NowStatus == "驳回"){ var campaignId = this.MeetingDelayApply.campaign__c; //学会id var rtn = await changeCampaign({campaignId:campaignId}); if (rtn != 'OK') { const event = new ShowToastEvent({ message: rtn, variant : 'error' }); this.dispatchEvent(event); return; } } //1.当前状态(只有取消或者延期报告状态才可以进行审批) if(NowStatus != "草案中" && NowStatus != "驳回"){ this.dispatchEvent(event1); return; } //2.提示 const result = await LightningConfirm.open({ message: '一旦提交此记录以待批准,根据您的设置您可能不再能够编辑此记录或将他从批准过程中调回。是否继续?', variant: 'headerless', label: 'this is the aria-label value', // setting theme would have no effect }); if(!result){ return; } //3.状态改为 提交 if(NowStatus == "草案中" || NowStatus == "驳回"){ await newUpdateMeetingDelayApply({Id : this.recordId }) .then(result=>{ }).catch(error=>{ const event2 = new ShowToastEvent({ message: error.message, variant : 'error' }); this.dispatchEvent(event2); }); } //4. 进程生成器 //5. 重新刷新页面 setTimeout(function(){ window.location.href = window.location; }, 1500 ) } } force-app/main/default/lwc/lexCommitNeedApproval/lexCommitNeedApproval.js-meta.xml
New file @@ -0,0 +1,11 @@ <?xml version="1.0" encoding="UTF-8"?> <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="lexCommitNeedApproval"> <apiVersion>51.0</apiVersion> <isExposed>true</isExposed> <targets> <target>lightning__RecordPage</target> <target>lightning__AppPage</target> <target>lightning__HomePage</target> <target>lightning__RecordAction</target> </targets> </LightningComponentBundle> force-app/main/default/lwc/lexMeetingCosts/lexMeetingCosts.js
@@ -43,6 +43,7 @@ userDetails({error, data}) { if (data) { this.currentUserProfileId = data.fields.ProfileId.value; console.log('currentUserProfileId = :' + this.currentUserProfileId); } else if (error) { this.error = error ;