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

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

/**
 * 导出正常快递订单
 * @param data
 * @returns
 */
export function fetchExportOrderList(data: any) {
  return request({
    url: '/platform/order/export',
    method: 'get',
    params: data
  });
}

/**
 * 导出正常快递订单记录
 * @param data
 * @returns
 */
export function fetchExportList(data: any) {
  return request({
    url: '/platform/exportTask/page',
    method: 'get',
    params: data
  });
}

/**
 * 下载
 * @param data
 * @returns
 */
export function fetchBreakDownload(fileId: any) {
  return request({
    url: `/platform/exportTask/cancel/${fileId}`,
    method: 'get'
  });
}

/**
 *  获取快递订单状态数量
 * @returns
 */
export function fetchGetDeliveryStatusNum(data: any) {
  return request<Api.delivery.DeliveryStatusNum>({
    url: '/smqjh-oms/api/v1/order/backendOrderListCount',
    method: 'get',
    params: data
  });
}

/**
 * 获取快递订单详情
 * @param orderNumber
 * @returns
 */
export function fetchGetNomalOrderInfo(orderNo: string) {
  return request<Api.delivery.deliveryOrder>({
    url: `/smqjh-oms/api/v1/order/backendOrderInfo`,
    method: 'get',
    params: { orderNo }
  });
}

/**
 *
 * 快递公司列表
 *  */
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
  });
}

/**
 * 核销
 */
export function fetchAudit(data: any) {
  return request({
    url: '/smqjh-oms/api/v1/djkOrder/backendVerification',
    method: 'get',
    params: data
  });
}
