import { request } from '@/service/request';

/**
 * 正常快递订单
 * @param data
 * @returns
 */
export function fetchGetDeliveryOrderList(data: any) {
  return request<Api.Common.PaginatingQueryRecord<Api.delivery.deliveryOrder>>({
    url: '/platform/order/deliverList',
    method: 'get',
    params: data
  });
}

/**
 *  获取快递订单状态数量
 * @returns
 */
export function fetchGetDeliveryStatusNum() {
  return request<Api.delivery.DeliveryStatusNum>({
    url: '/platform/order/deliverListStatusNum',
    method: 'get'
  });
}

/**
 * 获取快递订单详情
 * @param orderNumber
 * @returns
 */
export function fetchGetNomalOrderInfo(orderNumber: string) {
  return request<Api.delivery.deliveryOrder>({
    url: `/platform/order/orderInfo/${orderNumber}`,
    method: 'get'
  });
}

/**
 *
 * 快递公司列表
 *  */
export function fetchGetDevList(data: any) {
  return request<Api.delivery.devList>({
    url: '/platform/delivery/list',
    method: 'get',
    params: data
  });
}

/**
 * 发货
 */
export function fetchDeliveryOrder(data: any) {
  return request({
    url: '/platform/order/delivery',
    method: 'PUT',
    data
  });
}
