import request from '@/utils/request'

// 分页查询承运订单列表
export function pageListOrder(query) {
  return request({
    url: '/tm/order/pageList',
    method: 'get',
    params: query
  })
}

// 分页查询托运和承运订单列表
export function allPageListOrder(query) {
  return request({
    url: '/tm/allOrder/pageList',
    method: 'get',
    params: query
  })
}

// 查询承运订单列表
export function listOrder(query) {
  return request({
    url: '/tm/order/list',
    method: 'get',
    params: query
  })
}

// 查询承运订单详细
export function getOrder(ID) {
  return request({
    url: '/tm/order/' + ID,
    method: 'get'
  })
}

// 新增承运订单
export function addOrder(data) {
  return request({
    url: '/tm/order',
    method: 'post',
    data: data
  })
}

// 修改承运订单
export function updateOrder(data) {
  return request({
    url: '/tm/order',
    method: 'put',
    data: data
  })
}

// 删除承运订单
export function delOrder(ID) {
  return request({
    url: '/tm/order/' + ID,
    method: 'delete'
  })
}

// 导出承运订单
export function exportOrder(query) {
  return request({
    url: '/tm/order/' + 'export',
    method: 'post',
    params: query
  })
}

// 自动计算运输计划
export function addBatchTrans(data) {
  return request({
    url: '/tm/order/addBatchTrans',
    method: 'post',
    data: data
  })
}

// 撤销订单到已经完成
export function revokeOrder(data) {
  return request({
    url: '/tm/order/revokeOrder',
    method: 'post',
    data,
  })
}