| 
					
				 | 
			
			
				@@ -29,10 +29,12 @@ module.exports = app => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             // 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             // 。。。 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             let archiveList = []; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            let archiveEncryptionList = []; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             // console.log('tender.data.project_id: ' + tender.data.project_id); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (stage) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 // console.log('ctx.stage.id: ' + ctx.stage.id); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 const archives = await ctx.service.rptArchive.getPrjStgArchive(tender.data.project_id, ctx.stage.id); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                const archiveEncryptions = await ctx.service.rptArchiveEncryption.getPrjStgArchiveEncryption(tender.data.project_id, ctx.stage.id); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 stage_id = stage.id; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 stage_order = stage.order; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 stage_times = stage.times; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -40,9 +42,13 @@ module.exports = app => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 if (archives.length > 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     archiveList = JSON.parse(archives[0].content); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (archiveEncryptions.length > 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    archiveEncryptionList = JSON.parse(archiveEncryptions[0].content); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 // console.log('stageList[0].id: ' + stageList[0].id); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 const archives = await ctx.service.rptArchive.getPrjStgArchive(tender.data.project_id, stageList[stageList.length - 1].id); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                const archiveEncryptions = await ctx.service.rptArchiveEncryption.getPrjStgArchiveEncryption(tender.data.project_id, stageList[stageList.length - 1].id); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 // stage_id = stageList[0].id; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 // stage_order = stageList[0].order; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 // stage_times = stageList[0].times; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -50,6 +56,9 @@ module.exports = app => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 if (archives && archives.length > 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     archiveList = JSON.parse(archives[0].content); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (archiveEncryptions && archiveEncryptions.length > 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    archiveEncryptionList = JSON.parse(archiveEncryptions[0].content); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             let rpt_tpl_items = '{ customize: [], common: [] }'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (custTreeNodes.length > 0) { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -73,6 +82,7 @@ module.exports = app => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 stages: stageList, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 auditConst: auditConst.stage, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 archiveList, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                archiveEncryptionList, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             }; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             await this.layout('report/index_archive.ejs', renderData); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -82,12 +92,17 @@ module.exports = app => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             // ctx.body = await this._getReport(ctx, params); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             const archives = await ctx.service.rptArchive.getPrjStgArchive(params.prjId, params.stgId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            let archiveList = []; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            const archiveEncryptions = await ctx.service.rptArchiveEncryption.getPrjStgArchiveEncryption(params.prjId, params.stgId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            let archiveList = [], archiveEncryptionList = []; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (archives.length > 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 archiveList = JSON.parse(archives[0].content); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (archiveEncryptions.length > 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                archiveEncryptionList = JSON.parse(archiveEncryptions[0].content); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             ctx.body = { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 data: archiveList, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                encryptionData: archiveEncryptionList, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             }; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 |