import request from '@/utils/request'

//获取入库列表接口
export function getListJoin(query) {
  return request({
    url: '/chemical/hxpStock/listJoinByUser',
    method: 'get',
    params: query
  })
}

//获取出库列表接口
export function getListOut(query) {
  return request({
    url: '/chemical/hxpStock/listOutByUser',
    method: 'get',
    params: query
  })
}

//获取使用记录列表接口
export function getHxpUserecordList(query) {
  return request({
    url: '/chemical/hxpUserecord/getHxpUserecordListByUser',
    method: 'get',
    params: query
  })
}

//获取使用记录详情接口
export function getQueryDetail(id) {
  return request({
    url: '/chemical/hxpUserecord/queryDetail/'+id,
    method: 'get',
  })
}

//学生端查询自己存放的数据接口
export function getQueryByUser(query) {
  return request({
    url: '/chemical/hxpChemicalJoinCabinet/queryByUser',
    method: 'get',
    params: query
  })
}

//学生端查询化学品列表
export function getHxpQueryByUser(query) {
  return request({
    url: '/chemical/hxpChemical/queryByUser',
    method: 'get',
    params: query
  })
}

//学生端申购列表接口
export function getHxpapplyMyList(query) {
  return request({
    url: '/chemical/hxpapply/myList',
    method: 'get',
    params: query
  })
}

//采购申请草稿列表
export function getHxpapplyDraftsList(query) {
  return request({
    url: '/chemical/hxpapply/myDraftsList',
    method: 'get',
    params: query
  })
}

//学生端申购草稿箱列表接口
export function getHxpapplyMyDraftsList(query) {
  return request({
    url: '/chemical/hxpapply/myDraftsList',
    method: 'get',
    params: query
  })
}


//查询编辑详情
export function getHxpapply(id) {
  return request({
    url: '/chemical/hxpapply/myInfo/'+id,
    method: 'get',
  })
}

// 新增申购
export function addHxpapply(data) {
  return request({
    url: '/chemical/hxpapply/myadd',
    method: 'post',
    data: data
  })
}

//删除申购/草稿
export function delHxpapply(id) {
  return request({
    url: '/chemical/hxpapply/myDel/'+id,
    method: 'delete',
  })
}

//申购撤销接口
export function approvalRevoke(data) {
  return request({
    url: '/chemical/applytask/myApprovalRevoke',
    method: 'put',
    data: data
  })
}

//获取化学品信息列表
export function hxpChemicalList(query) {
  return request({
    url: '/chemical/hxpChemical/noAuthlist',
    method: 'get',
    params: query
  })
}

//获取化学品信息详情接口
export function getHxpChemicalInfo(id) {
  return request({
    url: '/chemical/hxpChemical/myInfo/'+id,
    method: 'get',
  })
}
