|
@@ -122,6 +122,7 @@ module.exports = app => {
|
|
|
async dashboard(ctx) {
|
|
|
// 获取待审批的期
|
|
|
const auditStages = await ctx.service.stageAudit.getAuditStageByWap(ctx.session.sessionUser.accountId);
|
|
|
+ const subProjects = [];
|
|
|
for (const audit of auditStages) {
|
|
|
if (audit.status !== auditConst.stage.status.uncheck) {
|
|
|
const isLastage = await ctx.service.stage.isLastStage(audit.tid, audit.id);
|
|
@@ -132,6 +133,21 @@ module.exports = app => {
|
|
|
audit.end_qc_tp = ctx.helper.sum([audit.qc_tp, audit.pre_qc_tp, audit.qc_pc_tp]);
|
|
|
audit.pre_gather_tp = ctx.helper.add(audit.pre_contract_tp, audit.pre_qc_tp);
|
|
|
audit.end_gather_tp = ctx.helper.add(audit.gather_tp, audit.pre_gather_tp);
|
|
|
+ let sp = null;
|
|
|
+ if (audit.spid) {
|
|
|
+ if (ctx.helper._.findIndex(subProjects, { id: audit.spid }) !== -1) {
|
|
|
+ sp = ctx.helper._.find(subProjects, { id: audit.spid });
|
|
|
+ } else {
|
|
|
+ sp = await ctx.service.subProject.getDataById(audit.spid);
|
|
|
+ subProjects.push(sp);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (sp) {
|
|
|
+ const pageShow = JSON.parse(sp.page_show);
|
|
|
+ audit.closeWapYfSf = pageShow.closeWapYfSf || 0;
|
|
|
+ } else {
|
|
|
+ audit.closeWapYfSf = 0;
|
|
|
+ }
|
|
|
}
|
|
|
// 获取待审批的变更期
|
|
|
const auditChanges = await ctx.service.changeAudit.getAuditChangeByWap(ctx.session.sessionUser.accountId);
|