| | |
| | | /* |
| | | * @Description: |
| | | * @version: |
| | | * @Author: chen jing wu |
| | | * @Date: 2023-03-27 13:53:40 |
| | | * @LastEditors: chen jing wu |
| | | * @LastEditTime: 2023-05-10 10:21:24 |
| | | */ |
| | | import { api, wire,LightningElement } from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import { NavigationMixin } from 'lightning/navigation'; |
| | | import init from '@salesforce/apex/MonthlyReportController.initForCreateNoteEmailButton'; |
| | | import UserInfo_Owner from '@salesforce/apex/TaskFeedbackController.UserInfo_Owner'; |
| | | |
| | | export default class LexCreateNotesEmail extends LightningElement { |
| | | @api recordId; |
| | | objectName; |
| | | ownerEmail; |
| | | ownerAlias; |
| | | keyIssue; |
| | |
| | | taskFollow; |
| | | otherIssue; |
| | | nextWeekPlan; |
| | | drSumUrl; |
| | | IsLoading = true; |
| | | url; |
| | | Link; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | |
| | | console.log(currentPageReference); |
| | | |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | const urlValue1 = currentPageReference.state.recordId; |
| | | if (urlValue1) { |
| | | let str = `${urlValue1}`; |
| | | console.log("str"); |
| | | console.log(str); |
| | | this.recordId = str; |
| | | } |
| | | const urlValue2 = currentPageReference.state.backgroundContext; |
| | | if (urlValue2) { |
| | | let str = `${urlValue2}`; |
| | | console.log("str"); |
| | | console.log(str); |
| | | this.Link = str; |
| | | } |
| | | } |
| | | } |
| | |
| | | console.log(result); |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.ownerEmail = result.ownerEmail; |
| | | this.ownerAlias = result.ownerAlias; |
| | | this.keyIssue = result.keyIssue; |
| | | this.feedBack = result.feedBack; |
| | | this.taskFollow = result.taskFollow; |
| | | this.otherIssue = result.otherIssue; |
| | | this.nextWeekPlan = result.nextWeekPlan; |
| | | this.drSumUrl = result.drSumUrl; |
| | | this.userEmail = result.userEmail; |
| | | this.ownerEmail = result.ownerEmail == undefined ? '' : result.ownerEmail; |
| | | this.ownerAlias = result.ownerAlias == undefined ? '' : result.ownerAlias; |
| | | this.keyIssue = result.keyIssue == undefined ? '' : result.keyIssue; |
| | | this.feedBack = result.feedBack == undefined ? '' : result.feedBack; |
| | | this.taskFollow = result.taskFollow == undefined ? '' : result.taskFollow; |
| | | this.otherIssue = result.otherIssue == undefined ? '' : result.otherIssue; |
| | | this.nextWeekPlan = result.nextWeekPlan == undefined ? '' : result.nextWeekPlan; |
| | | this.userEmail = result.userEmail == undefined ? '' : result.userEmail; |
| | | this.createEmail(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | |
| | | } |
| | | createEmail() { |
| | | console.log("start"); |
| | | |
| | | window.location.href = ("mailto:" |
| | | + this.ownerEmail |
| | | window.location.href = ("mailto:" |
| | | + this.ownerEmail |
| | | +"?bcc=" |
| | | + this.userEmail |
| | | + this.userEmail |
| | | +"&subject=【周报:" |
| | | + this.ownerAlias |
| | | + "】" + "&body=先生/女士" + "%0D%0A" + "%0D%0A" + "主要报告事项:" |
| | |
| | | + this.otherIssue |
| | | +"%0D%0A" + "下周计划:" |
| | | + this.nextWeekPlan |
| | | +"%0D%0A" + "连接:" |
| | | + this.drSumUrl |
| | | +"%0D%0A" + "连接:" + "%0D%0A" |
| | | + window.location.origin + this.Link |
| | | +"%0D%0A").substring(0,320).split("<br>").join("%0D%0A"); |
| | | |
| | | } |
| | | } |