From 1bc3f32b126277b5349564485665b462bb760354 Mon Sep 17 00:00:00 2001
From: zhangchunxu <1842059105@qq.com>
Date: 星期五, 04 八月 2023 13:21:26 +0800
Subject: [PATCH] 修改 招标项目 失单
---
force-app/main/default/lwc/lexUploadToRecognitionModel/lexUploadToRecognitionModel.js | 112 +++++++++++++++++++++++++++++++------------------------
1 files changed, 63 insertions(+), 49 deletions(-)
diff --git a/force-app/main/default/lwc/lexUploadToRecognitionModel/lexUploadToRecognitionModel.js b/force-app/main/default/lwc/lexUploadToRecognitionModel/lexUploadToRecognitionModel.js
index 6e22dc1..9025162 100644
--- a/force-app/main/default/lwc/lexUploadToRecognitionModel/lexUploadToRecognitionModel.js
+++ b/force-app/main/default/lwc/lexUploadToRecognitionModel/lexUploadToRecognitionModel.js
@@ -12,7 +12,10 @@
import init from '@salesforce/apex/otherButtonMaintenanceContractCtl.init';
import updateColunm from '@salesforce/apex/MaintenanceContractSetColunmWebService.updateColunm';
import up2sap from '@salesforce/apex/MaintenanceContractWebService.up2sap';
-import { ShowToastEvent } from 'lightning/platformShowToastEvent';
+import {
+ ShowToastEvent
+} from 'lightning/platformShowToastEvent';
+import LightningConfirm from 'lightning/confirm';
export default class LexUploadToRecognitionModel extends LightningElement {
@api recordId;
@@ -54,71 +57,68 @@
this.PaymentPlanSumFirstC = result.PaymentPlanSumFirstC;
this.uploadToRecognitionModel();
- this.dispatchEvent(new CloseActionScreenEvent());
}
}).catch(error => {
console.log(error);
- }).finally(() => {
-
- });
+ })
}
// 涓婁紶璁ゆ鍚堝悓
uploadToRecognitionModel() {
if (this.ContractQuotationOrNotC == '杩樻病鍋氭姤浠�') {
- this.ShowToastEvent("鎮ㄨ繕娌℃湁鍋氬悎鍚屾姤浠凤紝涓嶈兘涓婁紶璁ゆ鍚堝悓銆�", "error")
- // alert("鎮ㄨ繕娌℃湁鍋氬悎鍚屾姤浠凤紝涓嶈兘涓婁紶璁ゆ鍚堝悓銆�");
+ this.ShowToastEvent("鎮ㄨ繕娌℃湁鍋氬悎鍚屾姤浠凤紝涓嶈兘涓婁紶璁ゆ鍚堝悓銆�", "error");
+ this.dispatchEvent(new CloseActionScreenEvent());
+ return;
} else if (this.MaintenanceContractNoC == undefined) {
- this.ShowToastEvent('鍚堝悓鍙风爜涓虹┖锛屼笉鑳戒笂浼犺娆惧悎鍚屻��', "error")
- // alert('鍚堝悓鍙风爜涓虹┖锛屼笉鑳戒笂浼犺娆惧悎鍚屻��');
+ this.ShowToastEvent('鍚堝悓鍙风爜涓虹┖锛屼笉鑳戒笂浼犺娆惧悎鍚屻��', "error");
+ this.dispatchEvent(new CloseActionScreenEvent());
+ return;
} else if (this.uploadToSapTimeC != undefined) {
- this.ShowToastEvent('宸茬粡涓婁紶SAP锛屼笉鑳藉啀娆′笂浼犺娆惧悎鍚屻��', "error")
- // alert('宸茬粡涓婁紶SAP锛屼笉鑳藉啀娆′笂浼犺娆惧悎鍚屻��');
+ this.ShowToastEvent('宸茬粡涓婁紶SAP锛屼笉鑳藉啀娆′笂浼犺娆惧悎鍚屻��', "error");
+ this.dispatchEvent(new CloseActionScreenEvent());
+ return;
} else if (this.uploadToRMTimeC != undefined) {
- this.ShowToastEvent('宸茬粡涓婁紶璁ゆ鍚堝悓锛屼笉鑳藉啀娆′笂浼犺娆惧悎鍚屻��', "error")
- // alert('宸茬粡涓婁紶璁ゆ鍚堝悓锛屼笉鑳藉啀娆′笂浼犺娆惧悎鍚屻��');
+ this.ShowToastEvent('宸茬粡涓婁紶璁ゆ鍚堝悓锛屼笉鑳藉啀娆′笂浼犺娆惧悎鍚屻��', "error");
+ this.dispatchEvent(new CloseActionScreenEvent());
+ return;
} else {
if (!this.oldIsRecognitionModelC) {
- this.ShowToastEvent('缁忛攢鍟嗕负绌烘垨缁忛攢鍟嗕笉鏄厛娆惧璞★紝涓嶉渶瑕佷笂浼犺娆惧悎鍚屻��', "error")
- // alert('缁忛攢鍟嗕负绌烘垨缁忛攢鍟嗕笉鏄厛娆惧璞★紝涓嶉渶瑕佷笂浼犺娆惧悎鍚屻��');
+ this.ShowToastEvent('缁忛攢鍟嗕负绌烘垨缁忛攢鍟嗕笉鏄厛娆惧璞★紝涓嶉渶瑕佷笂浼犺娆惧悎鍚屻��', "error");
+ this.dispatchEvent(new CloseActionScreenEvent());
+ return;
} else if (this.PaymentPlanSumFirstC == undefined) {
- this.ShowToastEvent('绗竴娆¤鍒掍粯娆鹃噾棰濅笉鑳戒负绌恒��', "error")
- // alert('绗竴娆¤鍒掍粯娆鹃噾棰濅笉鑳戒负绌恒��');
+ this.ShowToastEvent('绗竴娆¤鍒掍粯娆鹃噾棰濅笉鑳戒负绌恒��', "error");
+ this.dispatchEvent(new CloseActionScreenEvent());
+ return;
} else {
- if (!confirm('璇风‘璁ゆ槸鍚﹁涓婁紶璁ゆ鍚堝悓銆�')) {
- return;
- }
-
- updateColunm({
- mcid: this.Id
- }).then(result => {
- console.log(result);
- if (result != '1') {
- this.ShowToastEvent('涓婁紶璁ゆ鍚堝悓澶辫触,鍥犱负 鏉ュ勾鍚堝悓鐩稿叧淇℃伅淇敼澶辫触', "error")
- // alert('涓婁紶璁ゆ鍚堝悓澶辫触,鍥犱负 鏉ュ勾鍚堝悓鐩稿叧淇℃伅淇敼澶辫触');
- location.href = "/" + this.Id;
- }
- }).catch(error => {
- console.log(error);
- })
-
- up2sap({
- mcid: this.Id
- }).then(rtn => {
- console.log(rtn);
- if (rtn == '1') {
- this.ShowToastEvent("涓婁紶璁ゆ鍚堝悓鎴愬姛", "success")
- // alert("涓婁紶璁ゆ鍚堝悓鎴愬姛");
- location.href = "/" + this.Id;
- } else {
- this.ShowToastEvent(rtn, "error")
- // alert(rtn);
- }
- }).catch(error => {
- console.log(error);
- })
+ this.handleConfirmClick('璇风‘璁ゆ槸鍚﹁涓婁紶璁ゆ鍚堝悓銆�');
}
}
+ }
+
+ ll() {
+ updateColunm({
+ mcid: this.Id
+ }).then(result => {
+ if (result != '1') {
+ this.ShowToastEvent('涓婁紶璁ゆ鍚堝悓澶辫触,鍥犱负 鏉ュ勾鍚堝悓鐩稿叧淇℃伅淇敼澶辫触', "error");
+ this.dispatchEvent(new CloseActionScreenEvent());
+ window.reload();
+ }
+ })
+ up2sap({
+ mcid: this.Id
+ }).then(rtn => {
+ if (rtn == '1') {
+ this.ShowToastEvent("涓婁紶璁ゆ鍚堝悓鎴愬姛", "success");
+ this.dispatchEvent(new CloseActionScreenEvent());
+ window.reload();
+ } else {
+ this.ShowToastEvent(rtn, "error");
+ this.dispatchEvent(new CloseActionScreenEvent());
+ return;
+ }
+ })
}
// 寮圭獥
@@ -130,4 +130,18 @@
});
this.dispatchEvent(event);
}
+
+ async handleConfirmClick(msg) {
+ const result = await LightningConfirm.open({
+ message: msg,
+ variant: 'headerless',
+ label: 'this is the aria-label value'
+ });
+
+ if (result) {
+ this.ll();
+ } else {
+ this.dispatchEvent(new CloseActionScreenEvent());
+ }
+ }
}
\ No newline at end of file
--
Gitblit v1.9.1