/*
 * @Date: 2022-09-19 08:58:49
 * @LastEditors: 陈禹琨 cyk910622@163.com
 * @LastEditTime: 2022-09-26 20:11:57
 * @FilePath: \upcloud-wms-hnsy-web\src\views\kzyWMS\inBound\quality\recheckEditor\api\index.js
 * @Description: cyk
 */
import request, { axios } from "@/utils/request";
import qs from "qs";
import { upcloud_base_wh_inbound, upcloud_base_common, upcloud_base_strategy } from "@/config/serviceSettings";

export const api = {
  addItem: upcloud_base_wh_inbound + "/rqcReHeaders/addWithRelated",
  doException: upcloud_base_wh_inbound + "/rqcHeaders/doException",
};

export function addItem(parameter) {
  return request({
    method: "post",
    url: api.addItem,
    data: parameter,
  });
}

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

// 字典
export function getDicts(parameter) {
  return request({
    method: "post",
    url: upcloud_base_common + "/dict/listbytype",
    params: parameter,
    replaceFields: {
      value: "dictCode",
      label: "dictName",
    },
  });
}

// 获取入库结论-策略
export const getStockStatusOptions = (params) => {
  return axios.get(upcloud_base_strategy + "/strategy/v1/execute", { params });
};
export const IS_AGV = () => {
  return axios.post(upcloud_base_common + "/dict/listbytype?dicttypeCodes=IS_AGV");
};

// remoteUrl: { url: upcloud_base_strategy + "/strategy/v1/execute", method: "get" },

export function strategyExecute(data) {
  return request({
    method: "get",
    url: upcloud_base_strategy + "/strategy/v1/execute",
    params: data,
  });
}
