import request from '@/utils/request'

// 创建检测报告模板
export function createInspectionTemplate(data) {
  return request({
    url: '/configure/inspection-template/create',
    method: 'post',
    data: data
  })
}

// 更新检测报告模板
export function updateInspectionTemplate(data) {
  return request({
    url: '/configure/inspection-template/update',
    method: 'put',
    data: data
  })
}

// 删除检测报告模板
export function deleteInspectionTemplate(id) {
  return request({
    url: '/configure/inspection-template/delete?id=' + id,
    method: 'delete'
  })
}

// 获得检测报告模板
export function getInspectionTemplate(id) {
  return request({
    url: '/configure/inspection-template/get?id=' + id,
    method: 'get'
  })
}

// 获得检测报告模板分页
export function getInspectionTemplatePage(query) {
  return request({
    url: '/configure/inspection-template/page',
    method: 'get',
    params: query
  })
}

// 导出检测报告模板 Excel
export function exportInspectionTemplateExcel(query) {
  return request({
    url: '/configure/inspection-template/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}

// 通过商户ID获得检测报告模板列表
export function getByBusinessId(params) {
  return request({
    url: '/configure/inspection-template/getByBusinessId',
    method: 'get',
    params
  })
}

// 创建检测报告模板
export function createTemplate(data) {
  return request({
    url: '/configure/inspection-template/create',
    method: 'post',
    data
  })
}
