import request from '@/utils/request'

// 查询食堂订单列表
export function payMiwp(data) {
  return request({
    url: '/canteen/order/payMiwp',
    method: 'post',
    data: data
  })
}

// 查询食堂订单列表
export function tjdcList(query) {
  return request({
    url: '/canteen/order/tjdcList',
    method: 'get',
    params: query
  })
}

// 查询订单菜单统计
export function jdcTj(query) {
  return request({
    url: '/canteen/order/jdcTj',
    method: 'get',
    params: query
  })
}

// 查询订单月度统计
export function jdcMonthTj(query) {
  return request({
    url: '/canteen/order/jdcMonthTj',
    method: 'get',
    params: query
  })
}

// 查询订单月度统计
export function useMoneyMonthTj(query) {
  return request({
    url: '/canteen/order/useMoneyMonthTj',
    method: 'get',
    params: query
  })
}

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

// 查询食堂订单列表
export function getPlace(data) {
  return request({
    url: '/app/getPlace',
    method: 'post',
    data: data
  })
}


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

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

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

// 因错退还食堂订单
export function partbackOrder(data) {
  return request({
    url: '/canteen/order/partback',
    method: 'post',
    data: data
  })
}

// 删除食堂订单
export function delOrder(orderId) {
  return request({
    url: '/canteen/order/' + orderId,
    method: 'delete'
  })
}
// 导出食堂订单
export function tjdcExport(query) {
  return request({
    url: '/canteen/order/tjdcExport',
    method: 'get',
    params: query
  })
}
// 导出食堂订单
export function useMoneyMonthTjExport(query) {
  return request({
    url: '/canteen/order/useMoneyMonthTjExport',
    method: 'get',
    params: query
  })
}

// 导出食堂订单
export function exportOrder(query) {
  return request({
    url: '/canteen/order/export',
    method: 'get',
    params: query
  })
}

// 作废食堂订单
export function backOrder(data) {
  return request({
    url: '/canteen/order/back' ,
    method: 'post',
    data:data
  })
}

// 查询食堂订单汇总
export function listOrders(query) {
  return request({
    url: '/canteen/order/lists',
    method: 'get',
    params: query
  })
}

export function sumOrderPay(query) {
  return request({
    url: '/canteen/order/sumpay',
    method: 'get',
    params: query
  })
}

export function sumOrderNum(query) {
  return request({
    url: '/canteen/order/sumordernum',
    method: 'get',
    params: query
  })
}
