import request from '@/utils/request'

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

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

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

// 导出
export function exportData(data) {
  return request({
    url: '/system/enterpriseDirectory/export',
    method: 'post',
    responseType: 'blob',
    data: data
  })
}

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

// 编辑企业名录
export function putTemplateRecord(data) {
  return request({
    url: '/system/templateRecord',
    method: 'put',
    data: data
  })
}

// 获取企业名录
export function getTemplateRecord(query) {
  return request({
    url: `/system/templateRecord/${query.templateRecordId}`,
    method: 'get',
    arams: query
  })
}

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

