From 1727a4f4d02e429475608e60f142a63bc24127bc Mon Sep 17 00:00:00 2001
From: 19626 <1962676589@qq.com>
Date: 星期一, 23 十月 2023 10:07:34 +0800
Subject: [PATCH] 近期修改

---
 force-app/main/default/lwc/lexLoseReport/lexLoseReport.js |   29 +++++++++++------------------
 1 files changed, 11 insertions(+), 18 deletions(-)

diff --git a/force-app/main/default/lwc/lexLoseReport/lexLoseReport.js b/force-app/main/default/lwc/lexLoseReport/lexLoseReport.js
index 3caec8e..576018d 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-10-10 17:35:29
+ * @LastEditTime: 2023-10-16 14:45:16
  */
 /*
  * @Description: 
@@ -20,6 +20,7 @@
 import { updateRecord } from 'lightning/uiRecordApi';
 import { ShowToastEvent } from 'lightning/platformShowToastEvent';
 import init  from '@salesforce/apex/OpportunityLightingButtonController.initForLostReportButton';
+import queryLostReport  from '@salesforce/apex/OpportunityLightingButtonController.queryLostReport';
 import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
 import {loadStyle} from 'lightning/platformResourceLoader';
 export default class LexLoseReport extends LightningElement {
@@ -35,6 +36,7 @@
     salesOwnerBuchang;
     salesOwnerBuchangID;
     cntLostCancelDraft;
+    haveLostReport;
     IsLoading = true;
     @wire(CurrentPageReference)
     getStateParameters(currentPageReference) {
@@ -75,7 +77,13 @@
                 this.dispatchEvent(new CloseActionScreenEvent());
                 return;
             }
-            this.loseReport();
+            queryLostReport({
+                recordId: this.recordId
+            }).then(result=>{
+                this.haveLostReport = result;
+                this.loseReport();
+            });
+            
         })
     }
     loseReport(){
@@ -88,27 +96,12 @@
         else if (this.sapSendOK == '1') {
             this.showToast("宸茬粡涓婁紶SAP銆佷笉鑳藉仛 澶卞崟 浜嗭紒","error");
         }
-        else if (this.cntLostCancelReport - this.cntLostCancelDraft > 0) {
-            // this.showToast("璇环宸茬粡鏈� 鍙栨秷锛忓け鍗曟姤鍛� 浜嗭紒","error");
+        else if (this.haveLostReport) {
             this.showToast('璇环宸茬粡鏈� 鍙栨秷锛忓け鍗曟姤鍛� 浜嗭紒','error');
         }
-        //else if({!Not(ISBLANK(Opportunity.Bidding_Project_Name_Bid__c))} && //'{!Opportunity.InfoTypeBid__c}' != '3锛氱粨鏋�' ){
-        //alert("鍏宠仈鎷涙姇鏍囬」鐩殑璇环锛屽彧鑳藉湪鏈夌粨鏋滃悗鍋氬け鍗曟姤鍛婏紒");
-        //}
         else {
             var url = '/lightning/n/PCLLostReportPageLwc#pageStatus=Create&oppId=' + this.recordId + '&lostType=澶卞崟';
             location.href = url;
-            // location.href = '/a1U/e?retURL=%2F' + this.recordId +
-            // '&RecordType=01210000000R4hM' +
-            // '&CF00N10000004lbGT=' + this.name +
-            // '&CF00N10000004lbGT_lkid=' + this.recordId +
-            // '&CF00N10000006QShg=' + this.salesAssistantName +
-            // '&CF00N10000006QShg_lkid=' + this.salesAssistantID +
-            // '&CF00N10000006QShq=' + this.managerName +
-            // '&CF00N10000006QShq_lkid=' + this.salesManagerDepartmentID +
-            // '&CF00N10000006QShb=' + this.salesOwnerBuchang +
-            // '&CF00N10000006QShb_lkid=' + this.salesOwnerBuchangID +
-            // '';
         }
         this.dispatchEvent(new CloseActionScreenEvent());
     }

--
Gitblit v1.9.1