import request from '@/utils/request'
import { download } from '@/utils/request'
// 查询报税列表
export function listTax(query) {
  request.defaults.baseURL = '/ezhizao-yzbh-finance'
  return request({
    url: '/business/financialReportTax/list',
    method: 'get',
    params: query
  })
}

// 导出
export function exportFinalTax(data) {
  request.defaults.baseURL = '/ezhizao-yzbh-production'
  download(
    "business/financialReportTax/export",
    {
      ...data,
    },
    `报税零申报导出_${new Date().getTime()}.xlsx`
  )
}

// 查询报税详细
export function getTax(id,year,month) {
  request.defaults.baseURL = '/ezhizao-yzbh-finance'
  return request({
    url: '/business/financialReportTax/getDetailById/' + id + "/" + year + "/" + month,
    method: 'get'
  })
}

export function saveDetail(data) {
  request.defaults.baseURL = '/ezhizao-yzbh-finance'
  return request({
    url: '/business/financialReportTax/saveDetail',
    method: 'post',
    data
  })
}

// 退回
export function deductionTurnBack(data) {
  request.defaults.baseURL = '/ezhizao-yzbh-finance'
  return request({
    url: '/business/financialReportTax/deductionTurnBack',
    method: 'post',
    data
  })
}


// 修改报税
export function updateTax(data) {
  request.defaults.baseURL = '/ezhizao-yzbh-finance'
  return request({
    url: '/business/financialReportTax',
    method: 'put',
    data: data
  })
}

