import { axios } from '@/utils/request'

//  库存盘点  列表  分页
export const checkWarehouseList = (params) => {
  const url = `/checkWarehouse/queryPage/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}
//  库存盘点  保存
export const checkWarehouseSave = (params) => {
  return axios({
    url: '/checkWarehouse/save',
    data: params,
    method: 'post'
  })
}
//  库存盘点  校验是否有未完结的盘点单
export const checkWarehouseValidate = (params) => {
  return axios({
    url: '/checkWarehouse/validate',
    data: params,
    method: 'post'
  })
}
//  库存盘点  详情  保存
export const checkWarehouseDetailSave = (params) => {
  return axios({
    url: '/checkWarehouse/detail/save',
    data: params,
    method: 'post'
  })
}
//  库存盘点  详情  批量保存
export const checkWarehouseDetailSaveBatch = (params) => {
  return axios({
    url: '/checkWarehouse/detail/saveBatch',
    data: params,
    method: 'post'
  })
}
//  库存盘点  提交
export const checkWarehouseSubmit = (params) => {
  return axios({
    url: '/checkWarehouse/submit',
    data: params,
    method: 'post'
  })
}
//  库存盘点  详情
export const checkWarehouseDetail = (params) => {
  return axios({
    url: `/checkWarehouse/queryBySn/${params.sn}`,
    method: 'get'
  })
}
//  库存盘点  删除
export const checkWarehouseDel = (params) => {
  return axios({
    url: '/checkWarehouse/delete',
    data: params,
    method: 'post'
  })
}
//  库存盘点  详情  删除
export const checkWarehouseDetailDel = (params) => {
  return axios({
    url: '/checkWarehouse/detail/delete',
    data: params,
    method: 'post'
  })
}
//  库存盘点  审核
export const checkWarehouseAudit = (params) => {
  return axios({
    url: '/checkWarehouse/audit',
    data: params,
    method: 'post'
  })
}
//  库存盘点  仓库列表
export const checkWarehouseWarehouse = (params) => {
  return axios({
    url: '/checkWarehouse/queryWarehouseList',
    data: params,
    method: 'post'
  })
}
//  库存盘点  详情  列表  分页
export const checkWarehouseDetailList = (params) => {
  const url = `/checkWarehouse/detail/queryPage/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}
//  库存盘点  详情  合计
export const checkWarehouseDetailCount = (params) => {
  return axios({
    url: '/checkWarehouse/detail/queryPageCount',
    data: params,
    method: 'post'
  })
}
//  库存盘点  自选盘点 选择产品  列表  分页
export const checkWarehouseDetailStockList = (params) => {
  const url = `/checkWarehouse/queryStockPage/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}
//  库存盘点  盘点  整单盘零
export const checkWarehouseCheckZero = (params) => {
  return axios({
    url: '/checkWarehouse/detail/checkZero',
    data: params,
    method: 'post'
  })
}
//  库存盘点  盘点  盘点完成
export const checkWarehouseInventory = (params) => {
  return axios({
    url: '/checkWarehouse/inventory',
    data: params,
    method: 'post'
  })
}
//  库存盘点  重盘
export const checkWarehouseReInventory = (params) => {
  return axios({
    url: '/checkWarehouse/reInventory',
    data: params,
    method: 'post'
  })
}
//  库存盘点  财务审核
export const checkWarehouseFinanceAudit = (params) => {
  return axios({
    url: '/checkWarehouse/financeAudit',
    data: params,
    method: 'post'
  })
}
//  库存盘点  盘点审核  列表  分页
export const checkWarehouseAuditList = (params) => {
  const url = `/checkWarehouse/queryAuditPage/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}
// 库存盘点 详情  导出
export const checkWarehouseDetailExport = params => {
  return axios.request({
    url: `checkWarehouse/detail/exportExcel`,
    method: 'post',
    data: params,
    responseType: 'blob'
  })
}
// 库存盘点 详情  打印
export const checkWarehouseDetailPrint = params => {
  return axios.request({
    url: `checkWarehouse/detail/print/${params.printType}`,
    method: 'post',
    data: params,
    responseType: 'blob'
  })
}
