import request from '@/utils/request'

export function postDrugWarehouse(params, warehousing_time, manufacturer_id, dealer_id, type) {
  return request({
    url: '/api/drugwarehouse/create?warehousing_time=' + warehousing_time + '&manufacturer_id=' + manufacturer_id + '&dealer_id=' + dealer_id + '&type=' + type,
    method: 'post',
    data: params
  })
}

export function getDrugWarehouseList(params) {
  return request({
    url: '/api/drugwarehouse/list',
    method: 'get',
    params: params
  })
}

export function getDrugWarehouseInfoList(params) {
  return request({
    url: '/api/drugwarehouseinfo/list',
    method: 'get',
    params: params
  })
}

export function postDrugSalesReturn(params, salesReturnTime, salesReturnTotal, dealer_id, manufacturer_id, type) {
  return request({
    url: '/api/drugsalesreturn/create?time=' + salesReturnTime + '&total=' + salesReturnTotal + '&dealer_id=' + dealer_id + '&manufacturer_id=' + manufacturer_id + '&type=' + type,
    method: 'post',
    data: params
  })
}

export function getDrugWarehouseInfo(params) {
  return request({
    url: '/api/info/get',
    method: 'get',
    params: params
  })
}

export function getDrugSalesReturnList(params) {
  return request({
    url: '/api/drugsalesreturn/list',
    method: 'get',
    params: params
  })
}

export function getDrugSalesReturnInfoList(params) {
  return request({
    url: '/api/return/info',
    method: 'get',
    params: params
  })
}

export function getAllDrugWarehouseInfo(params) {
  return request({
    url: '/api/warehouseinfo',
    method: 'get',
    params: params
  })
}

export function getDrugWarehouseOutInfoList(params) {
  return request({
    url: '/api/stock/out/info',
    method: 'get',
    params: params
  })
}

export function postDrugWarehouseOut(params, warehousing_time, dealer_id, manufacturer_id, type) {
  return request({
    url: '/api/drugwarehouseout/create?warehousing_out_time=' + warehousing_time + '&dealer_id=' + dealer_id + '&manufacturer_id=' + manufacturer_id + '&type=' + type,
    method: 'post',
    data: params
  })
}

export function getDrugWarehouseInfoCountByGoodId(params) {
  return request({
    url: '/api/info/count',
    method: 'get',
    params: params
  })
}

export function getDrugWarehouseInfoByGoodTypeId(params) {
  return request({
    url: '/api/warehouse/type',
    method: 'get',
    params: params
  })
}

export function getDrugCancelStockInfoList(params) {
  return request({
    url: '/api/cancel/info',
    method: 'get',
    params: params
  })
}

export function getAllDrugStockOutList(params) {
  return request({
    url: '/api/out/list',
    method: 'get',
    params: params
  })
}

export function getAllDrugStockQueryList(params) {
  return request({
    url: '/api/drugstock/query',
    method: 'get',
    params: params
  })
}

export function getDrugWarehouseInfoByOrdeNumber(params) {
  return request({
    url: '/api/stock/warehouse/get',
    method: 'get',
    params: params
  })
}

export function modifyDrugWarehouseInfo(params) {
  return request({
    url: '/api/drugwarehouse/edit',
    method: 'post',
    params: params
  })
}

export function deleteDrugWarehouseInfo(params) {
  return request({
    url: '/api/drugwarehouse/delete',
    method: 'post',
    params: params
  })
}

export function getDrugWarehouseOutInfoByOrdeNumber(params) {
  return request({
    url: '/api/stock/out/get',
    method: 'get',
    params: params
  })
}

export function modifyDrugWarehouseOutInfo(params) {
  return request({
    url: '/api/stock/out/edit',
    method: 'post',
    params: params
  })
}

export function GetAllConfig() {
  return request({
    url: '/api/drugstock/config',
    method: 'get'
  })
}

export function GetAllDrugInfoByID(params) {
  return request({
    url: '/api/drugstock/get',
    method: 'get',
    params: params

  })
}

export function DeleteDrugWarehouseInfoItem(params) {
  return request({
    url: '/api/drugwarehouseinfo/delete',
    method: 'post',
    params: params

  })
}

export function EditDrugWarehouse(params, warehousing_time, id,type,manufacturer_id,dealer_id) {
  return request({
    url: '/api/drugwarehouse/edit?warehousing_time=' + warehousing_time + '&id=' + id+"&type="+type+"&manufacturer_id="+manufacturer_id+"&dealer_id="+dealer_id,
    method: 'post',
    data: params
  })
}

