From 988f9735377909b6310301e582c15804e004783f Mon Sep 17 00:00:00 2001
From: 19626 <1962676589@qq.com>
Date: 星期六, 07 十月 2023 10:36:13 +0800
Subject: [PATCH] 近期修改cjw
---
force-app/main/default/lwc/lexLoseReport/lexLoseReport.js | 44 ++++++++++++++++++++++++++++++++++++++++----
1 files changed, 40 insertions(+), 4 deletions(-)
diff --git a/force-app/main/default/lwc/lexLoseReport/lexLoseReport.js b/force-app/main/default/lwc/lexLoseReport/lexLoseReport.js
index 432e6d8..270d206 100644
--- a/force-app/main/default/lwc/lexLoseReport/lexLoseReport.js
+++ b/force-app/main/default/lwc/lexLoseReport/lexLoseReport.js
@@ -4,7 +4,7 @@
* @Author: chen jing wu
* @Date: 2023-04-20 14:08:55
* @LastEditors: chen jing wu
- * @LastEditTime: 2023-08-25 16:44:13
+ * @LastEditTime: 2023-09-25 13:21:17
*/
/*
* @Description:
@@ -20,6 +20,8 @@
import { updateRecord } from 'lightning/uiRecordApi';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import init from '@salesforce/apex/OpportunityLightingButtonController.initForLostReportButton';
+import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
+import {loadStyle} from 'lightning/platformResourceLoader';
export default class LexLoseReport extends LightningElement {
@api recordId;
stageName;
@@ -32,6 +34,7 @@
salesManagerDepartmentID;
salesOwnerBuchang;
salesOwnerBuchangID;
+ cntLostCancelDraft;
IsLoading = true;
@wire(CurrentPageReference)
getStateParameters(currentPageReference) {
@@ -49,6 +52,10 @@
}
}
connectedCallback(){
+ Promise.all([
+ loadStyle(this, lwcCSS)
+ ]);
+
init({
recordId: this.recordId
}).then(result=>{
@@ -62,6 +69,7 @@
this.salesManagerDepartmentID = result.salesManagerDepartmentID;
this.salesOwnerBuchang = result.salesOwnerBuchang;
this.salesOwnerBuchangID = result.salesOwnerBuchangID;
+ this.cntLostCancelDraft = result.cntLostCancelDraft;
this.loseReport();
})
}
@@ -75,8 +83,9 @@
else if (this.sapSendOK == '1') {
this.showToast("宸茬粡涓婁紶SAP銆佷笉鑳藉仛 澶卞崟 浜嗭紒","error");
}
- else if (this.cntLostCancelReport > 0) {
- this.showToast("璇环宸茬粡鏈� 鍙栨秷锛忓け鍗曟姤鍛� 浜嗭紒","error");
+ else if (this.cntLostCancelReport - this.cntLostCancelDraft > 0) {
+ // this.showToast("璇环宸茬粡鏈� 鍙栨秷锛忓け鍗曟姤鍛� 浜嗭紒","error");
+ this.showToast('璇环宸茬粡鏈� 鍙栨秷锛忓け鍗曟姤鍛� 浜嗭紒','error');
}
//else if({!Not(ISBLANK(Opportunity.Bidding_Project_Name_Bid__c))} && //'{!Opportunity.InfoTypeBid__c}' != '3锛氱粨鏋�' ){
//alert("鍏宠仈鎷涙姇鏍囬」鐩殑璇环锛屽彧鑳藉湪鏈夌粨鏋滃悗鍋氬け鍗曟姤鍛婏紒");
@@ -103,10 +112,37 @@
title: ' ',
message: msg,
variant: type,
- mode: 'sticky'
+ duration: 15000
});
this.dispatchEvent(event);
}
+ //鏄剧ず淇℃伅
+ showMyToast(title, message, variant) {
+ console.log('show custom message');
+ let iconName = '';
+ let content = '';
+ if (variant == 'success') {
+ iconName = 'utility:check';
+ } else {
+ iconName = 'utility:error';
+ }
+ if (message != '') {
+ content =
+ '<h2><strong>' +
+ title +
+ '<strong/></h2><h5>' +
+ message +
+ '</h5>';
+ } else {
+ content = '<h2><strong>' + title + '<strong/></h2>';
+ }
+ this.template
+ .querySelector('c-common-toast')
+ .showToast(variant, content, iconName, 10000).then(result=>{
+ this.dispatchEvent(new CloseActionScreenEvent());
+ });
+ this.isLoading = false;
+ }
updateRecordView(recordId) {
updateRecord({fields: { Id: recordId }});
}
--
Gitblit v1.9.1