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

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


// 查询个税详情信息
export function getInfo(id,year,month) {
  request.defaults.baseURL = '/ezhizao-yzbh-production'
  return request({
    url: '/business/individualIncomeTaxDetail/' + id+'/'+year+'/'+month,
    method: 'get'
  })
}

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


// 查询查询工资列表信息
export function getDetail(id) {
  request.defaults.baseURL = '/ezhizao-yzbh-production'
  return request({
    url: '/business/detail/' + id,
    method: 'get'
  })
}

//查询工资列表
export function getSalaryDetail(data) {
  request.defaults.baseURL = '/ezhizao-yzbh-production'
  return request({
    url: '/business/detail/getDetail',
    method: 'post',
    data: data
  })
}

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

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

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

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