From 50ce6a5e5ae7ac6ce3e6281acca9a0db568306e6 Mon Sep 17 00:00:00 2001
From: unknown <sunxia@prec-tech.com>
Date: 星期三, 23 八月 2023 14:54:59 +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 | 46 ++++++++++++++++++++++++++++++++--------------
1 files changed, 32 insertions(+), 14 deletions(-)
diff --git a/force-app/main/default/lwc/lexTenderingLostButton/lexTenderingLostButton.js b/force-app/main/default/lwc/lexTenderingLostButton/lexTenderingLostButton.js
index 680d893..dcfd4d2 100644
--- a/force-app/main/default/lwc/lexTenderingLostButton/lexTenderingLostButton.js
+++ b/force-app/main/default/lwc/lexTenderingLostButton/lexTenderingLostButton.js
@@ -1,16 +1,24 @@
+/*
+ * @Author: zhangchunxu
+ * @Date: 2023-06-27 16:51:18
+ * @LastEditors: zhangchunxu
+ * @LastEditTime: 2023-08-04 13:17:42
+ *
+ */
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';
+import LightningConfirm from 'lightning/confirm';
export default class lexTenderingLostButton extends LightningElement {
@api recordId;//褰撳墠杩欐潯鏁版嵁鐨刬d
status;//鐘舵��
profileId;//profileId id
systemProfileId;
- SalesManagerId;
- SalesHospitalId;
+ TwoS1_Sales_Hospital;
+ TwoS4_Sales_Manager;
IsLoading = true;
@wire(CurrentPageReference)
@@ -33,10 +41,9 @@
this.status = result.status;
this.profileId = result.profileId;
this.systemProfileId = result.systemProfileId;
- this.SalesManagerId = result.SalesManagerId;
- this.SalesHospitalId = result.SalesHospitalId;
+ this.TwoS1_Sales_Hospital = result.TwoS1_Sales_Hospital;
+ this.TwoS4_Sales_Manager = result.TwoS4_Sales_Manager;
this.LoseButton();
- this.dispatchEvent(new CloseActionScreenEvent());
})
}
@@ -44,25 +51,35 @@
LoseButton(){
sqlResult({id: this.recordId}).then(result=>{
//绠�妗f潈闄� 2S1_閿�鍞尰闄㈡媴褰� 2S4_閿�鍞鐞嗚�� 绯荤粺绠$悊鍛�
- if (this.profileId != this.SalesManagerId && this.profileId != this.SalesHospitalId && this.profileId != this.systemProfileId) {
+ if (this.profileId != this.TwoS1_Sales_Hospital && this.profileId != this.TwoS4_Sales_Manager && this.profileId != this.systemProfileId) {
this.showToast("鎮ㄦ病鏈夋潈闄愶紝鏃犳硶鍒涘缓璇环鎻愪氦澶卞崟銆�","error");
return;
}
// 鍒ゆ柇鍐呴儴纭鐘舵��
if(this.status == '01.寰呯‘璁�'|| this.status == '02.涓嶇浉鍏�'){
- console.log('娌¤蛋鍚�');
this.showToast("鐘舵�佷负寰呯‘璁ゆ垨涓嶇浉鍏筹紝涓嶅彲浠ュ仛澶卞崟銆�","error");
return;
}
// 鍒ゆ柇鏄惁闇�瑕佹柊寤鸿浠�
if(this.status == '05.璇环涓�'|| this.status == '06.鎴愪氦' || this.status == '07.閮ㄥ垎鎴愪氦' || this.status == '08.澶卞崟' || result.length > 0){
- if(confirm('姝ら」鐩凡鍏宠仈璇环锛岃纭疄鏄惁鏂板缓璇环鎻愪氦澶卞崟銆�')) {
-
- }else{
- return;
- }
+ LightningConfirm.open({
+ message: '姝ら」鐩凡鍏宠仈璇环锛岃纭疄鏄惁鏂板缓璇环鎻愪氦澶卞崟銆�',
+ variant: 'headerless',
+ label: 'this is the aria-label value',
+ }).then(res=>{
+ if(res) {
+ window.open(`/apex/TenderLostPage?id=${this.recordId}`,'','height=500,width=800,top=200,left=250,location=no');
+ this.dispatchEvent(new CloseActionScreenEvent());
+ }else{
+ this.dispatchEvent(new CloseActionScreenEvent());
+ return;
+ }
+ });
}
- window.open(`/apex/TenderLostPage?id=${this.recordId}`,'','height=500,width=800,top=200,left=250,location=no');
+ if(this.status == "04.寰呭叧鑱旇浠�"){
+ window.open(`/apex/TenderLostPage?id=${this.recordId}`,'','height=500,width=800,top=200,left=250,location=no');
+ this.dispatchEvent(new CloseActionScreenEvent());
+ }
})
}
showToast(msg,type) {
@@ -71,5 +88,6 @@
variant: type
});
this.dispatchEvent(event);
+ this.dispatchEvent(new CloseActionScreenEvent());
}
-}
+}
\ No newline at end of file
--
Gitblit v1.9.1