import request from '@/utils/request'

// 查询订单列表
export function listOrderInfo(query) {
  return request({
    url: '/back/order/detailList',
    method: 'get',
    params: query
  })
}

// 查询订单详细
export function getOrderInfo(id) {
  return request({
    url: '/back/order/' + id,
    method: 'get'
  })
}

// 新增订单
export function addOrderInfo(data) {
  return request({
    url: '/back/order',
    method: 'post',
    data: data
  })
}

// 修改订单
export function updateOrderInfo(data) {
  return request({
    url: '/back/order',
    method: 'put',
    data: data
  })
}

// 删除订单
export function delOrderInfo(id) {
  return request({
    url: '/back/order/' + id,
    method: 'delete'
  })
}

// 确认出货
export function confirmShipment(orderId) {
  return request({
    url: '/back/order/confirmShipment/' + orderId,
    method: 'post'
  })
}

// 导出订单
export function exportOrderInfo(query) {
  return request({
    url: '/back/order/exportDetail',
    method: 'post',
    data: query
  })
}