export function getDrugSalesReturnConfig(params) {
  return request({
    url: '/api/return/config',
    method: 'get',
    params: params

  })
}

export function deleteDrugSalesReturn(params) {
  return request({
    url: '/api/drugsalesreturn/delete',
    method: 'post',
    params: params
  })
}

export function getDrugSaleReturnInfoList(params) {
  return request({
    url: '/api/stock/drugsalesReturn/list',
    method: 'get',
    params: params
  })
}

export function getDrugReturnList(params) {
  return request({
    url: '/api/drugsalesreturninfo/list',
    method: 'get',
    params: params
  })
}
export function deleteDrugSalesReturnInfo(params) {
  return request({
    url: '/api/drugsalesreturninfo/delete',
    method: 'post',
    params: params
  })
}

export function editDrugSalesReturnInfo(params, return_time, id,type,manufacturer_id,dealer_id) {
  return request({
    url: '/api/drugsalesreturn/edit?return_time=' + return_time + '&id=' + id+"&type="+type+"&manufacturer_id="+manufacturer_id+"&dealer_id="+dealer_id,
    method: 'post',
    data: params
  })
}

export function deleteDrugWarehouseOut(params) {
  return request({
    url: '/api/drugwarehouseout/delete',
    method: 'post',
    params: params
  })
}

export function deleteDrugWarehouseOutInfo(params) {
  return request({
    url: '/api/drugwarehouseoutinfo/delete',
    method: 'post',
    params: params
  })
}

export function getDrugWarehouseOutList(params) {
  return request({
    url: '/api/drugwarehouseout/list',
    method: 'get',
    params: params
  })
}

export function getDrugWarehouseOutInfo(params) {
  return request({
    url: '/api/drugwarehouseout/info',
    method: 'get',
    params: params
  })
}

export function editDrugWarehouseoutInfo(params, warehouse_out_time, id,type,manufacturer_id,dealer_id) {
  return request({
    url: '/api/drugwarehouseout/edit?warehouse_out_time=' + warehouse_out_time + '&id=' + id+"&type="+type+"&manufacturer_id="+manufacturer_id+"&dealer_id="+dealer_id,
    method: 'post',
    data: params
  })
}

export function getDrugCancelStockList(params) {
  return request({
    url: '/api/drugcancelstock/list',
    method: 'get',
    params: params
  })
}

export function editDrugCancelStockInfo(params, cancel_stock_time, id,type,manufacturer_id,dealer_id) {
  return request({
    url: '/api/drugcancelstockinfo/edit?cancel_time=' + cancel_stock_time + '&id=' + id+"&type="+type+"&manufacturer_id="+manufacturer_id+"&dealer_id=" + dealer_id,
    method: 'post',
    data: params
  })
}

export function getDrugCancelStockInfo(params) {
  return request({
    url: '/api/drugcancelstock/info',
    method: 'get',
    params: params
  })
}

export function deleteDrugCancelStock(params) {
  return request({
    url: '/api/drugcancelstock/delete',
    method: 'post',
    params: params
  })
}

export function deleteDrugCancelStockInfo(params) {
  return request({
    url: '/api/drugcancelstockinfo/delete',
    method: 'post',
    params: params
  })
}

export function postDrugCancelStock(params, cancelStockTime, manufacturer_id, dealer_id, type) {
  return request({
    url: '/api/drugcancelstock/create?time=' + cancelStockTime + '&manufacturer_id=' + manufacturer_id + '&dealer_id=' + dealer_id + '&type=' + type,
    method: 'post',
    data: params
  })
}
export function getDrugCancelStockConfig(params) {
  return request({
    url: '/api/drugcancelstockinfo/config',
    method: 'get',
    params: params
  })
}

export function getStockDetail(params) {
  return request({
    url: '/api/drugstock/detail',
    method: 'get',
    params: params
  })
}



export function getPrintStockGood(params) {
  return request({
    url: '/api/print/stock',
    method: 'get',
    params: params
  })
}



export function getDrugWarehouseOutUser(params) {
  return request({
    url: '/api/drugwarehouseout/user',
    method: 'get',
    params: params
  })
}


export function createDrugStockAutomaticReduceConfig(is_open) {
  return request({
    url: '/api/drugstock/automaticreduce/isopen?is_open='+is_open,
    method: 'post',
  })
}

export function getDrugStockAutomaticReduceConfig() {
  return request({
    url: '/api/drugstockautomaticreduce/get',
    method: 'get',
  })
}












