// 收入合同
import request from '../index'
import type { IListQuery } from '@/views/finance/contract/contract-interface'

// 收入合同审批列表-列表页
export function getContractList(data: IListQuery) {
  return request({
    url: `/finance/agreement/approval/listPage?offset=${data.offset}&limit=${data.limit}`,
    method: 'post',
    data,
  })
}

// 新建
export function addContractList(data: Object) {
  return request({
    url: '/finance/agreement/save',
    method: 'post',
    data,
  })
}

// 编辑-草稿箱、已取消
export function updateContractList(data: Object) {
  return request({
    url: '/finance/agreement/draftUpdate',
    method: 'post',
    data,
  })
}
// 未通过驳回编辑
export function failUpdateContractList(data: Object) {
  return request({
    url: '/finance/agreement/failUpdate',
    method: 'post',
    data,
  })
}

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

// 删除
export function delContractList(data: { id: string }) {
  return request({
    url: '/finance/agreement/delete',
    method: 'post',
    data,
  })
}
// 详情
export function getContractDetail(data: { id: string }) {
  return request({
    url: '/finance/agreement/detail',
    method: 'post',
    data,
  })
}

