From f7484973dc7c94fd41f23ef83d511f082cb0131e Mon Sep 17 00:00:00 2001
From: chenjingwu <chenjingwu@prec-tech.com>
Date: 星期五, 24 五月 2024 16:37:19 +0800
Subject: [PATCH] 1

---
 force-app/main/default/lwc/lexSubmitSolutionForApproval/lexSubmitSolutionForApproval.js |   33 ++++++++++++++++++++++++---------
 1 files changed, 24 insertions(+), 9 deletions(-)

diff --git a/force-app/main/default/lwc/lexSubmitSolutionForApproval/lexSubmitSolutionForApproval.js b/force-app/main/default/lwc/lexSubmitSolutionForApproval/lexSubmitSolutionForApproval.js
index acb7b32..84ae69b 100644
--- a/force-app/main/default/lwc/lexSubmitSolutionForApproval/lexSubmitSolutionForApproval.js
+++ b/force-app/main/default/lwc/lexSubmitSolutionForApproval/lexSubmitSolutionForApproval.js
@@ -4,7 +4,7 @@
  * @Author: chen jing wu
  * @Date: 2023-06-20 14:37:24
  * @LastEditors: chen jing wu
- * @LastEditTime: 2023-08-29 14:07:08
+ * @LastEditTime: 2023-10-11 16:54:13
  */
 import { api, wire,LightningElement, track } from 'lwc';
 import { CurrentPageReference } from "lightning/navigation";
@@ -17,6 +17,8 @@
 import { refreshApex } from '@salesforce/apex';
 import { ShowToastEvent } from 'lightning/platformShowToastEvent';
 import LightningConfirm from 'lightning/confirm';
+import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
+import {loadStyle} from 'lightning/platformResourceLoader';
 
 export default class LexSubmitSolutionForApproval extends LightningElement {
     @wire(getRecord, { recordId: '$recordId', fields: [STATUS_FIELD] })
@@ -45,13 +47,22 @@
         }
     }
     showToast(msg,type) {
-        const event = new ShowToastEvent({
-            title: ' ',
-            message: msg,
-            variant: type,
-            mode: 'sticky'
-        });
-        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());
+        }   
     }
 
 
@@ -60,6 +71,10 @@
     }
 
     connectedCallback(){
+        Promise.all([
+            loadStyle(this, lwcCSS)
+        ]);
+        
         init({
             recordId: this.recordId
         }).then(result=>{
@@ -99,7 +114,7 @@
             var usrname = this.userName;
             var rtn = '';
             console.log("start");
-            if(header.includes(usrname)){
+            if(header != undefined && header != null && header != '' && header.includes(usrname)){
                 rtn = 'Y';
             }else{
                 rtn = 'N';

--
Gitblit v1.9.1