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

//  店内调出 列表  分页
export const storeCallOutList = (params) => {
  const url = `/storeCallOut/queryPage/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}
//  店内调出 新增
export const storeCallOutSave = (params) => {
  return axios({
    url: '/storeCallOut/save',
    data: params,
    method: 'post'
  })
}
//  店内调出 审核
export const storeCallOutAudit = (params) => {
  return axios({
    url: '/storeCallOut/audit',
    data: params,
    method: 'post'
  })
}
//  店内调出 出库
export const storeCallOutOut = (params) => {
  return axios({
    url: '/storeCallOut/out',
    data: params,
    method: 'post'
  })
}
//  店内调出 删除
export const storeCallOutDel = (params) => {
  return axios({
    url: `/storeCallOut/delete/${params.id}`,
    method: 'get'
  })
}
//  店内调出 详情
export const storeCallOutDetail = (params) => {
  return axios({
    url: `/storeCallOut/findById/${params.id}`,
    method: 'get'
  })
}
//  店内调出 详情  根据sn查
export const storeCallOutDetailSn = (params) => {
  return axios({
    url: `/storeCallOut/findBySn/${params.sn}`,
    method: 'get'
  })
}
//  店内调出  提交
export const storeCallOutSubmit = (params) => {
  return axios({
    url: '/storeCallOut/submit',
    data: params,
    method: 'post'
  })
}
//  店内调出详情 列表  分页
export const storeCallOutDetailList = (params) => {
  const url = `/storeCallOut/detail/queryPage/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}
//  店内调出详情 合计
export const storeCallOutDetailCount = (params) => {
  return axios({
    url: '/storeCallOut/detail/queryCount',
    data: params,
    method: 'post'
  })
}
//  店内调出详情 保存
export const storeCallOutDetailSave = (params) => {
  return axios({
    url: '/storeCallOut/detail/save',
    data: params,
    method: 'post'
  })
}
//  店内调出详情 删除
export const storeCallOutDetailDel = (params) => {
  return axios({
    url: '/storeCallOut/detail/delete',
    data: params,
    method: 'post'
  })
}
// 店内调出 详情  打印
export const storeCallOutDetailPrint = params => {
  const data = {
    url: `storeCallOut/print/${params.sn}/${params.type}/${params.costFlag}`,
    method: 'get'
  }
  // 喷墨打印
  if (params.type == 'INK') {
    data.responseType = 'blob'
  }
  return axios.request(data)
}
