import request from '@/utils/request';
import { wrapTreeNode } from '@/utils/format';


// 获取稽核表列表
export async function handleGetCHECKACCOUNTList(params: any) {
    const data = await request('/Audit/GetCHECKACCOUNTList', {
        method: 'POST',
        data: params
    })

    if (data.Result_Code !== 100) {
        return {
            data: [],
            otherData: '',
            current: 1,
            pageSize: 20,
            total: 0,
            success: true,
        };
    }

    return data.Result_Data.List
}


// 提交稽核说明
export async function handleUpLoadAuditExplain(params: any) {
  const data = await request('/Audit/UpLoadAuditExplain', {
    method: 'POST',
    data: params
  })

  if (data.Result_Code !== 100) {
    return {
      data: [],
      otherData: '',
      current: 1,
      pageSize: 20,
      total: 0,
      success: true,
    };
  }

  return data
}

// 设置为无效
export async function handleDeleteCHECKACCOUNT(params: any) {
  const data = await request('/Audit/DeleteCHECKACCOUNT', {
    method: 'GET',
    params
  })

  if (data.Result_Code !== 100) {
    return {
      data: [],
      otherData: '',
      current: 1,
      pageSize: 20,
      total: 0,
      success: true,
    };
  }

  return data
}
