public with sharing class LexLostSubmitApprovalController {

    // 遗失报告 提交待审核
    @AuraEnabled
    public static InitData LexLostSubmitApprovalController(String recordId) {
        InitData res = new initData();
        try{
            List<LostReport_Detail__c> reportDetail = new List<LostReport_Detail__c>();
            LostReport__c report = [SELECT Id,Status__c FROM LostReport__c WHERE Id = :recordId LIMIT 1];
            res.Id = report.Id;
            res.statusTf = report.Status__c;
    	    reportDetail = [SELECT Rental_Apply_Equipment_Set_Detail__r.Lost_item_check_day__c FROM LostReport_Detail__c WHERE id = :recordId AND Rental_Apply_Equipment_Set_Detail__r.Lost_item_check_day__c != null];
            res.reportDetailList = reportDetail;
            System.debug(LoggingLevel.INFO, '*** zq: ' + res);
        }catch(Exception e){
            System.debug(LoggingLevel.INFO, '*** zq: ' + e);
        }
        return res;
    }

    public class InitData{
        @AuraEnabled
        public String Id;
        @AuraEnabled
        public String statusTf;
        @AuraEnabled
        public List<LostReport_Detail__c> reportDetailList;
    }

    //提交按钮
    @AuraEnabled
    public static String submit(String recordId) {
       try {
        LostReport__c rac = [SELECT Id,Status__c FROM LostReport__c WHERE Id = :recordId LIMIT 1];
        rac.Id = rac.Id;
        rac.Status__c = '填写完毕';
        update rac;
        return '1';
       } catch (Exception ex) {
        System.debug(LoggingLevel.INFO, '*** zq: ' + ex);
        // return errMsg;
        return ex.getMessage();
       }
    }
}