19626
2023-04-23 c83dc56870037a7b5a10d07ef1154a33b6bf43ee
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
public with sharing class buttonRepairQuotationCtl {
    public buttonRepairQuotationCtl() {
 
    }
 
    @AuraEnabled
    public static InitData init(String recordId){
        InitData res = new initData();
        try{
            Repair_Quotation__c report =  [SELECT Id,CutPriceStatus_Service__c FROM Repair_Quotation__c WHERE Id =: recordId LIMIT 1];
            System.debug(LoggingLevel.INFO, '*** opp: ' + report);
            res.Id = report.Id;
            res.CutPriceStatusServiceC = report.CutPriceStatus_Service__c;
            res.profileId = UserInfo.getProfileId();
 
            System.debug(LoggingLevel.INFO, '*** res: ' + res);
        }catch(Exception e){
            System.debug(LoggingLevel.INFO, '*** e: ' + e);
        }
        return res;
    }   
 
     // 根据ID修理报价
     @AuraEnabled
     public static String updateRepairQuotation(String recordId){
        String res ='';
         try {
            Repair_Quotation__c repair = new Repair_Quotation__c();
             repair.Id = recordid;
             update repair;
         } catch (Exception e) {
             System.debug(LoggingLevel.INFO, '*** e: ' + e);
             res = e.getMessage();
         }
         return res;
     }
 
    // 根据ID修理报价提交
    @AuraEnabled
    public static String updateRepairQuotation02(String recordId){
        String res ='';
        try {
            Repair_Quotation__c repair = new Repair_Quotation__c();
            repair.Id = recordid;
            repair.CutPriceStatus_Service__c = '已提交';
            update repair;
        } catch (Exception e) {
            System.debug(LoggingLevel.INFO, '*** e: ' + e);
            res = e.getMessage();
        }
        return res;
    }
 
    public class InitData{
        @AuraEnabled
        public String Id;
        @AuraEnabled
        public String CutPriceStatusServiceC;
        @AuraEnabled
        public String profileId;
     }
}