import request from '@/utils/request'

// 查询订单列表
export function listOrder(query) {
  return request({
    url: '/his/storeOrder/list',
    method: 'get',
    params: query
  })
}
// 下载导入模板
export function importTemplate() {
  return request({
    url: '/his/storeOrder/importTemplate',
    method: 'get'
  })
}
// 查询订单详细
export function getOrder(orderId) {
  return request({
    url: '/his/storeOrder/' + orderId,
    method: 'get'
  })
}
// 查询收货人电话
export function getOrderUserPhone(orderId) {
  return request({
    url: '/his/storeOrder/queryPhone/' + orderId,
    method: 'get'
  })
}
export function getMsgFollow(followId) {
  return request({
    url: '/his/storeOrder/follow/' + followId,
    method: 'get'
  })
}
export function msgList(query) {
  return request({
    url: '/his/storeOrder/msgList',
    method: 'get',
    params: query
  })
}
export function updateErp(data) {
  return request({
    url: '/his/storeOrder/updateErpOrder',
    method: 'post',
    data: data
  })
}
export function getPrescribe(orderId) {
  return request({
    url: '/his/storeOrder/Prescribe/' + orderId,
    method: 'get'
  })
}

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


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

export function returnCost(orderId) {
  return request({
    url: '/his/storeOrder/returnCost/' + orderId,
    method: 'get'
  })
}
export function sendMsg(orderId) {
  return request({
    url: '/his/storeOrder/sendMsg/' + orderId,
    method: 'get'
  })
}

export function syncExpress(orderId) {
  return request({
    url: '/his/storeOrder/syncExpress/' + orderId,
    method: 'get'
  })
}
export function updateExpress(orderId) {
  return request({
    url: '/his/storeOrder/updateExpress/' + orderId,
    method: 'get'
  })
}
// 新增订单
export function addOrder(data) {
  return request({
    url: '/his/storeOrder',
    method: 'post',
    data: data
  })
}

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


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


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


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

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

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


export function exportOrder2(query) {
  return request({
    url: '/his/storeOrder/orderExport',
    method: 'get',
    params: query
  })
}

