From ac49e658cf9674065476431a5deb81a93d1bc25a Mon Sep 17 00:00:00 2001
From: 黄千龙 <huangqianlong@prec-tech.com>
Date: 星期三, 24 五月 2023 10:45:54 +0800
Subject: [PATCH] 0524LightningConfirm框修改
---
force-app/main/default/lwc/lexOCSMNoToReportLighting/lexOCSMNoToReportLighting.js | 57 +++++++++++++++++++++++++++++++++------------------------
1 files changed, 33 insertions(+), 24 deletions(-)
diff --git a/force-app/main/default/lwc/lexOCSMNoToReportLighting/lexOCSMNoToReportLighting.js b/force-app/main/default/lwc/lexOCSMNoToReportLighting/lexOCSMNoToReportLighting.js
index 2c3c93c..f013db3 100644
--- a/force-app/main/default/lwc/lexOCSMNoToReportLighting/lexOCSMNoToReportLighting.js
+++ b/force-app/main/default/lwc/lexOCSMNoToReportLighting/lexOCSMNoToReportLighting.js
@@ -2,6 +2,7 @@
import { CurrentPageReference } from "lightning/navigation";
import { CloseActionScreenEvent } from 'lightning/actions';
import { NavigationMixin } from 'lightning/navigation';
+import LightningConfirm from 'lightning/confirm';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import init from '@salesforce/apex/QISReportController.initForlexOCSMNoToReportLightingButton';
import updateQis from '@salesforce/apex/QISReportController.updateQisForlexOCSMNoToReportLighting';
@@ -42,32 +43,40 @@
this.OCSMAdministrativeReportDate = result.oCSMAdministrativeReportDate;
this.qisReportId = result.Id;
this.Awaredate = result.awaredate;
- if (!confirm("涓嶈鎶ュ憡鍚庢棤娉曟挙鍥烇紝鏄惁缁х画锛�")) {
- this.dispatchEvent(new CloseActionScreenEvent());
- return;
- }
- if (this.OCSMAdministrativeReportDate != null || this.OCSMAdministrativeReportNumber != null) {
- const evt = new ShowToastEvent({
- title : '宸茬粡鎶ュ憡鐨凲IS锛屼笉鍙互鐐瑰嚮OCSM涓嶈鎶ュ憡',
- message: '',
- variant: 'error'
- });
- this.dispatchEvent(evt);
+ LightningConfirm.open({
+ message: '涓嶈鎶ュ憡鍚庢棤娉曟挙鍥烇紝鏄惁缁х画锛�',
+ variant: 'headerless',
+ label: 'this is the aria-label value',
+ }).then(res=>{
+ if(res) {
+ if (this.OCSMAdministrativeReportDate != null || this.OCSMAdministrativeReportNumber != null) {
+ const evt = new ShowToastEvent({
+ title : '宸茬粡鎶ュ憡鐨凲IS锛屼笉鍙互鐐瑰嚮OCSM涓嶈鎶ュ憡',
+ message: '',
+ variant: 'error'
+ });
+ this.dispatchEvent(evt);
+ this.dispatchEvent(new CloseActionScreenEvent());
+ return;
+ }
+ if (this.Awaredate!=null) {
+ this.updateQisSubmit();
+ }else{
+ const evt = new ShowToastEvent({
+ title : '娌℃湁AwareDate鎴栧凡缁廜CSM琛屾斂鎶ュ憡锛岃纭',
+ message: '',
+ variant: 'error'
+ });
+ this.dispatchEvent(evt);
+ this.dispatchEvent(new CloseActionScreenEvent());
+ return;
+ }
+ }else{
this.dispatchEvent(new CloseActionScreenEvent());
return;
- }
- if (this.Awaredate!=null) {
- this.updateQisSubmit();
- }else{
- const evt = new ShowToastEvent({
- title : '娌℃湁AwareDate鎴栧凡缁廜CSM琛屾斂鎶ュ憡锛岃纭',
- message: '',
- variant: 'error'
- });
- this.dispatchEvent(evt);
- this.dispatchEvent(new CloseActionScreenEvent());
- return;
- }
+ }
+
+ });
}).catch(error => {
console.log('error='+error);
}).finally(() => {
--
Gitblit v1.9.1