| | |
| | | * @Description: |
| | | * @version: |
| | | * @Author: chen jing wu |
| | | * @Date: 2023-04-20 14:08:55 |
| | | * @LastEditors: chen jing wu |
| | | * @LastEditTime: 2023-04-21 14:12:53 |
| | | */ |
| | | /* |
| | | * @Description: |
| | | * @version: |
| | | * @Author: chen jing wu |
| | | * @Date: 2023-04-13 13:50:23 |
| | | * @LastEditors: chen jing wu |
| | | * @LastEditTime: 2023-04-13 14:39:54 |
| | | * @LastEditTime: 2023-10-18 21:03:42 |
| | | */ |
| | | import { api, wire,LightningElement } from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | |
| | | import init from '@salesforce/apex/OpportunityLightingButtonController.initForCreateEventButton'; |
| | | import { updateRecord } from 'lightning/uiRecordApi'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | export default class LexCreateEvent extends LightningElement { |
| | | import { NavigationMixin } from 'lightning/navigation'; |
| | | import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils'; |
| | | export default class LexCreateEvent extends NavigationMixin(LightningElement) { |
| | | @api recordId; |
| | | accountId; |
| | | @wire(CurrentPageReference) |
| | |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result=>{ |
| | | console.log(result); |
| | | this.accountId = result.accountId; |
| | | this.createEvent(); |
| | | }).catch(error=>{ |
| | |
| | | }) |
| | | } |
| | | createEvent(){ |
| | | window.open("/00U/e?retURL=%2Fapex%2FVFClosePage&accid=" + this.accountId + "&oid=" + this.recordId, "新建计划"); |
| | | window.open( |
| | | "/apex/SimpleEventRegister?retURL=%2Fapex%2FVFClosePage&accid=" |
| | | + this.accountId + "&oid=" |
| | | + this.recordId + "&source=AccountPCL&save_new=1&sfdc.override=1"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | showToast(msg,type) { |
| | | const event = new ShowToastEvent({ |
| | | title: '', |
| | | message: msg, |
| | | variant: type |
| | | }); |
| | | this.dispatchEvent(event); |
| | | if(type == 'success'){ |
| | | const event = new ShowToastEvent({ |
| | | message: msg, |
| | | variant: type, |
| | | }); |
| | | this.dispatchEvent(event); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | }else{ |
| | | const event = new ShowToastEvent({ |
| | | message: msg, |
| | | variant: type, |
| | | mode: 'sticky' |
| | | }); |
| | | this.dispatchEvent(event); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | } |
| | | updateRecordView(recordId) { |
| | | updateRecord({fields: { Id: recordId }}); |