From 01ce9b5788c4369c150e57577cc4ea03b4fc5ee1 Mon Sep 17 00:00:00 2001
From: chenjingwu <chenjingwu@prec-tech.com>
Date: 星期五, 19 四月 2024 17:28:49 +0800
Subject: [PATCH] 123

---
 force-app/main/default/lwc/lexTenderingNotarizeButton/lexTenderingNotarizeButton.js |   84 ++++++++++++++++++++++++++++++++++++-----
 1 files changed, 73 insertions(+), 11 deletions(-)

diff --git a/force-app/main/default/lwc/lexTenderingNotarizeButton/lexTenderingNotarizeButton.js b/force-app/main/default/lwc/lexTenderingNotarizeButton/lexTenderingNotarizeButton.js
index e7f76d4..eb7832f 100644
--- a/force-app/main/default/lwc/lexTenderingNotarizeButton/lexTenderingNotarizeButton.js
+++ b/force-app/main/default/lwc/lexTenderingNotarizeButton/lexTenderingNotarizeButton.js
@@ -2,6 +2,7 @@
 import { CurrentPageReference } from "lightning/navigation";
 import { CloseActionScreenEvent } from 'lightning/actions';
 import  init  from '@salesforce/apex/TenderingButtonController.initTenderingController';
+import  sqlResult  from '@salesforce/apex/TenderingButtonController.sqlResult';
 import { ShowToastEvent } from 'lightning/platformShowToastEvent';
 export default class lexTenderingNotarizeButton extends LightningElement {
     @api recordId;//褰撳墠杩欐潯鏁版嵁鐨刬d
@@ -26,26 +27,40 @@
         init({
             recordId: this.recordId
         }).then(result => {
+            console.log(result)
                 this.IsLoading = false;
                 this.id = result.Id;
                 this.status = result.status;
                 this.profileId = result.profileId.slice(0,15);
                 this.NotarizeButton();
                 this.dispatchEvent(new CloseActionScreenEvent());
-        })       
+        }).catch(error => {
+            console.log("error"+error);
+        }).finally(() => {
+            
+        });        
     }
 
-    //鎷涙爣椤圭洰 鐩稿叧鎬х‘璁�
+    //鐩稿叧鎬х‘璁�
     NotarizeButton(){
-        if( this.ProfileId!= '00e1m000000MSci'
-        && this.ProfileId!= '00e10000000Y3o5'
-        && this.ProfileId!= '00e10000000xnpR' && this.ProfileId!= '00e10000000xyK6'
-        && this.ProfileId!= '00e10000000xnpW'
-        && this.ProfileId!= '00e10000000xnpb' && this.ProfileId!= '00e10000000xyKB'
-        && this.ProfileId!= '00e10000000a7NY'
-        && this.ProfileId!= '00e10000000s2fZ'
-        && this.ProfileId!= '00e10000000s3Jp'
+        console.log(this.ProfileId,'琛屽悧');
+        if( this.profileId!= '00e1m000000MSci'
+        // 绯荤粺绠$悊鍛�
+        && this.profileId!= '00e10000000Y3o5'
+        // 2s6
+        && this.profileId!= '00e10000000xnpR' && this.profileId!= '00e10000000xyK6'
+        // 2s7
+        && this.profileId!= '00e10000000xnpW'
+        // 2s8
+        && this.profileId!= '00e10000000xnpb' && this.profileId!= '00e10000000xyKB'
+        // 2s9
+        && this.profileId!= '00e10000000a7NY'
+        // OBA1
+        && this.profileId!= '00e10000000s2fZ'
+        // OBA7
+        && this.profileId!= '00e10000000s3Jp'
         ){
+            // alert("鍙湁鍔╃悊鎵嶈兘杩涜鐩稿叧鎬х‘璁わ紒");
             this.showToast("鍙湁鍔╃悊鎵嶈兘杩涜鐩稿叧鎬х‘璁わ紒","error");
             return;
         }
@@ -57,6 +72,8 @@
             window.open (`/apex/Relevance?id=${this.id}`, '', 'height=500, width=800, top=200, left=250,location=no');
         }
         else{
+        // alert('鍙湁01.寰呯‘璁ゆ椂闇�瑕佽繘琛岀浉鍏虫�х‘璁わ紒');
+            // alert('鍏宠仈璇环鍚庝笉鑳借繘琛岀浉鍏虫�х‘璁わ紒');
             this.showToast("鍏宠仈璇环鍚庝笉鑳借繘琛岀浉鍏虫�х‘璁わ紒","error");
         }
 
@@ -69,4 +86,49 @@
         this.dispatchEvent(event);
         this.dispatchEvent(new CloseActionScreenEvent());
     }
-}
\ No newline at end of file
+}
+
+
+// function init(){
+//     var ProfileId = "{!$Profile.Id}";
+//     if( ProfileId!= '00e1m000000MSci'
+//     // 绯荤粺绠$悊鍛�
+//     && ProfileId!= '00e10000000Y3o5'
+//     // 2s1
+//     // && ProfileId!= '00e10000000xnp2' && ProfileId!= '00e10000000xzQ0'
+    
+//     // 2s6
+//     && ProfileId!= '00e10000000xnpR' && ProfileId!= '00e10000000xyK6'
+    
+//     // 2s7
+//     && ProfileId!= '00e10000000xnpW'
+    
+//     // 2s8
+//     && ProfileId!= '00e10000000xnpb' && ProfileId!= '00e10000000xyKB'
+    
+//     // 2s9
+//     && ProfileId!= '00e10000000a7NY'
+//     // OBA1
+//     && ProfileId!= '00e10000000s2fZ'
+//     // OBA7
+//     && ProfileId!= '00e10000000s3Jp'
+//     )
+//     {
+//     alert("鍙湁鍔╃悊鎵嶈兘杩涜鐩稿叧鎬х‘璁わ紒");
+//     return;
+//     }
+    
+    
+//     if('{!Tender_information__c.status__c}' == '01.寰呯‘璁�' ||
+//     '{!Tender_information__c.status__c}' == '02.涓嶇浉鍏�' ||
+//     '{!Tender_information__c.status__c}' == '03.涓嶅簲鏍�' ||
+//     '{!Tender_information__c.status__c}' == '04.寰呭叧鑱旇浠�' )
+//     {
+//     window.open ('/apex/Relevance?id={!Tender_information__c.Id}', '', 'height=500, width=800, top=200, left=250,location=no');
+//     }
+//     else{
+//     // alert('鍙湁01.寰呯‘璁ゆ椂闇�瑕佽繘琛岀浉鍏虫�х‘璁わ紒');
+//     alert('鍏宠仈璇环鍚庝笉鑳借繘琛岀浉鍏虫�х‘璁わ紒');
+//     }
+//     }
+//     init();
\ No newline at end of file

--
Gitblit v1.9.1