import request from '@/utils/request';

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

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