import request from '@/utils/request'

/**
 * 获取生成的单号
 * @param data
 * @returns {*}
 */

export function getCodeNo(data) {
  return request({
    url: 'api/pickTicket/createNo?code='+data,
    method: 'get'
  })
}

export function getIdByPickTicket(id) {
  return request({
    url: 'api/pickTicket/getIdByPickTicket?id='+id,
    method: 'get'
  })
}

export function add(data) {
  return request({
    url: 'api/pickTicket',
    method: 'post',
    data
  })
}
export function xdckAllocate(data) {
  return request({
    url: 'api/pickTicket/xdckAllocate',
    method: 'post',
    data
  })
}

export function qtckAllocate(data) {
  return request({
    url: 'api/pickTicket/qtckAllocate',
    method: 'post',
    data
  })
}


export function xdckCancelAllocate(data) {
  return request({
    url: 'api/pickTicket/xdckCancelAllocate',
    method: 'post',
    data
  })
}
/**
 * 拣货操作
 * @param data
 * @returns {AxiosPromise}
 */
export function pickingOperations(data) {
  return request({
    url: 'api/pickTicket/pickingOperations',
    method: 'post',
    data
  })
}
/**
 * 拣货操作-整单
 * @param data
 * @returns {AxiosPromise}
 */
export function pickWhole(data) {
  return request({
    url: 'api/pickTicket/pickWhole',
    method: 'post',
    data
  })
}
/**
 * 拣货操作-批量
 * @param data
 * @returns {AxiosPromise}
 */
export function pickBatch(data) {
  return request({
    url: 'api/pickTicket/pickBatch',
    method: 'post',
    data
  })
}

/**
 * 拣货操作-箱单拣货
 * @param data
 * @returns {AxiosPromise}
 */
export function xdckPickOut(data) {
  return request({
    url: 'api/pickTicket/xdckPickOut',
    method: 'post',
    data
  })
}
/**
 * 拣货操作-单一
 * @param data
 * @returns {AxiosPromise}
 */
export function pickSingle(data) {
  return request({
    url: 'api/pickTicket/pickSingle',
    method: 'post',
    data
  })
}
/**
 * 拣货操作-现品票
 * @param data
 * @returns {AxiosPromise}
 */
export function pickForXpp(data) {
  return request({
    url: 'api/pickTicket/pickForXpp',
    method: 'post',
    data
  })
}

/**
 * 现品票拣货
 */
export function xppPickGoods(data) {
  return request({
    url: 'api/pickTicket/xppPickGoods',
    method: 'post',
    data
  })
}

/**
 * 拣货取消的数据查询
 * @param data
 * @returns {*}
 */
export function queryTaskLogDataS(data) {
  return request({
    url: 'api/pickTicket/queryTaskLogDataS',
    method: 'post',
    data
  })
}

/**
 * 拣货取消
 * @param data
 * @returns {AxiosPromise}
 */
export function pickingCancel(data) {
  return request({
    url: 'api/pickTicket/pickingCancel',
    method: 'post',
    data
  })
}

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

/**
 * 线边接收确认
 * @param ids
 * @returns {*}
 */
export function xbjsVerify(ids) {
  return request({
    url: 'api/pickTicket/xbjsVerify',
    method: 'post',
    data: ids
  })
}

/**
 * 发货登记
 * @param id
 */
export function shipmentRegistration(id) {
  return request({
    url: 'api/pickTicket/shipmentRegistration',
    method: 'post',
    data: id
  })
}

/**
 * 状态更新
 * @param ids
 * @returns {*}
 */
export function pickStatusUpdate(ids) {
  return request({
    url: 'api/pickTicket/pickStatusUpdate',
    method: 'post',
    data: ids
  })
}

export function edit(data) {
  return request({
    url: 'api/pickTicket',
    method: 'put',
    data
  })
}

export function queryDetails(id) {
  return request({
    url: 'api/pickTicket/queryDetails',
    method: 'post',
    data: id
  })
}

export function xdckPick(data) {
  return request({
    url: 'api/pickTicket/xdckPick',
    method: 'post',
    data
  })
}

export default { add, edit, del ,xdckPickOut,xdckAllocate,qtckAllocate,xdckCancelAllocate,pickingOperations,queryDetails,shipmentRegistration,xppPickGoods,xbjsVerify,pickWhole,pickBatch,pickSingle,pickForXpp,xdckPick}
