import request from '@/utils/request'

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

// 查询订单明细总数
export function getOrderItemsNum(query) {
  return request({
    url: '/store/storeOrder/orderItemsNum',
    method: 'get',
    params: query
  })
}
// 查询尾款订单列表
export function listPayRemainOrder(query) {
  return request({
    url: '/store/storeOrder/payRemainList',
    method: 'get',
    params: query
  })
}
// 查询推广订单列表
export function listPromotionOrder(query) {
  return request({
    url: '/store/storeOrder/promotionList',
    method: 'get',
    params: query
  })
}
// 查询健康商城订单列表
export function listHealthStoreOrder(query) {
  return request({
    url: '/store/storeOrder/healthList',
    method: 'get',
    params: query
  })
}

export function getCustomerOrderList(query) {
  return request({
    url: '/store/storeOrder/getCustomerOrderList',
    method: 'get',
    params: query
  })
}





// 查询订单详细
export function getStoreOrder(id) {
  return request({
    url: '/store/storeOrder/' + id,
    method: 'get'
  })
}
export function getStoreOrderLive(id,payTypeCode) {
  return request({
    url: '/store/storeOrder/v2/' + id+'/'+payTypeCode,
    method: 'get'
  })
}

// 查询订单详细
export function getStoreOrderAddress(id) {
  return request({
    url: '/store/storeOrder/queryAddress/' + id,
    method: 'get'
  })
}

// 查询订单详细
export function getStoreOrderPhone(id) {
  return request({
    url: '/store/storeOrder/queryPhone/' + id,
    method: 'get'
  })
}


export function getExpress(id) {
  return request({
    url: '/store/storeOrder/getExpress/' + id,
    method: 'get'
  })
}

// 新增订单
export function addStoreOrder(data) {
  return request({
    url: '/store/storeOrder',
    method: 'post',
    data: data
  })
}

// 修改订单
export function updateStoreOrder(data) {
  return request({
    url: '/store/storeOrder',
    method: 'put',
    data: data
  })
}

// 修改物流编号
export function updateDeliveryId(data) {
  return request({
    url: '/store/storeOrder/editDeliveryId',
    method: 'put',
    data: data
  })
}

// 删除订单
export function delStoreOrder(id) {
  return request({
    url: '/store/storeOrder/' + id,
    method: 'delete'
  })
}

// 导出订单
export function exportStoreOrder(query) {
  return request({
    url: '/store/storeOrder/export',
    method: 'get',
    params: query
  })
}

// 导出订单
export function exportHealthStoreOrder(query) {
  return request({
    url: '/store/storeOrder/healthExport',
    method: 'get',
    params: query
  })
}

// 导出订单
export function exportPromotionOrder(query) {
  return request({
    url: '/store/storeOrder/promotionExport',
    method: 'get',
    params: query
  })
}

// 导出付尾款订单
export function exportStorePayRemainOrder(query) {
  return request({
    url: '/store/storeOrder/payRemainExport',
    method: 'get',
    params: query
  })
}

// 导出订单
export function exportStoreOrderItems(query) {
  return request({
    url: '/store/storeOrder/exportItems',
    method: 'get',
    params: query
  })
}

// 导出订单
export function exportHealthStoreOrderItems(query) {
  return request({
    url: '/store/storeOrder/healthExportItems',
    method: 'get',
    params: query
  })
}

export function createUserOrder(data) {
  return request({
    url: '/store/storeOrder/createUserOrder',
    method: 'post',
    data: data
  })
}

export function finishOrder(data) {
  return request({
    url: '/store/storeOrder/finishOrder',
    method: 'post',
    data: data
  })
}
export function importTemplate() {
  return request({
    url: '/store/storeOrder/importTemplate',
    method: 'get'
  })
}

export function editTuiMoney(data) {
  return request({
    url: '/store/storeOrder/editTuiMoney',
    method: 'post',
    data: data
  })
}

export function refundOrderMoney(data) {
  return request({
    url: '/store/storeOrder/refundOrderMoney',
    method: 'post',
    data: data
  })
}

export function updateExpress(data) {
  return request({
    url: '/store/storeOrder/updateExpress',
    method: 'post',
    data: data
  })
}
export function syncExpress(data) {
  return request({
    url: '/store/storeOrder/syncExpress',
    method: 'post',
    data: data
  })
}

export function updateErp(data) {
  return request({
    url: '/store/storeOrder/updateErpOrder',
    method: 'post',
    data: data
  })
}
export function addTuiMoney(data) {
  return request({
    url: '/store/storeOrder/addTuiMoney',
    method: 'post',
    data: data
  })
}

export function getEroOrder(query) {
  return request({
    url: '/store/storeOrder/getEroOrder',
    method: 'get',
    params: query
  })
}

export function createErpOrder(query) {
  return request({
    url: '/store/storeOrder/createErpOrder',
    method: 'get',
    params: query
  })
}

//审核
export function auditPayRemain(data) {
  return request({
    url: '/store/storeOrder/auditPayRemain',
    method: 'post',
    data: data
  })
}
