import request from '@/utils/request'

// 创建集运包裹主
export function createCons(data) {
  return request({
    url: '/ecw/cons/create',
    method: 'post',
    data: data
  })
}

// 更新集运包裹主
export function updateCons(data) {
  return request({
    url: '/ecw/cons/update',
    method: 'put',
    data: data
  })
}
export function updateConsBatchSignOff(data) {
  return request({
    url: '/ecw/cons/updateConsBatchSignOff',
    method: 'put',
    data: data
  })
}

// 删除集运包裹主
export function deleteCons(id) {
  return request({
    url: '/ecw/cons/delete?id=' + id,
    method: 'delete'
  })
}

// 获得集运包裹主
export function getCons(id) {
  return request({
    url: '/ecw/cons/get?id=' + id,
    method: 'get'
  })
}

// 获得集运包裹主分页
export function getConsPage(query) {
  return request({
    url: '/ecw/cons/page',
    method: 'get',
    params: query
  })
}

// 导出集运包裹主 Excel
export function exportConsExcel(query) {
  return request({
    url: '/ecw/cons/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}

// 获取快递单号
export function getConsCourierNumber(params) {
  return request({
    url: "/ecw/cons/courier/number",
    method: "get",
    params
  })
}
