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

//  连锁调拨调入 列表  分页
export const allocLinkagePutList = (params) => {
  const url = `/allocLinkagePut/queryPage/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}
//  连锁调拨调入  审核
export const allocLinkagePutAudit = (params) => {
  return axios({
    url: `/allocLinkagePut/audit/${params.sn}`,
    method: 'get'
  })
}
//  连锁调拨调入  入库
export const allocLinkagePutSubmit = (params) => {
  return axios({
    url: `/allocLinkagePut/submit/${params.sn}`,
    method: 'get'
  })
}
//  连锁调拨调入 详情 合计
export const allocLinkagePutDetailCount = (params) => {
  return axios({
    url: '/allocLinkagePut/detail/queryCount',
    data: params,
    method: 'post'
  })
}
//  连锁调拨调出 详情  根据sn查
export const allocLinkagePutDetailSn = (params) => {
  return axios({
    url: `/allocLinkagePut/findBySn/${params.sn}`,
    method: 'get'
  })
}
//  连锁调拨调入 详情 列表  分页
export const allocLinkagePutDetailList = (params) => {
  const url = `/allocLinkagePut/detail/queryPage/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}
//  连锁调拨调入 详情 编辑
export const allocLinkagePutDetailUpdate = (params) => {
  const url = `/allocLinkagePut/detail/update/${params.id}`
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}
// 连锁调拨调入 详情  打印
export const allocLinkagePutDetailPrint = params => {
  const data = {
    url: `allocLinkagePut/print/${params.sn}/${params.type}`,
    method: 'get'
  }
  // 喷墨打印
  if (params.type == 'INK') {
    data.responseType = 'blob'
  }
  return axios.request(data)
}
