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;
     }
}