import request from '@/utils/request'

// 查询商品订单列表
export function listGoods(query) {
  return request({
    url: '/mapi/order/goods/list',
    method: 'get',
    params: query
  })
}

// 查询商品订单详细
export function getGoods(id) {
  return request({
    url: '/mapi/order/goods/' + id,
    method: 'get'
  })
}

// 查询商品订单详细
export function getRefundGoods(id) {
  return request({
    url: '/mapi/order/goods/refund/' + id,
    method: 'get'
  })
}

// 新增商品订单
export function insertRetailOrderGoods(data) {
  return request({
    url: '/mapi/order/goods/insertRetailOrderGoods',
    method: 'post',
    data: data
  })
}

// 支付接口
export function orderGoodsPay(data) {
  return request({
    url: '/mapi/order/goods/orderGoodsPay',
    method: 'post',
    data: data
  })
}

// 查询商品订单详细
export function cancelOrder(data) {
  return request({
    url: '/mapi/order/goods/cancelOrder',
    method: 'post',
    data: data
  })
}

// 新增商品订单
export function rePayOrder(data) {
  return request({
    url: '/mapi/order/goods/rePayOrder',
    method: 'post',
    data: data
  })
}

// 总部出货
export function outOrderGoods(data) {
  return request({
    url: '/mapi/order/goods/outOrderGoods',
    method: 'post',
    data: data
  })
}

//生活服务-汽车美容订单-总部接单
export function receiveOrder(query) {
  return request({
    url: '/mapi/order/goods/receiveOrder',
    method: 'get',
    params: query
  })
}

//生活服务-汽车美容订单-确认完成
export function confirmFinish(query) {
  return request({
    url: '/mapi/order/goods/confirmFinish',
    method: 'get',
    params: query
  })
}

// 查询退款商品订单列表
export function refundOrderGoodsList(query) {
  return request({
    url: '/mapi/order/goods/refundOrderGoodsList',
    method: 'get',
    params: query
  })
}

//订单-总部撤单
export function refundOrderGoods(data) {
  return request({
    url: '/mapi/order/goods/refundOrderGoods',
    method: 'post',
    data: data
  })
}

//商品订单退款审核，审批同意
export function refundApprovalPass(query) {
  return request({
    url: '/mapi/order/goods/refundApprovalPass',
    method: 'get',
    params: query
  })
}

//商品订单退款审核，审批驳回
export function refundApprovalReject(query) {
  return request({
    url: '/mapi/order/goods/refundApprovalReject',
    method: 'get',
    params: query
  })
}

//获取所有可支持的快递公司
export function getdeliveryAll() {
  return request({
    url: '/mapi/system/group/data/selectByKey?key=express_company',
    method: 'get'
  })
}

//查询订单物流轨迹
export function getDeliveryPath(query) {
  return request({
    url: '/mapi/order/goods/getDeliveryPath',
    method: 'get',
    params: query
  })
}

// 查询商品销售统计列表
export function listStatistics(query) {
  return request({
    url: '/mapi/order/goods/statistics',
    method: 'get',
    params: query
  })
}

// 导出商品销售统计列表
export function exportStatistics(query) {
  return request({
    url: '/mapi/order/goods/statistics/export',
    method: 'post',
    params: query
  })
}
