明树Git Lab

Commit 8264d2c3 authored by zfp1's avatar zfp1

update

parent 37d30c98
Pipeline #111312 passed with stage
in 3 seconds
...@@ -336,7 +336,7 @@ async function startLixiang(req, res, next) { ...@@ -336,7 +336,7 @@ async function startLixiang(req, res, next) {
projectCode: req.body.projectCode, projectCode: req.body.projectCode,
}); });
return res.sendData(ret); return res.sendData(ret);
} else if(req.body.projectLxzsUser) { } else if (req.body.projectLxzsUser) {
// 如果没有走初审、核准但是又有终审用户,则是终审退回 // 如果没有走初审、核准但是又有终审用户,则是终审退回
req.body.daibanUsers = [req.body.projectLxzsUser]; req.body.daibanUsers = [req.body.projectLxzsUser];
...@@ -370,7 +370,7 @@ async function startLixiang(req, res, next) { ...@@ -370,7 +370,7 @@ async function startLixiang(req, res, next) {
//更新信息和状态 //更新信息和状态
req.body.daibanUsers = approvers.map(o => o.id); req.body.daibanUsers = approvers.map(o => o.id);
let ret; let ret;
if(rett.type == 1) { if (rett.type == 1) {
//投管 //投管
ret = await xiangmulixianggengxin(req.body, "4"); //状态 2 -- 立项核准中 ret = await xiangmulixianggengxin(req.body, "4"); //状态 2 -- 立项核准中
} else { } else {
...@@ -687,7 +687,7 @@ async function xiangmujuecegengxin(body, projectLzType) { ...@@ -687,7 +687,7 @@ async function xiangmujuecegengxin(body, projectLzType) {
await Promise.all(pns8.map(item => { DB.ProjectZqrz.update(item, { where: { id: item.id } }) })); await Promise.all(pns8.map(item => { DB.ProjectZqrz.update(item, { where: { id: item.id } }) }));
// 处理决策审批意见 ProjectSpyjjc // 处理决策审批意见 ProjectSpyjjc
let projectSpyjjcs = body.projectSpyjjcs || []; let projectSpyjjcs = body.projectSpyjjcs || [];
let pnids12 = [],pns12 =[], newprojectSpyjjcs = []; let pnids12 = [], pns12 = [], newprojectSpyjjcs = [];
projectSpyjjcs.map(o => { if (!o.id) { if (!_.isEmpty(o)) { o.projectId = projectInfo.id; newprojectSpyjjcs.push(o); } } else { pnids12.push(o.id); pns12.push(o); } return o }); projectSpyjjcs.map(o => { if (!o.id) { if (!_.isEmpty(o)) { o.projectId = projectInfo.id; newprojectSpyjjcs.push(o); } } else { pnids12.push(o.id); pns12.push(o); } return o });
await DB.ProjectSpyjjc.destroy({ where: { projectId: projectInfo.id, id: { [Op.notIn]: pnids12 } } }); await DB.ProjectSpyjjc.destroy({ where: { projectId: projectInfo.id, id: { [Op.notIn]: pnids12 } } });
await DB.ProjectSpyjjc.bulkCreate(newprojectSpyjjcs); await DB.ProjectSpyjjc.bulkCreate(newprojectSpyjjcs);
...@@ -1221,7 +1221,7 @@ async function listProject(req, res, next) { ...@@ -1221,7 +1221,7 @@ async function listProject(req, res, next) {
projectLzTypes = ["1"]; projectLzTypes = ["1"];
break; break;
case "xmlx": case "xmlx":
projectLzTypes = ["2","3", "4", "5"]; projectLzTypes = ["2", "3", "4", "5"];
break; break;
case "xmjc": case "xmjc":
projectLzTypes = ["8", "9", "13"]; projectLzTypes = ["8", "9", "13"];
...@@ -1422,7 +1422,16 @@ async function getProFlowRecord(req, res, next) { ...@@ -1422,7 +1422,16 @@ async function getProFlowRecord(req, res, next) {
{ {
model: DB.User, model: DB.User,
as: 'creator', as: 'creator',
attributes: ["id", "name"] attributes: ["id", "name"],
include: [
{
model: DB.Depart,
as: 'departs',
// where: { del: 0 }, 当刚注册的用户 没有分配角色、部门时加上条件会查不到
attributes: ["id", "name", "parentIds", "parentId"],
through: { attributes: [] },
}
]
} }
] ]
}); });
......
...@@ -51,7 +51,7 @@ async function login(req, res, next) { ...@@ -51,7 +51,7 @@ async function login(req, res, next) {
model: DB.Depart, model: DB.Depart,
as: 'departs', as: 'departs',
// where: { del: 0 }, 当刚注册的用户 没有分配角色、部门时加上条件会查不到 // where: { del: 0 }, 当刚注册的用户 没有分配角色、部门时加上条件会查不到
attributes: ["id", "name"], attributes: ["id", "name", "parentIds", "parentId"],
through: { attributes: [] }, through: { attributes: [] },
} }
] ]
......
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