|
@@ -628,33 +628,37 @@ let rptArchiveObj = {
|
|
try {
|
|
try {
|
|
let signCells = [];
|
|
let signCells = [];
|
|
let txtSignCells = [];
|
|
let txtSignCells = [];
|
|
|
|
+ let dummyTxtSignCells = [];
|
|
|
|
+ const restoreCells = (srcCells, targetCellsStr) => {
|
|
|
|
+ if (srcCells.length > 0) {
|
|
|
|
+ currentRptPageRst.items.forEach((pageItem, pageIdx) => {
|
|
|
|
+ srcCells[pageIdx].forEach((srcCell) => {
|
|
|
|
+ pageItem[targetCellsStr].push(srcCell);
|
|
|
|
+ });
|
|
|
|
+ srcCells[pageIdx] = null;
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ };
|
|
if (PAGE_SHOW.isTextSignature) {
|
|
if (PAGE_SHOW.isTextSignature) {
|
|
// 如果是显示文本签名,需要把相关签名移除(草图不动),等创建完后再加回来
|
|
// 如果是显示文本签名,需要把相关签名移除(草图不动),等创建完后再加回来
|
|
// 批量归档的数据后台会处理(已经移除相关签名)
|
|
// 批量归档的数据后台会处理(已经移除相关签名)
|
|
currentRptPageRst.items.forEach((pageItem, pageIdx) => {
|
|
currentRptPageRst.items.forEach((pageItem, pageIdx) => {
|
|
const dtlSignCells = [];
|
|
const dtlSignCells = [];
|
|
signCells.push(dtlSignCells);
|
|
signCells.push(dtlSignCells);
|
|
|
|
+ const dtlTxtSignCells = [];
|
|
|
|
+ txtSignCells.push(dtlTxtSignCells);
|
|
for (let sCellIdx = pageItem.signature_cells.length - 1; sCellIdx >= 0; sCellIdx--) {
|
|
for (let sCellIdx = pageItem.signature_cells.length - 1; sCellIdx >= 0; sCellIdx--) {
|
|
let sCell = pageItem.signature_cells[sCellIdx];
|
|
let sCell = pageItem.signature_cells[sCellIdx];
|
|
if (sCell.signature_name.indexOf('dummy_pic') < 0) {
|
|
if (sCell.signature_name.indexOf('dummy_pic') < 0) {
|
|
dtlSignCells.push(sCell);
|
|
dtlSignCells.push(sCell);
|
|
pageItem.signature_cells.splice(sCellIdx, 1);
|
|
pageItem.signature_cells.splice(sCellIdx, 1);
|
|
- }
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- if (PAGE_SHOW.closeArchiveSignature) {
|
|
|
|
- // 如果有closeArchiveSignature标记,那么不显示文本文档(需要删除cells目录下的匹配cell,创建完后加回来)
|
|
|
|
- // closeArchiveSignature和isTextSignature不能在一起判断,是2个独立事件!!!
|
|
|
|
- currentRptPageRst.items.forEach((pageItem, pageIdx) => {
|
|
|
|
- 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) {
|
|
|
|
|
|
+ } else if (PAGE_SHOW.closeArchiveSignature) {
|
|
|
|
+ // 如果还有closeArchiveSignature标记,那么不显示文本文档(需要删除cells目录下的匹配cell(Value不为空串))
|
|
for (let cIdx = pageItem.cells.length - 1; cIdx >= 0; cIdx--) {
|
|
for (let cIdx = pageItem.cells.length - 1; cIdx >= 0; cIdx--) {
|
|
const cCell = pageItem.cells[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) {
|
|
|
|
|
|
+ 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 &&
|
|
|
|
+ cCell.Value !== '') {
|
|
dtlTxtSignCells.push(cCell);
|
|
dtlTxtSignCells.push(cCell);
|
|
pageItem.cells.splice(cIdx, 1);
|
|
pageItem.cells.splice(cIdx, 1);
|
|
break;
|
|
break;
|
|
@@ -663,27 +667,54 @@ let rptArchiveObj = {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
+ } else if (PAGE_SHOW.closeArchiveSignature) {
|
|
|
|
+ // 这里还有一个场景需要考虑:签名是图片且选择了签名,又不归档输出,
|
|
|
|
+ const rrSigns = [];
|
|
|
|
+ ROLE_REL_LIST.forEach(role_rel => {
|
|
|
|
+ if (role_rel.sign_output && role_rel.sign_output.includes(NORMAL_SIGN_STR)) {
|
|
|
|
+ rrSigns.push(role_rel.signature_name);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ if (rrSigns.length > 0) {
|
|
|
|
+ currentRptPageRst.items.forEach((pageItem, pageIdx) => {
|
|
|
|
+ const dtlSignCells = [];
|
|
|
|
+ const dtlDummyCells = [];
|
|
|
|
+ signCells.push(dtlSignCells);
|
|
|
|
+ dummyTxtSignCells.push(dtlDummyCells);
|
|
|
|
+ for (let sCellIdx = pageItem.signature_cells.length - 1; sCellIdx >= 0; sCellIdx--) {
|
|
|
|
+ let sCell = pageItem.signature_cells[sCellIdx];
|
|
|
|
+ if (rrSigns.includes(sCell.signature_name)) {
|
|
|
|
+ dtlSignCells.push(sCell);
|
|
|
|
+ pageItem.signature_cells.splice(sCellIdx, 1);
|
|
|
|
+ // 还得加一个dummy cell,处理边框用的
|
|
|
|
+ const newCell = {
|
|
|
|
+ font: 'Footer',
|
|
|
|
+ control: sCell.control,
|
|
|
|
+ style: sCell.style,
|
|
|
|
+ Value: '',
|
|
|
|
+ area: { Left: sCell.area.Left, Right: sCell.area.Right, Top: sCell.area.Top, Bottom: sCell.area.Bottom },
|
|
|
|
+ };
|
|
|
|
+ dtlDummyCells.push(newCell);
|
|
|
|
+ pageItem.cells.push(newCell);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
}
|
|
}
|
|
let doc = JpcJsPDFHelper._createPdf(currentRptPageRst, rptControlObj.getCurrentPageSize(), ROLE_REL_LIST, STAGE_AUDIT);
|
|
let doc = JpcJsPDFHelper._createPdf(currentRptPageRst, rptControlObj.getCurrentPageSize(), ROLE_REL_LIST, STAGE_AUDIT);
|
|
- if (PAGE_SHOW.isTextSignature) {
|
|
|
|
|
|
+ restoreCells(signCells, 'signature_cells');
|
|
|
|
+ signCells = null;
|
|
|
|
+ restoreCells(txtSignCells, 'cells');
|
|
|
|
+ txtSignCells = null;
|
|
|
|
+ if (dummyTxtSignCells.length === currentRptPageRst.items.length) {
|
|
currentRptPageRst.items.forEach((pageItem, pageIdx) => {
|
|
currentRptPageRst.items.forEach((pageItem, pageIdx) => {
|
|
- signCells[pageIdx].forEach((signCell) => {
|
|
|
|
- pageItem.signature_cells.push(signCell);
|
|
|
|
|
|
+ dummyTxtSignCells[pageIdx].forEach((dummyCell) => {
|
|
|
|
+ const idx = pageItem.cells.indexOf(dummyCell);
|
|
|
|
+ if (idx >= 0) pageItem.cells.splice(idx, 1);
|
|
});
|
|
});
|
|
- signCells[pageIdx] = null;
|
|
|
|
- });
|
|
|
|
- signCells = null;
|
|
|
|
- }
|
|
|
|
- if (PAGE_SHOW.closeArchiveSignature) {
|
|
|
|
- currentRptPageRst.items.forEach((pageItem, pageIdx) => {
|
|
|
|
- if (txtSignCells[pageIdx]) {
|
|
|
|
- txtSignCells[pageIdx].forEach((txtCell) => {
|
|
|
|
- pageItem.cells.push(txtCell);
|
|
|
|
- });
|
|
|
|
- txtSignCells[pageIdx] = null;
|
|
|
|
- }
|
|
|
|
|
|
+ dummyTxtSignCells[pageIdx] = null;
|
|
});
|
|
});
|
|
- txtSignCells = null;
|
|
|
|
|
|
+ dummyTxtSignCells = null;
|
|
}
|
|
}
|
|
let pageEncryptInfo = rptArchiveObj._getPageSignatureInfo(currentRptPageRst, currentNode.refId);
|
|
let pageEncryptInfo = rptArchiveObj._getPageSignatureInfo(currentRptPageRst, currentNode.refId);
|
|
// console.log(pageEncryptInfo);
|
|
// console.log(pageEncryptInfo);
|
|
@@ -703,8 +734,6 @@ let rptArchiveObj = {
|
|
archiveUrl = `/tender/report_api/addParentChildrenArchive/${PROJECT_ID}/${current_stage_id}/${currentNode.refId}/${JSON.stringify(currentRptPageRst.splitArcPages)};${JSON.stringify(currentRptPageRst.splitArcPagesInfo)};${currentRptPageRst.items.length}`;
|
|
archiveUrl = `/tender/report_api/addParentChildrenArchive/${PROJECT_ID}/${current_stage_id}/${currentNode.refId}/${JSON.stringify(currentRptPageRst.splitArcPages)};${JSON.stringify(currentRptPageRst.splitArcPagesInfo)};${currentRptPageRst.items.length}`;
|
|
}
|
|
}
|
|
postDataWithFile(archiveUrl, formData, function (result) {
|
|
postDataWithFile(archiveUrl, formData, function (result) {
|
|
- // postDataWithFile('/tender/report_api/addArchive/' + PROJECT_ID + '/' + current_stage_id + '/' + currentNode.refId, formData, function (result) {
|
|
|
|
- // postDataWithFile('/tender/report_api/addParentChildrenArchive/' + PROJECT_ID + '/' + current_stage_id + '/' + currentNode.refId, formData, function (result) { // 测试
|
|
|
|
// 成功后,更新当前页面
|
|
// 成功后,更新当前页面
|
|
//*
|
|
//*
|
|
if (result.updatedRst) {
|
|
if (result.updatedRst) {
|