import request from '@/utils/request'

// 查询项目列表
export function listProjectApi(query) {
  return request({
    url: '/ent/project/manageList',
    method: 'get',
    params: query
  })
}
//新增项目
export function addProjectApi(data) {
  return request({
    url: `/ent/project`,
    method: 'post',
    data: data
  })
}
//获取财务员、科技员
export function listUserListApi(query) {
  return request({
    url: `/ent/user/list`,
    method: 'get',
    params: query
  })
}
//修改项目
export function editProjectApi(data) {
  return request({
    url: `/ent/project`,
    method: 'put',
    data: data
  })
}
//获取项目信息  企业
export function getProjectInfoApi(id, query) {
  return request({
    url: `/ent/project/${id}`,
    method: 'get',
    params: query
  })
}
//获取项目详情信息 科德管理员
export function getProjectInfoAdminApi(id, query) {
  return request({
    url: `/admin/project/${id}`,
    method: 'get',
    params: query
  })
}
//同步给技术
export function synTechApi(id,data) {
  return request({
    url: `/ent/project/sync/tech/${id}`,
    method: 'put',
    data: data
  })
}
//同步给财务
export function synFinApi(id, data) {
  return request({
    url: `/ent/project/sync/finc/${id}`,
    method: 'put',
    data: data
  })
}
//删除项目
export function deleteProjectApi(ids) {
  return request({
    url: `/ent/project/${ids}`,
    method: 'delete'
  })
}
//获取项目附件
export function getEnclosureApi(attachType,dataId) {
  return request({
    url: `/common/attach/attach/${attachType}/${dataId}`,
    method: 'get'
  })
}
//删除附件信息
export function deleteEnclosureApi(ids) {
  return request({
    url: `/common/attach/${ids}`,
    method: 'delete'
  })
}

export function getProjectInfoCommonApi(id, query) {
  return request({
    url: `/project/${id}`,
    method: 'get',
    params: query
  })
}
//重新提交审核
export function entUserAudit(data) {
  return request({
    url: `/ent/user/auth`,
    method: 'put',
    data: data
  })
}

//保存草稿
export function draftApi(data) {
  return request({
    url: `/ent/project/save-draft`,
    method: 'post',
    data: data
  })
}
