import request from '@/utils/request'

// 查询配送员列表
export function listDelivery(query) {
  return request({
    url: '/mapi/app/delivery/list',
    method: 'get',
    params: query
  })
}

// 查询配送员详细
export function getDelivery(id) {
  return request({
    url: '/mapi/app/delivery/' + id,
    method: 'get'
  })
}

// 新增配送员
export function addDelivery(data) {
  return request({
    url: '/mapi/app/delivery',
    method: 'post',
    data: data
  })
}

// 修改配送员
export function updateDelivery(data) {
  return request({
    url: '/mapi/app/delivery',
    method: 'put',
    data: data
  })
}

// 删除配送员
export function delDelivery(id) {
  return request({
    url: '/mapi/app/delivery/' + id,
    method: 'delete'
  })
}


// 修改配送员状态
export function updateDeliveryStatus(id,status) {
  const data = {
    id,
    status
  }
  return request({
    url: '/mapi/app/delivery/updateStatus',
    method: 'post',
    data: data
  })
}
// 查询配送员接单记录列表
export function getDeliveryOrderRecordList(query) {
  return request({
    url: '/mapi/app/delivery/getDeliveryOrderRecordList',
    method: 'get',
    params: query
  })
}


// 预约订单查询配送员列表
export function getDeliveryManListByOrg() {
  return request({
    url: '/mapi/app/delivery/getDeliveryManListByOrg',
    method: 'get'
  })
}
