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

//  批量删除
export const deleteBatch = (params) => {
  return axios({
    url: '/dispatch/detail/deleteBatch',
    data: params,
    method: 'post',
    headers: {
      'module': encodeURIComponent(params.dispatchBillDetailList.length == 1 ? '删除' : '批量删除')
    }
  })
}

// 下推
export const pushDown = (params) => {
  return axios({
    url: `/dispatch/pushDown`,
    data: params,
    method: 'post',
    headers: {
      'module': encodeURIComponent('下推')
    }
  })
}

// 统计查询
export const queryCount = (params) => {
  return axios({
    url: `/dispatch/queryCount`,
    data: params,
    method: 'post'
  })
}
// 销售单  下推  带下推产品列表 合计
export const dispatchDetail = (params) => {
  return axios({
    url: `/dispatch/findBySn/${params.dispatchBillSn}`,
    method: 'get'
  })
}

// 列表  不分页
export const waitDispatchDetailAllList = (params) => {
  const url = `/dispatch/detail/queryPushing`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post',
    headers: {
      'module': encodeURIComponent('明细列表查询')
    }
  })
}

//  数量修改
export const updateQty = (params) => {
  return axios({
    url: '/dispatch/detail/updateQty',
    data: params,
    method: 'post',
    headers: {
      'module': encodeURIComponent('修改本次下推数量')
    }
  })
}
