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

//  连锁调拨调出 列表  分页
export const allocLinkageOutList = (params) => {
  const url = `/allocLinkageOut/queryPage/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}
//  连锁调拨调出   保存
export const allocLinkageOutSave = (params) => {
  return axios({
    url: '/allocLinkageOut/save',
    data: params,
    method: 'post'
  })
}
//  连锁调拨调出   提交
export const allocLinkageOutSubmit = (params) => {
  return axios({
    url: `/allocLinkageOut/submit/${params.sn}`,
    method: 'get'
  })
}
//  连锁调拨调出 详情 列表  分页
export const allocLinkageOutDetailList = (params) => {
  const url = `/allocLinkageOut/detail/queryPage/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}
//  连锁调拨调出 详情  根据sn查
export const allocLinkageOutDetailSn = (params) => {
  return axios({
    url: `/allocLinkageOut/findBySn/${params.sn}`,
    method: 'get'
  })
}
//  连锁调拨调出  审核
export const allocLinkageAudit = (params) => {
  return axios({
    url: `/allocLinkageOut/audit/${params.sn}`,
    method: 'get'
  })
}
//  连锁调拨调出  出库
export const allocLinkageOutStock = (params) => {
  return axios({
    url: `/allocLinkageOut/outStock/${params.sn}`,
    method: 'get'
  })
}
//  连锁调拨调出  删除
export const allocLinkageOutDel = (params) => {
  return axios({
    url: `/allocLinkageOut/delete/${params.sn}`,
    method: 'get'
  })
}
//  连锁调拨调出  详情  添加
export const allocLinkageOutDetailSave = (params) => {
  return axios({
    url: '/allocLinkageOut/detail/save',
    data: params,
    method: 'post'
  })
}
//  连锁调拨调出  详情  删除
export const allocLinkageOutDetailDel = (params) => {
  return axios({
    url: `/allocLinkageOut/detail/delete/${params.id}`,
    method: 'get'
  })
}
//  连锁调拨调出  详情  整单删除
export const allocLinkageOutDetailDelAll = (params) => {
  return axios({
    url: `/allocLinkageOut/detail/deleteAll/${params.sn}`,
    method: 'get'
  })
}
//  连锁调拨调出  详情  合计
export const allocLinkageOutDetailCount = (params) => {
  return axios({
    url: '/allocLinkageOut/detail/queryCount',
    data: params,
    method: 'post'
  })
}
//  连锁调拨调出   调往对象
export const getTenantList = (params) => {
  return axios({
    url: '/allocLinkageOut/getTenantList',
    method: 'get'
  })
}
// 连锁调拨调出 详情  打印
export const allocLinkageOutDetailPrint = params => {
  const data = {
    url: `allocLinkageOut/print/${params.sn}/${params.type}`,
    method: 'get'
  }
  // 喷墨打印
  if (params.type == 'INK') {
    data.responseType = 'blob'
  }
  return axios.request(data)
}
