import request from '@/utils/request'
import org from '../../router/modules/org'

export function GenerateDialysisNo(phone) {
  console.log('phone是什么', phone)
  return request({
    url: '/api/patient/getneratedialysisno?phone=' + phone,
    method: 'Get'
  })
}

export function savePatient(data, telephone) {
  console.log('data是什么', data)
  return request({
    url: '/api/patient/savepatient?telephone=' + telephone,
    method: 'Post',
    data: data
  })
}

export function getCourseManagement(patientid, orgid, startime, endtime) {
  console.log('startime', startime)
  console.log('endtime', endtime)
  const params = {
    patientid: patientid,
    orgid: orgid,
    startime: startime,
    endtime: endtime
  }
  return request({
    url: '/api/patient/getcoursemanagement',
    method: 'Post',
    params: params
  })
}

export function toDeleteCouseManage(id, orgid) {
  const params = {
    id: id,
    orgid: orgid
  }

  return request({
    url: '/api/patient/todeletecousemanage',
    method: 'Get',
    params: params
  })
}

export function getMissionInformation(patientid, orgid, startime, endtime) {
  const params = {
    patientid: patientid,
    orgid: orgid,
    startime: startime,
    endtime: endtime
  }

  return request({
    url: '/api/patient/getmissioninformation',
    method: 'Get',
    params: params
  })
}

export function getRecordSave(patientid, orgid, startime, endtime) {
  const params = {
    patientid: patientid,
    orgid: orgid,
    startime: startime,
    endtime: endtime
  }

  return request({
    url: '/api/patient/getrecordsave',
    method: 'Get',
    params: params
  })
}

export function getcheckPatientData(patientid, orgid, startime, endtime) {
  const params = {
    patientid: patientid,
    orgid: orgid,
    startime: startime,
    endtime: endtime
  }

  return request({
    url: '/api/patient/getcheckpatientdata',
    method: 'Get',
    params: params
  })
}

export function getlongDialysis(patientid, orgid, startime, endtime) {
  const params = {
    patientid: patientid,
    orgid: orgid,
    startime: startime,
    endtime: endtime
  }

  return request({
    url: '/api/patient/getlongdialysis',
    method: 'Get',
    params: params
  })
}

export function getDialysRecord(patientid, orgid, startime, endtime) {
  const params = {
    patientid: patientid,
    orgid: orgid,
    startime: startime,
    endtime: endtime
  }
  return request({
    url: '/api/patient/getdialysrecord',
    method: 'Get',
    params: params
  })
}

export function toSeacherCourseManagement(patientid, orgid, seacherVal) {
  const params = {
    patientid: patientid,
    orgid: orgid,
    seacherVal: seacherVal
  }

  return request({
    url: '/api/site/toseacherCourseManagement',
    method: 'Get',
    params: params
  })
}

export function toDeleteSaveRecord(id, params) {
  return request({
    url: '/api/site/todeletesaverecord?id=' + id,
    method: 'Get',
    params: params
  })
}

export function toSeacherRecord(patientid, orgid, seacherVal) {
  const params = {
    patientid: patientid,
    orgid: orgid,
    seacherVal: seacherVal
  }
  return request({
    url: '/api/site/toSeacherRecord',
    method: 'Get',
    params: params
  })
}

export function deleteMissionInformation(id, orgid) {
  const params = {
    id: id,
    orgid: orgid
  }
  return request({
    url: '/api/site/deletemissioninformation',
    method: 'Get',
    params: params
  })
}

export function toSeacherMissionInformation(patientid, orgid, seacherVal) {
  const params = {
    patientid: patientid,
    orgid: orgid,
    seacherVal: seacherVal
  }
  return request({
    url: '/api/patient/toseachermissioninformation',
    method: 'Get',
    params: params
  })
}

export function GetPatientSchedules(patientid, orgid, startime, endtime) {
  const params = {
    patientid: patientid,
    orgid: orgid,
    startime: startime,
    endtime: endtime
  }

  return request({
    url: '/api/patient/getpatientschedules',
    method: 'Get',
    params: params
  })
}

export function deleteScheduleInformation(id, params) {
  return request({
    url: '/api/patient/deletescheduleinformation?id=' + id,
    method: 'Get',
    params: params
  })
}

export function toSeacherScheduleInformation(patientid, orgid, seacherVal) {
  const params = {
    patientid: patientid,
    orgid: orgid,
    seacherVal: seacherVal
  }

  return request({
    url: '/api/patient/toseacherscheduleinformation',
    method: 'Get',
    params: params
  })
}

export function getPatientType(patientid, orgid) {
  const params = {
    patientid: patientid,
    orgid: orgid
  }
  return request({
    url: '/api/patient/getpatienttype',
    method: 'Get',
    params: params
  })
}

export function checkAll(checkdate, patientid, orgid) {
  const params = {
    checkdate: checkdate,
    patientid: patientid,
    orgid: orgid
  }
  return request({
    url: '/api/patient/checkall',
    method: 'Get',
    params: params
  })
}
