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

// 查询盘点批次信息列表
export function listTaksStockLot(query) {
  return request({
    url: baseUrl + '/business/taksStockLot/list',
    method: 'get',
    params: query
  })
}

// 查询盘点批次信息详细
export function getTaksStockLot(id) {
  return request({
    url: baseUrl + '/business/taksStockLot/' + id,
    method: 'get'
  })
}
export function updateNoStartLot(data) {
  return request({
    url: baseUrl + '/business/taksStockLot/updateNoStartLot',
    method: 'post',
    data: data
  })
}
export function getProductionPlanDetail(data) {
  return request({
    url: baseUrl + '/business/taksStockLot/getProductionPlanDetail',
    method: 'post',
    data: data
  })
}
export function getNotTaksLot(data) {
  return request({
    url: baseUrl + '/business/taksStockLot/getNotTaksLot',
    method: 'post',
    data: data
  })
}
export function getLotNumber(data) {
  return request({
    url: baseUrl + '/business/taksStockLot/getLotNumber',
    method: 'post',
    data: data
  })
}
// 新增盘点批次信息
export function addTaksStockLot(data) {
  return request({
    url: baseUrl + '/business/taksStockLot',
    method: 'post',
    data: data
  })
}

// 修改盘点批次信息
export function updateTaksStockLot(data) {
  return request({
    url: baseUrl + '/business/taksStockLot',
    method: 'put',
    data: data
  })
}
export function multiplyInventoryCheck(data) {
  return request({
    url: baseUrl + '/business/taksStockLot/multiplyInventoryCheck',
    method: 'put',
    data: data
  })
}
export function singleInventoryCheck(data) {
  return request({
    url: baseUrl + '/business/taksStockLot/singleInventoryCheck',
    method: 'put',
    data: data
  })
}


// 删除盘点批次信息
export function delTaksStockLot(id) {
  return request({
    url: baseUrl + '/business/taksStockLot/' + id,
    method: 'delete'
  })
}

// 导出
export function exportNoStartLot(data) {
  download(
    baseUrl + "/business/taksStockLot/export",
    {
      ...data,
    },
    `未盘点批次_${new Date().getTime()}.xlsx`
  )
}

export function getLotsByOutsourceFormNo(data) {
  return request({
    url: baseUrl + "/business/taksStockLot/getLotsByOutsourceFormNo",
    method: "post",
    data: data,
  });
}

export function batchTaksStockLot(data) {
  return request({
    url: baseUrl + "/business/taksStockLot/batchTaksStockLot",
    method: "post",
    data: data,
  })
}
