From bbc7c47e3eadfe0ae3ac57419b1c9b8b2ed3e3d4 Mon Sep 17 00:00:00 2001
From: 19626 <1962676589@qq.com>
Date: 星期四, 06 四月 2023 17:30:41 +0800
Subject: [PATCH] 修改按钮 4.6

---
 force-app/main/default/lwc/lexOPDtoSIS/lexOPDtoSIS.js |   23 +++++++++++++++++++----
 1 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/force-app/main/default/lwc/lexOPDtoSIS/lexOPDtoSIS.js b/force-app/main/default/lwc/lexOPDtoSIS/lexOPDtoSIS.js
index 0052ac3..c283bb6 100644
--- a/force-app/main/default/lwc/lexOPDtoSIS/lexOPDtoSIS.js
+++ b/force-app/main/default/lwc/lexOPDtoSIS/lexOPDtoSIS.js
@@ -14,7 +14,21 @@
     status;
     userId;
 
-  
+    @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(){
@@ -23,13 +37,12 @@
             recordId: this.recordId
         }).then(result => {
             console.log(result);
+            console.log("123");
             if (result != null) {
-                this.IsLoading = false;
                 this.ownerId = result.ownerId;
                 this.status = result.status;
                 this.userId = result.userId;
                 this.OPDtoSIS();
-                this.dispatchEvent(new CloseActionScreenEvent());
             }
         }).catch(error => {
             console.log("error");
@@ -60,11 +73,13 @@
             }).then(result =>{
                 this.updateRecordView(this.recordId);
                 this.showToast("鎴愬姛锛�","success");
+                this.dispatchEvent(new CloseActionScreenEvent());
                 });
             } else {
                 this.showToast("鍙崏妗堜腑鐘舵�佸強OPD/SIS鎶ュ憡涔︾殑鎵�鏈変汉鍙互鎻愪氦","error");
+                this.dispatchEvent(new CloseActionScreenEvent());
             }
-
+            this.IsLoading = false;
         
     }
 }
\ No newline at end of file

--
Gitblit v1.9.1