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

export const api = {
  querySubList: baseUrl + '/report/v1.0/getReportExceptionLine',
  querySubList2: baseUrl + '/report/v1.0/getReportInstockLine',
  querySubList3: baseUrl + '/report/v1.0/getReportRcvLine',
  querySubList4: baseUrl + '/report/v1.0/getReportRejectLine',
  querySubList5: baseUrl + '/report/v1.0/getReportRqcLine',
  querySubList6: baseUrl + '/report/v1.0/getReportRqcReLine',

  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 querySubList2(parameter) {
  return request({
    method: 'get',
    url: api.querySubList2,
    params: parameter,
  })
}
export function querySubList3(parameter) {
  return request({
    method: 'get',
    url: api.querySubList3,
    params: parameter,
  })
}
export function querySubList4(parameter) {
  return request({
    method: 'get',
    url: api.querySubList4,
    params: parameter,
  })
}
export function querySubList5(parameter) {
  return request({
    method: 'get',
    url: api.querySubList5,
    params: parameter,
  })
}
export function querySubList6(parameter) {
  return request({
    method: 'get',
    url: api.querySubList6,
    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,
  })
}