|  | @@ -22,6 +22,7 @@ const path = require('path');
 | 
	
		
			
				|  |  |  const sendToWormhole = require('stream-wormhole');
 | 
	
		
			
				|  |  |  const scheduleConst = require('../const/schedule');
 | 
	
		
			
				|  |  |  const SumLoad = require('../lib/sum_load');
 | 
	
		
			
				|  |  | +const changeConst = require('../const/change');
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  module.exports = app => {
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -434,6 +435,35 @@ module.exports = app => {
 | 
	
		
			
				|  |  |                  const revise = await ctx.service.ledgerRevise.getLastestRevise(tender.id);
 | 
	
		
			
				|  |  |                  const tenders = await ctx.service.tender.getList('', null, 1);
 | 
	
		
			
				|  |  |                  const categoryData = await ctx.service.category.getAllCategory(ctx.session.sessionProject.id);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +                // 变更图表数据
 | 
	
		
			
				|  |  | +                const change_done_total = await ctx.service.change.getCountByStatus(tender.id, auditConst.filter.status.checked);
 | 
	
		
			
				|  |  | +                const change_doing_total = await ctx.service.change.getCountByStatus(tender.id, auditConst.filter.status.checking);
 | 
	
		
			
				|  |  | +                const change_uncheck_total = await ctx.service.change.getCountByStatus(tender.id, auditConst.filter.status.uncheck);
 | 
	
		
			
				|  |  | +                const change_status_total = [
 | 
	
		
			
				|  |  | +                    { num: change_uncheck_total, name: '待上报' },
 | 
	
		
			
				|  |  | +                    { num: change_doing_total, name: '审批中' },
 | 
	
		
			
				|  |  | +                    { num: change_done_total, name: '已完成' },
 | 
	
		
			
				|  |  | +                ];
 | 
	
		
			
				|  |  | +                const change_common_total = await ctx.service.change.getCountByQuality(tender.id, changeConst.quality.common.value);
 | 
	
		
			
				|  |  | +                const change_more_total = await ctx.service.change.getCountByQuality(tender.id, changeConst.quality.more.value);
 | 
	
		
			
				|  |  | +                const change_great_total = await ctx.service.change.getCountByQuality(tender.id, changeConst.quality.great.value);
 | 
	
		
			
				|  |  | +                const change_quality_total = [
 | 
	
		
			
				|  |  | +                    { num: change_common_total, name: '一般变更' },
 | 
	
		
			
				|  |  | +                    { num: change_more_total, name: '较大变更' },
 | 
	
		
			
				|  |  | +                    { num: change_great_total, name: '重大变更' },
 | 
	
		
			
				|  |  | +                ];
 | 
	
		
			
				|  |  | +                // 调差最新期数据
 | 
	
		
			
				|  |  | +                const materials = await ctx.service.material.getValidMaterials(ctx.tender.id);
 | 
	
		
			
				|  |  | +                let materialData = null;
 | 
	
		
			
				|  |  | +                if (materials && materials.length > 0) {
 | 
	
		
			
				|  |  | +                    materialData = materials[0];
 | 
	
		
			
				|  |  | +                    materialData.curAuditor = await ctx.service.materialAudit.getAuditorByStatus(materialData.id, materialData.status, materialData.times);
 | 
	
		
			
				|  |  | +                    const times = materialData.status === auditConst.material.status.checkNo ? materialData.times - 1 : materialData.times;
 | 
	
		
			
				|  |  | +                    materialData.auditors = await ctx.service.materialAudit.getAuditors(materialData.id, times);
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +                // 修订完成数目
 | 
	
		
			
				|  |  | +                const reviseNum = await ctx.service.ledgerRevise.count({ tid: tender.id, status: auditConst.revise.status.checked });
 | 
	
		
			
				|  |  |                  const renderData = {
 | 
	
		
			
				|  |  |                      tenders,
 | 
	
		
			
				|  |  |                      categoryData,
 | 
	
	
		
			
				|  | @@ -447,6 +477,10 @@ module.exports = app => {
 | 
	
		
			
				|  |  |                      stages: stages.reverse(),
 | 
	
		
			
				|  |  |                      monthProgress,
 | 
	
		
			
				|  |  |                      audit: auditConst,
 | 
	
		
			
				|  |  | +                    change_status_total,
 | 
	
		
			
				|  |  | +                    change_quality_total,
 | 
	
		
			
				|  |  | +                    materialData,
 | 
	
		
			
				|  |  | +                    reviseNum,
 | 
	
		
			
				|  |  |                      jsFiles: this.app.jsFiles.common.concat(this.app.jsFiles.tender.tenderInfo),
 | 
	
		
			
				|  |  |                  };
 | 
	
		
			
				|  |  |                  if (ctx.session.sessionUser.is_admin) {
 |