import request from '@/utils/request'

// 查询快递公司列表
export function listExpress(query) {
  return request({
    url: '/his/express/list',
    method: 'get',
    params: query
  })
}

// 查询快递公司详细
export function getExpress(id) {
  return request({
    url: '/his/express/' + id,
    method: 'get'
  })
}

export function getExpressList() {
  return request({
    url: '/his/express/getExpressList',
    method: 'get'
  })
}

// 新增快递公司
export function addExpress(data) {
  return request({
    url: '/his/express',
    method: 'post',
    data: data
  })
}

// 修改快递公司
export function updateExpress(data) {
  return request({
    url: '/his/express',
    method: 'put',
    data: data
  })
}

// 删除快递公司
export function delExpress(id) {
  return request({
    url: '/his/express/' + id,
    method: 'delete'
  })
}

// 导出快递公司
export function exportExpress(query) {
  return request({
    url: '/his/express/export',
    method: 'get',
    params: query
  })
}

//分配快递公司
export function allotExpress(data,omsCode) {
  return request({
    url: '/his/express/allotExpress/'+omsCode,
    method: 'post',
    data: data
  })
}

export function getCompanyByOmsCode(omsCode) {
  return request({
    url: '/his/express/omsCode/' + omsCode,
    method: 'get'
  })
}