import request from '@/utils/request'

// 获取项目授信项目信息处理列表
export function projectInfoPendingList(data) {
  return request({
    url: '/businessProcessingTask/doMyPendingList',
    method: 'post',
    data
  })
}

// 获取项目授信项目信息全部列表
export function projectInfoAllList(data) {
  return request({
    url: '/project/getAllProject',
    method: 'post',
    data
  })
}

// 获取项目授信核心企业全部列表
export function coreEnterpriseInfoAllList(data) {
  return request({
    url: '/project/getAllCoreEnterprise',
    method: 'post',
    data
  })
}

// 获取项目审核信息
export function getReviewInfo(params) {
  return request({
    url: '/project/getProjectAuditInfo',
    method: 'get',
    params
  })
}

// 获取项目核心企业审核信息
export function getCoreReviewInfo(params) {
  return request({
    url: '/project/getProjectCoreEnterpriseAuditInfo',
    method: 'get',
    params
  })
}

// 字典数据
export function getDictionaryInfo(params) {
  return request({
    url: '/dictionary/do_findByParentCode',
    method: 'get',
    params
  })
}

// 项目一键评估
export function assessProject(data) {
  return request({
    url: '/project/addProject/measurement',
    method: 'post',
    data
  })
}

// 项目一审核提交
export function auditSubmitProject(data) {
  return request({
    url: '/project/addProjectAuditInfo',
    method: 'post',
    data
  })
}

// 核心企业一键评估
export function assessCore(data) {
  return request({
    url: '/project/addProjectCoreEnterprise/measurement',
    method: 'post',
    data
  })
}

// 核心企业一审核提交
export function auditSubmitCore(data) {
  return request({
    url: '/project/addProjectCoreEnterpriseAuditInfo',
    method: 'post',
    data
  })
}

// 获取项目准入报告
export function getProjectReport(params) {
  return request({
    url: '/project/admission/report',
    method: 'get',
    params
  })
}

// 获取核心企业准入报告
export function getEnterpriseReport(params) {
  return request({
    url: '/enterprise/admission/report',
    method: 'get',
    params
  })
}

// 下载报告
export const download = (data) => (
  request({
    url: '/project/admission/report/download',
    method: 'get',
    params: data,
    responseType: 'arraybuffer'
  })
)

// 下载报告
export const downloadCore = (data) => (
  request({
    url: '/enterprise/admission/report/download',
    method: 'get',
    params: data,
    responseType: 'arraybuffer'
  })
)
