import request from '@/utils/request'

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

// 查询充值/退款订单列表
export function rechargeList(query) {
  return request({
    url: '/system/order/rechargeList',
    method: 'get',
    params: query
  })
}

// 查询订单详细
export function getOrder(orderId) {
  return request({
    url: '/system/order/' + orderId,
    method: 'get'
  })
}

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

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

// 删除订单
export function delOrder(orderId) {
  return request({
    url: '/system/order/' + orderId,
    method: 'delete'
  })
}

// 改价
export function changePrice(data) {
  return request({
    url: '/appVerify/order/editPrice',
    method: 'put',
    data: data
  })
}

// 退款
export function refund(data) {
  return request({
    url: '/appVerify/order/refund',
    method: 'put',
    data: data
  })
}

// 退款
export function returnVehicle(data) {
  return request({
    url: '/appVerify/device/return',
    method: 'post',
    params: data
  })
}

// 押金抵扣
export function deduction(data) {
  return request({
    url: '/appVerify/order/deduction',
    method: 'post',
    data: data
  })
}

// 押金退款
export function handleRefund(orderNo) {
  return request({
    url: '/system/order/depositRefund/'+orderNo,
    method: 'post',
  })
}

// 审核通过
export function passAudit(orderNo) {
  return request({
    url: '/system/order/passAudit/'+orderNo,
    method: 'post',
  })
}

// 官方审核通过
export function authoritypass(orderNo) {
  return request({
    url: '/appVerify/authoritypass/'+orderNo,
    method: 'put',
  })
}

