From fd1234ddc5be42b9ec2fad9d9286cd2aa58eb0ef Mon Sep 17 00:00:00 2001
From: unknown <sunxia@prec-tech.com>
Date: 星期二, 11 四月 2023 14:29:54 +0800
Subject: [PATCH] Merge branch 'LEX_dev' of http://47.92.229.245:8089/r/lightningupdate into LEX_dev

---
 force-app/main/default/lwc/lexTenderingLostButton/lexTenderingLostButton.js |   71 +++++++++++++++++++++++++++++++++++
 1 files changed, 71 insertions(+), 0 deletions(-)

diff --git a/force-app/main/default/lwc/lexTenderingLostButton/lexTenderingLostButton.js b/force-app/main/default/lwc/lexTenderingLostButton/lexTenderingLostButton.js
new file mode 100644
index 0000000..ff5d294
--- /dev/null
+++ b/force-app/main/default/lwc/lexTenderingLostButton/lexTenderingLostButton.js
@@ -0,0 +1,71 @@
+import { LightningElement,wire,track,api} from 'lwc';
+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 lexTenderingLostButton extends LightningElement {
+    @api recordId;//褰撳墠杩欐潯鏁版嵁鐨刬d
+    id;//杩斿洖鍊肩殑id  Tender_information__c鎷涙爣椤圭洰鐨刬d
+    status;//鐘舵��
+    profileId;//profileId id
+    IsLoading = true;
+
+    @wire(CurrentPageReference)
+     getStateParameters(currentPageReference) {
+         if (currentPageReference) {
+           const urlValue = currentPageReference.state.recordId;
+           if (urlValue) {
+             let str = `${urlValue}`;
+             this.recordId = str;
+           }
+         }
+     }
+    
+
+    connectedCallback(){
+        init({
+            recordId: this.recordId
+        }).then(result => {
+                this.IsLoading = false;
+                this.id = result.Id;
+                this.status = result.status;
+                this.profileId = result.profileId.slice(0,15);
+                this.LoseButton();
+                this.dispatchEvent(new CloseActionScreenEvent());
+        })        
+    }
+
+    //鎷涙爣椤圭洰澶卞崟
+    LoseButton(){
+        sqlResult({id: this.id}).then(result=>{
+            //绠�妗f潈闄� 2S1_閿�鍞尰闄㈡媴褰� 2S4_閿�鍞鐞嗚�� 绯荤粺绠$悊鍛�
+            if (this.profileId != '00e10000000xnp2' && this.profileId != '00e10000000xnpH' && this.profileId != '00e10000000Y3o5') {
+                this.showToast("鎮ㄦ病鏈夋潈闄愶紝鏃犳硶鍒涘缓璇环鎻愪氦澶卞崟銆�","error");
+                return;
+            }
+            // 鍒ゆ柇鍐呴儴纭鐘舵��
+            if(this.status == '01.寰呯‘璁�'|| this.status == '02.涓嶇浉鍏�'){ 
+                this.showToast("鐘舵�佷负寰呯‘璁ゆ垨涓嶇浉鍏筹紝涓嶅彲浠ュ仛澶卞崟銆�","error");
+                return;
+            }
+            // 鍒ゆ柇鏄惁闇�瑕佹柊寤鸿浠�
+            if(this.status == '05.璇环涓�'|| this.status == '06.鎴愪氦' || this.status == '07.閮ㄥ垎鎴愪氦' || this.status == '08.澶卞崟' || result.length > 0){
+                if(confirm('姝ら」鐩凡鍏宠仈璇环锛岃纭疄鏄惁鏂板缓璇环鎻愪氦澶卞崟銆�')) {
+                    
+                }else{
+                    return;
+                }
+            }
+            window.open(`/apex/TenderLostPage?id=${this.id}`,'','height=500,width=800,top=200,left=250,location=no');
+        })
+    }
+    showToast(msg,type) {
+        const event = new ShowToastEvent({
+            message: msg,
+            variant: type
+        });
+        this.dispatchEvent(event);
+        this.dispatchEvent(new CloseActionScreenEvent());
+    }
+}
\ No newline at end of file

--
Gitblit v1.9.1