From 50ce6a5e5ae7ac6ce3e6281acca9a0db568306e6 Mon Sep 17 00:00:00 2001
From: unknown <sunxia@prec-tech.com>
Date: 星期三, 23 八月 2023 14:54:59 +0800
Subject: [PATCH] Merge branch 'LEX_dev' of http://47.92.229.245:8089/r/lightningupdate into LEX_dev
---
force-app/main/default/lwc/lexLostSubmitApproval/lexLostSubmitApproval.js | 63 +++++++++++++++----------------
1 files changed, 31 insertions(+), 32 deletions(-)
diff --git a/force-app/main/default/lwc/lexLostSubmitApproval/lexLostSubmitApproval.js b/force-app/main/default/lwc/lexLostSubmitApproval/lexLostSubmitApproval.js
index 4598166..24375b3 100644
--- a/force-app/main/default/lwc/lexLostSubmitApproval/lexLostSubmitApproval.js
+++ b/force-app/main/default/lwc/lexLostSubmitApproval/lexLostSubmitApproval.js
@@ -3,6 +3,7 @@
import { CloseActionScreenEvent } from 'lightning/actions';
import updateForSubmitButton from '@salesforce/apex/ReportController.updateForSubmitButton';
import { updateRecord } from 'lightning/uiRecordApi';
+import LightningConfirm from 'lightning/confirm';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import init from '@salesforce/apex/LexLostSubmitApprovalController.LexLostSubmitApprovalController';
import submit from '@salesforce/apex/LexLostSubmitApprovalController.submit';
@@ -35,16 +36,19 @@
console.log("LexConsumablesLost------>>>",result)
if (result.statusTf == "濉啓瀹屾瘯" || result.statusTf == "鐢宠涓�" || result.statusTf == "宸叉壒鍑�") {
- this.showToast('璇风‘璁ら仐澶辨姤鍛婄姸鎬侊紝宸茬粡鎻愪氦杩囩殑鐢宠锛屼笉鑳介噸澶嶆彁浜�','warning')
- return;
+ this.showToast('124563','璇风‘璁ら仐澶辨姤鍛婄姸鎬侊紝宸茬粡鎻愪氦杩囩殑鐢宠锛屼笉鑳介噸澶嶆彁浜�','error');
}
-
- if (!confirm("涓�鏃︽彁浜ゆ璁板綍浠ュ緟鎵瑰噯锛屾牴鎹偍鐨勮缃偍鍙兘涓嶅啀鑳藉缂栬緫姝よ褰曟垨灏嗕粬浠庢壒鍑嗚繃绋嬩腑璋冨洖銆傛槸鍚︾户缁紵")) {
- return;
- }
-
- // -----------------------------------------------------------------------------------------------------
+ // if (!confirm("涓�鏃︽彁浜ゆ璁板綍浠ュ緟鎵瑰噯锛屾牴鎹偍鐨勮缃偍鍙兘涓嶅啀鑳藉缂栬緫姝よ褰曟垨灏嗕粬浠庢壒鍑嗚繃绋嬩腑璋冨洖銆傛槸鍚︾户缁紵")) {
+ // return;
+ // }
+ LightningConfirm.open({
+ message: "涓�鏃︽彁浜ゆ璁板綍浠ュ緟鎵瑰噯锛屾牴鎹偍鐨勮缃偍鍙兘涓嶅啀鑳藉缂栬緫姝よ褰曟垨灏嗕粬浠庢壒鍑嗚繃绋嬩腑璋冨洖銆傛槸鍚︾户缁紵",
+ variant: 'headerless',
+ label: '鎻愮ず淇℃伅',
+ // setting theme would have no effect
+ }).then(submitgo=>{
if (result.reportDetailList.length > 0) {
+ // console.log("-----reportDetailList-----------",result.reportDetailList.length);
var qianpinDate = new Date(result.reportDetailList[0].Rental_Apply_Equipment_Set_Detail__r.Lost_item_check_day__c);
for (var i = 1; i < result.reportDetailList.length; i++) {
var d = new Date(result.reportDetailList[i].Rental_Apply_Equipment_Set_Detail__r.Lost_item_check_day__c);
@@ -54,29 +58,13 @@
}
qianpinDate.setDate(qianpinDate.getDate() + 90);
var d = '' + qianpinDate.getFullYear()+'/' + (qianpinDate.getMonth()+1) + '/' + qianpinDate.getDate();
- this.showToast('璇锋偍鐨勪笂绾ч瀵间簬' + d + '鍓嶅畬鎴愰仐澶辨姤鍛婂鎵癸紝鍚﹀垯澶囧搧鑷姩鏂康锛岄仐澶辨姤鍛婅嚜鍔ㄥ彇娑堛��','warning');
+ this.showToast('璇锋偍鐨勪笂绾ч瀵间簬' + d + '鍓嶅畬鎴愰仐澶辨姤鍛婂鎵癸紝鍚﹀垯澶囧搧鑷姩鏂康锛岄仐澶辨姤鍛婅嚜鍔ㄥ彇娑堛��','error');
}
- // -----------------------------------------------------------------------------------------------------
-
- this.submitApproval()
+ this.submitApproval();
+ })
})
.catch(e=>{console.log(e)})
- .finally(()=>{
- this.dispatchEvent(new CloseActionScreenEvent());
- })
}
-
-
- showToast(msg,type) {
- const event = new ShowToastEvent({
- // title: '',
- message: msg,
- variant: type
- });
- this.dispatchEvent(event);
- this.dispatchEvent(new CloseActionScreenEvent());
- }
-
updateRecordView(recordId) {
updateRecord({fields: { Id: recordId }});
@@ -87,15 +75,26 @@
recordId: this.recordId
}).then(result=>{
if(result != '1'){
- this.showToast(result,"warning");
- return
+ this.showToast('','姝よ褰曚笉婊¤冻浠讳綍鏈夋晥鎵瑰噯杩囩▼鐨勯」鐩潯浠舵垨鍒濆鎻愪氦銆傝涓庢偍鐨勭鐞嗗憳鑱旂郴浠ヨ幏鍙栧府鍔┿��','error');
+ return;
}
this.updateRecordView(this.recordId);
- // this.showToast("鎻愪氦鎴愬姛","success");
+ this.showToast("鎻愪氦鎴愬姛","success");
this.dispatchEvent(new CloseActionScreenEvent());
- })
- .finally(()=>{
window.location.reload();
})
+ .catch(e=>{
+ console.log("submitApproval----eee------->>>>",e);
+ })
}
+
+ showToast(title,msg,type) {
+ const event = new ShowToastEvent({
+ title: '',
+ message: msg,
+ variant: type
+ });
+ this.dispatchEvent(event);
+ this.dispatchEvent(new CloseActionScreenEvent());
+ }
}
\ No newline at end of file
--
Gitblit v1.9.1