|
|
@@ -47,6 +47,7 @@ module.exports = app => {
|
|
|
const allAuditCostStageLedger = await ctx.service.costStageAudit.getAuditStage('ledger', ctx.session.sessionUser.accountId);
|
|
|
const allAuditCostStageBook = await ctx.service.costStageAudit.getAuditStage('book', ctx.session.sessionUser.accountId);
|
|
|
const allAuditCostStageAnalysis = await ctx.service.costStageAudit.getAuditStage('analysis', ctx.session.sessionUser.accountId);
|
|
|
+ const allAuditCostStageDuty = await ctx.service.costStageAudit.getAuditStage('duty', ctx.session.sessionUser.accountId);
|
|
|
const pa = await ctx.service.projectAccount.getDataById(ctx.session.sessionUser.accountId);
|
|
|
const auditShenpiTenders = await ctx.service.ledgerAudit.getDonesByAudit(ctx.session.sessionUser.accountId);
|
|
|
const auditShenpiStages = await ctx.service.stageAudit.getDonesByAudit(ctx.session.sessionUser.accountId);
|
|
|
@@ -66,6 +67,7 @@ module.exports = app => {
|
|
|
const auditShenpiCostStageLedger = await ctx.service.costStageAudit.getDonesByAudit('ledger', ctx.session.sessionUser.accountId);
|
|
|
const auditShenpiCostStageBook = await ctx.service.costStageAudit.getDonesByAudit('book', ctx.session.sessionUser.accountId);
|
|
|
const auditShenpiCostStageAnalysis = await ctx.service.costStageAudit.getDonesByAudit('analysis', ctx.session.sessionUser.accountId);
|
|
|
+ const auditShenpiCostStageDuty = await ctx.service.costStageAudit.getDonesByAudit('duty', ctx.session.sessionUser.accountId);
|
|
|
const dashboardStatus = {
|
|
|
all: 0,
|
|
|
dashboard: 0,
|
|
|
@@ -90,6 +92,7 @@ module.exports = app => {
|
|
|
costStageLedger: 0,
|
|
|
costStageBook: 0,
|
|
|
costStageAnalysis: 0,
|
|
|
+ costStageDuty: 0,
|
|
|
},
|
|
|
};
|
|
|
let noticeList = [];
|
|
|
@@ -133,6 +136,8 @@ module.exports = app => {
|
|
|
noticeList.push(...ctx.helper.addKeyValue4ObjArray(spCostStageBook, 'shenpi_type', 'costStageBook'));
|
|
|
const spCostStageAnalysis = subProject.page_show.cost ? ctx.helper._.filter(auditShenpiCostStageAnalysis, { spid: subProject.id }) : [];
|
|
|
noticeList.push(...ctx.helper.addKeyValue4ObjArray(spCostStageAnalysis, 'shenpi_type', 'costStageAnalysis'));
|
|
|
+ const spCostStageDuty = subProject.page_show.cost ? ctx.helper._.filter(auditShenpiCostStageDuty, { spid: subProject.id }) : [];
|
|
|
+ noticeList.push(...ctx.helper.addKeyValue4ObjArray(spCostStageDuty, 'shenpi_type', 'costStageDuty'));
|
|
|
}
|
|
|
const noticeDayList = [];
|
|
|
noticeList = ctx.helper._.orderBy(noticeList, ['shenpi_time'], ['desc']);
|
|
|
@@ -180,6 +185,8 @@ module.exports = app => {
|
|
|
dashboardShenpis.push(...auditCostStageBook);
|
|
|
const auditCostStageAnalysis = await this.auditSet(ctx, allAuditCostStageAnalysis, subProjects, dashboardStatus, 'costStageAnalysis');
|
|
|
dashboardShenpis.push(...auditCostStageAnalysis);
|
|
|
+ const auditCostStageDuty = await this.auditSet(ctx, allAuditCostStageDuty, subProjects, dashboardStatus, 'costStageDuty');
|
|
|
+ dashboardShenpis.push(...auditCostStageDuty);
|
|
|
// console.log(ctx.helper._.orderBy(dashboardShenpis, ['start_audit', 'shenpi_time'], ['desc', 'desc']));
|
|
|
const projectData = await ctx.service.project.getDataById(ctx.session.sessionProject.id);
|
|
|
// 获取销售人员数据
|
|
|
@@ -335,6 +342,7 @@ module.exports = app => {
|
|
|
case 'costStageLedger':
|
|
|
case 'costStageBook':
|
|
|
case 'costStageAnalysis':
|
|
|
+ case 'costStageDuty':
|
|
|
if (!sp.page_show.cost) closeType = true;
|
|
|
calcTime = t.create_time;
|
|
|
break;
|
|
|
@@ -390,6 +398,7 @@ module.exports = app => {
|
|
|
const auditCostStageLedger = ctx.subProject.page_show.cost ? await ctx.service.costStageAudit.getAuditStage('ledger', ctx.session.sessionUser.accountId, ctx.subProject.id) : [];
|
|
|
const auditCostStageBook = ctx.subProject.page_show.cost ? await ctx.service.costStageAudit.getAuditStage('book', ctx.session.sessionUser.accountId, ctx.subProject.id) : [];
|
|
|
const auditCostStageAnalysis = ctx.subProject.page_show.cost ? await ctx.service.costStageAudit.getAuditStage('analysis', ctx.session.sessionUser.accountId, ctx.subProject.id) : [];
|
|
|
+ const auditCostStageDuty = ctx.subProject.page_show.cost ? await ctx.service.costStageAudit.getAuditStage('duty', ctx.session.sessionUser.accountId, ctx.subProject.id) : [];
|
|
|
const pa = await ctx.service.projectAccount.getDataById(ctx.session.sessionUser.accountId);
|
|
|
const noticeList = await ctx.service.noticePush.getNotice(ctx.session.sessionProject.id, pa.id, ctx.subProject.id);
|
|
|
const projectData = await ctx.service.project.getDataById(ctx.session.sessionProject.id);
|
|
|
@@ -427,6 +436,7 @@ module.exports = app => {
|
|
|
shenpi_count.push({ count: await ctx.service.costStageAudit.getCountByChecked('ledger', ctx.session.sessionUser.accountId, ctx.subProject.id), name: '成本报审' });
|
|
|
shenpi_count.push({ count: await ctx.service.costStageAudit.getCountByChecked('book', ctx.session.sessionUser.accountId, ctx.subProject.id), name: '财务账面' });
|
|
|
shenpi_count.push({ count: await ctx.service.costStageAudit.getCountByChecked('analysis', ctx.session.sessionUser.accountId, ctx.subProject.id), name: '成本分析' });
|
|
|
+ shenpi_count.push({ count: await ctx.service.costStageAudit.getCountByChecked('duty', ctx.session.sessionUser.accountId, ctx.subProject.id), name: '责任成本' });
|
|
|
}
|
|
|
// shenpi_count.push({ count: await ctx.service.advanceAudit.getCountByChecked(ctx.session.sessionUser.accountId), name: '预付款' });
|
|
|
const total_count = ctx.app._.sumBy(shenpi_count, 'count');
|
|
|
@@ -448,6 +458,7 @@ module.exports = app => {
|
|
|
ctx.subProject.page_show.cost ? await ctx.service.costStageAudit.getLastEndTimeByChecked('ledger', ctx.session.sessionUser.accountId, ctx.subProject.id) : null,
|
|
|
ctx.subProject.page_show.cost ? await ctx.service.costStageAudit.getLastEndTimeByChecked('book', ctx.session.sessionUser.accountId, ctx.subProject.id) : null,
|
|
|
ctx.subProject.page_show.cost ? await ctx.service.costStageAudit.getLastEndTimeByChecked('analysis', ctx.session.sessionUser.accountId, ctx.subProject.id) : null,
|
|
|
+ ctx.subProject.page_show.cost ? await ctx.service.costStageAudit.getLastEndTimeByChecked('duty', ctx.session.sessionUser.accountId, ctx.subProject.id) : null,
|
|
|
];
|
|
|
const last_time = ctx.app._.max(shenpi_lastime);
|
|
|
// console.log(ctx.app._.max(shenpi_lastime), ctx.helper.calcDayNum(last_time));
|
|
|
@@ -471,6 +482,7 @@ module.exports = app => {
|
|
|
auditCostStageLedger,
|
|
|
auditCostStageBook,
|
|
|
auditCostStageAnalysis,
|
|
|
+ auditCostStageDuty,
|
|
|
shenpi_count,
|
|
|
total_count,
|
|
|
last_day: ctx.helper.calcDayNum(last_time),
|