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

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

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

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

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

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

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

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

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

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

// 导出
export function exportKeepAccount(data) {
  request.defaults.baseURL = '/ezhizao-yzbh-production'
  download(
    "business/keepAccount/export",
    {
      ...data,
    },
    `记账信息导出_${new Date().getTime()}.xlsx`
  )
}