/**
 * 计量数据管理
*/
import request from '../../index'

// 计量数据管理列表
export function getMeasureDataList(data: { offset: number; limit: number }) {
  return request({
    url: `/business/certificateReport/approval/listPage?offset=${data.offset}&limit=${data.limit}`,
    method: 'post',
    data,
  })
}

// 点击下载模板后生成证书
export function downLoadTemplate(data: any) {
  return request({
    url: '/business/certificateReport/exportFile',
    method: 'post',
    data,
    responseType: 'blob',
  })
}

// 新增
export function addMeasureData(data: any) {
  return request({
    url: '/business/certificateReport/save',
    method: 'post',
    data,
  })
}

// 草稿箱更新
export function draftUpdateMeasureData(data: any) {
  return request({
    url: '/business/certificateReport/draftUpdate',
    method: 'post',
    data,
  })
}

// 未通过-驳回编辑
export function failUpdateMeasureData(data: any) {
  return request({
    url: '/business/certificateReport/failUpdate',
    method: 'post',
    data,
  })
}

// 提交
export function submit(data: { formId: string; processId?: string; id: string }) {
  return request({
    url: '/business/certificateReport/submit',
    method: 'post',
    data,
  })
}

// 详情
export function getMeasureDataDetail(data: { id: string }) {
  return request({
    url: '/business/certificateReport/detail',
    method: 'post',
    data,
  })
}

// 删除
export function deleteMeasureData(data: any) {
  return request({
    url: '/business/certificateReport/batchDelete',
    method: 'post',
    data,
  })
}

