From db0fa56676f63e02a43900891781aa67498f9ea6 Mon Sep 17 00:00:00 2001
From: twysparks <twysparks@163.com>
Date: 星期一, 15 五月 2023 13:49:04 +0800
Subject: [PATCH] tt
---
force-app/main/default/lwc/lexCustomDelete/lexCustomDelete.js | 28 +++++++++++++++++-----------
1 files changed, 17 insertions(+), 11 deletions(-)
diff --git a/force-app/main/default/lwc/lexCustomDelete/lexCustomDelete.js b/force-app/main/default/lwc/lexCustomDelete/lexCustomDelete.js
index 4ae611c..5123b26 100644
--- a/force-app/main/default/lwc/lexCustomDelete/lexCustomDelete.js
+++ b/force-app/main/default/lwc/lexCustomDelete/lexCustomDelete.js
@@ -12,7 +12,9 @@
import init from '@salesforce/apex/otherButtonRepairController.init';
import selectCustomDeleteById from '@salesforce/apex/otherButtonRepairController.selectCustomDeleteById';
import deleteRepair from '@salesforce/apex/otherButtonRepairController.deleteRepair';
-
+import {
+ ShowToastEvent
+} from 'lightning/platformShowToastEvent';
export default class LexCustomDelete extends LightningElement {
@api recordId;
@@ -59,17 +61,12 @@
}).then(repList => {
if (repList != null && repList.length > 0) {
var rp = repList[0];
- if (rp.Status__c != "鑽夋涓�" &&
- rp.Status__c != "1.鍙楃悊瀹屾瘯(SAP寰呭彂閫�)" &&
- rp.Status__c != "4.淇悊鍝佽繑閫侀樁娈�"
- ) {
- alert("涓嶆槸鑽夋涓紝涓嶈兘鍒犻櫎");
- } else if (rp.Status__c == "4.淇悊鍝佽繑閫侀樁娈�" &&
- (rp.SAP_Transfer_time__c != "" || rp.Repair_Ordered_Date__c != "")
- ) {
- alert("宸茬粡鍙戦�佽繃SAP锛屼笉鑳藉垹闄�");
+ if (rp.Status__c != "鑽夋涓�" && rp.Status__c != "1.鍙楃悊瀹屾瘯(SAP寰呭彂閫�)" && rp.Status__c != "4.淇悊鍝佽繑閫侀樁娈�") {
+ this.ShowToastEvent("涓嶆槸鑽夋涓紝涓嶈兘鍒犻櫎", "error")
+ } else if (rp.Status__c == "4.淇悊鍝佽繑閫侀樁娈�" && (rp.SAP_Transfer_time__c != undefined || rp.Repair_Ordered_Date__c != undefined)) {
+ this.ShowToastEvent("宸茬粡鍙戦�佽繃SAP锛屼笉鑳藉垹闄�", "error")
} else if (this.userID.substring(0, 15) != rp.CreatedById.substring(0, 15) && this.userID.substring(0, 15) != rp.Acc_OwnerId__c.substring(0, 15) && this.userID.substring(0, 15) != rp.FSE_ownerid__c.substring(0, 15)) {
- alert("涓嶆槸鎵�鏈変汉銆佸垱寤轰汉鎴朏SE涓昏礋璐d汉锛屼笉鑳藉垹闄�");
+ this.ShowToastEvent("涓嶆槸鎵�鏈変汉銆佸垱寤轰汉鎴朏SE涓昏礋璐d汉锛屼笉鑳藉垹闄�", "error")
} else {
if (confirm("鏄惁纭畾锛�")) {
deleteRepair({
@@ -86,4 +83,13 @@
}
})
}
+
+ ShowToastEvent(msg, type) {
+ const event = new ShowToastEvent({
+ title: '',
+ message: msg,
+ variant: type
+ });
+ this.dispatchEvent(event);
+ }
}
\ No newline at end of file
--
Gitblit v1.9.1