From 1363fbac72b3c291821917fc883587c1928f1651 Mon Sep 17 00:00:00 2001
From: 黄千龙 <huangqianlong@prec-tech.com>
Date: 星期二, 08 八月 2023 17:38:39 +0800
Subject: [PATCH] 20230808上传修改伟意代码
---
force-app/main/default/lwc/lexSCSubmit/lexSCSubmit.js | 51 ++++++++++++++++++++++++++++++++-------------------
1 files changed, 32 insertions(+), 19 deletions(-)
diff --git a/force-app/main/default/lwc/lexSCSubmit/lexSCSubmit.js b/force-app/main/default/lwc/lexSCSubmit/lexSCSubmit.js
index 2f0f4de..905ac6c 100644
--- a/force-app/main/default/lwc/lexSCSubmit/lexSCSubmit.js
+++ b/force-app/main/default/lwc/lexSCSubmit/lexSCSubmit.js
@@ -14,6 +14,7 @@
import {
ShowToastEvent
} from 'lightning/platformShowToastEvent';
+import LightningConfirm from 'lightning/confirm';
export default class LexSCSubmit extends LightningElement {
@api recordId;
@@ -39,12 +40,10 @@
}).then(result => {
console.log(result);
if (result != null) {
- this.IsLoading = false;
this.Id = result.Id;
this.StatusC = result.StatusC;
this.SCSubmit();
- this.dispatchEvent(new CloseActionScreenEvent());
}
}).catch(error => {
console.log(error);
@@ -54,26 +53,12 @@
// 鎻愪氦寰呭鎵�
SCSubmit() {
if (this.StatusC != '鑽夋涓�') {
- this.ShowToastEvent("宸茬粡鎻愪氦瀹℃壒", "error")
+ this.ShowToastEvent("宸茬粡鎻愪氦瀹℃壒", "error");
+ this.dispatchEvent(new CloseActionScreenEvent());
return;
}
- if (!confirm("涓�鏃CM鎻愪氦姝よ褰曚互寰呮壒鍑嗭紝鏍规嵁鎮ㄧ殑璁剧疆鎮ㄥ彲鑳戒笉鍐嶈兘澶熺紪杈戞璁板綍鎴栧皢浠栦粠鎵瑰噯杩囩▼涓皟鍥炪�傛槸鍚︾户缁紵")) {
- return;
- }
-
- updateQISSCReport({
- QId: this.Id
- }).then(result => {
- console.log(result);
- if (result.length > 0) {
- var split = result.split(", ");
- alert(split[1]);
- } else {
- this.ShowToastEvent("宸叉彁浜�", "success")
- window.location.reload();
- }
- })
+ this.handleConfirmClick("涓�鏃CM鎻愪氦姝よ褰曚互寰呮壒鍑嗭紝鏍规嵁鎮ㄧ殑璁剧疆鎮ㄥ彲鑳戒笉鍐嶈兘澶熺紪杈戞璁板綍鎴栧皢浠栦粠鎵瑰噯杩囩▼涓皟鍥炪�傛槸鍚︾户缁紵");
}
ShowToastEvent(msg, type) {
@@ -84,4 +69,32 @@
});
this.dispatchEvent(event);
}
+
+ async handleConfirmClick(msg) {
+ const result = await LightningConfirm.open({
+ message: msg,
+ variant: 'headerless',
+ label: 'this is the aria-label value'
+ });
+
+ if(result){
+ updateQISSCReport({
+ QId: this.Id
+ }).then(result => {
+ console.log(result);
+ if (result.length > 0) {
+ var split = result.split(", ");
+ this.ShowToastEvent(split[1], "error");
+ this.dispatchEvent(new CloseActionScreenEvent());
+ // alert(split[1]);
+ } else {
+ this.ShowToastEvent("宸叉彁浜�", "success");
+ this.dispatchEvent(new CloseActionScreenEvent());
+ window.location.reload();
+ }
+ })
+ }else{
+ this.dispatchEvent(new CloseActionScreenEvent());
+ }
+ }
}
\ No newline at end of file
--
Gitblit v1.9.1