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

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

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

// 导出社保信息
export function exportSociaSecurity(data) {
  request.defaults.baseURL = '/ezhizao-yzbh-production'
  download(
    "business/socialSecurityConfirm/export",
    {
      ...data,
    },
    `社保信息${new Date().getTime()}.xlsx`
  )
}


//导出社保人员信息
export function exportSocialSecurityEmployee(id) {
  request.defaults.baseURL = '/ezhizao-yzbh-production'
  download(
    "business/socialSecurityConfirm/exportSocialSecurityExcel",
    {
      id: id
    },
    `社保人员信息${new Date().getTime()}.xlsx`
  )
}

// 下载社保模板
export function exportSocialSecurityTemplate() {
  request.defaults.baseURL = '/ezhizao-yzbh-production'
  download(
    "business/socialSecurityConfirm/exportSocialSecurityTemplate",
    {
    },
    `社保人员确认导入模板_${new Date().getTime()}.xlsx`
  )
}

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

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

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

export function exportSocialSecurityPdf(id) {
  request.defaults.baseURL = '/ezhizao-yzbh-production'
  downloadPdf(
    "business/socialSecurityConfirm/SocialSecurityPdf",
    {
      id: id
    },
    `社保人员信息${new Date().getTime()}.pdf`
  )
}

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

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

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

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

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