import request from '@/utils/request'

// 创建合同档案
export function createElectronicContracts(data) {
  return request({
    url: '/ea/electronicContracts/create',
    method: 'post',
    data: data
  })
}

// 更新合同档案
export function updateElectronicContracts(data) {
  return request({
    url: '/ea/electronicContracts/update',
    method: 'put',
    data: data
  })
}

// 删除合同档案
export function deleteElectronicContracts(id) {
  return request({
    url: '/ea/electronicContracts/delete?id=' + id,
    method: 'delete'
  })
}

// 获得合同档案
export function getElectronicContracts(id) {
  return request({
    url: '/ea/electronicContracts/get?id=' + id,
    method: 'get'
  })
}

// 获得合同档案分页
export function getElectronicContractsPage(query) {
  return request({
    url: '/ea/electronicContracts/page',
    method: 'get',
    params: query
  })
}

// 导出合同档案 Excel
export function exportElectronicContractsExcel(query) {
  return request({
    url: '/ea/electronicContracts/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
