import request from '@/utils/request'

export function getAllSubregion(params) {
  console.log('params', params)
  return request({
    url: '/api/management/getallsubregion',
    method: 'Get',
    params: params
  })
}

export function SaveManageInfo(data) {
  return request({
    url: '/api/management/savemanageinfo',
    method: 'Post',
    data: data
  })
}

export function getAllMachineInfo(
  page,
  limit,
  searchKey,
  zoneid,
  equipmentid,
  statusid
) {
  const params = {
    page: page,
    limit: limit,
    searchKey: searchKey,
    zoneid: zoneid,
    equipmentid: equipmentid,
    statusid: statusid
  }
  return request({
    url: '/api/management/getallmachineinfo',
    method: 'Get',
    params: params
  })
}

export function getAllMachine(zoneid, deviceid) {
  const params = {
    zoneid: zoneid,
    deviceid: deviceid
  }
  return request({
    url: '/api/management/getallmachine',
    method: 'Get',
    params: params
  })
}

export function getAllMachineTwo(zoneid, deviceid) {
  const params = {
    zoneid: zoneid,
    deviceid: deviceid
  }
  return request({
    url: '/api/management/getallmachinetwo',
    method: 'Get',
    params: params
  })
}

export function getMachineDetailById(id, params) {
  return request({
    url: '/api/management/getmachinedetail?id=' + id,
    method: 'Get',
    params: params
  })
}

export function UpdateMachineInfo(data) {
  return request({
    url: '/api/management/updatemachineinfo',
    method: 'Post',
    data: data
  })
}

export function UpdateMachineInfoTwo(data) {
  return request({
    url: '/api/management/updatemachineinfotwo',
    method: 'post',
    data: data
  })
}

export function getAllEquimentName(params) {
  return request({
    url: '/api/management/getallequimentname',
    method: 'Get',
    params: params
  })
}

export function savePlan(data, id) {
  console.log('data', data)
  return request({
    url: '/api/management/saveplan?id=' + id,
    method: 'Post',
    data: data
  })
}

export function getAllPlan(params) {
  return request({
    url: '/api/management/getallplan',
    method: 'Get',
    params: params
  })
}

export function getAllPlanDetail(unitype) {
  // eslint-disable-next-line no-redeclare
  const params = {
    unitype: unitype
  }
  return request({
    url: '/api/management/getallplandetail',
    method: 'Get',
    params: params
  })
}

export function getEditMachine(id, params) {
  return request({
    url: '/api/management/geteditmachine?id=' + id,
    method: 'Get',
    params: params
  })
}

export function DeletePlans(data) {
  return request({
    url: '/api/staff/deleteplans',
    method: 'delete',
    data: data
  })
}

export function EditPlanDetail(id, params) {
  return request({
    url: '/api/manage/editplandetail?id=' + id,
    method: 'get',
    params: params
  })
}

export function UpdatePlanInfo(data) {
  console.log('data', data)
  return request({
    url: '/api/manage/updateplaninfo',
    method: 'Post',
    data: data
  })
}

export function getComprehensive(params) {
  return request({
    url: '/api/manage/getcomprehensive',
    method: 'Get',
    params: params
  })
}

export function SaveInformation(eid, data) {
  console.log('data--', data)
  return request({
    url: '/api/manage/saveinformation?eid=' + eid,
    method: 'Post',
    data: data
  })
}

export function getPatientInfo(id, params) {
  return request({
    url: '/api/manage/getpatientinfo?id=' + id,
    method: 'Get',
    params: params
  })
}

export function ChangeClass(equitid, id) {
  const params = {
    equitid: equitid,
    id: id
  }
  return request({
    url: '/api/manage/changeclass',
    method: 'Get',
    params: params
  })
}

export function changePatient(equitid, id) {
  const params = {
    equitid: equitid,
    id: id
  }
  return request({
    url: '/api/manage/changepatient',
    method: 'Get',
    params: params
  })
}

export function getAllOrganization(params) {
  return request({
    url: '/api/manage/getallorganization',
    method: 'Get',
    params: params
  })
}

export function getUserRegister(id, params) {
  return request({
    url: '/api/manage/getregisterinfo?id=' + id,
    method: 'Get',
    params: params
  })
}

export function getInformationData(limit, page) {
  const params = {
    limit: limit,
    page: page
  }
  return request({
    url: '/api/manage/getinformationdata',
    method: 'Get',
    params: params
  })
}

