import request from '@/utils/request'

// 分页查询货源信息列表
export function pageListSource(query) {
  return request({
    url: '/cargo/source/pageList',
    method: 'get',
    params: query
  })
}

// 查询货源信息列表
export function listSource(query) {
  return request({
    url: '/cargo/source/list',
    method: 'get',
    params: query
  })
}

// 查询货源信息详细
export function getSource(ID) {
  return request({
    url: '/cargo/source/' + ID,
    method: 'get'
  })
}

// 新增货源信息
export function addSource(data) {
  return request({
    url: '/cargo/source',
    method: 'post',
    data: data
  })
}

// 修改货源信息
export function updateSource(data) {
  return request({
    url: '/cargo/source',
    method: 'put',
    data: data
  })
}

// 删除货源信息
export function delSource(ID) {
  return request({
    url: '/cargo/source/' + ID,
    method: 'delete'
  })
}

// 导出货源信息
export function exportSource(query) {
  return request({
    url: '/cargo/source/' + 'export',
    method: 'post',
    params: query
  })
}

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