import request from '@/utils/request'

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

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

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

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

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

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

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

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

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

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

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