/**
 * 分包方档案接口
 */
import request from '../../index'
import type { IListQuery } from '@/views/business/subpackage/record/record-interface'

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

// 导出
export function exportRecordList(data: Omit<IListQuery, 'limit' | 'offset'>) {
  return request({
    url: '/business/outsourcer/listExport',
    method: 'post',
    responseType: 'blob',
    data,
  })
}

// 批量导入
export function batchImportSubpackageRecord(data: FormData) {
  return request({
    url: '/business/outsourcer/import',
    method: 'post',
    data,
  })
}

// 人员列表查询
export function getPersonList(data: { outsourcerId: string; offset?: number; limit?: number }) {
  return request({
    url: `/business/outsourcerUser/listPage?offset=${data.offset}&limit=${data.limit}`,
    method: 'post',
    data,
  })
}

// 人员列表删除
export function delPersonList(data: any) {
  return request({
    url: '/business/outsourcerUser/delete',
    method: 'post',
    data,
  })
}

// 人员列表新增
export function addPersonList(data: Object) {
  return request({
    url: '/business/outsourcerUser/add',
    method: 'post',
    data,
  })
}

// 业务能力列表查询
export function getAbilityList(data: { outsourcerId: string; offset?: number; limit?: number }) {
  return request({
    url: `/business/outsourcerAbility/listPage?offset=${data.offset}&limit=${data.limit}`,
    method: 'post',
    data,
  })
}

// 业务能力删除
export function delAbilityList(data: any) {
  return request({
    url: '/business/outsourcerAbility/delete',
    method: 'post',
    data,
  })
}

// 业务能力新增
export function addAbilityList(data: Object) {
  return request({
    url: '/business/outsourcerAbility/add',
    method: 'post',
    data,
  })
}

// 审批通过列表
export function getListApprovePass(data: any) {
  return request({
    url: `/business/outsourceProject/check/listPage?offset=${data.offset}&limit=${data.limit}`,
    method: 'post',
    data,
  })
}

