| 
					
				 | 
			
			
				@@ -268,6 +268,9 @@ module.exports = app => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (!params.stage_select && copyCustomSelect) delete copyCustomSelect.stage_select; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             const pageRst = await getAllPagesCommon(ctx, rptTpl, params, JV.PAGING_OPTION_NORMAL, JV.OUTPUT_TYPE_NORMAL, this.app.baseDir, copyCustomSelect); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            for (const page of pageRst.items) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                page[JV.PROP_WATERMARK_CELLS] = []; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (params.stage_status !== 3) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 // 加水印 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 // fillWaterMark([pageRst]); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -357,9 +360,14 @@ module.exports = app => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             const params = JSON.parse(ctx.request.body.params); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             await this._saveCustomSelects(params); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             const pageRstArr = await getMultiRptsCommon(ctx, params, JV.OUTPUT_TYPE_NORMAL, this.app.baseDir); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            for (const pageRst of pageRstArr) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                for (const page of pageRst.items) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    page[JV.PROP_WATERMARK_CELLS] = []; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (params.stage_status !== 3) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 // 加水印 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                // fillWaterMark(pageRstArr); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                fillWaterMark(pageRstArr); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             const stgAudit = await ctx.service.stageAudit.getStageAudit(params.stage_id, params.stage_times); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             const roleRel = (params.stage_status === 3) ? (await ctx.service.roleRptRel.getRoleRptRelByDetailIds(params.tender_id, params.rpt_ids, params.stage_id)) : []; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1028,8 +1036,8 @@ function isFileExisted(file) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 function fillWaterMark(pageRstArray) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     for (const pageRst of pageRstArray) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        const orgWaterMarkWidth = 800; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        const orgWaterMarkHeight = 350; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        const orgWaterMarkWidth = 600; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        const orgWaterMarkHeight = 288; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         for (const page of pageRst.items) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             const w = page[JV.PROP_PAGE_MERGE_BORDER].Right - page[JV.PROP_PAGE_MERGE_BORDER].Left; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             const h = page[JV.PROP_PAGE_MERGE_BORDER].Bottom - page[JV.PROP_PAGE_MERGE_BORDER].Top; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1040,6 +1048,7 @@ function fillWaterMark(pageRstArray) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             const warterCell = { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 signature_name: JV.SIGNATURE_NAME_DUMMY, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 path: '/public/images/not_Approve.png', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                sign_path: '/public/images/not_Approve.png', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 pic: null, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 control: 'Title', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 style: 'Default_None', 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1050,8 +1059,8 @@ function fillWaterMark(pageRstArray) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     Bottom: bottom, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             }; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            console.log(page[JV.PROP_PAGE_MERGE_BORDER]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            page[JV.PROP_SIGNATURE_CELLS].push(warterCell); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            page[JV.PROP_WATERMARK_CELLS] = []; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            page[JV.PROP_WATERMARK_CELLS].push(warterCell); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1108,6 +1117,25 @@ async function encodeDummySignatureDataUri(pageRst, baseDir) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            for (const signature of page[JV.PROP_WATERMARK_CELLS]) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (signature.path !== '') { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    const filePath = baseDir + '/app' + signature.path; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        const res = await isFileExisted(filePath); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if (res) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            const bData = fs.readFileSync(filePath); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            const base64Str = bData.toString('base64'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            const datauri = 'data:image/png;base64,' + base64Str; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            signature.pic = datauri; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            signature.path = ''; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            console.log('文件不存在:' + filePath); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } catch (err) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        console.error(err); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 |