import request from '@/utils/request'
/** 学生端----------------------------------------------------------------------- */

//气瓶使用-领用气瓶-列表
export function receivingGasListByStu(query) {
  return request({
    url: '/bottle/bottleStorage/receivingGasListByStu',
    method: 'get',
    params: query
  })
}
//气瓶使用-归还气瓶-列表
export function returnGasByStu(query) {
  return request({
    url: '/bottle/bottleStorage/returnGasByStu',
    method: 'get',
    params: query
  })
}
//气瓶使用-领用
export function useRecord(data) {
  return request({
    url: '/bottle/useRecord',
    method: 'post',
    data: data
  })
}
//气瓶使用-领用
export function returnRecord(data) {
  return request({
    url: '/bottle/useRecord',
    method: 'put',
    data: data
  })
}
//使用记录
export function useRecordList(query) {
  return request({
    url: '/bottle/useRecord/list',
    method: 'get',
    params: query
  })
}
//使用记录-详情
export function useRecordDetail(data) {
  return request({
    url: '/bottle/useRecord/bottle/'+data,
    method: 'get',
  })
}
//使用记录-详情-列表
export function useRecordListDetail(data) {
  return request({
    url: '/bottle/useRecord/getUseDetails?id='+data,
    method: 'get',
  })
}
/** 管理端----------------------------------------------------------------------- */
//用气审核-列表头部总数
export function usegasTitle(query) {
  return request({
    url: '/bottle/usegasApply/applyTabCount',
    method: 'get',
    params: query
  })
}
//用气审核-待审核列表
export function usegasWaitApplyList(query) {
  return request({
    url: '/bottle/usegasApply/waitApplyList',
    method: 'get',
    params: query
  })
}
//用气审核-已通过列表
export function usegasPassApplyList(query) {
  return request({
    url: '/bottle/usegasApply/passApplyList',
    method: 'get',
    params: query
  })
}
//用气审核-未通过列表
export function usegasRefuseApplyList(query) {
  return request({
    url: '/bottle/usegasApply/refuseApplyList',
    method: 'get',
    params: query
  })
}
//用气审核-审核记录
export function usegasAuditRecordList(query) {
  return request({
    url: '/bottle/usegasAuditRecord/auditRecordList',
    method: 'get',
    params: query
  })
}
//用气审核-审核
export function usegasCheck(data) {
  return request({
    url: '/bottle/usegasAuditRecord/auditPass',
    method: 'post',
    data: data
  })
}

//气瓶使用-领用气瓶-列表
export function receivingGasList(query) {
  return request({
    url: '/bottle/bottleStorage/receivingGasList',
    method: 'get',
    params: query
  })
}
//入库记录-列表
export function enterRecordList(query) {
  return request({
    url: '/bottle/statistics/list',
    method: 'get',
    params: query
  })
}
//入库记录-详情
export function enterRecordDetail(data) {
  return request({
    url: '/bottle/statistics/'+data,
    method: 'get',
  })
}
//出库记录-列表
export function outRecordList(query) {
  return request({
    url: '/bottle/statistics/outList',
    method: 'get',
    params: query
  })
}
//出库记录-详情
export function outRecordDetail(data) {
  return request({
    url: '/bottle/statistics/out/'+data,
    method: 'get',
  })
}