export function SaveBacteria(id, data) {
  return request({
    url: '/api/manage/savebacteria?id=' + id,
    method: 'Post',
    data: data
  })
}

export function SaveLincomycin(id, data) {
  return request({
    url: '/api/manage/savelincomycin?id=' + id,
    method: 'Post',
    data: data
  })
}

export function SaveQualityControl(id, data) {
  return request({
    url: '/api/manage/savequalitycontrol?id=' + id,
    method: 'Post',
    data: data
  })
}

export function getOrgName(params) {
  return request({
    url: '/api/manage/getorgname',
    method: 'Get',
    params: params
  })
}

export function getAllQulityInfo(params) {
  return request({
    url: '/api/manage/getallqulityinfo',
    method: 'Get',
    params: params
  })
}

export function EditCulture(id, userid) {
  const params = {
    id: id,
    userid: userid
  }
  return request({
    url: '/api/manage/editculture',
    method: 'Get',
    params: params
  })
}

export function UpdateCulture(data) {
  return request({
    url: '/api/manage/updateculture',
    method: 'Post',
    data: data
  })
}

export function DeleteCultrue(data) {
  return request({
    url: '/api/manage/deletecultrue',
    method: 'delete',
    data: data
  })
}

export function EditDialyState(id, params) {
  return request({
    url: '/api/manage/editdialystate?id=' + id,
    method: 'Get',
    params: params
  })
}

export function UpdateDialyState(data) {
  return request({
    url: '/api/manage/updatedialystate',
    method: 'post',
    data: data
  })
}

export function DeleteDialystate(data) {
  return request({
    url: '/api/manage/deletedialystate',
    method: 'delete',
    data: data
  })
}

export function EditIon(id, params) {
  return request({
    url: '/api/manage/edition?id=' + id,
    method: 'Get',
    params: params
  })
}

export function UpdateIon(data) {
  return request({
    url: '/api/manage/updateion',
    method: 'Post',
    data: data
  })
}

export function DeleteIon(data) {
  return request({
    url: '/api/manage/deleteion',
    method: 'delete',
    data: data
  })
}

export function queryTable(bedid, startime, endtime) {
  const params = {
    bedid: bedid,
    startime: startime,
    endtime: endtime
  }
  return request({
    url: '/api/manage/query',
    method: 'Get',
    params: params
  })
}

export function SaveRepair(id, data) {
  return request({
    url: '/api/manage/saverepair?id=' + id,
    method: 'post',
    data: data
  })
}

export function getAllRepair(limit, page) {
  const params = {
    limit: limit,
    page: page
  }
  return request({
    url: '/api/manage/getallrepair',
    method: 'Get',
    params: params
  })
}

export function EditRepair(id, params) {
  return request({
    url: '/api/manage/editrepair?id=' + id,
    method: 'Get',
    params: params
  })
}

export function UpdateRepair(data) {
  console.log('data-----', data)
  return request({
    url: '/api/manage/updaterepair',
    method: 'Post',
    data: data
  })
}

export function DeleteRepair(data) {
  return request({
    url: '/api/manage/deleterepair',
    method: 'delete',
    data: data
  })
}

export function queryRepair(bedid, startime, endtime) {
  const params = {
    bedid: bedid,
    startime: startime,
    endtime: endtime
  }

  return request({
    url: '/api/manage/queryrepair',
    method: 'Get',
    params: params
  })
}

export function EditUser(id, patientid) {
  const params = {
    id: id,
    patientid: patientid
  }
  return request({
    url: '/api/manage/edituser',
    method: 'Get',
    params: params
  })
}

export function DeleteUserform(data) {
  return request({
    url: '/api/manage/deleteform',
    method: 'delete',
    data: data
  })
}

export function UpdateForm(data) {
  return request({
    url: '/api/manage/updateform',
    method: 'post',
    data: data
  })
}

export function queryInfo(zone, bed, startime, endtime, limit, page) {
  const params = {
    zone: zone,
    bed: bed,
    startime: startime,
    endtime: endtime,
    limit: limit,
    page: page
  }
  console.log('params', params)
  return request({
    url: '/api/manage/queryinfo',
    method: 'Get',
    params: params
  })
}

export function getAutoData(id, params) {
  return request({
    url: '/api/manage/insertautodata?id=' + id,
    method: 'Get',
    params: params
  })
}

