import request from '@/utils/request'

//校验项目编码是否存在
export function checkProjectCodeExist (data) {
  return request({
    url: '/cbProjectRecord/checkProjectCodeExist/'+data,
    method: 'get',
  })
}
//新增项目
export function addProject (data) {
  return request({
    url: '/cbProjectRecord/addProject',
    method: 'post',
    data:data,
  })
}
//修改项目
export function editProjectInfo (data) {
  return request({
    url: '/cbProjectRecord/editProjectInfo',
    method: 'PUT',
    data:data,
  })
}
//新增新阶段项目
export function addNewStageProject (data) {
  return request({
    url: '/cbProjectRecord/addNewStageProject',
    method: 'POST',
    data:data,
  })
}
//获取当前项目文件上传
export function getProjectFileUploadDetail (projectId) {
  return request({
    url: '/cbProjectFile/getProjectFileUploadDetail/'+projectId,
    method: 'get',
  })
}

//获取草稿箱列表
export function getDraftDialogList (projectId) {
  return request({
    url: '/cbProjectRecord/getDraftDialogList',
    method: 'get',
  })
}

//上传文件
export function uploadCbProjectFile (data) {
  return request({
    url: '/cbProjectFile/uploadCbProjectFile',
    method: 'post',
    data
  })
}
//删除文件
export function deleteCbProjectFile (fileId) {
  return request({
    url: '/cbProjectFile/deleteCbProjectFile/'+fileId,
    method: 'Delete',
  })
}

//删除草稿
export function deleteDraft (projectId) {
  return request({
    url: '/cbProjectRecord/deleteDraft/'+projectId,
    method: 'Delete',
  })
}

//查询当前项目可删除成本阶段
export function getProjectCbStageNotDraft (relatedId) {
  return request({
    url: '/cbProjectRecord/getProjectCbStageNotDraft/'+relatedId,
    method: 'get',
  })
}
