Explorar o código

归档不显示签字签章标签问题(文本签字显示)

Tony Kang hai 1 ano
pai
achega
73baeca479
Modificáronse 1 ficheiros con 24 adicións e 1 borrados
  1. 24 1
      app/public/report/js/rpt_archive.js

+ 24 - 1
app/public/report/js/rpt_archive.js

@@ -627,18 +627,32 @@ let rptArchiveObj = {
         if (currentRptPageRst !== null) {
             try {
                 let signCells = [];
+                let txtSignCells = [];
                 if (PAGE_SHOW.isTextSignature) {
                     // 如果是显示文本签名,需要把相关签名移除(草图不动),等创建完后再加回来
                     // 批量归档的数据后台会处理(已经移除相关签名)
+                    // 如果有closeArchiveSignature标记,那么不显示文本文档(需要删除cells目录下的匹配cell,创建完后加回来)
                     currentRptPageRst.items.forEach((pageItem, pageIdx) => {
                         const dtlSignCells = [];
                         signCells.push(dtlSignCells);
+                        const dtlTxtSignCells = [];
+                        txtSignCells.push(dtlTxtSignCells);
                         for (let sCellIdx = pageItem.signature_cells.length - 1; sCellIdx >= 0; sCellIdx--) {
                             let sCell = pageItem.signature_cells[sCellIdx];
                             if (sCell.signature_name.indexOf('dummy_pic') < 0) {
-                            // if (sCell.signature_name !== 'dummy_pic') {
                                 dtlSignCells.push(sCell);
                                 pageItem.signature_cells.splice(sCellIdx, 1);
+                            } else {
+                                if (PAGE_SHOW.closeArchiveSignature) {
+                                    for (let cIdx = pageItem.cells.length - 1; cIdx >= 0; cIdx--) {
+                                        const cCell = pageItem.cells[cIdx];
+                                        if (cCell.area.Left === sCell.orgArea.Left && cCell.area.Right === sCell.orgArea.Right && cCell.area.Top === sCell.orgArea.Top && cCell.area.Bottom === sCell.orgArea.Bottom) {
+                                            dtlTxtSignCells.push(cCell);
+                                            pageItem.cells.splice(cIdx, 1);
+                                            break;
+                                        }
+                                    }
+                                }
                             }
                         }
                     });
@@ -653,6 +667,15 @@ let rptArchiveObj = {
                     });
                     signCells = null;
                 }
+                if (PAGE_SHOW.closeArchiveSignature) {
+                    currentRptPageRst.items.forEach((pageItem, pageIdx) => {
+                        txtSignCells[pageIdx].forEach((txtCell) => {
+                            pageItem.cells.push(txtCell);
+                        });
+                        txtSignCells[pageIdx] = null;
+                    });
+                    txtSignCells = null;
+                }
                 let pageEncryptInfo = rptArchiveObj._getPageSignatureInfo(currentRptPageRst, currentNode.refId);
                 // console.log(pageEncryptInfo);
                 let formData = new FormData();