From e6a0a7f9ffb463c5ce78d6770b09eac739f88b15 Mon Sep 17 00:00:00 2001
From: 19626 <1962676589@qq.com>
Date: 星期三, 24 五月 2023 16:57:53 +0800
Subject: [PATCH] 优化确认框以及修改页面

---
 force-app/main/default/lwc/lexCancelSubmit/lexCancelSubmit.js |   19 +++++++++++--------
 1 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/force-app/main/default/lwc/lexCancelSubmit/lexCancelSubmit.js b/force-app/main/default/lwc/lexCancelSubmit/lexCancelSubmit.js
index f5e217a..e4d87c9 100644
--- a/force-app/main/default/lwc/lexCancelSubmit/lexCancelSubmit.js
+++ b/force-app/main/default/lwc/lexCancelSubmit/lexCancelSubmit.js
@@ -4,7 +4,7 @@
  * @Author: chen jing wu
  * @Date: 2023-04-07 09:02:03
  * @LastEditors: chen jing wu
- * @LastEditTime: 2023-04-11 09:05:05
+ * @LastEditTime: 2023-05-09 17:42:28
  */
 import { LightningElement,wire,track,api} from 'lwc';
 import { CurrentPageReference } from "lightning/navigation";
@@ -19,6 +19,7 @@
     @api recordId;//OwnerId
     ownerId;
     monthlyReportId;
+    userId;
     IsLoading = true;
 
 
@@ -46,16 +47,14 @@
             console.log(result);
             if (result != null) {
                 this.ownerId = result.ownerId;
+                this.userId = result.userId;
                 this.monthlyReportId = result.Id;
                 this.cancelSubmit();
-                console.log("end");
                 //window.location.replace("https://ocsm--partial.sandbox.lightning.force.com/lightning/r/Monthly_Report__c/" + this.monthlyReportId + "/view");
             }
         }).catch(error => {
             console.log("error");
             console.log(error);
-        }).finally(() => {
-            
         });   
     }
 
@@ -71,13 +70,17 @@
         updateRecord({fields: { Id: recordId }});
     }
     cancelSubmit () {
-        //闇�瑕佸畬鍠�
-        if(this.ownerId == UserInfo_Owner.Id) {
+        if(this.ownerId == this.userId) {
             cancel({
                 recordId: this.recordId
             }).then(result=>{
-                this.showToast("鎴愬姛","success");
-                this.updateRecordView(this.recordId);
+                if(result){
+                    this.showToast(result,"error");
+                }else{
+                    this.showToast("鎴愬姛","success");
+                    this.updateRecordView(this.recordId);
+                }
+                this.IsLoading = false;
                 this.dispatchEvent(new CloseActionScreenEvent());
             });
             console.log("321");

--
Gitblit v1.9.1