import service from '@/utils/request'

// 查询所有流程
export const getAllProcess = () => {
  return service({
    url: '/process/queryAllProcess',
    method: 'GET'
  })
}

// 新增流程
export const postProcess = (data) => {
  return service({
    url: '/process/createProcess',
    method: 'POST',
    data
  })
}

// 查询流程列表
export const getProcessList = (data) => {
  return service({
    url: '/process/queryProcessList',
    method: 'POST',
    data
  })
}

// 修改流程
export const putProcess = (data) => {
  return service({
    url: '/process/updateProcess',
    method: 'PUT',
    data
  })
}

// 删除流程
export const delProcess = (data) => {
  return service({
    url: '/process/deleteProcess',
    method: 'delete',
    data
  })
}

// 开关流程
export const switchProcess = (data) => {
  return service({
    url: '/process/switchProcess',
    method: 'post',
    data
  })
}

// 查询项目审批列表
export const getItemApproveList = (data) => {
  return service({
    url: '/projectProcess/queryProjectApplicantList',
    method: 'POST',
    data
  })
}

// 查询项目流程列表
export const getItemProcessList = (data) => {
  return service({
    url: '/projectProcess/queryProjectProcessList',
    method: 'POST',
    data
  })
}
