import request from '@/utils/request'

// 查询在线申报记录列表
export function listRecords(query) {
  return request({
    url: '/system/declarationRecords/list',
    method: 'get',
    params: query
  })
}

// 查询申报模版列表
export function templateList(query) {
  return request({
    url: '/system/templateRecord/templateNameList',
    method: 'get',
    params: query
  })
}

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

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

// 下载需要评定数据
export function downloadData(data) {
  return request({
    url: '/system/declarationRecords/exportMunicipalBureauReview',
    method: 'post',
    responseType: 'blob',
    data: data
  })
}

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

// 上传评定数据
export function putMunicipalBureauReview(data) {
  return request({
    url: '/system/declarationRecords/municipalReviewNew',
    method: 'put',
    data: data
  })
}
