明树Git Lab

Commit c19c9645 authored by zfp1's avatar zfp1

1

parent 6a2fefeb
Pipeline #111176 passed with stage
in 4 seconds
......@@ -310,7 +310,7 @@ async function startLixiang(req, res, next) {
projectName: req.body.projectName,
projectCode: req.body.projectCode,
});
return res.sendData();
return res.sendData(ret);
} else if (req.body.projectHzUser) {
//更新信息和状态
let ret = await xiangmulixianggengxin(req.body, "2"); //状态 2 -- 立项核准中
......@@ -330,8 +330,13 @@ async function startLixiang(req, res, next) {
projectName: req.body.projectName,
projectCode: req.body.projectCode,
});
return res.sendData();
return res.sendData(ret);
} else {
// 项目公司所属单位员工发起,发送消息给项目单位部门长核准
let approvers = await userModule.getCompanyProjectApprover(req.user.id);
if (!(approvers && approvers.length > 0)) {
return res.sendError({ code: '60001', msg: '项目已保存,请联系管理员为本公司添加【项目立项核准】角色人员' });
}
//更新信息和状态
let ret = await xiangmulixianggengxin(req.body, "2"); //状态 2 -- 立项核准中
// 记录流程节点操作
......@@ -342,11 +347,6 @@ async function startLixiang(req, res, next) {
projectName: req.body.projectName,
projectCode: req.body.projectCode,
});
// 项目公司所属单位员工发起,发送消息给项目单位部门长核准
let approvers = await userModule.getCompanyProjectApprover(req.user.id);
if (!(approvers && approvers.length > 0)) {
return res.sendError({ code: '60001', msg: '项目已保存,请联系管理员为本公司添加【项目立项核准】角色人员' });
}
await DB.Message.create({
projectId: req.body.id,
creator: req.user.id,
......@@ -443,13 +443,13 @@ async function approvalLixiangByTouGuanJbr(req, res, next) {
}
let ret;
if (body.approvalResult) {
//投管部经办人审批通过,更新项目信息和状态为--立项终审
ret = await xiangmulixianggengxin(body, "4");
// 给投管部正副职发消息
let approvers = await userModule.getTouGuanZfzProjectApprover(req.user.id);
if (!(approvers && approvers.length > 0)) {
return res.sendError({ code: '60001', msg: '项目已保存,请联系管理员添加【投管部正副职】角色人员' });
return res.sendError({ code: '60001', msg: '请联系管理员添加【投管部正副职】角色人员' });
}
//投管部经办人审批通过,更新项目信息和状态为--立项终审
ret = await xiangmulixianggengxin(body, "4");
await DB.Message.create({
projectId: body.id,
creator: req.user.id,
......@@ -707,7 +707,7 @@ async function saveJuece(req, res, next) {
if (!req.body.id) {
return res.sendError(errorMessage.resourceNotFound)
}
body.projectFqJueceUser = req.user.id;//记录一下项目决策发起人
req.body.projectFqJueceUser = req.user.id;//记录一下项目决策发起人
let ret = await xiangmujuecegengxin(req.body, 7); //决策填报中
return res.sendData(ret);
} catch (error) {
......@@ -720,8 +720,13 @@ async function startJuece(req, res, next) {
if (!req.body.id) {
return res.sendError(errorMessage.resourceNotFound)
}
body.projectFqJueceUser = req.user.id;//记录一下项目决策发起人
let ret = await xiangmujuecegengxin(req.body, 8); //决策审批中
let approvers = await userModule.getTouGuanZfzProjectApprover(req.user.id);
if (!(approvers && approvers.length > 0)) {
return res.sendError({ code: '60002', msg: '请联系管理员为本公司添加【项目决策】角色人员' });
}
req.body.projectFqJueceUser = req.user.id;//记录一下项目决策发起人
let ret = await xiangmujuecegengxin(req.body, "8"); //决策审批中
// 给审批人员发消息
await DB.FlowRecord.create({
......@@ -731,10 +736,6 @@ async function startJuece(req, res, next) {
projectName: req.body.projectName,
projectCode: req.body.projectCode,
});
let approvers = await userModule.getTouGuanZfzProjectApprover(req.user.id);
if (!(approvers && approvers.length > 0)) {
return res.sendError({ code: '60002', msg: '项目已保存,请联系管理员为本公司添加【项目决策】角色人员' });
}
await DB.Message.create({
projectId: req.body.id,
creator: req.user.id,
......@@ -1171,7 +1172,7 @@ async function listProject(req, res, next) {
let projectLzTypes = ["1"];
switch (req.body.menuType) {
case "xmlingxuan":
projectLzTypes = ["1","2"];
projectLzTypes = ["1", "2"];
break;
case "xmlx":
projectLzTypes = ["3", "4", "5"];
......@@ -1401,6 +1402,11 @@ async function startZaiJuece(req, res, next) {
if (!req.body.id) {
return res.sendError(errorMessage.resourceNotFound)
}
let approvers = await userModule.getTouGuanZfzProjectApprover(req.user.id);
if (!(approvers && approvers.length > 0)) {
return res.sendError({ code: '60002', msg: '项目已保存,请联系管理员为本公司添加【项目再决策】角色人员' });
}
req.body.projectFqZaiJueceUser = req.user.id; //发起人
let ret = await xiangmujuecegengxin(req.body, "12"); //再决策审批中
......@@ -1412,10 +1418,6 @@ async function startZaiJuece(req, res, next) {
projectName: req.body.projectName,
projectCode: req.body.projectCode,
});
let approvers = await userModule.getTouGuanZfzProjectApprover(req.user.id);
if (!(approvers && approvers.length > 0)) {
return res.sendError({ code: '60002', msg: '项目已保存,请联系管理员为本公司添加【项目再决策】角色人员' });
}
await DB.Message.create({
projectId: req.body.id,
creator: req.user.id,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment