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

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


// 导出
export function exportOnceWork(data) {
  request.defaults.baseURL = '/ezhizao-yzbh-production'
  download(
    "business/onceWorkOrder/export",
    {
      ...data,
    },
    `单次任务导出_${new Date().getTime()}.xlsx`
  )
}

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

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

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