From ddb0231ef7c5cf2bad9d3f1afc2f733674ad38a5 Mon Sep 17 00:00:00 2001
From: unknown <sunxia@prec-tech.com>
Date: 星期四, 24 八月 2023 14:50:51 +0800
Subject: [PATCH] 再修理按钮

---
 force-app/main/default/lwc/lexYanshoudanRequest/lexYanshoudanRequest.js |   19 +++++++++----------
 1 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/force-app/main/default/lwc/lexYanshoudanRequest/lexYanshoudanRequest.js b/force-app/main/default/lwc/lexYanshoudanRequest/lexYanshoudanRequest.js
index 84fe55d..687c05f 100644
--- a/force-app/main/default/lwc/lexYanshoudanRequest/lexYanshoudanRequest.js
+++ b/force-app/main/default/lwc/lexYanshoudanRequest/lexYanshoudanRequest.js
@@ -33,7 +33,6 @@
     }
 
     connectedCallback() {
-        console.log(this.recordId);
         init({
             recordId: this.recordId
         }).then(result => {
@@ -43,13 +42,10 @@
                 this.Id = result.Id;
 
                 this.YanshoudanRequest();
-                this.dispatchEvent(new CloseActionScreenEvent());
             }
         }).catch(error => {
             console.log(error);
-        }).finally(() => {
-
-        });
+        })
     }
 
     // 楠屾敹鍗曞洖鏀剁敵璇�
@@ -58,12 +54,15 @@
             recordId: this.Id
         }).then(result => {
             console.log(result);
-            if (result.length > 0) {
-                var indexs = result.indexOf(": ")
-                var resolves = result.substring(indexs + 1, result.length);
-                alert(resolves);
+            if (result != null) {
+                if (result.length > 0) {
+                    var split = result.split(", ");
+                    this.ShowToastEvent(split[1], "error");
+                    this.dispatchEvent(new CloseActionScreenEvent());
+                }
             }
-            location.reload();
+            this.ShowToastEvent("宸茬粡鐢宠杩囦簡锛屼笉鍏佽閲嶆柊鐢宠", "error");
+            this.dispatchEvent(new CloseActionScreenEvent());
         })
     }
 

--
Gitblit v1.9.1