import request from '@/utils/request'
export function getTaskInfo(id) {
  return request({
    url: 'api/task/queryAsnTask?asnDetailId=' + id,
    method: 'get'
  })
}
export function add(data) {
  return request({
    url: 'api/task',
    method: 'post',
    data
  })
}

export function del(ids) {
  return request({
    url: 'api/task/',
    method: 'delete',
    data: ids
  })
}

export function edit(data) {
  return request({
    url: 'api/task',
    method: 'put',
    data
  })
}
export function devanRfid(rfid, type) {
  return request({
    url: 'api/task/devanRfid',
    method: 'post',
    data: {
      'rfid': rfid,
      'type': type
    }
  })
}
export function replaceInv(taskId, invId) {
  return request({
    url: 'api/task/replaceInv',
    method: 'post',
    data: {
      'taskId': taskId,
      'invId': invId
    }
  })
}
export function manualReceiving(data) {
  return request({
    url: 'api/task/manualReceiving',
    method: 'post',
    data
  })
}

export function queryPickTask(id) {
  return request({
    url: 'api/task/queryPickTask?pickDetailId=' + id,
    method: 'get'
  })
}
export function picking(datas) {
  return request({
    url: 'api/task/picking',
    method: 'post',
    data: datas
  })
}
export function STAgvReceiving(datas) {
  return request({
    url: 'api/task/STAgvReceiving',
    method: 'post',
    data: datas
  })
}
export function butSTputaway(datas) {
  return request({
    url: 'api/task/butSTputaway',
    method: 'post',
    data: datas
  })
}
export function rmCkPickUp(ids) {
  return request({
    url: 'api/task/rmCkPickUp',
    method: 'post',
    data: ids
  })
}

export default { add, edit, del, getTaskInfo, queryPickTask, manualReceiving, picking, devanRfid, replaceInv, STAgvReceiving, butSTputaway, rmCkPickUp }
