import request from '@/utils/request'

// 查询仓库主(出入库)列表
export function listStorageFeeCalculation(query) {
  return request({
    url: '/warehouseBusiness/storageFeeCalculation/list',
    method: 'get',
    params: query
  })
}

// 计算仓储费
export function calculateStorageFees(data) {
  return request({
    url: '/warehouseBusiness/storageFeeCalculation/calculateFees',
    method: 'post',
    data: data
  })
}

// 查询仓库主(出入库)详细
export function getStorageFeeCalculation(fId) {
  return request({
    url: '/warehouseBusiness/storageFeeCalculation/' + fId,
    method: 'get'
  })
}

// 新增仓库主(出入库)
export function addStorageFeeCalculation(data) {
  return request({
    url: '/warehouseBusiness/storageFeeCalculation/add',
    method: 'post',
    data: data
  })
}

// 撤销入库
export function updateCredit(data) {
  return request({
    url: '/warehouseBusiness/storageFeeCalculation/updateCredit',
    method: 'post',
    data: data
  })
}

// 入库确认
export function addWhgenleg(data) {
  return request({
    url: '/warehouseBusiness/storageFeeCalculation/addCredit',
    method: 'post',
    data: data
  })
}

// 修改仓库主(出入库)
export function updateStorageFeeCalculation(data) {
  return request({
    url: '/warehouseBusiness/storageFeeCalculation',
    method: 'put',
    data: data
  })
}

// 删除仓库主(出入库)
export function delStorageFeeCalculation(fId) {
  return request({
    url: '/warehouseBusiness/storageFeeCalculation/' + fId,
    method: 'delete'
  })
}

// 导出仓库主(出入库)
export function exportStorageFeeCalculation(query) {
  return request({
    url: '/warehouseBusiness/storageFeeCalculation/export',
    method: 'get',
    params: query
  })
}

// 导出计算明细从表
export function exportWarehousebillsitems(fId) {
  return request({
    url: '/warehouseBusiness/storageFeeCalculation/exportItems/'+fId,
    method: 'get'
  })
}
 // 撤销请核
export function backFee(fId) {
  return request({
    url: '/warehouseBusiness/storageFeeCalculation/withdrawById/' + fId,
    method: 'get',
  })
}
