|
@@ -172,10 +172,23 @@
|
|
|
iniPage();
|
|
|
});
|
|
|
|
|
|
- function _getAdhocDummyCells(picPath) {
|
|
|
- const rst = [];
|
|
|
- //
|
|
|
- return rst;
|
|
|
+ function _getAdhocDummyCells(srcCell, rstCells) {
|
|
|
+ if (typeof srcCell.path === 'string') {
|
|
|
+ let paths = srcCell.path.split('!;!');
|
|
|
+ for (let dtlPath of paths) {
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
function downloadPDFReport(pageDataArr, pageSize, rpt_names, signatureRelArr, signatureRelInfo, refRptTplIds, STAGE_AUDIT) {
|
|
@@ -197,31 +210,17 @@
|
|
|
if (auditRptPrintHelper.currentDownloadIdx < newPageDataArr.length) setTimeout(private_download(newPageDataArr, new_rpt_names), 2000);
|
|
|
}
|
|
|
};
|
|
|
- // 导出PDF真实优化代码
|
|
|
- let picPaths = [], dummyPicAmt = 0, dummyCells = [], dupPicPath = [], dupPicCell = [];
|
|
|
+ // 导出PDF审核优化代码
|
|
|
+ let picPaths = [], dummyPicAmt = 0, dummyCells = [];
|
|
|
// 1. 先找有没有dummy
|
|
|
for (let pageData of pageDataArr) {
|
|
|
for (let page of pageData.items) {
|
|
|
for (let dCell of page.signature_cells) {
|
|
|
- if (dCell.signature_name.indexOf('dummy_pic') >= 0) {
|
|
|
- let picIdx = picPaths.indexOf(dCell.path);
|
|
|
- if (picIdx < 0) {
|
|
|
- picPaths.push(dCell.path);
|
|
|
- dummyCells.push(dCell);
|
|
|
- dummyPicAmt++;
|
|
|
- } else {
|
|
|
- let dPicIdx = dupPicPath.indexOf(dCell.path);
|
|
|
- if (dPicIdx < 0) {
|
|
|
- dupPicPath.push(dCell.path);
|
|
|
- dupPicCell.push([]);
|
|
|
- dPicIdx = dupPicPath.length - 1;
|
|
|
- }
|
|
|
- dupPicCell[dPicIdx].push(dCell);
|
|
|
- }
|
|
|
- }
|
|
|
+ _getAdhocDummyCells(dCell, dummyCells);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ dummyPicAmt = dummyCells.length;
|
|
|
if (dummyPicAmt > 0) {
|
|
|
// 2. 有则一个个请求下载图片,下载完后统一导出PDF
|
|
|
$.bootstrapLoading.start();
|
|
@@ -241,13 +240,6 @@
|
|
|
let base64 = e.target.result;
|
|
|
dCell.pic = base64;
|
|
|
handledAmt++;
|
|
|
- let pPathIdx = dupPicPath.indexOf(dCell.path);
|
|
|
- if (pPathIdx >= 0) {
|
|
|
- for (let dupCell of dupPicCell[pPathIdx]) {
|
|
|
- dupCell.pic = base64;
|
|
|
- }
|
|
|
- }
|
|
|
- // console.log(`已处理草图: ${handledAmt}`);
|
|
|
if ((handledAmt + exceptionAmt) === dummyPicAmt) {
|
|
|
$.bootstrapLoading.end();
|
|
|
private_download(pageDataArr, rpt_names);
|