|
@@ -220,17 +220,29 @@
|
|
function _getAdhocDummyCells(srcCell, rstCells) {
|
|
function _getAdhocDummyCells(srcCell, rstCells) {
|
|
if (typeof srcCell.path === 'string') {
|
|
if (typeof srcCell.path === 'string') {
|
|
let paths = srcCell.path.split('!;!');
|
|
let paths = srcCell.path.split('!;!');
|
|
- for (let dtlPath of paths) {
|
|
|
|
|
|
+ for (let dtlPathIdx = 0; dtlPathIdx < paths.length; dtlPathIdx++) {
|
|
|
|
+ dtlPath = paths[dtlPathIdx];
|
|
|
|
+ // srcCell.picFeatures
|
|
if (dtlPath.length > 10) {
|
|
if (dtlPath.length > 10) {
|
|
- const newStampCell = {
|
|
|
|
- signature_name: 'dummy_pic',
|
|
|
|
- control: srcCell.control,
|
|
|
|
- style: srcCell.style,
|
|
|
|
- path: dtlPath,
|
|
|
|
- isStamp: true,
|
|
|
|
- area: srcCell.area,
|
|
|
|
- };
|
|
|
|
- rstCells.push(newStampCell);
|
|
|
|
|
|
+ let imgSrc = dtlPath;
|
|
|
|
+ if (dtlPath.indexOf(OSS_PATH) < 0 && dtlPath[0] !== '/') {
|
|
|
|
+ imgSrc = OSS_PATH + dtlPath;
|
|
|
|
+ }
|
|
|
|
+ let couldCreate = true;
|
|
|
|
+ if (srcCell.picFeatures && srcCell.picFeatures.length === paths.length && srcCell.picFeatures[dtlPathIdx] === 'not found!') {
|
|
|
|
+ couldCreate = false;
|
|
|
|
+ }
|
|
|
|
+ if (couldCreate) {
|
|
|
|
+ const newStampCell = {
|
|
|
|
+ signature_name: 'dummy_pic',
|
|
|
|
+ control: srcCell.control,
|
|
|
|
+ style: srcCell.style,
|
|
|
|
+ path: imgSrc,
|
|
|
|
+ isStamp: true,
|
|
|
|
+ area: srcCell.area,
|
|
|
|
+ };
|
|
|
|
+ rstCells.push(newStampCell);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -238,7 +250,7 @@
|
|
|
|
|
|
function downloadPDFReport(pageDataArr, pageSize, rpt_names, signatureRelArr, signatureRelInfo, refRptTplIds, STAGE_AUDIT) {
|
|
function downloadPDFReport(pageDataArr, pageSize, rpt_names, signatureRelArr, signatureRelInfo, refRptTplIds, STAGE_AUDIT) {
|
|
auditRptPrintHelper.currentDownloadIdx = 0;
|
|
auditRptPrintHelper.currentDownloadIdx = 0;
|
|
- const private_download = function(newPageDataArr, new_rpt_names) {
|
|
|
|
|
|
+ const private_download = function(newPageDataArr, new_rpt_names, dummyCells) {
|
|
if (auditRptPrintHelper.currentDownloadIdx < newPageDataArr.length) {
|
|
if (auditRptPrintHelper.currentDownloadIdx < newPageDataArr.length) {
|
|
let singleSignatureRelArr = [];
|
|
let singleSignatureRelArr = [];
|
|
for (let rIdx = 0; rIdx < signatureRelInfo.length; rIdx++) {
|
|
for (let rIdx = 0; rIdx < signatureRelInfo.length; rIdx++) {
|
|
@@ -252,16 +264,35 @@
|
|
let rptName = new_rpt_names[auditRptPrintHelper.currentDownloadIdx];
|
|
let rptName = new_rpt_names[auditRptPrintHelper.currentDownloadIdx];
|
|
auditRptPrintHelper.currentDownloadIdx++;
|
|
auditRptPrintHelper.currentDownloadIdx++;
|
|
JpcJsPDFHelper.outputAsPdf(pageData, pageSize, rptName, singleSignatureRelArr, STAGE_AUDIT); // 精确控制签名
|
|
JpcJsPDFHelper.outputAsPdf(pageData, pageSize, rptName, singleSignatureRelArr, STAGE_AUDIT); // 精确控制签名
|
|
- if (auditRptPrintHelper.currentDownloadIdx < newPageDataArr.length) setTimeout(private_download(newPageDataArr, new_rpt_names), 2000);
|
|
|
|
|
|
+ if (auditRptPrintHelper.currentDownloadIdx < newPageDataArr.length) {
|
|
|
|
+ setTimeout(private_download(newPageDataArr, new_rpt_names), 2000);
|
|
|
|
+ } else {
|
|
|
|
+ for (let pd of newPageDataArr) {
|
|
|
|
+ for (let pItem of pd.items) {
|
|
|
|
+ for (let idx = pItem.signature_cells.length - 1; idx >= 0; idx--) {
|
|
|
|
+ let pIdx = dummyCells.indexOf(pItem.signature_cells[idx]);
|
|
|
|
+ if (pIdx >= 0) {
|
|
|
|
+ pItem.signature_cells.splice(idx, 1);
|
|
|
|
+ dummyCells.splice(pIdx, 1);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
};
|
|
};
|
|
// 导出PDF审核优化代码
|
|
// 导出PDF审核优化代码
|
|
let picPaths = [], dummyPicAmt = 0, dummyCells = [];
|
|
let picPaths = [], dummyPicAmt = 0, dummyCells = [];
|
|
// 1. 先找有没有dummy
|
|
// 1. 先找有没有dummy
|
|
for (let pageData of pageDataArr) {
|
|
for (let pageData of pageDataArr) {
|
|
|
|
+ let tmpDummyCells = [];
|
|
for (let page of pageData.items) {
|
|
for (let page of pageData.items) {
|
|
for (let dCell of page.signature_cells) {
|
|
for (let dCell of page.signature_cells) {
|
|
- _getAdhocDummyCells(dCell, dummyCells);
|
|
|
|
|
|
+ _getAdhocDummyCells(dCell, tmpDummyCells);
|
|
|
|
+ }
|
|
|
|
+ if (tmpDummyCells.length > 0) {
|
|
|
|
+ page.signature_cells = page.signature_cells.concat(tmpDummyCells);
|
|
|
|
+ dummyCells = dummyCells.concat(tmpDummyCells);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -277,7 +308,7 @@
|
|
exceptionAmt++;
|
|
exceptionAmt++;
|
|
if ((handledAmt + exceptionAmt) === dummyPicAmt) {
|
|
if ((handledAmt + exceptionAmt) === dummyPicAmt) {
|
|
$.bootstrapLoading.end();
|
|
$.bootstrapLoading.end();
|
|
- private_download(pageDataArr, rpt_names);
|
|
|
|
|
|
+ private_download(pageDataArr, rpt_names, dummyCells);
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
let oFileReader = new FileReader();
|
|
let oFileReader = new FileReader();
|
|
@@ -287,7 +318,7 @@
|
|
handledAmt++;
|
|
handledAmt++;
|
|
if ((handledAmt + exceptionAmt) === dummyPicAmt) {
|
|
if ((handledAmt + exceptionAmt) === dummyPicAmt) {
|
|
$.bootstrapLoading.end();
|
|
$.bootstrapLoading.end();
|
|
- private_download(pageDataArr, rpt_names);
|
|
|
|
|
|
+ private_download(pageDataArr, rpt_names, dummyCells);
|
|
}
|
|
}
|
|
};
|
|
};
|
|
oFileReader.readAsDataURL(blob);
|
|
oFileReader.readAsDataURL(blob);
|