| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353 |
- import request from '@/utils/request';
- /**
- * 查询项目列表
- * @data data
- */
- export async function projectsPageAPI(data) {
- const res = await request.post('/pro/projects/page', data);
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- /**
- * 我的项目
- * @data data
- */
- export async function getMyProjectsPage(data) {
- const res = await request.post('/pro/projects/getMyPage', data);
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- /**
- * 项目保存
- * @data data
- */
- export async function projectsSaveAPI(data) {
- const res = await request.post('/pro/projects/save', data);
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- /**
- * 项目修改
- * @data data
- */
- export async function projectsUpdateAPI(data) {
- const res = await request.put('/pro/projects/update', data);
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- /**
- * 项目阶段新增
- * @data data
- */
- export async function projectsstageSave(data) {
- const res = await request.post('/pro/projectsstage/save', data);
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- export async function projectsstageSaveBatch(data) {
- const res = await request.post('/pro/projectsstage/saveBatch', data);
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- /**
- * 项目详情
- * @id id
- */
- export async function projectsGetByIdAPI(id) {
- const res = await request.get(`/pro/projects/getById/${id}`);
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- /**
- * 项目查询项目结构树
- * @id id
- */
- export async function projectsToTreeAPI(params){
- const res = await request.get(`/pro/projects/selectProjectsToTree`,{params});
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- /**
- * 项目详情明细信息(含子集阶段、计划、任务)
- * @id id
- */
- export async function projectsGetByIdDetailsAPI(id){
- const res = await request.get(`/pro/projects/getByIdDetails/${id}`,);
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- /**
- * 逐级查询项目各层级列表数据
- * @id id
- */
- export async function projectsSelectTreeDataAPI(params){
- const res = await request.get(`/pro/projects/selectTreeDatas`,{params});
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- /**
- * 获取项目BOM树数据
- * @id id
- */
- export async function projectsBomGetTreeDataAPI(id){
- const res = await request.get(`/pro/projectsbom/getTreeDatas/${id}`,{});
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- /**
- * 根据类型获取项目编码
- * @id id
- */
- export async function getProjectCode(type){
- const res = await request.get(`/pro/projects/getProjectCode/${type}`,);
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- export async function getProjectCodeG(type){
- const res = await request.get(`/main/codemanage/getCode/${type}`,);
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- /**
- * 项目删除
- * @id id
- */
- export async function projectsDeleteAPI(data) {
- const res = await request.delete(`/pro/projects/delete`,{data});
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- /**
- * 提交
- */
- export async function submit(data) {
- const res = await request.post(`/bpm/pro/project/submit`, data);
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- /**
- * 获取项目bom和子项目结构树数据
- */
- export async function getByBomTreeAPI(id) {
- const res = await request.get(`/pro/projects/getByBomTree/${id}`);
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }/**
- * 根据项目id/计划/BOM获取项目计划树结构
- */
- export async function getPlanAndTaskTreeById(data) {
- const res = await request.post(`/pro/targetplan/getPlanTreeByPO`, data);
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- /**
- * 根据项目id/计划/BOM获取项目任务树结构
- */
- export async function getTaskTreeById(data) {
- const res = await request.post(`/pro/projects/getTaskTreeByPO`, data);
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- /**
- * 据项目对象查询所包含的阶段
- */
- export async function getProjectStageTree(id) {
- const data = {
- id: id,
- parentId: 0
- };
- const res = await request.post(`/pro/projects/getProjectStageTree`, data);
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- /**
- * 项目阶段删除
- * @id id
- */
- export async function projectsStageDeleteAPI(data) {
- const res = await request.delete(`/pro/projectsstage/delete`,{data});
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- export async function projectsStageUpdateAPI(data) {
- const res = await request.put(`/pro/projectsstage/update`,data);
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- /**
- * 项目完成
- * @id id
- */
- export async function projectsFinishAPI(id) {
- const res = await request.get(`/pro/projects/finishStatus/${id}`,{});
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- /**
- * 项目暂停
- * @id id
- */
- export async function projectsPauseAPI(id) {
- const res = await request.get(`/pro/projects/pauseStatus/${id}`,{});
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- /**
- * 项目启动
- * @id id
- */
- export async function projectsStartupAPI(id) {
- const res = await request.get(`/pro/projects/startupStatus/${id}`,{});
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- /**
- * 项目终止
- * @id id
- */
- export async function projectsTerminationAPI(id) {
- const res = await request.get(`/pro/projects/terminationStatus/${id}`,{});
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- /**
- * 项目完成
- * @id id
- */
- export async function projectsStageFinishAPI(id) {
- const res = await request.get(`/pro/projectsstage/finishStatus/${id}`,{});
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- /**
- * 项目暂停
- * @id id
- */
- export async function projectsStagePauseAPI(id) {
- const res = await request.get(`/pro/projectsstage/pauseStatus/${id}`,{});
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- /**
- * 项目启动
- * @id id
- */
- export async function projectsStageStartupAPI(id) {
- const res = await request.get(`/pro/projectsstage/startupStatus/${id}`,{});
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- /**
- * 项目终止
- * @id id
- */
- export async function projectsStageTerminationAPI(id) {
- const res = await request.get(`/pro/projectsstage/terminationStatus/${id}`,{});
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- /**
- * 项目详情获取项目树
- * @id id
- */
- export async function getProjectAndCategoryLevelTree(id) {
- const res = await request.get(`/pro/projects/getProjectAndCategoryLevelTree`,{});
- if (res.data.code == 0) {
- return res.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- /**
- * 项目行事历 树
- * @id id
- */
- export async function getProjectCalender(data) {
- const res = await request.post(`/pro/projects/getProjectCalender`,data);
- if (res.data.code == 0) {
- return res.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
|