import request from '@/utils/request'

export function getWeekPanels(t, patitionId) {
  return request({
    url: '/api/schedule/weekpanel?data=' + t + '&patitionid=' + patitionId,
    method: 'get'
  })
}

export function getWeekPanelsOne(t, patitionId) {
  return request({
    url: '/api/schedule/weekpanelone?data=' + t + '&patitionid=' + patitionId,
    method: 'get'
  })
}

export function getSchedules(params) {
  return request({
    url: '/api/schedule/schedules',
    method: 'get',
    params: params
  })
}

export function getSchedulesOne(params) {
  return request({
    url: '/api/schedule/schedulesone',
    method: 'get',
    params: params
  })
}

export function getSchedulePatients(params) {
  return request({
    url: '/api/schedule/patients',
    method: 'get',
    params: params
  })
}

export function CreateSchedule(id, schedule) {
  return request({
    url: '/api/schedule/create?patient_id=' + id,
    method: 'Post',
    data: schedule
  })
}

export function CancelSchedule(id) {
  return request({
    url: '/api/schedule/delete?id=' + id,
    method: 'Delete'
  })
}

export function ChangeSchedule(id, schedule) {
  console.log('schedule', schedule)
  return request({
    url: '/api/schedule/change?id=' + id,
    method: 'Put',
    data: schedule
  })
}

export function GetPatientSchedules(id) {
  return request({
    url: '/api/patients/schedules?id=' + id,
    method: 'Get'
  })
}

export function GetWeekSchedulePrintInitData(date, type) {
  return request({
    url: '/api/schedule/print/initdata',
    method: 'get',
    params: {
      date: date
    }
  })
}

export function getUrgentScheduleInitData(params) {
  return request({
    url: '/api/schedule/urgentinit',
    method: 'Get',
    params: params
  })
}

export function getSearchResult(params) {
  return request({
    url: '/api/schedule/search',
    method: 'Get',
    params: params
  })
}

export function getScheduleWeekDay(params) {
  return request({
    url: '/api/schedule/week',
    method: 'Get',
    params: params
  })
}

export function exportSchedule(params, date) {
  return request({
    url: '/api/schedule/export?date=' + date,
    method: 'Post',
    data: params
  })
}

export function initDate() {
  return request({
    url: '/api/excel_date/init',
    method: 'Get'
  })
}

export function exportScheduleTemplate(params) {
  return request({
    url: '/api/schedule_template/export',
    method: 'Post',
    data: params
  })
}

export function getNextScheduleWeekDay(params) {
  return request({
    url: '/api/schedule/getnextscheduleweekday',
    method: 'get',
    params: params
  })
}

export function getThreeWeekList(params) {
  return request({
    url: '/api/schedule/getthreeweeklist',
    method: 'get',
    params: params
  })
}

export function getAllZones(params) {
  return request({
    url: '/api/schedule/getallzones',
    method: 'get',
    params: params
  })
}

export function copyPatientSchedule(params) {
  return request({
    url: '/api/schedule/copypatientschedules',
    method: 'Get',
    params: params
  })
}

export function saveRemindPrint(params) {
  return request({
    url: '/api/schedule/saveremindprint',
    method: 'get',
    params: params
  })
}

export function getRemindPrintList(params) {
  return request({
    url: '/api/schedule/getremindprintlist',
    method: 'get',
    params: params
  })
}

export function getScheduleList(params) {
  return request({
    url: '/api/schedule/getbloodschedulelist',
    method: 'get',
    params: params
  })
}

export function getPrintList(params) {
  return request({
    url: '/api/schedule/getprintlist',
    method: 'Get',
    params: params
  })
}

export function getAllZoneList(params) {
  return request({
    url: '/api/schedule/getallzonelist',
    method: 'get',
    params: params
  })
}

export function getPatientSheduleCount(params) {
  return request({
    url: '/api/schedule/getpatientschedulecount',
    method: 'get',
    params: params
  })
}

export function postScheduleTemplate(params) {
  return request({
    url: '/api/schedule/postscheduletemplate',
    method: 'get',
    params: params
  })
}

export function getScheduleTemplate(params) {
  return request({
    url: '/api/schedule/getscheduletemplate',
    method: 'get',
    params: params
  })
}

export function getNextWeekPanels(params) {
  return request({
    url: '/api/schedule/getnextweekpanels',
    method: 'get',
    params: params
  })
}

export function synchroSchedule(params) {
  return request({
    url: '/api/schedule/synchroschedule',
    method: 'get',
    params: params
  })
}

export function getPatientScheduleTemplate(params) {
  return request({
    url: '/api/schedule/getpatientscheduletemplate',
    method: 'get',
    params: params
  })
}

export function getSolutionSchedule(params) {
  return request({
    url: '/api/schedule/getsolutionschedule',
    method: 'Get',
    params: params
  })
}
