import request from "@/utils/request";

export function erpList(query) {
  const {pageNum, pageSize, date, ...data} = query;
  if (Array.isArray(date)) [data.startTime, data.endTime = data.startTime] = date;
  return request({
    url: '/yfc-admin/erpOrderManage/pageErpOrder',
    method: 'post',
    data,
    params: {pageNum, pageSize},
  })
}

export function erpDetail(id) {
  return request({
    url: '/yfc-admin/erpOrderManage/getHealRepDetailById',
    method: 'get',
    params: {erpOrderId: id}
  })
}

export function erpDelete(id) {
  return request({
    url: '/yfc-admin/erpOrderManage/cancelErpOrder',
    method: 'post',
    data: {},
    params: {erpOrderIds: id},
  })
}

export function erpUpdate(data) {
  return request({
    url: '/yfc-admin/erpOrderManage/receiveErpOrder',
    method: 'post',
    data,
  })
}
