import request from '@/utils/request'

// 查询药品库存列表
export function listInventory(query) {
  return request({
    url: '/inventory/inventory/list',
    method: 'get',
    params: query
  })
}

// 详情
export function selectInventorDrugsList(query) {
  return request({
    // url: '/inventory/inventory/' + id + '/' + validState,
    url: '/inventory/inventory/selectInventorDrugsList',
    method: 'get',
    params: query
  })
}

// 查询药品库存详细
export function getInventory(query) {
  return request({
    url: '/inventory/inventory/getInfo',
    method: 'get',
    params: query
  })
}

// 详情
export function getInventoryDetail(id, validState) {
  return request({
    url: '/inventory/inventory/' + id + '/' + validState,
    method: 'get',
    params: {}
  })
}

// 新增药品库存
export function addInventory(data) {
  return request({
    url: '/inventory/inventory',
    method: 'post',
    data: data
  })
}

// 修改药品库存
export function updateInventory(data) {
  return request({
    url: '/inventory/inventory',
    method: 'put',
    data: data
  })
}

// 删除药品库存
export function delInventory(id) {
  return request({
    url: '/inventory/inventory/' + id,
    method: 'delete'
  })
}

// 导出药品库存
export function exportInventory(query) {
  return request({
    url: '/inventory/inventory/export',
    method: 'get',
    params: query
  })
}

//查看库存数量
export function oneList(query) {
  return request({
    // url: '/inventory/inventory/getOne',
    url: '/inventory/inventory/getDrugs',
    method: "get",
    params: query
  })
}

//库存数量
export function getSumStock(query) {
  return request({
    url: '/inventory/inventory/getSumStock',
    method: "get",
    params: query
  })
}

//获取药品名称
export function getOneGroup(query) {
  return request({
    url: '/inventory/inventory/getOneGroup',
    method: "get",
    params: query
  })
}
//获取药品名称
// drugsName药品名称 pharmacyId药房id
export function getDrugs(query) {
  return request({
    url: '/inventory/inventory/getDrugs',
    method: "get",
    params: query
  })
}
// 出入库汇总
export function getWarehousingAndWarehouse(query) {
  return request({
    url: '/inventory/inventory/getWarehousingAndWarehouse',
    method: "get",
    params: query
  })
}
// 出入库汇总导出
export function getWarehousingAndWarehouseExport(query) {
  return request({
    url: '/inventory/inventory/getWarehousingAndWarehouseExport',
    method: "get",
    params: query
  })
}
// 药品账簿汇总
export function getAccountBook(query) {
  return request({
    url: '/inventory/inventory/getAccountBook',
    method: "get",
    params: query
  })
}
// 发药汇总
export function fySummary(query) {
  return request({
    url: '/prescription/prescriptionCore/fySummary',
    method: "get",
    params: query
  })
}
// 收支月报
export function getReport(query) {
  return request({
    url: '/inventory/inventory/getReport',
    method: "get",
    params: query
  })
}
// 收支月报导出
export function reportExport(query) {
  return request({
    url: '/inventory/inventory/reportExport',
    method: "get",
    params: query
  })
}
// 收支月报导出
export function detailList(query) {
  return request({
    url: '/inventory/inventory/detailList',
    method: "get",
    params: query
  })
}
// 收支月报导出
export function detailGroupList(query) {
  return request({
    url: '/inventory/inventory/detailGroupList',
    method: "get",
    params: query
  })
}
// 发药汇总导出
export function fySummaryExport(query) {
  return request({
    url: '/prescription/prescriptionCore/fySummaryExport',
    method: "get",
    params: query
  })
}