From 87861ae5f1ed5456685f97f8a8e7625e47b9576d Mon Sep 17 00:00:00 2001
From: KKbes <1620284052@qq.com>
Date: 星期四, 13 四月 2023 11:12:26 +0800
Subject: [PATCH] Merge branch 'LEX_dev' of http://47.92.229.245:8089/r/lightningupdate into LEX_dev

---
 force-app/main/default/lwc/lexCreateNotesEmail/lexCreateNotesEmail.js |   97 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 97 insertions(+), 0 deletions(-)

diff --git a/force-app/main/default/lwc/lexCreateNotesEmail/lexCreateNotesEmail.js b/force-app/main/default/lwc/lexCreateNotesEmail/lexCreateNotesEmail.js
new file mode 100644
index 0000000..3130703
--- /dev/null
+++ b/force-app/main/default/lwc/lexCreateNotesEmail/lexCreateNotesEmail.js
@@ -0,0 +1,97 @@
+/*
+ * @Description: 
+ * @version: 
+ * @Author: chen jing wu
+ * @Date: 2023-03-27 13:53:40
+ * @LastEditors: chen jing wu
+ * @LastEditTime: 2023-04-10 14:22:27
+ */
+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;
+    ownerEmail;
+    ownerAlias;
+    keyIssue;
+    feedBack;
+    taskFollow;
+    otherIssue;
+    nextWeekPlan;
+    drSumUrl;
+    IsLoading = true;
+    url;
+
+    @wire(CurrentPageReference)
+    getStateParameters(currentPageReference) {
+            console.log(111);
+            console.log(currentPageReference);
+
+        if (currentPageReference) {
+          const urlValue = currentPageReference.state.recordId;
+          if (urlValue) {
+            let str = `${urlValue}`;
+            console.log("str");
+            console.log(str);
+            this.recordId = str;
+          }
+        }
+    }
+
+
+
+    connectedCallback(){
+        console.log(this.recordId);
+        init({
+            recordId: this.recordId
+        }).then(result => {
+            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.createEmail();
+                this.dispatchEvent(new CloseActionScreenEvent());
+            }
+        }).catch(error => {
+            console.log("error");
+            console.log(error);
+        }).finally(() => {
+            
+        });
+    }
+    createEmail() {
+        console.log("start");
+    
+       window.location.href = ("mailto:" 
+        + this.ownerEmail
+        +"?bcc=" 
+        +   this.userEmail
+        +"&subject=銆愬懆鎶�:" 
+        + this.ownerAlias 
+        + "銆�" + "&body=鍏堢敓/濂冲+" + "%0D%0A" + "%0D%0A" + "涓昏鎶ュ憡浜嬮」锛�"
+        + this.keyIssue 
+        +"%0D%0A" + "涓嬪睘浜嬮」/鐘舵�佹姤鍛婏細"
+        + this.feedBack 
+        +"%0D%0A" + "璇鹃鍙婂搴旂粨鏋�/鎻愭锛�" 
+        +  this.taskFollow 
+        +"%0D%0A" + "鍏朵粬浜嬮」锛�" 
+        + this.otherIssue 
+        +"%0D%0A" + "涓嬪懆璁″垝锛�" 
+        + this.nextWeekPlan 
+        +"%0D%0A" + "杩炴帴锛�" 
+        + this.drSumUrl
+        +"%0D%0A").substring(0,320).split("<br>").join("%0D%0A");
+    }
+}
\ No newline at end of file

--
Gitblit v1.9.1