import request from '@/utils/request'
import { download } from '@/utils/request'

// 查询个税详情列表
export function listDetail(query) {
  request.defaults.baseURL = '/ezhizao-yzbh-finance'
  return request({
    url: '/business/detailIsZero/list',
    method: 'get',
    params: query
  })
}

// 查询个税详情详细
export function getDetail(id) {
  request.defaults.baseURL = '/ezhizao-yzbh-finance'
  return request({
    url: '/business/detailIsZero/' + id,
    method: 'get'
  })
}

//查询
export function getSalaryDetail(data) {
  request.defaults.baseURL = '/ezhizao-yzbh-finance'
  return request({
    url: '/business/detailIsZero/getDetail',
    method: 'post',
    data: data
  })
}

//导出
export function exportIndividualIncome(query) {
  request.defaults.baseURL = '/ezhizao-yzbh-finance'
  download(
    "/business/detailIsZero/export",
    {
      ...query,
    },
    `个税零申报信息_${new Date().getTime()}.xlsx`
  )
}

// 修改个税任务
export function updateDetail(data) {
  request.defaults.baseURL = '/ezhizao-yzbh-finance'
  return request({
    url: '/business/detailIsZero',
    method: 'put',
    data: data
  })
}

// 修改个税详情
export function updateIndividualIncomeTaxDetail(data) {
  request.defaults.baseURL = '/ezhizao-yzbh-finance'
  return request({
    url: '/business/individualIncomeTaxDetailIsZero',
    method: 'put',
    data: data
  })
}

// 新增个税详情
export function addIndividualIncomeTaxDetail(data) {
  request.defaults.baseURL = '/ezhizao-yzbh-finance'
  return request({
    url: '/business/individualIncomeTaxDetailIsZero',
    method: 'post',
    data: data
  })
}

// 删除个税详情
export function delDetail(id) {
  request.defaults.baseURL = '/ezhizao-yzbh-finance'
  return request({
    url: '/business/detailIsZero/' + id,
    method: 'delete'
  })
}
