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',
    headers:{
      'module': encodeURIComponent('列表查询')
    }
  })
}
//  盘点确认  列表  分页
export const verifyQueryPage = (params) => {
  const url = `/checkWarehouse/verifyQueryPage/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post',
    headers:{
      'module': encodeURIComponent('列表查询')
    }
  })
}
//  库存盘点  保存
export const checkWarehouseSave = (params) => {
  return axios({
    url: '/checkWarehouse/save',
    data: params,
    method: 'post',
    headers:{
      'module': encodeURIComponent('新增盘点')
    }
  })
}
//  库存盘点  详情
export const checkWarehouseDetail = (params) => {
  return axios({
    url: `/checkWarehouse/queryBySn/${params.sn}`,
    method: 'get'
  })
}
//  库存盘点  详情  分页
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',
    headers:{
      'module': encodeURIComponent('明细列表查询')
    }
  })
}
//  库存盘点  详情  合计
export const checkWarehouseDetailCount = (params) => {
  return axios({
    url: '/checkWarehouse/detail/queryCount',
    data: params,
    method: 'post'
  })
}
// 盘点人盘点/监盘人监盘 盘点  打印
export const checkWarehouseDetailPrint = params => {
  const url = `/checkWarehouse/detail/print/${params.printType}`
  return axios.request({
    url: url,
    data: params,
    method: 'post',
    responseType: 'blob',
    headers:{
      'module': encodeURIComponent('打印')
    }
  })
}
//  库存盘点  新增盘点  检查是否有未完结
export const checkWarehouseStartCheck = (params) => {
  return axios({
    url: '/checkWarehouse/startCheck',
    method: 'get'
  })
}
//  盘点人盘点/监盘人监盘  盘点  打印检查产品
export const checkWarehousePrintCheck = (params) => {
  const url = `/checkWarehouse/detail/printCheck/${params.checkWarehouseSn}/${params.type}`
  delete params.checkWarehouseSn
  delete params.type
  return axios({
    url: url,
    data: {},
    method: 'get',
    headers:{
      'module': encodeURIComponent('盘点打印')
    }
  })
}
//  盘点人盘点/监盘人监盘  详情  保存
export const checkWarehouseDetailSave = (params) => {
  return axios({
    url: '/checkWarehouse/detail/save',
    data: params,
    method: 'post',
    headers:{
      'module': encodeURIComponent('修改盘点数量')
    }
  })
}
//  盘点人盘点  盘点
export const checkWarehouseCheck = (params) => {
  return axios({
    url: '/checkWarehouse/checkWarehouse',
    data: params,
    method: 'post',
    headers:{
      'module': encodeURIComponent('提交盘点')
    }
  })
}
//  库存盘点  作废
export const checkWarehouseDelete = (params) => {
  return axios({
    url: '/checkWarehouse/delete',
    data: params,
    method: 'post',
    headers:{
      'module': encodeURIComponent('作废盘点单')
    }
  })
}
//  盘点人盘点  提交监盘
export const checkWarehouseSupervise = (params) => {
  return axios({
    url: '/checkWarehouse/checkSupervise',
    data: params,
    method: 'post',
    headers:{
      'module': encodeURIComponent('提交监盘')
    }
  })
}
//  盘点人盘点  重盘
export const checkWarehouseReCheck = (params) => {
  return axios({
    url: '/checkWarehouse/reCheckWarehouse',
    data: params,
    method: 'post',
    headers:{
      'module': encodeURIComponent('重盘')
    }
  })
}
//  盘点人盘点  财务确认
export const checkWarehouseFinanceAudit = (params) => {
  return axios({
    url: '/checkWarehouse/financeAudit',
    data: params,
    method: 'post',
    headers:{
      'module': encodeURIComponent('盘点确认')
    }
  })
}
//  财务盘点确认  详情  列表  分页
export const checkWarehouseDetailFinanceList = (params) => {
  const url = `/checkWarehouse/detail/queryFinanceAuditPage/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post',
    headers:{
      'module': encodeURIComponent('明细列表查询')
    }
  })
}
// 数据导出  导出盘点   盘点列表
export const checkWarehouseExcelList = (params) => {
  return axios({
    url: `/checkWarehouse/excelList`,
    data: params,
    method: 'post',
    headers:{
      'module': encodeURIComponent('导出')
    }
  })
}
// 数据导出  导出盘点   盘点列表  导出
export const checkWarehouseExport = params => {
  const url = `/checkWarehouse/excel`
  return axios.request({
    url: url,
    data: params,
    method: 'post',
    responseType: 'blob',
    headers:{
      'module': encodeURIComponent('导出')
    }
  })
}
