| | |
| | | |
| | | // with lwc lexNoReportApplication |
| | | //author kkbes |
| | | public class LexNoReportApplicationController { |
| | |
| | | } |
| | | |
| | | @AuraEnabled |
| | | public static void NewAndUpdateOPDStatus(String Id){ |
| | | public static String NewAndUpdateOPDStatus(String Id){ |
| | | try{ |
| | | OPDPlan__c res =new OPDPlan__c(); |
| | | res.Id = Id; |
| | | res.Status__c='提交'; |
| | | update res; |
| | | return 'success'; |
| | | } |
| | | catch (Exception e) { |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | | return e.getMessage(); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @AuraEnabled |
| | | public static void updateStatuById(String Id){ |
| | | public static String updateStatuById(String Id){ |
| | | try{ |
| | | SubAuthorized__c res = new SubAuthorized__c(); |
| | | res.Id = Id; |
| | | res.Status__c = '已取消'; |
| | | update res; |
| | | return 'success'; |
| | | } |
| | | catch(Exception e){ |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | | return e.getMessage(); |
| | | } |
| | | } |
| | | } |
| 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 { NavigationMixin } from 'lightning/navigation'; |
| | | import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils'; |
| | | import init from '@salesforce/apex/LexAgenceCopyPIController.init'; |
| | | export default class lexAgenceCopyPI extends NavigationMixin(LightningElement) { |
| | | |
| | | @api recordId; |
| | | IsLoading=true; |
| | | Agency_Contact; |
| | | |
| | | @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(res=>{ |
| | | if(res!=null){ |
| | | this.Agency_Contact =res; |
| | | console.log(res); |
| | | this.CopyPI().then(result => { |
| | | this.IsLoading=false; |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | }); |
| | | } |
| | | }).catch(error=>{ |
| | | console.log('error'); |
| | | console.log(error.message); |
| | | }) |
| | | |
| | | } |
| | | |
| | | |
| | | async CopyPI(){ |
| | | const defaultFieldValues = encodeDefaultFieldValues({ |
| | | Name: this.Agency_Contact.Name, |
| | | Department_Class__c:this.Agency_Contact.Department_Class__c, |
| | | Contact__c: this.Agency_Contact.Contact__c, |
| | | Agency_ID__c: this.Agency_Contact.Agency_ID__c, |
| | | Type__c : this.Agency_Contact.Type__c, |
| | | Doctor_Division1__c : this.Agency_Contact.Doctor_Division1__c, |
| | | Agency_Hospital__c :this.Agency_Contact.Agency_Hospital__c , |
| | | AWS_Data_Id__c : this.Agency_Contact.AWS_Data_Id__c |
| | | }) |
| | | this.IsLoading=false; |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | this[NavigationMixin.Navigate]({ |
| | | type: 'standard__objectPage', |
| | | attributes: { |
| | | objectApiName: 'Agency_Contact__c', // 要新建的对象API |
| | | actionName: 'new', |
| | | }, |
| | | state:{ |
| | | nooverride: '1', |
| | | defaultFieldValues: defaultFieldValues, |
| | | |
| | | } |
| | | }); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="lexAgenceCopyPI"> |
| | | <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> |
| | |
| | | this.CampaignMember().then(result => { |
| | | this.IsLoading=false; |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | }).catch(error => { |
| | | const eventInItError = new ShowToastEvent({ |
| | | message: |
| | | error.message, |
| | | variant : 'error' |
| | | }); |
| | | this.dispatchEvent(eventInItError); |
| | | }); |
| | | } |
| | | |
| | | async CampaignMember (){ |
| | | console.log(this.recordId); |
| | | window.open("/apex/CampaignMember?id=" + this.recordId,'CampaignMember','height=400,width=890,top=0,left=0,toolbar=no,menubar=no,scrollbars=yes,resizable=no,location=no,status=no'); |
| | | } |
| | | |
| | |
| | | } 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()); |
| | |
| | | }); |
| | | this.dispatchEvent(eventInItError); |
| | | }); |
| | | } |
| | | |
| | | |
| | | |
| | | connectedCallback(){ |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | async cancelInService(){ |
| | | var checkUpdate=0; |
| | | var Status =this.Campaign.Status; |
| | | if (this.Campaign.Status == '取消') { |
| | | this.dispatchEvent(event1); |
| | | return; |
| | | } |
| | | if (this.Campaign.Status != '草案中' && this.Campaign.Status != '公开中') { |
| | | const event2 = new dispatchEvent({ |
| | | message : this.Campaign.Status +"状态不能取消" , |
| | | const event2 = new ShowToastEvent({ |
| | | message : Status +"状态不能取消" , |
| | | variant : 'error' |
| | | }) |
| | | }); |
| | | this.dispatchEvent(event2); |
| | | return; |
| | | } |
| | |
| | | this.dispatchEvent(event3); |
| | | return; |
| | | } |
| | | |
| | | var IsCancelFromOpen = false; |
| | | console.log(this.Campaign.Status); |
| | | if (this.Campaign.Status == '公开中') { |
| | |
| | | result2, |
| | | variant : 'error' |
| | | }); |
| | | checkUpdate +=1; |
| | | this.dispatchEvent(eventErroe3); |
| | | } |
| | | |
| | | if(checkUpdate!=0){ |
| | | return; |
| | | } |
| | | }); |
| | | if(checkUpdate!=0){ |
| | | return; |
| | | } |
| | | const eventFail = new ShowToastEvent({ |
| | | message: |
| | | result1, |
| | | variant : 'error' |
| | | }); |
| | | checkUpdate +=1; |
| | | this.dispatchEvent(eventFail); |
| | | } |
| | | }); |
| | | if(checkUpdate!=0){ |
| | | return; |
| | | } |
| | | window.location.reload(); |
| | | |
| | | |
| | |
| | | this.dispatchEvent(event3); |
| | | return; |
| | | } |
| | | await updateStatuById().then(result=>{ |
| | | this.dispatchEvent(event2); |
| | | location.href = this.SubAuthorized.Id; |
| | | }).catch(error=>{ |
| | | await updateStatuById({Id : this.recordId}).then(result=>{ |
| | | if(result!='success'){ |
| | | const eventError = new ShowToastEvent({ |
| | | message: |
| | | error.message, |
| | | result, |
| | | variant : 'error' |
| | | }); |
| | | this.dispatchEvent(eventError); |
| | | }) |
| | | } |
| | | else{ |
| | | this.dispatchEvent(event2); |
| | | location.href = this.SubAuthorized.Id; |
| | | } |
| | | }); |
| | | } |
| | | } |
| | |
| | | |
| | | const event1 = new ShowToastEvent({ |
| | | message: |
| | | "已经取消!!", |
| | | "已经取消!", |
| | | variant : "error" |
| | | }); |
| | | const event4 = new ShowToastEvent({ |
| | |
| | | }).then(result => { |
| | | if (result != null) { |
| | | this.Campaign = result; |
| | | console.log(this.Campaign); |
| | | this.cancle().then(result=>{ |
| | | this.IsLoading=false; |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | |
| | | |
| | | |
| | | async cancle(){ |
| | | var checkUpdate=0; |
| | | if(this.Campaign.Status =='取消'){ |
| | | this.dispatchEvent(event1); |
| | | return; |
| | |
| | | message : result, |
| | | variant : 'error' |
| | | }) |
| | | checkUpdate +=1; |
| | | this.dispatchEvent(event7); |
| | | |
| | | } |
| | | }); |
| | | }else if(this.Campaign.Status =='公开中'){ |
| | |
| | | message : result, |
| | | variant : 'error' |
| | | }) |
| | | checkUpdate +=1; |
| | | this.dispatchEvent(event8); |
| | | } |
| | | }); |
| | | if(checkUpdate!=0){ |
| | | return; |
| | | } |
| | | await submitApprovalRequest({recordId : this.recordId}).then(result1=>{ |
| | | console.log(result1); |
| | | if(result1!=null){ |
| | |
| | | result2, |
| | | variant : 'error' |
| | | }); |
| | | checkUpdate +=1; |
| | | this.dispatchEvent(eventErroe3); |
| | | } |
| | | |
| | | }); |
| | | if(checkUpdate!=0){ |
| | | return; |
| | | } |
| | | const eventFail = new ShowToastEvent({ |
| | | message: |
| | | result1, |
| | | variant : 'error' |
| | | }); |
| | | checkUpdate +=1; |
| | | this.dispatchEvent(eventFail); |
| | | return; |
| | | } |
| | | }); |
| | | if(checkUpdate!=0){ |
| | | return; |
| | | } |
| | | window.location.reload(); |
| | | } |
| | | |
| | |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | export default class lexCopyPIContarct extends LightningElement { |
| | | import { NavigationMixin } from 'lightning/navigation'; |
| | | import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils'; |
| | | import init2 from '@salesforce/apex/LexAgenceCopyPIController.init2'; |
| | | export default class lexCopyPIContarct extends NavigationMixin(LightningElement) { |
| | | @api recordId; |
| | | IsLoading=true; |
| | | dateF; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | |
| | | } |
| | | |
| | | connectedCallback(){ |
| | | init2({recordId : this.recordId}).then(res=>{ |
| | | this.dateF = res; |
| | | this.CopyPI().then(result => { |
| | | this.IsLoading=false; |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | }).catch(error => { |
| | | const eventInItError = new ShowToastEvent({ |
| | | message: |
| | | error.message, |
| | | variant : 'error' |
| | | }); |
| | | this.dispatchEvent(eventInItError); |
| | | }); |
| | | |
| | | } |
| | | |
| | | async CopyPI(){ |
| | | window.location.href = '/'+this.recordId+'/e?newclone=1'; |
| | | this[NavigationMixin.Navigate]({ |
| | | type: 'standard__objectPage', |
| | | attributes: { |
| | | objectApiName: 'Contact', // 要新建的对象API |
| | | actionName: 'new', |
| | | }, |
| | | state:{ |
| | | nooverride: '1', |
| | | defaultFieldValues:this.dateF , |
| | | } |
| | | }); |
| | | console.log(this.dateF); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | } |
| | |
| | | } |
| | | var rs = await createReport({assetId : this.recordId}); |
| | | var arr = String(rs).split(':'); |
| | | console.log(arr[0]); |
| | | console.log(arr[1]); |
| | | if (arr[0] == '1') { |
| | | window.open('/apex/LostReportEditAsset?assetid=' + arr[1]); |
| | | } |
| | |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | this.recordId = str; |
| | | console.log(this.recordId); |
| | | } |
| | | } |
| | | } |
| | |
| | | }).then(result => { |
| | | if (result != null) { |
| | | this.Account = result; |
| | | console.log(this.Account); |
| | | this.createProduct2(); |
| | | } |
| | | }).catch(error => { |
| | |
| | | this.Statu_Achievements__c=res; |
| | | this.guaranteePeriodAlterationApplication().then(res=>{ |
| | | this.IsLoading=false; |
| | | |
| | | if(this.msg==""){ |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | this.closeAction(); |
| | |
| | | |
| | | async guaranteePeriodAlterationApplication(){ |
| | | let hasError ='0'; |
| | | console.log(this.Statu_Achievements__c.InstallDate__c ); |
| | | if (this.Statu_Achievements__c.InstallDate__c != '' && this.Statu_Achievements__c.InstallDate__c !=undefined) { |
| | | window.open('/apex/AssetGuaranteePeriodAlteration?Statu_AchievementsId='+this.recordId) |
| | | } else { |
| | |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | |
| | | const event = new ShowToastEvent({ |
| | | title: '意向已结束', |
| | | message: |
| | | '意向已结束不能做报价委托', |
| | | variant : 'error' |
| | | }); |
| | | import init from '@salesforce/apex/LexLeadRequestController.init'; |
| | | |
| | |
| | | // author: kkbes |
| | | |
| | | const event = new ShowToastEvent({ |
| | | title: '权限不足', |
| | | message: |
| | | '无权查看会议费用情况', |
| | | variant : 'error' |
| | | }); |
| | | export default class lexMeetingCosts extends LightningElement { |
| | | |
| | |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | console.log("str"); |
| | | console.log(str); |
| | | this.recordId = str; |
| | | } |
| | | } |
| | |
| | | userDetails({error, data}) { |
| | | if (data) { |
| | | this.currentUserProfileId = data.fields.ProfileId.value; |
| | | console.log('currentUserProfileId = :' + this.currentUserProfileId); |
| | | |
| | | } else if (error) { |
| | | this.error = error ; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | connectedCallback(){ |
| | | console.log(this.recordId); |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | |
| | | console.log("error"); |
| | | console.log(error); |
| | | }); |
| | | } |
| | | |
| | | |
| | | |
| | | connectedCallback(){ |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | |
| | | const event = new ShowToastEvent({ |
| | | title: '检查状态', |
| | | message: |
| | | '只有状态为待提交报告的OPD计划才能进行无报告申请', |
| | | variant: 'error' |
| | | }); |
| | | export default class lexNoReportApplication extends LightningElement { |
| | | |
| | |
| | | } else if (error) { |
| | | this.error = error ; |
| | | } |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result=>{ |
| | | this.OPDPlan__c=result; |
| | | this.NoReportApplication().then(result=>{ |
| | | this.IsLoading=false; |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | }); |
| | | }).catch(error=>{ |
| | | const eventError = new ShowToastEvent({ |
| | | title: '页面初始化错误', |
| | | message: |
| | | error.message, |
| | | }); |
| | | this.dispatchEvent(eventError); |
| | | }); |
| | | } |
| | | |
| | | @wire(CurrentPageReference) |
| | |
| | | |
| | | |
| | | |
| | | async connectedCallback(){ |
| | | await init({ |
| | | recordId: this.recordId |
| | | }).then(result=>{ |
| | | this.OPDPlan__c=result; |
| | | this.NoReportApplication().then(result=>{ |
| | | this.IsLoading=false; |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | }); |
| | | }).catch(error=>{ |
| | | const eventError = new ShowToastEvent({ |
| | | title: '页面初始化错误', |
| | | message: |
| | | error.message, |
| | | }); |
| | | this.dispatchEvent(eventError); |
| | | }); |
| | | connectedCallback(){ |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | async commitNeedApproval(){ |
| | | var changeFlg=0; |
| | | //0.当前状态(只有草案中才可以进行审批) |
| | | var NowStatus = this.OPDPlan.Status__c; |
| | | //获取出借目的 |
| | |
| | | } |
| | | } |
| | | //2022-07-20 zyh |
| | | await NewAndUpdateOPDStatus({Id : this.OPDPlan.Id}).catch(error=>{ |
| | | await NewAndUpdateOPDStatus({Id : this.OPDPlan.Id}).then(result=>{ |
| | | if(result!='success'){ |
| | | const eventError = new ShowToastEvent({ |
| | | message: |
| | | error.message, |
| | | result, |
| | | error |
| | | }); |
| | | changeFlg+=1; |
| | | this.dispatchEvent(eventError); |
| | | } |
| | | }); |
| | | if(changeFlg!=0){ |
| | | return; |
| | | } |
| | | |
| | | |
| | | //4. 进程生成器 |
| | |
| | | } |
| | | }).catch(error => { |
| | | const event3 = new ShowToastEvent({ |
| | | title: '页面初始化错误', |
| | | message: |
| | | error.message, |
| | | variant : 'error' |
| | | }); |
| | | this.dispatchEvent(event3); |
| | | }); |
| | |
| | | |
| | | }).catch(error=>{ |
| | | const eventError = new ShowToastEvent({ |
| | | title: '页面初始化错误', |
| | | message: |
| | | error.message, |
| | | variant : 'error' |
| | | }); |
| | | this.dispatchEvent(eventError); |
| | | }) |
| | |
| | | |
| | | |
| | | const event1 = new ShowToastEvent({ |
| | | title: '状态错误', |
| | | message: |
| | | "OPD计划的状态为取消或完毕时,不能改期!", |
| | | variant : 'error' |
| | | }); |
| | | export default class lexPostPoneReport extends NavigationMixin(LightningElement) { |
| | | |
| | |
| | | |
| | | }).catch(error => { |
| | | const event3 = new ShowToastEvent({ |
| | | title: '按钮跳转错误', |
| | | message: |
| | | error.message, |
| | | variant : 'error' |
| | | }); |
| | | this.dispatchEvent(event3); |
| | | }); |
| | |
| | | }).then(result => { |
| | | if (result != null) { |
| | | this.Campaign = result; |
| | | console.log(this.Campaign); |
| | | this.SendToComPlat().then(result=>{ |
| | | this.IsLoading=false; |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | |
| | | const event1 = new ShowToastEvent({ |
| | | message: |
| | | "请填写是否需要出借备品!", |
| | | variant : "warning" |
| | | variant : "error" |
| | | }); |
| | | const event2 = new ShowToastEvent({ |
| | | message: |
| | |
| | | const event3 = new ShowToastEvent({ |
| | | message: |
| | | "会议未结束,不允许提交会议报告。!", |
| | | variant : "warning" |
| | | variant : "error" |
| | | }); |
| | | const event4 = new ShowToastEvent({ |
| | | message: |
| | | "不能提交审批,请确认会议状态!", |
| | | variant : "warning" |
| | | variant : "error" |
| | | }); |
| | | |
| | | import init from '@salesforce/apex/LexSubmitCampaignController.initSubmit'; |
| | |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | this.recordId = str; |
| | | console.log(this.recordId); |
| | | } |
| | | } |
| | | } |
| | |
| | | }).then(result => { |
| | | if (result != null) { |
| | | this.Campaign = result; |
| | | console.log(this.Campaign); |
| | | this.submit().then(result=>{ |
| | | this.IsLoading=false; |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | |
| | | variant : 'error' |
| | | }); |
| | | this.dispatchEvent(eventFail); |
| | | alert('2222'); |
| | | return; |
| | | } |
| | | }); |
| | |
| | | const event1 = new ShowToastEvent({ |
| | | message: |
| | | "不能提交审批,请确认会议状态!", |
| | | variant : "warning" |
| | | variant : "error" |
| | | }); |
| | | import init from '@salesforce/apex/LexSubmitCampaignController.initSubmit'; |
| | | import newAndUpddateCampaign from '@salesforce/apex/LexSubmitCampaignController.newAndUpddateCampaign'; |
| | |
| | | this.dispatchEvent(eventErroe3); |
| | | } |
| | | }); |
| | | if(checkUpdate!=0){ |
| | | return; |
| | | } |
| | | const eventFail = new ShowToastEvent({ |
| | | message: |
| | | result, |
| | | variant : 'error' |
| | | }); |
| | | this.dispatchEvent(eventFail); |
| | | checkUpdate +=1; |
| | | return; |
| | | } |
| | | }); |
| | | if(checkUpdate!=0){ |
| | | return; |
| | | } |
| | | |
| | | window.location.reload(); |
| | | } |
| | |
| | | userDetails({error, data}) { |
| | | if (data) { |
| | | this.currentUserProfileId =data.fields.ProfileId.value; |
| | | console.log(data.fields); |
| | | } else if (error) { |
| | | this.error = error ; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | connectedCallback(){ |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | if (result != null) { |
| | | this.Campaign = result; |
| | | console.log(this.Campaign); |
| | | this.UpdateTimeReply().then(result=>{ |
| | | this.IsLoading=false; |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | |
| | | }); |
| | | this.dispatchEvent(eventInItError); |
| | | }); |
| | | } |
| | | |
| | | |
| | | |
| | | connectedCallback(){ |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | this.dispatchEvent(event2); |
| | | return; |
| | | } |
| | | setInterval |
| | | } |
| | | } |