|
@@ -346,16 +346,13 @@ module.exports = app => {
|
|
responseData.data.spGroupList = await ctx.service.shenpiGroup.getGroupListByChangeType(ctx.tender.id, shenpiConst.sp_type.change, 'change');
|
|
responseData.data.spGroupList = await ctx.service.shenpiGroup.getGroupListByChangeType(ctx.tender.id, shenpiConst.sp_type.change, 'change');
|
|
} else {
|
|
} else {
|
|
// 获取所有项目参与者
|
|
// 获取所有项目参与者
|
|
- const accountList = await ctx.service.projectAccount.getAllDataByCondition({
|
|
|
|
- where: { project_id: ctx.session.sessionProject.id, enable: 1 },
|
|
|
|
- columns: ['id', 'name', 'company', 'role', 'enable', 'is_admin', 'account_group', 'mobile'],
|
|
|
|
- });
|
|
|
|
|
|
+ const accountList = await ctx.service.projectAccount.getAllSubProjectAccount(ctx.subProject);
|
|
responseData.data.accountList = accountList;
|
|
responseData.data.accountList = accountList;
|
|
const unitList = await ctx.service.constructionUnit.getAllDataByCondition({ where: { pid: ctx.session.sessionProject.id } });
|
|
const unitList = await ctx.service.constructionUnit.getAllDataByCondition({ where: { pid: ctx.session.sessionProject.id } });
|
|
responseData.data.accountGroup = unitList.map(item => {
|
|
responseData.data.accountGroup = unitList.map(item => {
|
|
const groupList = accountList.filter(item1 => item1.company === item.name);
|
|
const groupList = accountList.filter(item1 => item1.company === item.name);
|
|
return { groupName: item.name, groupList };
|
|
return { groupName: item.name, groupList };
|
|
- });
|
|
|
|
|
|
+ }).filter(x => { return x.groupList.length > 0; });
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
case 'get_shenpi_list':
|
|
case 'get_shenpi_list':
|
|
@@ -508,15 +505,12 @@ module.exports = app => {
|
|
renderData.changeUnits = changeConst.units;
|
|
renderData.changeUnits = changeConst.units;
|
|
if (!change.readOnly || ctx.session.sessionUser.is_admin) {
|
|
if (!change.readOnly || ctx.session.sessionUser.is_admin) {
|
|
// 获取所有项目参与者
|
|
// 获取所有项目参与者
|
|
- const accountList = await ctx.service.projectAccount.getAllDataByCondition({
|
|
|
|
- where: { project_id: ctx.session.sessionProject.id, enable: 1 },
|
|
|
|
- columns: ['id', 'name', 'company', 'role', 'enable', 'is_admin', 'account_group', 'mobile'],
|
|
|
|
- });
|
|
|
|
|
|
+ const accountList = await ctx.service.projectAccount.getAllSubProjectAccount(ctx.subProject);
|
|
renderData.accountList = accountList;
|
|
renderData.accountList = accountList;
|
|
renderData.accountGroup = unitList.map(item => {
|
|
renderData.accountGroup = unitList.map(item => {
|
|
const groupList = accountList.filter(item1 => item1.company === item.name);
|
|
const groupList = accountList.filter(item1 => item1.company === item.name);
|
|
return { groupName: item.name, groupList };
|
|
return { groupName: item.name, groupList };
|
|
- });
|
|
|
|
|
|
+ }).filter(x => { return x.groupList.length > 0; });
|
|
// 获取公司列表
|
|
// 获取公司列表
|
|
const companyList = await ctx.service.changeCompany.getAllDataByCondition({ where: { tid: ctx.tender.id } });
|
|
const companyList = await ctx.service.changeCompany.getAllDataByCondition({ where: { tid: ctx.tender.id } });
|
|
renderData.companyList = companyList;
|
|
renderData.companyList = companyList;
|
|
@@ -2266,16 +2260,13 @@ module.exports = app => {
|
|
// if ((ctx.change.status === audit.changeProject.status.uncheck || ctx.change.status === audit.changeProject.status.back) && (ctx.session.sessionUser.accountId === ctx.change.uid || ctx.tender.isTourist)) {
|
|
// if ((ctx.change.status === audit.changeProject.status.uncheck || ctx.change.status === audit.changeProject.status.back) && (ctx.session.sessionUser.accountId === ctx.change.uid || ctx.tender.isTourist)) {
|
|
// data.accountGroup = accountGroup;
|
|
// data.accountGroup = accountGroup;
|
|
// 获取所有项目参与者
|
|
// 获取所有项目参与者
|
|
- const accountList = await ctx.service.projectAccount.getAllDataByCondition({
|
|
|
|
- where: { project_id: ctx.session.sessionProject.id, enable: 1 },
|
|
|
|
- columns: ['id', 'name', 'company', 'role', 'enable', 'is_admin', 'account_group', 'mobile'],
|
|
|
|
- });
|
|
|
|
|
|
+ const accountList = await ctx.service.projectAccount.getAllSubProjectAccount(ctx.subProject);
|
|
renderData.accountList = accountList;
|
|
renderData.accountList = accountList;
|
|
const unitList = await ctx.service.constructionUnit.getAllDataByCondition({ where: { pid: ctx.session.sessionProject.id } });
|
|
const unitList = await ctx.service.constructionUnit.getAllDataByCondition({ where: { pid: ctx.session.sessionProject.id } });
|
|
renderData.accountGroup = unitList.map(item => {
|
|
renderData.accountGroup = unitList.map(item => {
|
|
const groupList = accountList.filter(item1 => item1.company === item.name);
|
|
const groupList = accountList.filter(item1 => item1.company === item.name);
|
|
return { groupName: item.name, groupList };
|
|
return { groupName: item.name, groupList };
|
|
- });
|
|
|
|
|
|
+ }).filter(x => { return x.groupList.length > 0; });
|
|
// 获取固定审批流列表
|
|
// 获取固定审批流列表
|
|
if (ctx.tender.info.shenpi.change === shenpiConst.sp_status.gdspl) {
|
|
if (ctx.tender.info.shenpi.change === shenpiConst.sp_status.gdspl) {
|
|
renderData.spGroupList = await ctx.service.shenpiGroup.getGroupListByChangeType(ctx.tender.id, shenpiConst.sp_type.change, 'changeProject');
|
|
renderData.spGroupList = await ctx.service.shenpiGroup.getGroupListByChangeType(ctx.tender.id, shenpiConst.sp_type.change, 'changeProject');
|
|
@@ -3126,16 +3117,13 @@ module.exports = app => {
|
|
// if ((ctx.change.status === audit.changeApply.status.uncheck || ctx.change.status === audit.changeApply.status.checkNo || ctx.change.status === audit.changeApply.status.revise) && (ctx.session.sessionUser.accountId === ctx.change.uid || ctx.tender.isTourist)) {
|
|
// if ((ctx.change.status === audit.changeApply.status.uncheck || ctx.change.status === audit.changeApply.status.checkNo || ctx.change.status === audit.changeApply.status.revise) && (ctx.session.sessionUser.accountId === ctx.change.uid || ctx.tender.isTourist)) {
|
|
// data.accountGroup = accountGroup;
|
|
// data.accountGroup = accountGroup;
|
|
// 获取所有项目参与者
|
|
// 获取所有项目参与者
|
|
- const accountList = await ctx.service.projectAccount.getAllDataByCondition({
|
|
|
|
- where: { project_id: ctx.session.sessionProject.id, enable: 1 },
|
|
|
|
- columns: ['id', 'name', 'company', 'role', 'enable', 'is_admin', 'account_group', 'mobile'],
|
|
|
|
- });
|
|
|
|
|
|
+ const accountList = await ctx.service.projectAccount.getAllSubProjectAccount(ctx.subProject);
|
|
renderData.accountList = accountList;
|
|
renderData.accountList = accountList;
|
|
const unitList = await ctx.service.constructionUnit.getAllDataByCondition({ where: { pid: ctx.session.sessionProject.id } });
|
|
const unitList = await ctx.service.constructionUnit.getAllDataByCondition({ where: { pid: ctx.session.sessionProject.id } });
|
|
renderData.accountGroup = unitList.map(item => {
|
|
renderData.accountGroup = unitList.map(item => {
|
|
const groupList = accountList.filter(item1 => item1.company === item.name);
|
|
const groupList = accountList.filter(item1 => item1.company === item.name);
|
|
return { groupName: item.name, groupList };
|
|
return { groupName: item.name, groupList };
|
|
- });
|
|
|
|
|
|
+ }).filter(x => { return x.groupList.length > 0; });
|
|
// }
|
|
// }
|
|
// 获取固定审批流列表
|
|
// 获取固定审批流列表
|
|
if (ctx.tender.info.shenpi.change === shenpiConst.sp_status.gdspl) {
|
|
if (ctx.tender.info.shenpi.change === shenpiConst.sp_status.gdspl) {
|
|
@@ -3960,16 +3948,13 @@ module.exports = app => {
|
|
// if ((ctx.change.status === audit.changePlan.status.uncheck || ctx.change.status === audit.changePlan.status.checkNo || ctx.change.status === audit.changePlan.status.revise) && (ctx.session.sessionUser.accountId === ctx.change.uid || ctx.tender.isTourist)) {
|
|
// if ((ctx.change.status === audit.changePlan.status.uncheck || ctx.change.status === audit.changePlan.status.checkNo || ctx.change.status === audit.changePlan.status.revise) && (ctx.session.sessionUser.accountId === ctx.change.uid || ctx.tender.isTourist)) {
|
|
// data.accountGroup = accountGroup;
|
|
// data.accountGroup = accountGroup;
|
|
// 获取所有项目参与者
|
|
// 获取所有项目参与者
|
|
- const accountList = await ctx.service.projectAccount.getAllDataByCondition({
|
|
|
|
- where: { project_id: ctx.session.sessionProject.id, enable: 1 },
|
|
|
|
- columns: ['id', 'name', 'company', 'role', 'enable', 'is_admin', 'account_group', 'mobile'],
|
|
|
|
- });
|
|
|
|
|
|
+ const accountList = await ctx.service.projectAccount.getAllSubProjectAccount(ctx.subProject);
|
|
renderData.accountList = accountList;
|
|
renderData.accountList = accountList;
|
|
const unitList = await ctx.service.constructionUnit.getAllDataByCondition({ where: { pid: ctx.session.sessionProject.id } });
|
|
const unitList = await ctx.service.constructionUnit.getAllDataByCondition({ where: { pid: ctx.session.sessionProject.id } });
|
|
renderData.accountGroup = unitList.map(item => {
|
|
renderData.accountGroup = unitList.map(item => {
|
|
const groupList = accountList.filter(item1 => item1.company === item.name);
|
|
const groupList = accountList.filter(item1 => item1.company === item.name);
|
|
return { groupName: item.name, groupList };
|
|
return { groupName: item.name, groupList };
|
|
- });
|
|
|
|
|
|
+ }).filter(x => { return x.groupList.length > 0; });
|
|
// 获取固定审批流列表
|
|
// 获取固定审批流列表
|
|
if (ctx.tender.info.shenpi.change === shenpiConst.sp_status.gdspl) {
|
|
if (ctx.tender.info.shenpi.change === shenpiConst.sp_status.gdspl) {
|
|
renderData.spGroupList = await ctx.service.shenpiGroup.getGroupListByChangeType(ctx.tender.id, shenpiConst.sp_type.change, 'changePlan');
|
|
renderData.spGroupList = await ctx.service.shenpiGroup.getGroupListByChangeType(ctx.tender.id, shenpiConst.sp_type.change, 'changePlan');
|