import request from '@/utils/request'

// 查询 订单 四种状态和总数量
export function getOrderTabData(query) {
  return request({
    url: '/system/order/statusCount',
    method: 'get',
    params: query
  })
}

// 查询order列表
export function listOrder(query) {
    return request({
        url: '/system/order/getOrderSellerList',
        method: 'get',
        params: query
    })
}

// 查询order详细
export function orderInfo (query) {
    return request({
        url: '/system/order/getOrderSellerListInfo',
        method: 'get',
        params: query
    })
}

// order发货
/*export function sendOrder(data) {
    return request({
        url: '/system/order/sendOrde',
        method: 'post',
        data: data
    })
}*/

//查看物流
export function expressInfoNew(params){
  return request({
      url: '/system/order/getOrderInfoDeliver',
      method: 'get',
      params
  })
}

// 修改订单收货信息
export function orderInfoEdit(data){
  return request({
      url: '/system/order/orderUpdateAddress',
      method: 'post',
      data: data
  })
}

//订单备注
export function remarkOrder(data){
  return request({
      url: '/system/order/orderListRemark',
      method: 'post',
      data: data
  })
}

// 获取 所有物流信息
export function expressList(query) {
  return request({
    url: '/system/order/expressList',
    method: 'get',
    params: query
  })
}

// 新增order
export function addOrder(data) {
    return request({
        url: '/system/order/add',
        method: 'post',
        data: data
    })
}

// 修改order
export function updateOrder(data) {
    return request({
        url: '/system/order/edit',
        method: 'post',
        data: data
    })
}

// 删除order
export function delOrder(ids) {
    return request({
        url: '/system/order/delete',
        method: 'delete',
        data:{ids:ids}
    })
}

// 订单导出-按搜索条件，全部导出
export function exportOrder(query) {
  return request({
    url: '/system/order/unSendOrderGoodsExport',
    method: 'get',
    params: query
  })
}
// old
// export function exportOrder(query) {
//   return request({
//     url: '/system/order/getOrderListExport',
//     method: 'get',
//     params: query
//   })
// }

// 批量发货
export function deliveryOrder(data) {
  return request({
    url: '/system/order/batchDeliveryGoods',
    method: 'post',
    data: data
  })
}

// 订单 右上角的 批量发货接口 /system/order/batchDeliveryGoodsOut 老接口

// 批量 去发货
export function deliveryOrderOne(data) {
  return request({
    url: '/system/order/orderListSend',
    method: 'post',
    data: data
  })
}

// 批量 补单发货
export function deliveryOrderTwo(data) {
  return request({
    url: '/system/order/orderListAllSend',
    method: 'post',
    data: data
  })
}
//
// // 单商品订单 补单发货
// export function toReissueOrderData(data) {
//   return request({
//     url: '/system/order/orderListAgainSend',
//     method: 'post',
//     data: data
//   })
// }
