/**
 * 分包方资格审批接口
 */
import request from '../../index'
import type { IListQueryApprove } from '@/views/business/subpackage/subpackage-interface'

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

// 删除
export function deleteListItem(data: { id: string }) {
  return request({
    url: '/business/outsourcer/delete',
    method: 'post',
    data,
  })
}

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

// 审批删除
export function approvalDel(data: object) {
  return request({
    url: '/business/outsourcer/approval/operate/delete',
    method: 'post',
    data,
  })
}

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

// 编辑(草稿箱-已取消)
export function UpdateApprove(data: object) {
  return request({
    url: '/business/outsourcer/draftUpdate',
    method: 'post',
    data,
  })
}

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

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

