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

//  入库 列表  有分页
export const receivingList = (params) => {
  const url = `/receiving/queryPage/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}
//  入库 列表  合计
export const receivingCount = (params) => {
  return axios({
    url: '/receiving/queryCount',
    data: params,
    method: 'post'
  })
}
//  入库 详情
export const receivingDetailSn = (params) => {
  return axios({
    url: `/receiving/findBySn/${params.sn}`,
    method: 'get'
  })
}
//  入库 入库
export const receivingStockIn = (params) => {
  return axios({
    url: '/receiving/stockIn',
    data: params,
    method: 'post'
  })
}
//  入库 入库审核
export const receivingStockInAudit = (params) => {
  return axios({
    url: '/receiving/stockInAudit',
    data: params,
    method: 'post'
  })
}
//  入库 详情  有分页
export const receivingDetailList = (params) => {
  const url = `/receivingDetail/queryPage/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}
// 入库审核 详情  打印
export const receivingDetailPrint = params => {
  const data = {
    url: `receiving/print/${params.sn}/${params.type}`,
    method: 'get'
  }
  // 喷墨打印
  if (params.type == 'INK') {
    data.responseType = 'blob'
  }
  return axios.request(data)
}
// 备货 详情  导出
export const receivingExport = params => {
  return axios.request({
    url: `/receiving/export`,
    data: params,
    method: 'post',
    responseType: 'blob'
  })
}
//  签收入库 列表  有分页
export const receivingStockList = (params) => {
  const url = `/receiving/queryStockInPage/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}
//  入库审核 列表  有分页
export const receivingAuditList = (params) => {
  const url = `/receiving/queryStockInAuditPage/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}
