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

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

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


// 查询工资详细
export function exportReceiveTicket(data) {
  request.defaults.baseURL = '/ezhizao-yzbh-production'
  download(
    "business/receiveTicket/export",
    {
      ...data,
    },
    `收票任务导出_${new Date().getTime()}.xlsx`
  )
}
// 新增工资
export function addReceiveTicket(data) {
  request.defaults.baseURL = '/ezhizao-yzbh-production'
  return request({
    url: '/business/receiveTicket',
    method: 'post',
    data: data
  })
}

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

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

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

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

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

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