/**
 * 现场检测审批
 */
import request from '../../index'
import type { IListQuery } from '@/views/business/fieldTest/approve/approve-interface'

// 列表查询
export function getFieldTestApproveList(data: IListQuery) {
  return request({
    url: `/business/siteExecutive/approval/listPage?offset=${data.offset}&limit=${data.limit}`,
    method: 'post',
    data,
  })
}

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

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

// 新增
export function addFieldTestApproveList(data: object) {
  return request({
    url: '/business/siteExecutive/save',
    method: 'post',
    data,
  })
}

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

// 草稿箱编辑
export function updateFieldTestApprove(data: object) {
  return request({
    url: '/business/siteExecutive/draftUpdate',
    method: 'post',
    data,
  })
}

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

