From dfff58b7cd897b824a129edba6b5cdae20bb1e5c Mon Sep 17 00:00:00 2001
From: unknown <sunxia@prec-tech.com>
Date: 星期三, 23 八月 2023 17:40:58 +0800
Subject: [PATCH] 发起再注册分析并同步SAP

---
 force-app/main/default/lwc/lexBidAnnouncementConsentButton/lexBidAnnouncementConsentButton.js |   24 +++++++++++++-----------
 1 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/force-app/main/default/lwc/lexBidAnnouncementConsentButton/lexBidAnnouncementConsentButton.js b/force-app/main/default/lwc/lexBidAnnouncementConsentButton/lexBidAnnouncementConsentButton.js
index b170c4e..8e91256 100644
--- a/force-app/main/default/lwc/lexBidAnnouncementConsentButton/lexBidAnnouncementConsentButton.js
+++ b/force-app/main/default/lwc/lexBidAnnouncementConsentButton/lexBidAnnouncementConsentButton.js
@@ -5,7 +5,7 @@
 import { updateRecord } from 'lightning/uiRecordApi';
 import { ShowToastEvent } from 'lightning/platformShowToastEvent';
 export default class lexBidAnnouncementRejectButton extends LightningElement {
-    @api recordId;
+    @api recordId;//OwnerId
     IsLoading = true;
 
     @wire(CurrentPageReference)
@@ -18,6 +18,7 @@
            }
          }
      }
+    
     connectedCallback(){
         this.IsLoading = false;
         this.Consent();
@@ -26,14 +27,22 @@
     Consent(){  
         ConSent({recordId:this.recordId}).then(res=>{
             if(res == '1'){
-                this.showToast("鍚屾剰璇锋眰鎴愬姛","success");
+                this.updateRecordView();
+                this.dispatchEvent(new CloseActionScreenEvent());
             }
             if(res != "1"){
                 var messageage = "";
-                messageage = res.split(',')[1];
+                if(res.split(',')[1].slice(-2) == '[]'){
+                    messageage = res.split(',')[1].slice(0,-4);
+                }else{
+                    messageage = res;
+                }
                 this.showToast(messageage,"error");
             }
         })
+    }
+    updateRecordView() {
+        updateRecord({fields: { Id: this.recordId }});
     }
     showToast(msg,type) {
         const event = new ShowToastEvent({
@@ -41,13 +50,6 @@
             variant: type
         });
         this.dispatchEvent(event);
-        if(type == 'success'){
-            this.updateRecordView();
-        }
         this.dispatchEvent(new CloseActionScreenEvent());
     }
-    updateRecordView() {
-        updateRecord({fields: { Id: this.recordId }});
-    }
-
-}
\ No newline at end of file
+}

--
Gitblit v1.9.1