import { baseServer, baseApp, dict } from '@/api'
import request from '@/utils/require'

// 详情
export function detailsFn(data) {
  return request({
    url: `${baseApp}/getWarehouseDetail`,
    method: 'post',
    data
  })
}

// 删除
export function deleteFn(cfbh) {
  return request({
    url: `${baseServer}/warehouse/${cfbh}`,
    method: 'delete',
  })
}

// 获取分页列表
export function getPageList(pageData, params) {
  return request({
    url: `${baseServer}/warehousePage/${pageData.page}/${pageData.size}`,
    method: 'post',
    data: params
  })
}
// export function getPageList(pageData, params) {
//   return request({
//     url: `${baseServer}/warehousePageNew/${pageData.page}/${pageData.size}`,
//     method: 'post',
//     data: params
//   })
// }
//导出
// 获取分页列表
export function warehouseListExport(pageData, params) {
  return request({
    url: `${baseApp}/notice/warehouseListExport/${pageData.page}/${pageData.size}`,
    method: 'post',
    responseType: "blob",
    data: params
  })
}

// 新增
export function addFn(params) {
  return request({
    url: `${baseServer}/warehouse`,
    method: 'post',
    data: params
  })
}

// 编辑
export function editFn(params) {
  return request({
    url: `${baseServer}/warehouse`,
    method: 'put',
    data: params
  })
}

//批量审核
export function warehouseBatch(params) {
  return request({
    url: `${baseServer}/warehouseBatch`,
    method: 'put',
    data: params
  })
}

//仓房字典
export function dataDictionary(groupId) {
  return request({
    url: `${dict}/dataDictionary/getDataGroup?groupId=${groupId}`,
    method: 'get'
  })
}


// 获取分页列表
export function page_update_log(data) {
  return request({
    url: `${baseServer}/warehouse/page_update_log/${data.pageNum}/${data.pageSize}`,
    method: 'post',
    data: data
  })
}
// export function warehouseLog(data) {
//   return request({
//     url: `${baseServer}/warehouse/page_update_log/${data.pageNum}/${data.pageSize}`,
//     method: 'post',
//     data
//   })   
// }


