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

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



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

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

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

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

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

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

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

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

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

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

export function exportDetail(data) {
  request.defaults.baseURL = '/ezhizao-yzbh-production'
  download(
    "business/housingFundDeclare/exportDetail",
    {
      ...data,
    },
    `公积金明细导出_${new Date().getTime()}.xls`
  )
}