|
|
@@ -56,8 +56,15 @@ module.exports = app => {
|
|
|
},
|
|
|
};
|
|
|
const subProjects = await ctx.service.subProject.getSubProject(ctx.session.sessionUser.project_id, ctx.session.sessionUser.id, ctx.session.sessionUser.is_admin, true);
|
|
|
+ const accountInfo = await ctx.service.projectAccount.getDataById(ctx.session.sessionUser.accountId);
|
|
|
+ const userPermission = accountInfo !== undefined && accountInfo.permission !== '' ? JSON.parse(accountInfo.permission) : null;
|
|
|
+ let tendersCount = 0;
|
|
|
for (const subProject of subProjects) {
|
|
|
subProject.page_show = ctx.service.subProject.getPageShow(subProject.page_show);
|
|
|
+ if (tendersCount < 99) {
|
|
|
+ const subProjectTenders = await ctx.service.tender.getList('', userPermission, ctx.session.sessionUser.is_admin, '', subProject);
|
|
|
+ tendersCount += subProjectTenders.length;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
const dashboardShenpis = [];
|
|
|
@@ -103,6 +110,7 @@ module.exports = app => {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
const auditAdvance = await DashboardStats.auditSet(ctx, allAuditAdvance, subProjects, dashboardStatus, 'advance');
|
|
|
dashboardShenpis.push(...(auditAdvance.map(item => ({ ...item, type: 'advance', subType: 'advance' }))));
|
|
|
const auditChangeProject = await DashboardStats.auditSet(ctx, allAuditChangeProject, subProjects, dashboardStatus, 'changeProject');
|
|
|
@@ -177,7 +185,7 @@ module.exports = app => {
|
|
|
data: {
|
|
|
dashboardShenpis: ctx.helper._.orderBy(dashboardShenpis, ['start_audit', 'shenpi_time'], ['desc', 'asc']),
|
|
|
dashboardStatus: {
|
|
|
- all: dashboardStatus.all,
|
|
|
+ all: tendersCount,
|
|
|
dashboard: dashboardStatus.dashboard,
|
|
|
worry: dashboardStatus.worry,
|
|
|
early: dashboardStatus.early,
|