import request from '@/utils/request'

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

export function userOrderList(query) {
  return request({
    url: '/store/storeOrder/userOrderList',
    method: 'get',
    params: query
  })
}
export function myListOrder(query) {
  return request({
    url: '/store/storeOrder/myList',
    method: 'get',
    params: query
  })
}
// 下载导入模板
export function importTemplate() {
  return request({
    url: '/store/storeOrder/importTemplate',
    method: 'get'
  })
}
// 查询订单详细
export function getOrder(orderId) {
  return request({
    url: '/store/storeOrder/' + orderId,
    method: 'get'
  })
}

// 查询地址
export function getOrderAddress(orderId) {
  return request({
    url: '/store/storeOrder/query/' + orderId,
    method: 'get'
  })
}

// 查询电话
export function getUserPhone(orderId) {
  return request({
    url: '/store/storeOrder/queryPhone/' + orderId,
    method: 'get'
  })
}
export function getPrescribe(orderId) {
  return request({
    url: '/store/storeOrder/Prescribe/' + orderId,
    method: 'get'
  })
}

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

export function payment(orderId) {
  return request({
    url: '/store/storeOrder/payment/' + orderId,
    method: 'get'
  })
}
export function syncExpress(orderId) {
  return request({
    url: '/store/storeOrder/syncExpress/' + orderId,
    method: 'get'
  })
}
export function updateExpress(orderId) {
  return request({
    url: '/store/storeOrder/updateExpress/' + orderId,
    method: 'get'
  })
}
export function logList(orderId) {
  return request({
    url: '/store/storeOrder/logList/' + orderId,
    method: 'get'
  })
}


export function listOrderitem(orderId) {
  return request({
    url: '/store/storeOrder/ltemlist/' + orderId,
    method: 'get'
  })
}

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

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

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

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


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

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

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

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


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

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

export function getMsgFollow(followId) {
  return request({
    url: '/store/storeOrder/follow/' + followId,
    method: 'get'
  })
}
export function msgList(query) {
  return request({
    url: '/store/storeOrder/msgList',
    method: 'get',
    params: query
  })
}