export function getAllEquitType(params) {
  return request({
    url: '/api/manage/getallequittype',
    method: 'Get',
    params: params
  })
}

export function getUserForm(id, limit, page) {
  const params = {
    id: id,
    limit: limit,
    page: page
  }
  return request({
    url: '/api/manage/getuserform',
    method: 'Get',
    params: params
  })
}

export function UpdateMacheineTwo(data) {
  return request({
    url: '/api/manage/updatemacheinettwo',
    method: 'post',
    data: data
  })
}

export function getBedForm(id, params) {
  console.log('设备-id', id)
  return request({
    url: '/api/manage/getbedform?id=' + id,
    method: 'get',
    params: params
  })
}

export function getTotalCount(params) {
  return request({
    url: '/api/manage/gettotalcount',
    method: 'Get',
    params: params
  })
}

export function getTotalNumber(id, params) {
  return request({
    url: '/api/manage/getotalnumber?id=' + id,
    method: 'Get',
    params: params
  })
}

export function getTimeWarning(id, params) {
  return request({
    url: '/api/manage/gettimewarning?id=' + id,
    method: 'Get',
    params: params
  })
}

export function SaveManageInfoTwo(data, beds) {
  console.log('data', beds)
  return request({
    url: '/api/manage/savemanageinfotwo?beds=' + beds,
    method: 'post',
    data: data
  })
}

export function getAllpatient(params) {
  return request({
    url: '/api/manage/getallpatient',
    method: 'get',
    params: params
  })
}

export function changeBed(id, params) {
  return request({
    url: '/api/manage/changebed?id=' + id,
    method: 'get',
    params: params
  })
}

export function getPatientDetail(id, params) {
  return request({
    url: '/api/manage/getpatientdetail?id=' + id,
    method: 'get',
    params: params
  })
}

export function changeRun(id, data) {
  return request({
    url: '/api/manage/changrun?id=' + id,
    method: 'post',
    data: data
  })
}

export function getRemanderData(params) {
  return request({
    url: '/api/manage/getremanderdata',
    method: 'get',
    params: params
  })
}

export function openDelete(id, params) {
  return request({
    url: '/api/manage/opendelete?id=' + id,
    method: 'delete',
    params: params
  })
}

export function DeleteUserLogin(id, params) {
  return request({
    url: '/api/manage/deleteuserlogin?id=' + id,
    method: 'delete',
    params: params
  })
}

export function DeleteCultrues(id, params) {
  return request({
    url: '/api/manage/deletecultrues?id=' + id,
    method: 'delete',
    params: params
  })
}

export function DeleteDialystates(id, params) {
  return request({
    url: '/api/manage/deletedialystates?id=' + id,
    method: 'delete',
    params: params
  })
}

export function DeleteIons(id, params) {
  return request({
    url: '/api/manage/deleteions?id=' + id,
    method: 'delete',
    params: params
  })
}

export function DeleteRepairs(id, params) {
  return request({
    url: '/api/manage/deleterepairs?id=' + id,
    method: 'delete',
    params: params
  })
}

export function SaveMode(data) {
  return request({
    url: '/api/manage/savemode',
    method: 'post',
    data: data
  })
}

export function getAllMode(params) {
  return request({
    url: '/api/manage/getallmode',
    method: 'get',
    params: params
  })
}

export function EditMode(id, params) {
  return request({
    url: '/api/manage/editmode?id=' + id,
    method: 'get',
    params: params
  })
}

export function UpdateMode(id, data) {
  return request({
    url: '/api/manage/updatemode?id=' + id,
    method: 'post',
    data: data
  })
}

export function DeleteMode(id, params) {
  return request({
    url: '/api/manage/deletemode?id=' + id,
    method: 'delete',
    params: params
  })
}

export function selectChange(id, params) {
  return request({
    url: '/api/manage/selectchange?id=' + id,
    method: 'get',
    params: params
  })
}

export function selectBed(id, params) {
  return request({
    url: '/api/manage/selectbed?id=' + id,
    method: 'get',
    params: params
  })
}

export function getTimeBeteen(equitid, todaytime) {
  const params = {
    equitid: equitid,
    todaytime: todaytime
  }
  return request({
    url: '/api/manage/getime',
    method: 'get',
    params: params
  })
}

export function DeleteImages(id, params) {
  return request({
    url: '/api/manage/deleteimages?id=' + id,
    method: 'delete',
    params: params
  })
}
