import request from "@/utils/request";

const BASE_URL = "/internal/medical-treatment-plan";

/**
 * 治疗方案
 */
//  治疗方案列表
export function getTherapeuticListApi(params) {
  return request({
    url: `${BASE_URL}`,
    method: "get",
    params,
  });
}

// 新增治疗方案
export function addTherapeuticApi(data) {
  return request({
    url: `${BASE_URL}`,
    method: "post",
    data,
  });
}

// 编辑治疗方案
export function editTherapeuticApi(data) {
  return request({
    url: `${BASE_URL}`,
    method: "put",
    data,
  });
}

// 批量删除
export function batchDelTherapeuticApi(data) {
  return request({
    url: `${BASE_URL}`,
    method: "delete",
    data,
  });
}
// 批量导入
export function bathImportTherapeuticApi(file) {
  const formData = new FormData();
  formData.append("file", file);
  return request({
    url: `${BASE_URL}/import`,
    timeout: 60 * 1000 * 10, // 10分钟
    method: "post",
    data: formData,
    headers: {
      "Content-Type": "multipart/form-data",
    },
  });
}
// 治疗方案详情
export function getTherapeuticApi(id) {
  return request({
    url: `${BASE_URL}/${id}`,
    method: "get",
  });
}
// 治疗方案详情
export function delTherapeuticApi(id) {
  return request({
    url: `${BASE_URL}/${id}`,
    method: "delete",
  });
}
