import request from '@/utils/request'
import qs from 'qs'
import { upcloud_base_wh_operate,SERVICE_DATA_API_BASE } from "@/config/serviceSettings";


export const api = {
  reject: upcloud_base_wh_operate + '/adjust/rejectErpForGen',
  genAdjust: upcloud_base_wh_operate + '/adjust/genAdjust',
};
//查询头表
export function getList(params) {
  return request ({
    url: SERVICE_DATA_API_BASE+'/search',
    method: 'post',
    data: params,
    headers: {
      'Authorization':'Bearer '+JSON.parse( localStorage.getItem("token") ),
      'content-type': 'application/json'
    }
  })
}
//查询头表
export function getInventory(params) {
  return request ({
    url: SERVICE_DATA_API_BASE+'/search/page',
    method: 'post',
    data: params,
    headers: {
      'Authorization':'Bearer '+JSON.parse( localStorage.getItem("token") ),
      'content-type': 'application/json'
    }
  })
}

//生成损溢单
export function genAdjust(parameter) {
  return request({
    method: 'post',
    url: api.genAdjust,
    data: parameter,
  })
}


//驳回处理
export function reject(parameter) {
  return request({
    method: 'post',
    url: api.reject,
    data: parameter,
  })
}