From 35910c355f74e736e2068a0ffb7f39ae9615d8e1 Mon Sep 17 00:00:00 2001
From: chenjingwu <chenjingwu@prec-tech.com>
Date: 星期五, 24 五月 2024 16:29:00 +0800
Subject: [PATCH] 1
---
force-app/main/default/lwc/lexSISubmit/lexSISubmit.js | 43 ++++++++++++++++++++++++++++++++++---------
1 files changed, 34 insertions(+), 9 deletions(-)
diff --git a/force-app/main/default/lwc/lexSISubmit/lexSISubmit.js b/force-app/main/default/lwc/lexSISubmit/lexSISubmit.js
index 7b51ea2..3a1b5ff 100644
--- a/force-app/main/default/lwc/lexSISubmit/lexSISubmit.js
+++ b/force-app/main/default/lwc/lexSISubmit/lexSISubmit.js
@@ -7,6 +7,9 @@
import init from '@salesforce/apex/ISOpportunityDemand.initISOpportunityController';
import submit from '@salesforce/apex/ISOpportunityDemand.submit';
+import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
+import {loadStyle} from 'lightning/platformResourceLoader';
+import LightningConfirm from 'lightning/confirm';
export default class LexSiSubmit extends LightningElement {
@api recordId;
@@ -28,14 +31,25 @@
}
connectedCallback(){
+ Promise.all([
+ loadStyle(this, lwcCSS)
+ ]);
this.IsLoading = false;
// this.submit();
init({recordId:this.recordId})
.then(result=>{
console.log("lexsubmit------>>>",result)
- if (!confirm("涓�鏃︽彁浜ゆ璁板綍浠ュ緟鎵瑰噯锛屾牴鎹偍鐨勮缃偍鍙兘涓嶅啀鑳藉缂栬緫姝よ褰曟垨灏嗕粬浠庢壒鍑嗚繃绋嬩腑璋冨洖銆傛槸鍚︾户缁紵")) {
- return;
- }
+ // if (!confirm("涓�鏃︽彁浜ゆ璁板綍浠ュ緟鎵瑰噯锛屾牴鎹偍鐨勮缃偍鍙兘涓嶅啀鑳藉缂栬緫姝よ褰曟垨灏嗕粬浠庢壒鍑嗚繃绋嬩腑璋冨洖銆傛槸鍚︾户缁紵")) {
+ // return;
+ // }
+ // this.handleConfirmClick();
+ LightningConfirm.open({
+ message: "涓�鏃︽彁浜ゆ璁板綍浠ュ緟鎵瑰噯锛屾牴鎹偍鐨勮缃偍鍙兘涓嶅啀鑳藉缂栬緫姝よ褰曟垨灏嗕粬浠庢壒鍑嗚繃绋嬩腑璋冨洖銆傛槸鍚︾户缁紵",
+ variant: 'headerless',
+ label: '鎻愮ず淇℃伅',
+ // setting theme would have no effect
+ }).then(res=>{
+ if(!res) return;
if (result.checkTf !=true ) {
this.showToast('璇疯惀涓氭媴褰撴彁浜ゅ鎵�','error')
return;
@@ -62,6 +76,7 @@
.finally(()=>{
window.location.reload();
})
+ })
})
.catch(e=>{console.log(e)})
.finally(()=>{
@@ -71,12 +86,22 @@
showToast(msg,type) {
- const event = new ShowToastEvent({
- title: '',
- message: msg,
- variant: type
- });
- this.dispatchEvent(event);
+ if(type == "success"){
+ const event = new ShowToastEvent({
+ // title: '',
+ message: msg,
+ variant: type
+ });
+ this.dispatchEvent(event);
+ }else{
+ const event = new ShowToastEvent({
+ // title: '',
+ message: msg,
+ variant: type,
+ mode:'sticky'
+ });
+ this.dispatchEvent(event);
+ }
this.dispatchEvent(new CloseActionScreenEvent());
}
--
Gitblit v1.9.1