//气瓶使用-归还气瓶-列表
export function returnGas(query) {
  return request({
    url: '/bottle/bottleStorage/returnGas',
    method: 'get',
    params: query
  })
}
//报警记录
export function alarmRecordList(query) {
  return request({
    url: '/bottle/alarmRecord/list',
    method: 'get',
    params: query
  })
}
//使用记录
export function useRecordManageList(query) {
  return request({
    url: '/bottle/useRecord/listByAdmin',
    method: 'get',
    params: query
  })
}
//使用记录-详情
export function useRecordManageDetail(data) {
  return request({
    url: '/bottle/useRecord/bottleByAdmin/'+data,
    method: 'get',
  })
}
//使用记录-详情-列表
export function useRecordListManageDetail(data) {
  return request({
    url: '/bottle/useRecord/getUseDetailsByAdmin?id='+data,
    method: 'get',
  })
}
//气瓶类目-列表
export function gasCategoryList(query) {
  return request({
    url: '/system/dict/data/listNotPower?dictType=qp_specification_category',
    method: 'get',
    params: query
  })
}
//出入库信息统计
export function outStatistics(query) {
  return request({
    url: '/bottle/useRecord/calcRepertory',
    method: 'get',
    params: query
  })
}
//气瓶申请统计
export function gasApplyStatistics(query) {
  return request({
    url: '/bottle/useRecord/calcApply',
    method: 'get',
    params: query
  })
}
//用气量统计
export function useGasStatistics(query) {
  return request({
    url: '/bottle/useRecord/calcAmount',
    method: 'get',
    params: query
  })
}

//异常记录
export function abnormalRecordList(query) {
  return request({
    url: '/bottle/bottleStorageError/list',
    method: 'get',
    params: query
  })
}
//异常记录-详情
export function abnormalRecordDetail(query) {
  return request({
    url: '/bottle/bottleStorageError/'+query,
    method: 'get',
    params: query
  })
}

// RFID标签-新增
export function RFIDtagAdd(data) {
  return request({
    url: '/bottle/rfidTag',
    method: 'post',
    data: data
  })
}
// RFID标签-列表
export function RFIDtagList(query) {
  return request({
    url: '/bottle/rfidTag/list',
    method: 'get',
    params: query
  })
}
// RFID标签-删除
export function RFIDtagDelete(data) {
  return request({
    url: '/bottle/rfidTag/'+data,
    method: 'delete',
  })
}

// 气瓶管理-列表
export function gasManageList(query) {
  return request({
    url: '/bottle/bottleStorage/list',
    method: 'get',
    params: query
  })
}
// 气瓶管理-新增
export function gasManageAdd(data) {
  return request({
    url: '/bottle/bottleStorage',
    method: 'post',
    data: data
  })
}
// 气瓶管理-详情
export function gasManageInfo(data) {
  return request({
    url: '/bottle/bottleStorage/'+data,
    method: 'get',
  })
}
// 气瓶管理-出库
export function gasManageOut(data) {
  return request({
    url: '/bottle/bottleStorageOut',
    method: 'post',
    data: data
  })
}
// 气瓶管理-新增-获取气瓶名称列表
export function gasManageAirName(data) {
  return request({
    url: '/system/dict/data/listNotPower?dictType=bottle_type',
    method: 'get',
  })
}
// 气瓶管理-新增-获取气瓶规格列表
export function gasManageConfigName(data) {
  return request({
    url: '/system/dict/data/listNotPower?dictType=bottle_specs_type',
    method: 'get',
  })
}
// 气瓶管理-新增-查询所有实验室
export function subjectListAdmin(data) {
  return request({
    url: '/laboratory/subject/list/listAdmin',
    method: 'get',
  })
}
export function getLoginUser(query) {
  return request({
    url: '/bottle/usegasApply/getLoginUser',
    method: 'get',
    params: query
  })
}
// 新增用气申请
export function useAgsApplyAdd(data) {
  return request({
    url: '/bottle/usegasApply/addByUser',
    method: 'post',
    data: data
  })
}
// 新增资格申请-重新提交
export function useAgsApplyAnew(data) {
  return request({
    url: '/bottle/usegasApply/updateByUser',
    method: 'post',
    data: data
  })
}
// 获取资格申请详情
export function useAgsApplyDetail(data) {
  return request({
    url: '/bottle/usegasApply/detail',
    method: 'post',
    data: data
  })
}
// 获取用气申请列表
export function useAgsApplyList(data) {
  return request({
    url: '/bottle/usegasApply/listByUser',
    method: 'post',
    data: data
  })
}
