From ddb0231ef7c5cf2bad9d3f1afc2f733674ad38a5 Mon Sep 17 00:00:00 2001
From: unknown <sunxia@prec-tech.com>
Date: 星期四, 24 八月 2023 14:50:51 +0800
Subject: [PATCH] 再修理按钮
---
force-app/main/default/lwc/lexCustomNewMCMaintenance/lexCustomNewMCMaintenance.js | 58 +++++++++++++++++++++++++++++++++++++++-------------------
1 files changed, 39 insertions(+), 19 deletions(-)
diff --git a/force-app/main/default/lwc/lexCustomNewMCMaintenance/lexCustomNewMCMaintenance.js b/force-app/main/default/lwc/lexCustomNewMCMaintenance/lexCustomNewMCMaintenance.js
index 7fe37a2..86a5138 100644
--- a/force-app/main/default/lwc/lexCustomNewMCMaintenance/lexCustomNewMCMaintenance.js
+++ b/force-app/main/default/lwc/lexCustomNewMCMaintenance/lexCustomNewMCMaintenance.js
@@ -10,6 +10,7 @@
CloseActionScreenEvent
} from 'lightning/actions';
import init from '@salesforce/apex/otherButtonMaintenanceContractCtl.init';
+import LightningConfirm from 'lightning/confirm';
export default class LexCustomNewMCMaintenance extends LightningElement {
@api recordId;
@@ -18,8 +19,9 @@
Id;
StatusC;
IsRecognitionModelC;
- RecordTypeId;
URFContractC;
+ RecordTypeDeveloperNameC;
+ msg;
@wire(CurrentPageReference)
getStateParameters(currentPageReference) {
@@ -39,13 +41,12 @@
}).then(result => {
console.log(result);
if (result != null) {
- this.IsLoading = false;
this.Id = result.Id;
this.StatusC = result.StatusC;
this.IsRecognitionModelC = result.IsRecognitionModelC;
- this.RecordTypeId = result.RecordTypeId;
this.URFContractC = result.URFContractC;
- this.RecordTypeId1 = result.RecordTypeId1;
+ this.RecordTypeDeveloperNameC = result.RecordTypeDeveloperNameC;
+
this.CustomNewMC();
this.dispatchEvent(new CloseActionScreenEvent());
}
@@ -56,26 +57,45 @@
// 鏂板缓鏂版湇鍔″悎鍚屾姤浠�
CustomNewMC() {
- if ( this.StatusC != "寮曞悎涓�") {
- alert("缁翠慨鍚堝悓涓嶆槸璇环涓殑鐘舵�侊紝涓嶈兘鏂板缓鎶ヤ环");
+ if (this.StatusC != "寮曞悎涓�") {
+ this.msg = "缁翠慨鍚堝悓涓嶆槸璇环涓殑鐘舵�侊紝涓嶈兘鏂板缓鎶ヤ环";
+ this.IsLoading = false;
} else {
- //缁翠慨鍚堝悓鏂板缓鎶ヤ环鏃讹紝濡傛灉鏄厛娆惧璞★紝寮瑰嚭瀵硅瘽妗嗘彁绀� thh 20220304 start
if (this.IsRecognitionModelC == 1) {
- if (!confirm("璇ョ粡閿�鍟嗕负鍏堟瀵硅薄锛屾槸鍚︾户缁柊寤烘姤浠凤紵")) {
- return;
- }
- }
- //缁翠慨鍚堝悓鏂板缓鎶ヤ环鏃讹紝濡傛灉鏄厛娆惧璞★紝寮瑰嚭瀵硅瘽妗嗘彁绀� thh 20220304 end
- if (this.RecordTypeId == this.RecordTypeId1) {
- if (this.URFContractC == "0") {
- window.open("/apex/SelectAssetEstimateVM?mcid=" + this.Id, "_top");
- } else {
- window.open("/apex/SelectAssetEstimateURF?mcid=" + this.Id, "_top");
- }
+ this.handleConfirmClick("璇ョ粡閿�鍟嗕负鍏堟瀵硅薄锛屾槸鍚︾户缁柊寤烘姤浠凤紵")
} else {
- window.open("/apex/SelectAssetEstimate?mcid=" + this.Id, "_top");
+ this.ll();
}
}
}
+
+ ll() {
+ if (this.RecordTypeDeveloperNameC == "NewMaintenance_Contract") {
+ if (this.URFContractC == 0) {
+ window.open("/apex/SelectAssetEstimateVM?mcid=" + this.Id, "_top");
+ } else {
+ window.open("/apex/SelectAssetEstimateURF?mcid=" + this.Id, "_top");
+ }
+ } else {
+ window.open("/apex/SelectAssetEstimate?mcid=" + this.Id, "_top");
+ }
+ }
+
+ async handleConfirmClick(msg) {
+ const result = await LightningConfirm.open({
+ message: msg,
+ variant: 'headerless',
+ label: 'this is the aria-label value'
+ });
+ if (result) {
+ this.ll();
+ } else {
+ window.history.go(-1);
+ }
+ }
+
+ closeAction() {
+ window.history.go(-1);
+ }
}
\ No newline at end of file
--
Gitblit v1.9.1