/*
 * @Date: 2024-05-10 16:29:07
 * @LastEditors: 陈禹琨 chenyukun@prolog-int.com
 * @LastEditTime: 2024-05-23 10:06:24
 * @FilePath: /upcloud-wms-qingniu-web/src/views/kzyWMS/regions/api/index.js
 * @Description: cyk
 */
import { axios } from "@/utils/request";
import request from "@/utils/request";
import { upcloud_base_common } from "@/config/serviceSettings";
import qs from "qs";
//获取树形列表
export function getTree(params) {
  return axios({
    url: upcloud_base_common + "/region/tree",
    method: "get",
    headers: { "Content-Type": "application/x-www-form-urlencoded" },
    params: params,
  });
}
//获取区域信息
export function regionInfo(params) {
  return axios({
    url: upcloud_base_common + "/region/info",
    method: "get",
    headers: { "Content-Type": "application/x-www-form-urlencoded" },
    params: params,
  });
}
//根据父级编码查区域信息
export function queryRegion(params) {
  return axios({
    url: upcloud_base_common + "/region/list",
    method: "get",
    headers: { "Content-Type": "application/x-www-form-urlencoded" },
    params: params,
  });
}
//新增
export function addDetail(params) {
  return axios({
    url: upcloud_base_common + "/region/add",
    method: "post",
    headers: { "Content-Type": "application/json" },
    data: params,
  });
}
//修改
export function editDetail(params) {
  return axios({
    url: upcloud_base_common + "/region/edit",
    method: "post",
    headers: { "Content-Type": "application/json" },
    data: params,
  });
}
//删除
export function delDetail(params) {
  return axios({
    url: upcloud_base_common + "/region/del",
    method: "post",
    headers: { "Content-Type": "application/json" },
    data: params,
    // data:  qs.stringify(params)
  });
}
//批量删除
export function delBatchDetail(params) {
  return axios({
    url: upcloud_base_common + "/region/del-batch",
    method: "post",
    headers: { "Content-Type": "application/json" },
    data: params,
    // data:  qs.stringify(params)
  });
}
