From 25f056535350a0b80bad50d2cc45311998e5d1cd Mon Sep 17 00:00:00 2001
From: 19626 <1962676589@qq.com>
Date: 星期一, 09 十月 2023 18:28:00 +0800
Subject: [PATCH] 近期修改
---
force-app/main/default/lwc/tenderLost/tenderLost.js | 37 ++++++++++++++++++++++++++-----------
1 files changed, 26 insertions(+), 11 deletions(-)
diff --git a/force-app/main/default/lwc/tenderLost/tenderLost.js b/force-app/main/default/lwc/tenderLost/tenderLost.js
index 6530e03..0318df7 100644
--- a/force-app/main/default/lwc/tenderLost/tenderLost.js
+++ b/force-app/main/default/lwc/tenderLost/tenderLost.js
@@ -4,9 +4,14 @@
// import SearchParent from '@salesforce/apex/TenderLostController.SearchParent';
import InitData from '@salesforce/apex/TenderLostController.InitData';
import LinkedHospitals from '@salesforce/apex/TenderLostController.LinkedHospitals';
+import { ShowToastEvent } from 'lightning/platformShowToastEvent';
+import { CloseActionScreenEvent } from 'lightning/actions';
export default class TenderLost extends LightningElement {
-
+ @api
+ recordid;
+ @api
+ url;
//璧勯噾鏉ユ簮閫夐」
RelateOption=[
{label:"鏀垮簻鎷ㄦ",value:"鏀垮簻璩囬噾"},
@@ -61,8 +66,8 @@
//鍒濆鍖�
connectedCallback(){
- this.tenId = this.getQueryVariable('id');
-
+ // this.tenId = this.getQueryVariable('id');
+ this.tenId = this.recordid
InitData({ParamIdStr:this.tenId}).then(response=>{
this.opp=JSON.parse(response);
});
@@ -105,19 +110,22 @@
//淇濆瓨鏁版嵁閫昏緫
saveFn(){
if(this.opp.Fund_Basis__c == undefined || this.opp.Sales_Method__c == undefined || this.opp.AccountId == undefined){
- this.Alert("璇蜂笉瑕佽緭鍏ョ┖鍝︺��",false,true);
+ this.showToast("璇蜂笉瑕佽緭鍏ョ┖鍝︺��",'error')
}else{
this.OnLoading(true);
SaveData({JsonData:JSON.stringify(this.opp)}).then((response)=>{
if (response != '' && response.indexOf('閿欒') < 0) {
this.OnLoading(false);
console.log(response);
- this.Alert("淇濆瓨鎴愬姛",false,true);
- window.open('/apex/PCLLostReportPage?pageStatus=Create&oppId=' + response + '&lostType=澶卞崟');
+ // this.Alert("淇濆瓨鎴愬姛",false,true);
+ this.showToast("淇濆瓨鎴愬姛",'success')
+ window.location.href = '/'+this.recordid
+ window.open('/lightning/n/PCLLostReportPageLwc#pageStatus=Create&oppId=' + response + '&lostType=澶卞崟');
+ // top.window.close();
// window.location.hash = "Refresh"+"=="+response;
- top.window.close();
}else{
- this.Alert(response,true);
+ // this.Alert(response,true);
+ this.showToast(response,'error')
}
});
}
@@ -139,10 +147,10 @@
if (error) {
this.TongzhiIcon = "standard:first_non_empty";
- this.BgColorStyle = "background-color:#f88568";
+ this.BgColorStyle = "background-color:rgb(234, 0, 30)";
}else{
this.TongzhiIcon = "standard:account";
- this.BgColorStyle = "background-color:#69e669";
+ this.BgColorStyle = "background-color:rgb(46, 132, 74)";
}
if (left) {
this.IsLeftStyle = "left: 0.25rem"
@@ -150,7 +158,14 @@
this.IsLeftStyle = ""
}
}
-
+ showToast(msg,type) {
+ const event = new ShowToastEvent({
+ message: msg,
+ variant: type
+ });
+ this.dispatchEvent(event);
+ this.dispatchEvent(new CloseActionScreenEvent());
+ }
//鍏抽棴鎻愮ず妗�
CloseAlert(){
this.closeOffRefresh();
--
Gitblit v1.9.1