From 626f3c3bb25e204568019e8d568e2d7547d1037a Mon Sep 17 00:00:00 2001
From: 黄千龙 <huangqianlong@prec-tech.com>
Date: 星期三, 09 八月 2023 10:54:08 +0800
Subject: [PATCH] 20230809修改伟意按钮同步

---
 force-app/main/default/lwc/lexServiceCutPriceApply/lexServiceCutPriceApply.js |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/force-app/main/default/lwc/lexServiceCutPriceApply/lexServiceCutPriceApply.js b/force-app/main/default/lwc/lexServiceCutPriceApply/lexServiceCutPriceApply.js
index 26b7f7d..e9609e2 100644
--- a/force-app/main/default/lwc/lexServiceCutPriceApply/lexServiceCutPriceApply.js
+++ b/force-app/main/default/lwc/lexServiceCutPriceApply/lexServiceCutPriceApply.js
@@ -18,7 +18,7 @@
 } from 'lightning/platformShowToastEvent';
 
 
-export default class LexServiceCutPriceApply extends LightningElement {
+export default class lexServiceCutPriceApply extends LightningElement {
     @api recordId;
     str;
     IsLoading = true;
@@ -59,7 +59,6 @@
                         this.ServiceCutPriceApply();
                     }
                 })
-                this.dispatchEvent(new CloseActionScreenEvent());
             }
         }).catch(error => {
             console.log(error);
@@ -74,15 +73,18 @@
 
         if (power != '2F2A_RC' && power != '2F4_鎶�鏈帹杩涢儴' && power != '2F4_鎶�鏈帹杩涢儴_闈濻SO') {
             this.ShowToastEvent("瀵逛笉璧凤紝鎮ㄦ病鏈夋潈闄愭彁浜ゆ鐢宠锛�", "error");
+            this.dispatchEvent(new CloseActionScreenEvent());
             return;
         }
         var status = this.CutPriceStatusServiceC;
         if (status == '瀹℃壒涓�') {
             this.ShowToastEvent("瀹℃壒鎻愪氦鎴愬姛,褰撳墠姝e湪瀹℃壒璇峰嬁鍐嶆彁浜わ紒", "error");
+            this.dispatchEvent(new CloseActionScreenEvent());
             return;
         }
         if (status == '鎵瑰噯') {
             this.ShowToastEvent("瀹℃壒宸叉壒鍑�,璇峰嬁鍐嶆彁浜わ紒", "error");
+            this.dispatchEvent(new CloseActionScreenEvent());
             return;
         }
         if (status == '鑽夋涓�' || status == undefined || status == '椹冲洖') {
@@ -92,8 +94,12 @@
                 console.log(result);
                 if (result.length > 0) {
                     var split = result.split(", ");
-                    alert(split[1]);
+                    this.ShowToastEvent(split[1], "error");
+                    this.dispatchEvent(new CloseActionScreenEvent());
                     return;
+                }else{
+                    this.ShowToastEvent("鏇存柊鎴愬姛锛�", "success");
+                    this.dispatchEvent(new CloseActionScreenEvent());
                 }
             })
             updateRepairQuotation02({
@@ -102,11 +108,13 @@
                 console.log(result);
                 if (result.length > 0) {
                     var split = result.split(", ");
-                    alert("鎻愪氦澶辫触 " + split[1]);
+                    this.ShowToastEvent("鎻愪氦澶辫触 " + split[1], "error");
+                    this.dispatchEvent(new CloseActionScreenEvent());
                     return;
                 } else {
                     this.ShowToastEvent("瀹℃壒鎻愪氦鎴愬姛锛�", "success");
                     location.reload();
+                    this.dispatchEvent(new CloseActionScreenEvent());
                 }
             })
         }

--
Gitblit v1.9.1