import request from '@/router/axios';

export const getList = (current, size, params) => {
  return request({
    url: '/api/finance/order/list',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

export const getDetail = (id) => {
  return request({
    url: '/api/finance/order/detail',
    method: 'get',
    params: {
      id
    }
  })
}

export const remove = (ids) => {
  return request({
    url: '/api/finance/order/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

export const add = (row) => {
  return request({
    url: '/api/finance/order/submit',
    method: 'post',
    data: row
  })
}

export const update = (row) => {
  return request({
    url: '/api/finance/order/submit',
    method: 'post',
    data: row
  })
}

export const deliverGoods = (row) => {
  return request({
    url: '/api/finance/order/deliverGoods',
    method: 'post',
    params: row
  })
}

export const dataReport = () => {
  return request({
    url: '/api/finance/order/dataReport',
    method: 'get'
  })
}

export const dataReportByDate = (queryType) => {
  return request({
    url: '/api/finance/order/dataReportByDate',
    method: 'get',
    params: {
      queryType
    }
  })
}

export const saveCustomOrder = (row) => {
  return request({
    url: '/api/finance/order/saveOrder',
    method: 'post',
    data: row
  })
}

