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

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

// 导出
export function exportSocialSecurityDeclare(data) {
  request.defaults.baseURL = '/ezhizao-yzbh-production'
  download(
    "business/socialSecurityDeclare/export",
    {
      ...data,
    },
    `社保申报任务${new Date().getTime()}.xlsx`
  )
}


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

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

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

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

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

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

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

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

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


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


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