import request from '@/utils/request'

// 查询补充协议列表
export function listAgreement(query) {
  return request({
    url: '/ct/agreement/list',
    method: 'get',
    params: query
  })
}

// 查询补充协议详细
export function getAgreement(id) {
  return request({
    url: '/ct/agreement/' + id,
    method: 'get'
  })
}

// 新增补充协议
export function addAgreement(data) {
  return request({
    url: '/ct/agreement',
    method: 'post',
    data: data
  })
}

// 修改补充协议
export function updateAgreement(data) {
  return request({
    url: '/ct/agreement',
    method: 'put',
    data: data
  })
}

// 删除补充协议
export function delAgreement(id) {
  return request({
    url: '/ct/agreement/' + id,
    method: 'delete'
  })
}



//预览
export function previewAgreemwnt(id){
    return request({
        url: '/ct/agreement/previewAgreemwnt?id='+id,
        method: 'get'
    })
}

//生成文件
export function buildFile(id){
    return request({
        url: '/ct/agreement/buildFile/'+id,
        method: 'post'
    })
}

//提交流程
export function submitFlow(id){
    return request({
        url: '/ct/agreement/submitFlow/'+id,
        method: 'post'
    })
}

export function cancleFlow(id){
    return request({
        url: '/ct/agreement/cancleFlow/'+id,
        method: 'post'
    })
}
