| New file |
| | |
| | | <aura:component implements="flexipage:availableForAllPageTypes,force:lightningQuickActionWithoutHeader,force:hasRecordId,lightning:actionOverride,lightning:isUrlAddressable" access="global"> |
| | | <aura:attribute name="recordId" type="String" /> |
| | | <aura:handler name="render" value="{!this}" action="{!c.closeModal}" /> |
| | | <aura:attribute name="isDoneRendering" type="Boolean" default="false"/> |
| | | <div class="exampleHolder"> |
| | | |
| | | <c:lexCampaignMemberService recordId="{!v.recordId}" /> |
| | | |
| | | </div> |
| | | </aura:component> |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <description>A Lightning Component Bundle</description> |
| | | </AuraDefinitionBundle> |
| New file |
| | |
| | | ({ |
| | | myAction : function(component, event, helper) { |
| | | |
| | | } |
| | | }) |
| New file |
| | |
| | | ({ |
| | | helperMethod : function() { |
| | | |
| | | } |
| | | }) |
| New file |
| | |
| | | <aura:component implements="flexipage:availableForAllPageTypes,force:lightningQuickActionWithoutHeader,force:hasRecordId,lightning:actionOverride,lightning:isUrlAddressable" access="global"> |
| | | <aura:attribute name="recordId" type="String" /> |
| | | <aura:handler name="render" value="{!this}" action="{!c.closeModal}" /> |
| | | <aura:attribute name="isDoneRendering" type="Boolean" default="false"/> |
| | | <div class="exampleHolder"> |
| | | |
| | | <c:lexCancelInService recordId="{!v.recordId}" /> |
| | | |
| | | </div> |
| | | </aura:component> |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <description>A Lightning Component Bundle</description> |
| | | </AuraDefinitionBundle> |
| New file |
| | |
| | | ({ |
| | | myAction : function(component, event, helper) { |
| | | |
| | | } |
| | | }) |
| New file |
| | |
| | | ({ |
| | | helperMethod : function() { |
| | | |
| | | } |
| | | }) |
| New file |
| | |
| | | <aura:component implements="flexipage:availableForAllPageTypes,force:lightningQuickActionWithoutHeader,force:hasRecordId,lightning:actionOverride,lightning:isUrlAddressable" access="global"> |
| | | <aura:attribute name="recordId" type="String" /> |
| | | <aura:handler name="render" value="{!this}" action="{!c.closeModal}" /> |
| | | <aura:attribute name="isDoneRendering" type="Boolean" default="false"/> |
| | | <div class="exampleHolder"> |
| | | |
| | | <c:lexCancleCampaign recordId="{!v.recordId}" /> |
| | | |
| | | </div> |
| | | </aura:component> |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <description>A Lightning Component Bundle</description> |
| | | </AuraDefinitionBundle> |
| New file |
| | |
| | | ({ |
| | | myAction : function(component, event, helper) { |
| | | |
| | | } |
| | | }) |
| New file |
| | |
| | | ({ |
| | | helperMethod : function() { |
| | | |
| | | } |
| | | }) |
| New file |
| | |
| | | public with sharing class LexSubmitCampaignController { |
| | | //提交审批按钮 学会 |
| | | @AuraEnabled |
| | | public static Campaign initSubmit(String recordId){ |
| | | try{ |
| | | Campaign res = [SELECT Id,Status,Is_LendProduct__c,EndDate |
| | | FROM Campaign |
| | | WHERE Id = : recordId]; |
| | | return res; |
| | | } |
| | | catch(Exception e){ |
| | | System.debug('lexSubmitCampaign,method:initSubmit error: '+e.getMessage()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | @AuraEnabled |
| | | public static void newAndUpddateCampaign(String Id,String Status){ |
| | | try{ |
| | | Campaign res = new Campaign(); |
| | | res.Id = Id; |
| | | res.Status=Status; |
| | | update res; |
| | | } |
| | | catch(Exception e){ |
| | | System.debug('lexSubmitCampaign,method:newAndUpddateCampaign error: '+e.getMessage()); |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | @AuraEnabled |
| | | public static String submitApprovalRequest(String recordId) { |
| | | try{ |
| | | Approval.ProcessSubmitRequest req = new Approval.ProcessSubmitRequest(); |
| | | req.setObjectId(recordId); |
| | | Approval.ProcessResult result = Approval.process(req); |
| | | if(result!=null&&result.getErrors()!=null&&result.getErrors().size()>0) return result.getErrors().get(0).getMessage(); |
| | | }catch(Exception e){ |
| | | System.debug('lexSubmitCampaign,method:submitApprovalRequest submitApprovalRequest error: '+e.getMessage()); |
| | | return e.getMessage(); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | //取消按钮 |
| | | @AuraEnabled |
| | | public static Campaign initCancle(String recordId){ |
| | | Campaign res = new Campaign(); |
| | | try { |
| | | res = [SELECT Status,Id,CancleReason__c,IF_Submit__c |
| | | From Campaign Where Id = :recordId]; |
| | | return res; |
| | | } |
| | | catch (Exception e) { |
| | | System.debug('lexSubmitCampaign,method:initCancle error: '+e.getMessage()); |
| | | } |
| | | return res; |
| | | } |
| | | |
| | | @AuraEnabled |
| | | public static String newAndUpdateCampaignCancle(String campaignId ,String Status){ |
| | | |
| | | try { |
| | | Campaign res = new Campaign(); |
| | | res.Id = campaignId; |
| | | res.Status =Status; |
| | | update res; |
| | | |
| | | } |
| | | catch (Exception e) { |
| | | return e.getMessage(); |
| | | } |
| | | return 'success'; |
| | | } |
| | | |
| | | @AuraEnabled |
| | | public static Campaign initMember(String recordId){ |
| | | Campaign res = new Campaign(); |
| | | try { |
| | | res = [SELECT Status,Id, ServiceDesignDep__c |
| | | From Campaign Where Id = :recordId]; |
| | | return res; |
| | | } |
| | | catch (Exception e) { |
| | | System.debug('lexSubmitCampaign,method:initCancle error: '+e.getMessage()); |
| | | } |
| | | return res; |
| | | } |
| | | |
| | | //取消按钮 CancleService |
| | | @AuraEnabled |
| | | public static Campaign initCancleService(String recordId){ |
| | | Campaign res = new Campaign(); |
| | | try { |
| | | res = [SELECT Status,Id,CancleReason__c |
| | | From Campaign Where Id = :recordId]; |
| | | return res; |
| | | } |
| | | catch (Exception e) { |
| | | System.debug('lexSubmitCampaign,method:initCancle error: '+e.getMessage()); |
| | | } |
| | | return res; |
| | | } |
| | | |
| | | @AuraEnabled |
| | | public static String cancleServiceNewAndUpdate(String Id,String Status,Boolean IsCancelFromOpen){ |
| | | Campaign res = new Campaign(); |
| | | try{ |
| | | res.Id = Id; |
| | | res.Status = Status; |
| | | res.IsCancelFromOpen__c = IsCancelFromOpen; |
| | | UPDATE res; |
| | | return 'success'; |
| | | } |
| | | catch (Exception e) { |
| | | System.debug('lexSubmitCampaign,method:initCancle error: '+e.getMessage()); |
| | | return e.getMessage(); |
| | | } |
| | | return 'success'; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>51.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | <template> |
| | | <div class="Attachment" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement, track, wire,api } from 'lwc'; |
| | | import { getRecord } from 'lightning/uiRecordApi'; |
| | | import USER_ID from '@salesforce/user/Id'; |
| | | import USERPROFILE_ID from '@salesforce/schema/User.ProfileId'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | const event1 = new ShowToastEvent({ |
| | | message: |
| | | "批准后不能添加参会人员,如需添加请联系服务企划部!", |
| | | variant : 'error' |
| | | }); |
| | | import init from '@salesforce/apex/LexSubmitCampaignController.initMember'; |
| | | import getProfileIdByName from '@salesforce/apex/LexMeetingCostsController.getProfileIdByName'; |
| | | export default class lexCampaignMemberService extends LightningElement { |
| | | @api recordId; |
| | | IsLoading=true; |
| | | Campaign; |
| | | currentUserProfileId; |
| | | |
| | | |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | @wire(getRecord, { recordId: USER_ID, fields: [USERPROFILE_ID]}) |
| | | userDetails({error, data}) { |
| | | if (data) { |
| | | this.currentUserProfileId =data.fields.ProfileId.value; |
| | | } else if (error) { |
| | | this.error = error ; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | connectedCallback(){ |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | if (result != null) { |
| | | this.Campaign = result; |
| | | console.log(this.Campaign); |
| | | this.campaignMemberService().then(result=>{ |
| | | this.IsLoading=false; |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | }); |
| | | } |
| | | }).catch(error => { |
| | | const eventInItError = new ShowToastEvent({ |
| | | message: |
| | | error.message, |
| | | variant : 'error' |
| | | }); |
| | | this.dispatchEvent(eventInItError); |
| | | }); |
| | | |
| | | } |
| | | |
| | | async campaignMemberService(){ |
| | | var ProfileId= await getProfileIdByName({Name : "系统管理员"}); |
| | | console.log(ProfileId); |
| | | var cstatus = this.Campaign.Status; |
| | | if (cstatus =='草案中' || this.Campaign.ServiceDesignDepId__c == USER_ID |
| | | || this.currentUserProfileId == ProfileId ){ |
| | | window.open("/apex/CampaignMemberService?id=" + this.Campaign.Id,'CampaignMember','height=400,width=890,top=0,left=0,toolbar=no,menubar=no,scrollbars=yes,resizable=no,location=no,status=no'); |
| | | |
| | | } else { |
| | | this.dispatchEvent(event1); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="lexCampaignMemberService"> |
| | | <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> |
| New file |
| | |
| | | <template> |
| | | <div class="Attachment" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement, track, wire,api } from 'lwc'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | const event1 = new ShowToastEvent({ |
| | | message: |
| | | "已经取消!", |
| | | variant : 'error' |
| | | }); |
| | | const event3 = new ShowToastEvent({ |
| | | message: |
| | | "必须输入取消理由", |
| | | variant : 'error' |
| | | }); |
| | | import init from '@salesforce/apex/LexSubmitCampaignController.initCancleService'; |
| | | import submitApprovalRequest from '@salesforce/apex/LexSubmitCampaignController.submitApprovalRequest'; |
| | | import newAndUpdateCampaignCancle from '@salesforce/apex/LexSubmitCampaignController.newAndUpdateCampaignCancle'; |
| | | import cancleServiceNewAndUpdate from '@salesforce/apex/LexSubmitCampaignController.cancleServiceNewAndUpdate'; |
| | | export default class lexCancelInService extends LightningElement { |
| | | @api recordId; |
| | | IsLoading=true; |
| | | Campaign; |
| | | |
| | | @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.Campaign = result; |
| | | this.cancelInService().then(result=>{ |
| | | this.IsLoading=false; |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | }); |
| | | } |
| | | }).catch(error => { |
| | | const eventInItError = new ShowToastEvent({ |
| | | message: |
| | | error.message, |
| | | variant : 'error' |
| | | }); |
| | | this.dispatchEvent(eventInItError); |
| | | }); |
| | | |
| | | } |
| | | |
| | | async cancelInService(){ |
| | | if (this.Campaign.Status == '取消') { |
| | | this.dispatchEvent(event1); |
| | | return; |
| | | } |
| | | if (this.Campaign.Status != '草案中' && this.Campaign.Status != '公开中') { |
| | | const event2 = new dispatchEvent({ |
| | | message : this.Campaign.Status +"状态不能取消" , |
| | | variant : 'error' |
| | | }) |
| | | this.dispatchEvent(event2); |
| | | return; |
| | | } |
| | | if (this.Campaign.CancleReason__c == null || this.Campaign.CancleReason__c == '' || this.Campaign.CancleReason__c == undefined) { |
| | | this.dispatchEvent(event3); |
| | | return; |
| | | } |
| | | var IsCancelFromOpen = false; |
| | | console.log(this.Campaign.Status); |
| | | if (this.Campaign.Status == '公开中') { |
| | | IsCancelFromOpen = true; |
| | | } |
| | | await cancleServiceNewAndUpdate({ |
| | | Id: this.Campaign.Id, Status : '取消申请中', IsCancelFromOpen : IsCancelFromOpen}).then(result1=>{ |
| | | if(result1 != 'success'){ |
| | | const event4 = new dispatchEvent({ |
| | | message : result1, |
| | | variant : 'error' |
| | | }); |
| | | this.dispatchEvent(event4); |
| | | } |
| | | }); |
| | | //开始审批流 |
| | | await submitApprovalRequest({recordId : this.recordId}).then(result=>{ |
| | | if(result!=null){ |
| | | var theStatus =''; |
| | | if(IsCancelFromOpen){ |
| | | theStatus = '公开中'; |
| | | } |
| | | else{ |
| | | theStatus = '草案中' |
| | | } |
| | | newAndUpddateCampaign({campaignId : this.Campaign.Id , Status : theStatus}).then(result2=>{ |
| | | if(result2!='success'){ |
| | | const eventErroe3 = new ShowToastEvent({ |
| | | message: |
| | | result2, |
| | | variant : 'error' |
| | | }); |
| | | this.dispatchEvent(eventErroe3); |
| | | } |
| | | |
| | | }); |
| | | const eventFail = new ShowToastEvent({ |
| | | message: |
| | | result1, |
| | | variant : 'error' |
| | | }); |
| | | this.dispatchEvent(eventFail); |
| | | } |
| | | }); |
| | | window.location.reload(); |
| | | |
| | | |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="lexCancelInService"> |
| | | <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> |
| New file |
| | |
| | | <template> |
| | | <div class="Attachment" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement, track, wire,api } from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | |
| | | const event1 = new ShowToastEvent({ |
| | | message: |
| | | "已经取消!!", |
| | | variant : "error" |
| | | }); |
| | | const event4 = new ShowToastEvent({ |
| | | message: |
| | | "必须输入取消理由", |
| | | variant : "error" |
| | | }); |
| | | const event5 = new ShowToastEvent({ |
| | | message: |
| | | "该活动信息已发送到智慧医疗,请确认后再操作", |
| | | variant : "error" |
| | | }); |
| | | const event6 = new ShowToastEvent({ |
| | | message: |
| | | "已取消", |
| | | variant : "success" |
| | | }); |
| | | |
| | | |
| | | import init from '@salesforce/apex/LexSubmitCampaignController.initCancle'; |
| | | import changeCampaign from '@salesforce/apex/OpdPlanWebService.changeCampaign'; |
| | | import submitApprovalRequest from '@salesforce/apex/LexSubmitCampaignController.submitApprovalRequest'; |
| | | import newAndUpdateCampaignCancle from '@salesforce/apex/LexSubmitCampaignController.newAndUpdateCampaignCancle'; |
| | | export default class lexCancleCampaign extends LightningElement { |
| | | @api recordId; |
| | | IsLoading=true; |
| | | Campaign; |
| | | |
| | | @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.Campaign = result; |
| | | console.log(this.Campaign); |
| | | this.cancle().then(result=>{ |
| | | this.IsLoading=false; |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | }); |
| | | } |
| | | }).catch(error => { |
| | | const eventInItError = new ShowToastEvent({ |
| | | message: |
| | | error.message, |
| | | variant : 'error' |
| | | }); |
| | | this.dispatchEvent(eventInItError); |
| | | }); |
| | | |
| | | } |
| | | |
| | | |
| | | async cancle(){ |
| | | if(this.Campaign.Status =='取消'){ |
| | | this.dispatchEvent(event1); |
| | | return; |
| | | } |
| | | if(this.Campaign.Status !='草案中' && this.Campaign.Status !='公开中' && this.Campaign.Status !='取消'){ |
| | | const event2 = new ShowToastEvent({ |
| | | message : this.Campaign.Status +'状态不能取消', |
| | | variant : 'error' |
| | | }); |
| | | this.dispatchEvent(event2); |
| | | return; |
| | | } |
| | | // OPD取消和备品取消检查 |
| | | var campaignId= this.Campaign.Id; |
| | | var rtn = await changeCampaign({campaignId : campaignId }); |
| | | if (rtn != 'OK') { |
| | | const event3 = new dispatchEvent({ |
| | | message : rtn, |
| | | variant : 'error' |
| | | }) |
| | | this.dispatchEvent(event3); |
| | | return; |
| | | } |
| | | if(this.Campaign.CancleReason__c == null || this.Campaign.CancleReason__c =='' || this.Campaign.CancleReason__c == undefined){ |
| | | this.dispatchEvent(event4); |
| | | return; |
| | | } |
| | | if(this.Campaign.IF_Submit__c != 0){ |
| | | this.dispatchEvent(event5); |
| | | } |
| | | // End |
| | | //状态不同的取消操作会不一样,公开中的学会 |
| | | if(this.Campaign.Status =='草案中'){ |
| | | await newAndUpdateCampaignCancle({campaignId : this.Campaign.Id, Status : '取消'}).then(result=>{ |
| | | if(result=='success'){ |
| | | this.dispatchEvent(event6); |
| | | location.href = "/"+this.Campaign.Id; |
| | | } |
| | | else{ |
| | | const event7 = new ShowToastEvent({ |
| | | message : result, |
| | | variant : 'error' |
| | | }) |
| | | this.dispatchEvent(event7); |
| | | |
| | | } |
| | | }); |
| | | }else if(this.Campaign.Status =='公开中'){ |
| | | await newAndUpdateCampaignCancle({campaignId : this.Campaign.Id, Status : '取消申请中'}).then(result=>{ |
| | | if(result!='success'){ |
| | | const event8 = new ShowToastEvent({ |
| | | message : result, |
| | | variant : 'error' |
| | | }) |
| | | this.dispatchEvent(event8); |
| | | } |
| | | }); |
| | | await submitApprovalRequest({recordId : this.recordId}).then(result1=>{ |
| | | console.log(result1); |
| | | if(result1!=null){ |
| | | //更新状态 |
| | | newAndUpddateCampaign({campaignId : this.Campaign.Id , Status : '公开中'}).then(result2=>{ |
| | | if(result2!='success'){ |
| | | const eventErroe3 = new ShowToastEvent({ |
| | | message: |
| | | result2, |
| | | variant : 'error' |
| | | }); |
| | | this.dispatchEvent(eventErroe3); |
| | | } |
| | | |
| | | }); |
| | | const eventFail = new ShowToastEvent({ |
| | | message: |
| | | result1, |
| | | variant : 'error' |
| | | }); |
| | | this.dispatchEvent(eventFail); |
| | | return; |
| | | } |
| | | }); |
| | | window.location.reload(); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="lexCancleCampaign"> |
| | | <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> |