/**
 * 证书打印
*/
import request from '../../index'
import type { ICertApprove, ICertExport, ICertInitiate, ICertPrintSearch } from '@/views/business/schedule/certPrint/cert-interface'

// 证书打印列表
export function getCertList(data: ICertPrintSearch) {
  return request({
    url: `/business/certificatePrint/listPage?offset=${data.offset}&limit=${data.limit}`,
    method: 'post',
    data,
  })
}

// 发起申请
export function submitApproval(data: ICertInitiate) {
  return request({
    url: '/business/certificatePrint/submitApproval',
    method: 'post',
    data,
  })
}

// 同意
export function agreeCert(data: ICertApprove) {
  return request({
    url: '/business/certificatePrint/agree',
    method: 'post',
    data,
  })
}

// 拒绝
export function refuseCert(data: ICertApprove) {
  return request({
    url: '/business/certificatePrint/refuse',
    method: 'post',
    data,
  })
}

// 证书导出
export function exportCert(data: ICertExport) {
  return request({
    url: '/business/certificatePrint/export',
    method: 'post',
    responseType: 'blob',
    data,
  })
}

// 证书详情
export function certificatePrintDetail(data: object) {
  return request({
    url: '/business/certificatePrint/detail',
    method: 'post',
    data,
  })
}
