import request from '@/utils/request'

// 调拨订单列表
export function getOrderList(data) {
  return request({
    url: `/pu/allot/list?pageSize=${data.pageSize}&pageNum=${data.pageNum}&isAsc=desc&orderByColumn=updateTime`,
    method: 'post',
    data: data
  })
}
// 调拨订单新增
export function addOrder(data) {
  return request({
    url: `/pu/allot/add`,
    method: 'post',
    data: data
  })
}
// 调拨订单编辑
export function editOrder(data) {
  return request({
    url: `/pu/allot/edit`,
    method: 'put',
    data: data
  })
}
// 调拨订单提交
export function submitOrder(data) {
  return request({
    url: `/pu/allot/submit`,
    method: 'post',
    data: data
  })
}
// 调拨订单详情
export function getOrderDetail(id) {
  return request({
    url: `/pu/allot/detail/${id}`,
    method: 'get',
  })
}
// 调拨订单删除
export function delOrder(ids) {
  return request({
    url: `/pu/allot/delete/${ids}`,
    method: 'delete',
  })
}
// 调拨订单重传NC
export function againToNC(data) {
  return request({
    url: `/pu/allot/toNC`,
    method: 'post',
    data: data
  })
}

// 查询调拨物料明细列表
export function listStAllotItem(pid) {
  return request({
    url: `/pu/allot/material/byPid/${pid}`,
    method: 'get',
  })
}

//导入
export function importData(data) {
  return request({
    url: `/pu/allot/importData`,
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}

//收回
export function oaBack(data) {
  return request({
    url: `/oaflow/rollback`,
    method: "POST",
    data: data,
  });
}

//拉单确认
export function bipPullVerify(data) {
  return request({
    url: `/pu/allot/bipPull`,
    method: "POST",
    data: data,
  });
}