import request from '@/utils/request'
import qs from 'qs'
import { baseUrl } from "../../../../config/baseUrl";
import { upcloud_base_strategy,upcloud_base_wh_inbound  } from "@/config/serviceSettings";

export const api = {
  querySubList: baseUrl + '/rcvInstockLines/extractTask',
  addItems: baseUrl + '/rcvInstockLines/batchAdd',
  taskSplit: baseUrl + '/rcvInstockLines/taskSplit',
  doException: baseUrl + '/rcvInstockLines/doException',
};

export function querySubList(parameter) {
  return request({
    method: 'get',
    url: api.querySubList,
    params: parameter,
  })
}

export function addItems(parameter) {
  return request({
    method: 'post',
    url: api.addItems,
    data: parameter,
  })
}

export function taskSplit(parameter) {
  return request({
    method: 'post',
    url: api.taskSplit,
    data: parameter,
  })
}

export function doException(parameter) {
  return request({
    method: 'post',
    url: api.doException,
    data: parameter,
  })
}

export function getLocationType(parameter) {
  return request({
    method: 'get',
    url: upcloud_base_strategy+'/registry/by-code',
    params: parameter,
  })
}
export function getRcvInstockLabelPrintData(parameter) {
  return request({
    method: 'post',
    url:upcloud_base_wh_inbound+"/print/v1.0/getRcvInstockLabelPrintData",
    data: parameter,
  })
}