import request from "@/utils/request";

export function getReportTemplate(data) {
  return request({
    url: "/point-strategy/v/reportTemplate/queryPage",
    method: "post",
    data
  });
}
// 模板删除
export function deleteTemplate(data) {
  return request({
    url: `/point-strategy/v/reportTemplate/delete?id=${data.id}`,
    method: "post"
  });
}

// 模板查询
export function queryEntity(data) {
  return request({
    url: "/point-strategy/v/reportMatching/queryEntity",
    method: "post",
    data
  });
}
// 模板pdf展示
export function showPdf(params) {
  return request({
    url: `/point-strategy/v/reportMatching/showPdf?templatePath=${params.templatePath}&token=${params.token}`,
    method: "get",
    responseType: "blob"
  });
}
// 报表匹配
export function saveReportMatching(data) {
  return request({
    url: "/point-strategy/v/reportMatching/saveReportMatching",
    method: "post",
    data
  });
}
// 查询是卷内还是案卷
export function queryEntityLevel(data) {
  return request({
    url: `/point-strategy/v/reportMatching/queryEntityLevel?entityId=${data.entityId}`,
    method: "post"
  });
}
// 报表展示
export function queryReportName(data) {
  return request({
    url: "/point-strategy/v/reportMatching/queryReportName",
    method: "post",
    data
  });
}
//生成报表
export function generateReport(data) {
  return request({
    url: "/point-strategy/v/reportMatching/generateReport",
    method: "post",
    data
  });
}
//删除模板
export function deleteReportMatching(data) {
  return request({
    url: "/point-strategy/v/reportMatching/deleteReportMatching",
    method: "post",
    data
  });
}
// 预先匹配模板
export function defaultReportMatching(data) {
  return request({
    url: `/point-strategy/v/reportMatching/defaultReportMatching?entityId=${data.entityId}&templateId=${data.templateId}`,
    method: "post"
  });
}
