import request from '@/utils/request'

// 查询在线申报管理列表
export function approvalList(query) {
  return request({
    url: '/system/declarationRecords/approvalList',
    method: 'get',
    params: query
  })
}

// 查询企业列表
export function listBusiness(query) {
  return request({
    url: '/system/enterpriseDirectory/list',
    method: 'get',
    params: query
  })
}

// 导出
export function exportData(data) {
  return request({
    url: `/system/templateInfo/exportTemplate/${data.id}`,
    method: 'get',
    responseType: 'blob'
  })
}

// 新增企业名录
export function addTemplateRecord(data) {
  return request({
    url: '/system/templateRecord',
    method: 'post',
    data: data
  })
}

// 审批数据
export function approvalEdit(data) {
  return request({
    url: '/system/declarationRecords/approvalEdit',
    method: 'put',
    data: data
  })
}

// 上传单个文件
export function uploadFile(data) {
  return request({
    url: '/common/upload',
    method: 'post',
    data: data,
    headers: {
      'Content-type': 'multipart/form-data'
    }
  })
}
