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

// 查询工资列表
export function listHousingFundConfirm(query) {
  request.defaults.baseURL = '/ezhizao-yzbh-production'
  return request({
    url: '/business/housingFundConfirm/list',
    method: 'get',
    params: query
  })
}

// 下载导入模板
export function exportHousingFundTemplate() {
  request.defaults.baseURL = '/ezhizao-yzbh-production'
  download(
    "business/housingFundConfirm/exportHousingFundTemplate",
    {
    },
    `公积金导入模板_${new Date().getTime()}.xlsx`
  )
}


// 导出公积金信息
export function exportHoisngFundConfirm(data) {
  request.defaults.baseURL = '/ezhizao-yzbh-production'
  download(
    "business/housingFundConfirm/export",
    {
      ...data,
    },
    `公积金信息${new Date().getTime()}.xlsx`
  )
}

// 查询工资详细
export function getHousingFundConfirm(id) {
  request.defaults.baseURL = '/ezhizao-yzbh-production'
  return request({
    url: '/business/housingFundConfirm/' + id,
    method: 'get'
  })
}

// 新增工资
export function addHousingFundConfirm(data) {
  request.defaults.baseURL = '/ezhizao-yzbh-production'
  return request({
    url: '/business/housingFundConfirm',
    method: 'post',
    data: data
  })
}

// 修改工资
export function updateHousingFundConfirm(data) {
  request.defaults.baseURL = '/ezhizao-yzbh-production'
  return request({
    url: '/business/housingFundConfirm',
    method: 'put',
    data: data
  })
}

// 删除工资
export function delHousingFundConfirm(id) {
  request.defaults.baseURL = '/ezhizao-yzbh-production'
  return request({
    url: '/business/housingFundConfirm/' + id,
    method: 'delete'
  })
}

//导出公积金人员信息
export function exportHousingFundConfirmEmployee(id) {
  request.defaults.baseURL = '/ezhizao-yzbh-production'
  download(
    "business/housingFundConfirm/exportHousingFundConfirmExcel",
    {
      id: id
    },
    `公积金人员信息${new Date().getTime()}.xlsx`
  )
}

//打印公积金人员信息
export function exportHousingFundConfirmPdf(id) {
  request.defaults.baseURL = '/ezhizao-yzbh-production'
  downloadPdf(
    "business/housingFundConfirm/printDetailPdf",
    {
      id: id
    },
    `公积金人员信息${new Date().getTime()}.pdf`
  )
}

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

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

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

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

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