From f8bd322b4f93f8a04743078bccf89e08e01bf51f Mon Sep 17 00:00:00 2001
From: liwentao <1376563863@qq.com>
Date: 星期三, 19 七月 2023 10:51:51 +0800
Subject: [PATCH] 营业 任务按钮: 询价失单

---
 force-app/main/default/classes/OppLoseController.cls |   52 +++++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 47 insertions(+), 5 deletions(-)

diff --git a/force-app/main/default/classes/OppLoseController.cls b/force-app/main/default/classes/OppLoseController.cls
index fb78bab..60155b9 100644
--- a/force-app/main/default/classes/OppLoseController.cls
+++ b/force-app/main/default/classes/OppLoseController.cls
@@ -4,12 +4,13 @@
     public static InitData init(String taskId){
         InitData res = new initData();
         try{
-            task__c task = [SELECT id, OpportunityId__c 
+            task__c task = [SELECT id, OpportunityId__c , taskStatus__c
                             FROM task__c
                             WHERE Id =: taskId 
                             LIMIT 1];
 
             res.task = task;
+            res.taskStatus = task.taskStatus__c;
             res.OpportunityId = task.OpportunityId__c;
 
             Opportunity opp =  [SELECT Sales_owner_buchangID__c,Manager_name__c,Sales_owner_buchang__c,
@@ -32,24 +33,61 @@
             res.Sales_manager_departmentID = opp.Sales_manager_departmentID__c;
             res.Sales_owner_buchang = opp.Sales_owner_buchang__c;
             res.Sales_owner_buchangID = opp.Sales_owner_buchangID__c;
+            RecordType re=[select Id from recordType where name='璇环澶卞崟鎶ュ憡'];
+            res.reId=re.Id;
             res.opp = opp;
             System.debug(LoggingLevel.INFO, '*** res: ' + res);
         }catch(Exception e){
             System.debug(LoggingLevel.INFO, '*** e: ' + e);
         }
         return res;
-    }    
-
+    }  
+  
     public class ReturnData{
 
     }
-
+    //OLY涓爣
+    @AuraEnabled
+    public static String taskOLYwinBid(String recordId) {
+        String messageText = '';
+       try {
+        Opportunity opp = [SELECT Id,ConfirmationofAward__c FROM Opportunity WHERE Id = :recordId LIMIT 1];
+        opp.Id = recordId;
+        opp.ConfirmationofAward__c = LightingButtonConstant.STATUS_OLYwinBid;
+        messageText = '1';
+        update opp;
+        System.debug(LoggingLevel.INFO, '*** winBid: ' + opp);
+        return messageText;
+       } catch (Exception ex) {
+        System.debug(LoggingLevel.INFO, '*** winBidXu: ' + ex);
+        messageText = ex.getMessage();
+        return messageText;
+       }
+    }
+    //绔炰簤瀵规墜涓爣
+    @AuraEnabled
+    public static String taskLoseBid(String recordId) {
+        String messageText = '';
+        try {
+        Opportunity opp = [SELECT Id,ConfirmationofAward__c FROM Opportunity WHERE Id = :recordId LIMIT 1];
+        opp.Id = recordId;
+        opp.ConfirmationofAward__c = LightingButtonConstant.STATUS_Bid_LoseBid;
+        messageText = '1';
+        update opp;
+        System.debug(LoggingLevel.INFO, '*** winBid: ' + opp);
+        return messageText;
+        } catch (Exception ex) {
+        System.debug(LoggingLevel.INFO, '*** winBidXu: ' + ex);
+        messageText = ex.getMessage();
+        return messageText;
+        }
+    }
     public class InitData{
         //璇环鏁版嵁
         @AuraEnabled
         public Opportunity opp;
         @AuraEnabled
-        public String stageName;
+        public String StageName;
         @AuraEnabled
         public Boolean SAP_Send_OK;
         @AuraEnabled
@@ -73,7 +111,11 @@
         @AuraEnabled
         public String OpportunityId;
         @AuraEnabled
+        public String taskStatus;
+        @AuraEnabled
         public task__c task;
+        @AuraEnabled
+        public String reId;
     }
 
 }
\ No newline at end of file

--
Gitblit v1.9.1