|
@@ -12,7 +12,7 @@ module.exports = app => {
|
|
|
ctx.body = { err: 1, msg: '缺少projectId参数', data: null };
|
|
ctx.body = { err: 1, msg: '缺少projectId参数', data: null };
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- const accountInfo = await this.ctx.service.projectAccount.getDataById(ctx.session.sessionUser.id);
|
|
|
|
|
|
|
+ const accountInfo = ctx.session.sessionUser;
|
|
|
const userPermission = accountInfo !== undefined && accountInfo.permission !== '' ? JSON.parse(accountInfo.permission) : null;
|
|
const userPermission = accountInfo !== undefined && accountInfo.permission !== '' ? JSON.parse(accountInfo.permission) : null;
|
|
|
if (userPermission !== null && userPermission.tender !== undefined && userPermission.tender.indexOf('1') !== -1) {
|
|
if (userPermission !== null && userPermission.tender !== undefined && userPermission.tender.indexOf('1') !== -1) {
|
|
|
const subProject = await this.ctx.service.subProject.getDataById(projectId);
|
|
const subProject = await this.ctx.service.subProject.getDataById(projectId);
|
|
@@ -90,7 +90,7 @@ module.exports = app => {
|
|
|
const monthProgress = [];
|
|
const monthProgress = [];
|
|
|
for (const s of stages) {
|
|
for (const s of stages) {
|
|
|
if (s.s_time) {
|
|
if (s.s_time) {
|
|
|
- let progress = monthProgress.find(function(x) {
|
|
|
|
|
|
|
+ let progress = monthProgress.find(function (x) {
|
|
|
return x.month === s.s_time;
|
|
return x.month === s.s_time;
|
|
|
});
|
|
});
|
|
|
if (!progress) {
|
|
if (!progress) {
|
|
@@ -100,7 +100,7 @@ module.exports = app => {
|
|
|
progress.tp = ctx.helper.add(ctx.helper.add(progress.tp, s.contract_tp), s.qc_tp);
|
|
progress.tp = ctx.helper.add(ctx.helper.add(progress.tp, s.contract_tp), s.qc_tp);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- monthProgress.sort(function(x, y) {
|
|
|
|
|
|
|
+ monthProgress.sort(function (x, y) {
|
|
|
return Date.parse(x.month) - Date.parse(y.month);
|
|
return Date.parse(x.month) - Date.parse(y.month);
|
|
|
});
|
|
});
|
|
|
let sum = 0;
|
|
let sum = 0;
|