import request from '@/utils/request'
const baseUrl = import.meta.env.VITE_APP_PRODUCTION_API
import { download, downloadPdf } from '@/utils/request'

// 查询零存库
export function listStorageRetrieval(query) {
  return request({
    url:  baseUrl +'/business/storageRetrieval/list',
    method: 'get',
    params: query
  })
}


// 修改零存库
export function updateStorageRetrieval(data) {
  return request({
    url:  baseUrl +'/business/storageRetrieval',
    method: 'put',
    data: data
  })
}

// 查询工段人员
export function getDeptUserList(data) {
  return request({
    url:  baseUrl +'/business/storageRetrieval/getDeptUserList',
    method: 'post',
    data: data
  })
}

//零存库新增
export function addSave(data) {
  return request({
    url:  baseUrl +'/business/storageRetrieval/add',
    method: 'post',
    data: data
  })
}


// 零存库领取
export function updateFetch(data) {
  return request({
    url:  baseUrl +'/business/storageRetrieval/updateFetch',
    method: 'post',
    data: data
  })
}

// 零存库领取
export function getLotList(query) {
  return request({
    url:  baseUrl +'/business/storageRetrieval',
    method: 'get',
    params: query
  })
}



// 导出
export function exportStorageLot(data) {
  download(
    baseUrl + "/business/taksStockStorageRetrieval/export",
    {
      ...data,
    },
    `未领取批次_${new Date().getTime()}.xlsx`
  )
}

