/**
 * 分包项目验收接口
 */
import request from '../../index'
import type { IListQuery } from '@/views/business/subpackage/subpackage-interface'

// 列表查询
export function getListPage(data: IListQuery) {
  return request({
    url: `/business/outsourceProject/check/approval/listPage?offset=${data.offset}&limit=${data.limit}`,
    method: 'post',
    data,
  })
}
// 详情
export function detail(data: object) {
  return request({
    url: '/business/outsourceProject/check/detail',
    method: 'post',
    data,
  })
}

// 删除
export function approvalDel(data: { id: string }) {
  return request({
    url: '/business/outsourceProject/check/approval/operate/delete',
    method: 'post',
    data,
  })
}

// 草稿箱删除
export function deleteListItem(data: { id: string }) {
  return request({
    url: '/business/outsourceProject/check/delete',
    method: 'post',
    data,
  })
}

// 编辑（草稿箱和取消）
export function updateCheck(data: object) {
  return request({
    url: '/business/outsourceProject/check/draftUpdate',
    method: 'post',
    data,
  })
}

// 驳回后编辑
export function failUpdateCheck(data: object) {
  return request({
    url: '/business/outsourceProject/check/failUpdate',
    method: 'post',
    data,
  })
}

// 新建
export function addCheck(data: object) {
  return request({
    url: '/business/outsourceProject/check/save',
    method: 'post',
    data,
  })
}

// 提交
export function submit(data: object) {
  return request({
    url: '/business/outsourceProject/check/submit',
    method: 'post',
    data,
  })
}
