import { axios } from "@/utils/request";
import qs from "qs";


import { UPCLOUD_RDC_TMS_MAINDATA_SERVICE } from '@/config/serviceSettings.js'
const serviceName = UPCLOUD_RDC_TMS_MAINDATA_SERVICE
// 主表地址
export const listRemoteUrl = {
  url: serviceName + "/approval/page",
  method: "post"
};

// 审批配置启用
export const Enable = data => {
  return axios.post(serviceName + "/approval/approval_enable", data);
};

// 审批配置停用
export const Disable = data => {
  return axios.post(serviceName + "/approval/approval_disable", data);
};

// 审批配置删除
export const Delete = data => {
  return axios.post(serviceName + "/approval/approval_delete", data);
};

// 审批配置新增
export const Add = data => {
  return axios.post(serviceName + "/approval/add", data);
};

// 审批配置修改
export const Update = data => {
  return axios.post(serviceName + "/approval/approval_update", data);
};

// 审批配置查看
export const View = data => {
  return axios.post(serviceName + "/approval/approval_view", qs.stringify(data), {
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    }
  });
};

// 审批流程节点配置
export const approval_node_config = data => {
  return axios.post(serviceName + "/approval/approval_node_config", data);
};

// 审批流程节点删除
export const approval_node_delete = data => {
  return axios.post(serviceName + "/approval/approval_node_delete", data);
};

// 审批流程节点查询
export const approval_node_query = data => {
  return axios.post(serviceName + "/approval/approval_node_query", qs.stringify(data), {
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    }
  });
};