瀏覽代碼

审核报表功能

Tony Kang 2 年之前
父節點
當前提交
6cdf5240bc

+ 4 - 0
app/public/report/js/jpc_output.js

@@ -609,6 +609,10 @@ let JpcCanvasOutput = {
                 let cell = page.cells[j];
                 private_drawCell(cell, fonts, styles, controls, newPageMergeBand);
             }
+            for (let j = 0; j < page.interact_cells.length; j++) {
+                let cell = page.interact_cells[j];
+                private_drawCell(cell, fonts, styles, controls, newPageMergeBand);
+            }
             //电子签名
             if (page.signature_cells && page.signature_cells.length > 0) {
               

+ 15 - 0
app/public/report/js/rpt_jsexcel.js

@@ -359,6 +359,7 @@ function _setupPgBrks(pageData) {
         const page = pageData.items[i];
         const maxBottomArr = [];
         _insertMaxBottom(page[JV.PROP_CELLS], maxBottomArr);
+        _insertMaxBottom(page[JV.PROP_INTERACT_CELLS], maxBottomArr);
         _insertMaxBottom(page[JV.PROP_SIGNATURE_CELLS], maxBottomArr, true);
         _insertMaxBottom(page[JV.PROP_SIGNATURE_DATE_CELLS], maxBottomArr);
         _insertMaxBottom(page[JV.PROP_SIGNATURE_AUDIT_CELLS], maxBottomArr);
@@ -503,6 +504,10 @@ function preAnalyzePos(pageData, sheetData, xPos, yPos, yMultiPos) {
             cell = theShtData[JV.PROP_CELLS][i];
             private_set_cell_pos(cell, theXPos, theYPos);
         }
+        for (let i = 0; i < theShtData[JV.PROP_INTERACT_CELLS].length; i++) {
+            cell = theShtData[JV.PROP_INTERACT_CELLS][i];
+            private_set_cell_pos(cell, theXPos, theYPos);
+        }
         for (let i = 0; i < theShtData[JV.PROP_SIGNATURE_CELLS].length; i++) {
             cell = theShtData[JV.PROP_SIGNATURE_CELLS][i];
             private_set_cell_pos(cell, theXPos, theYPos);
@@ -864,6 +869,7 @@ function writeSheet(pageData, sheetData, paperSize, sharedStrList, stylesObj, ap
         if (sheetData) {
             // self_setMergedCells(sheetData, yPos, 0);
             self_setMergedCells(sheetData[JV.PROP_CELLS], yPos, 0);
+            self_setMergedCells(sheetData[JV.PROP_INTERACT_CELLS], yPos, 0);
             if (sheetData[JV.PROP_SIGNATURE_DATE_CELLS]) self_setMergedCells(sheetData[JV.PROP_SIGNATURE_DATE_CELLS], yPos, 0);
             if (sheetData[JV.PROP_SIGNATURE_AUDIT_CELLS]) self_setMergedCells(sheetData[JV.PROP_SIGNATURE_AUDIT_CELLS], yPos, 0);
         } else {
@@ -873,6 +879,7 @@ function writeSheet(pageData, sheetData, paperSize, sharedStrList, stylesObj, ap
                 const tmpPos = yMultiPos[i];
                 // self_setMergedCells(shtItemData, tmpPos, osY);
                 self_setMergedCells(shtItemData[JV.PROP_CELLS], tmpPos, osY);
+                self_setMergedCells(shtItemData[JV.PROP_INTERACT_CELLS], tmpPos, osY);
                 if (shtItemData[JV.PROP_SIGNATURE_DATE_CELLS]) self_setMergedCells(shtItemData[JV.PROP_SIGNATURE_DATE_CELLS], tmpPos, osY);
                 if (shtItemData[JV.PROP_SIGNATURE_AUDIT_CELLS]) self_setMergedCells(shtItemData[JV.PROP_SIGNATURE_AUDIT_CELLS], tmpPos, osY);
                 osY += tmpPos.length - 2;
@@ -942,6 +949,7 @@ function writeSheet(pageData, sheetData, paperSize, sharedStrList, stylesObj, ap
             }
             // 2. then fill up the cell style-ids and values
             self_create_cell(theShtData[JV.PROP_CELLS], rows, theYPos);
+            self_create_cell(theShtData[JV.PROP_INTERACT_CELLS], rows, theYPos);
             self_create_cell(theShtData[JV.PROP_SIGNATURE_DATE_CELLS], rows, theYPos);
             self_create_cell(theShtData[JV.PROP_SIGNATURE_AUDIT_CELLS], rows, theYPos);
             // fsUtil.writeObjToFile(newPageData, 'D:/GitHome/ConstructionOperation/tmp/combinedHeader.js');
@@ -1747,6 +1755,7 @@ const excelExportUtil = {
                     }
                     // 1.2.1 重新设置普通cells的Top Bottom坐标
                     checkAndResetCellYPos(pageDataArray[i].items[j][JV.PROP_CELLS]);
+                    checkAndResetCellYPos(pageDataArray[i].items[j][JV.PROP_INTERACT_CELLS]);
                     // 1.2.2 重新设置电子签名cells的Top Bottom坐标
                     checkAndResetCellYPos(pageDataArray[i].items[j][JV.PROP_SIGNATURE_CELLS]);
                     // 1.2.3 重新设置电子签名日期cells的Top Bottom坐标
@@ -1775,6 +1784,12 @@ const excelExportUtil = {
                         pageItem[JV.PROP_CELLS].push(pageDataArray[i].items[j][JV.PROP_CELLS][k]);
                     }
                 }
+                pageItem[JV.PROP_INTERACT_CELLS] = [];
+                for (let j = 0; j < pageDataArray[i].items.length; j++) {
+                    for (let k = 0; k < pageDataArray[i].items[j][JV.PROP_INTERACT_CELLS].length; k++) {
+                        pageItem[JV.PROP_INTERACT_CELLS].push(pageDataArray[i].items[j][JV.PROP_INTERACT_CELLS][k]);
+                    }
+                }
                 pageItem[JV.PROP_SIGNATURE_CELLS] = [];
                 for (let j = 0; j < pageDataArray[i].items.length; j++) {
                     for (let k = 0; k < pageDataArray[i].items[j][JV.PROP_SIGNATURE_CELLS].length; k++) {

+ 4 - 2
app/public/report/js/rpt_jspdf.js

@@ -99,8 +99,10 @@ let JpcJsPDFHelper = {
                     newPageMergeBand[JV.PROP_TOP] = page[JV.PROP_PAGE_MERGE_BORDER][JV.PROP_TOP];
                     newPageMergeBand[JV.PROP_BOTTOM] = page[JV.PROP_PAGE_MERGE_BORDER][JV.PROP_BOTTOM];
                 }
-                for (let j = 0; j < page.cells.length; j++) {
-                    let cell = page.cells[j];
+                for (let cell of page.cells) {
+                    private_drawCell(doc, ctx, cell, fonts, styles, controls, newPageMergeBand);
+                }
+                for (cell of page.interact_cells) {
                     private_drawCell(doc, ctx, cell, fonts, styles, controls, newPageMergeBand);
                 }
                 // 计量有电子签名日期,在处理上与cells一样

+ 4 - 18
app/public/report/js/rpt_main.js

@@ -1231,7 +1231,7 @@ function downloadPDFReport(pageDataArr, pageSize, rpt_names, signatureRelArr, si
         return rst;
     };
 
-    const private_download = function(newPageDataArr, new_rpt_rames) {
+    const private_download = function(newPageDataArr, new_rpt_names) {
         if (rptControlObj.currentDownloadIdx < newPageDataArr.length) {
             let singleSignatureRelArr = [];
             for (let rIdx = 0; rIdx < signatureRelInfo.length; rIdx++) {
@@ -1252,7 +1252,7 @@ function downloadPDFReport(pageDataArr, pageSize, rpt_names, signatureRelArr, si
                 // }
             }
             let pageData = newPageDataArr[rptControlObj.currentDownloadIdx];
-            let rptName = new_rpt_rames[rptControlObj.currentDownloadIdx];
+            let rptName = new_rpt_names[rptControlObj.currentDownloadIdx];
             rptControlObj.currentDownloadIdx++;
             /*
             // 临时代码,为大批量草图PDF下载用(强制分页)
@@ -1274,7 +1274,7 @@ function downloadPDFReport(pageDataArr, pageSize, rpt_names, signatureRelArr, si
             //*/
 
             JpcJsPDFHelper.outputAsPdf(pageData, pageSize, rptName, singleSignatureRelArr, STAGE_AUDIT); // 精确控制签名
-            if (rptControlObj.currentDownloadIdx < newPageDataArr.length) setTimeout(private_download(newPageDataArr, new_rpt_rames), 2000);
+            if (rptControlObj.currentDownloadIdx < newPageDataArr.length) setTimeout(private_download(newPageDataArr, new_rpt_names), 2000);
         }
     };
     /*
@@ -1315,7 +1315,7 @@ function downloadPDFReport(pageDataArr, pageSize, rpt_names, signatureRelArr, si
         let handledAmt = 0, exceptionAmt = 0;
         for (let pIdx = 0; pIdx < dummyCells.length; pIdx++) {
             let dCell = dummyCells[pIdx];
-            getBlob(dCell.path).then(blob => {
+            getBlobPublic(dCell.path).then(blob => {
                 if (blob === 'not found!') {
                     exceptionAmt++;
                     if ((handledAmt + exceptionAmt) === dummyPicAmt) {
@@ -1366,20 +1366,6 @@ function downloadReport(urls) {
     private_download();
 }
 
-function dynamicLoadJs(url, type, callback) {
-    let head = document.getElementsByTagName('head')[0];
-    let script = document.createElement('script');
-    script.type = 'text/javascript';
-    script.src = url;
-    if(callback) {
-        script.onload = script.onreadystatechange = function (event) {
-            callback(type);
-            script.onload = script.onreadystatechange = null;
-        };
-    }
-    head.appendChild(script);
-}
-
 function getStageStatus() {
     let ppStatus = zTreeOprObj._chkPrePayStatus();
     if (ppStatus === 3) return ppStatus

+ 79 - 62
app/public/report/js/rpt_preview_common.js

@@ -28,72 +28,89 @@ Date.prototype.Format = function(fmt) {
 };
 
 async function printPageLoading() {
-    let params = JSON.parse(sessionStorage.report_params);
-    let _current_stage_status = parseInt(sessionStorage.current_stage_status);
-    let closeWaterMark = parseInt(sessionStorage.closeWaterMark);
-    let refRptTplIds = JSON.parse(sessionStorage.refRptTplIds);
-    STAGE_LIST = JSON.parse(sessionStorage.STAGE_LIST);
-    STAGE_AUDIT_ORG = JSON.parse(sessionStorage.STAGE_AUDIT_ORG);
-    OSS_PATH = sessionStorage.OSS_PATH;
-    let isTextSignature = parseInt(sessionStorage.isTextSignature);
-    current_stage_id = parseInt(sessionStorage.current_stage_id);
-    let scaleFactor = 1;
-    CommonAjax.postXsrfEx("/tender/report_api/getMultiReports", params, 60000, true, getCookie('csrfToken_j'),
-        async function(result){
-            const signatureRelArr = [];
-            STAGE_AUDIT = result.stageAudit;
-            // sessionStorage.waterMarkStr = result.waterMarkStr;
-            if (params.needWaterMark) sessionStorage.waterMarkStr = result.waterMarkStr;
-            for (const signatureRel of result.signatureRelInfo) {
-                signatureRelArr.push(JSON.parse(signatureRel.rel_content));
-            }
-            // if (params.needWaterMark) COMMON_WATER_MARK_PIC_DATA = result.waterMarkStr;
-            for (let idx = 0; idx < result.data.length; idx++) {
-                let singleSignatureRelArr = [];
-                for (let rIdx = 0; rIdx < result.signatureRelInfo.length; rIdx++) {
-                    if (result.signatureRelInfo[rIdx].rpt_id === refRptTplIds[idx]) {
-                        singleSignatureRelArr = signatureRelArr[rIdx]; // 有些报表可能没有签名
-                        break;
-                    }
-                }
-                if (_current_stage_status === 3) {
-                    rptSignatureHelper.mergeSignDate(result.data[idx], singleSignatureRelArr, false);
-                    rptSignatureHelper.mergeSignature(result.data[idx], singleSignatureRelArr, true);
-                    await rptSignatureHelper.resetDummySignature(result.data[idx], null); // 这里重新整理签章坐标信息(因签章大小在后台暂时获取不到,挪到前端处理)
-                    rptSignatureHelper.mergeSignAudit(result.data[idx], singleSignatureRelArr, result.stageAudit);
-                } else {
-                    rptSignatureHelper.mergeSignDate(result.data[idx], singleSignatureRelArr, false, true);
-                    rptSignatureHelper.mergeSignature(result.data[idx], singleSignatureRelArr, true, true);
-                    await rptSignatureHelper.resetDummySignature(result.data[idx], singleSignatureRelArr, false, true); // 这里重新整理签章坐标信息(因签章大小在后台暂时获取不到,挪到前端处理)
-                    rptSignatureHelper.mergeSignAudit(result.data[idx], singleSignatureRelArr, result.stageAudit, true);
+    if (sessionStorage.report_direct_data) {
+        printPageDirectLoading();
+    } else {
+        let params = JSON.parse(sessionStorage.report_params);
+        let _current_stage_status = parseInt(sessionStorage.current_stage_status);
+        let closeWaterMark = parseInt(sessionStorage.closeWaterMark);
+        let refRptTplIds = JSON.parse(sessionStorage.refRptTplIds);
+        STAGE_LIST = JSON.parse(sessionStorage.STAGE_LIST);
+        STAGE_AUDIT_ORG = JSON.parse(sessionStorage.STAGE_AUDIT_ORG);
+        OSS_PATH = sessionStorage.OSS_PATH;
+        let isTextSignature = parseInt(sessionStorage.isTextSignature);
+        current_stage_id = parseInt(sessionStorage.current_stage_id);
+        let scaleFactor = 1;
+        CommonAjax.postXsrfEx("/tender/report_api/getMultiReports", params, 60000, true, getCookie('csrfToken_j'),
+            async function(result){
+                const signatureRelArr = [];
+                STAGE_AUDIT = result.stageAudit;
+                // sessionStorage.waterMarkStr = result.waterMarkStr;
+                if (params.needWaterMark) sessionStorage.waterMarkStr = result.waterMarkStr;
+                for (const signatureRel of result.signatureRelInfo) {
+                    signatureRelArr.push(JSON.parse(signatureRel.rel_content));
                 }
-                if (isTextSignature) {
-                    resetTextSignature(result.data[idx], _current_stage_status !== 3);
+                // if (params.needWaterMark) COMMON_WATER_MARK_PIC_DATA = result.waterMarkStr;
+                for (let idx = 0; idx < result.data.length; idx++) {
+                    let singleSignatureRelArr = [];
+                    for (let rIdx = 0; rIdx < result.signatureRelInfo.length; rIdx++) {
+                        if (result.signatureRelInfo[rIdx].rpt_id === refRptTplIds[idx]) {
+                            singleSignatureRelArr = signatureRelArr[rIdx]; // 有些报表可能没有签名
+                            break;
+                        }
+                    }
+                    if (_current_stage_status === 3) {
+                        rptSignatureHelper.mergeSignDate(result.data[idx], singleSignatureRelArr, false);
+                        rptSignatureHelper.mergeSignature(result.data[idx], singleSignatureRelArr, true);
+                        await rptSignatureHelper.resetDummySignature(result.data[idx], null); // 这里重新整理签章坐标信息(因签章大小在后台暂时获取不到,挪到前端处理)
+                        rptSignatureHelper.mergeSignAudit(result.data[idx], singleSignatureRelArr, result.stageAudit);
+                    } else {
+                        rptSignatureHelper.mergeSignDate(result.data[idx], singleSignatureRelArr, false, true);
+                        rptSignatureHelper.mergeSignature(result.data[idx], singleSignatureRelArr, true, true);
+                        await rptSignatureHelper.resetDummySignature(result.data[idx], singleSignatureRelArr, false, true); // 这里重新整理签章坐标信息(因签章大小在后台暂时获取不到,挪到前端处理)
+                        rptSignatureHelper.mergeSignAudit(result.data[idx], singleSignatureRelArr, result.stageAudit, true);
+                    }
+                    if (isTextSignature) {
+                        resetTextSignature(result.data[idx], _current_stage_status !== 3);
+                    }
                 }
-            }
-            let multiRptData = result.data;
-            for (let idx = 0; idx < multiRptData.length; idx++) {
-                let pageData = multiRptData[idx];
-                if (idx === 0) {
-                    $(document).attr("title", pageData[JV.NODE_PAGE_INFO][JV.NODE_MAIN_INFO_RPT_NAME]);
+                let multiRptData = result.data;
+                for (let idx = 0; idx < multiRptData.length; idx++) {
+                    let pageData = multiRptData[idx];
+                    if (idx === 0) {
+                        $(document).attr("title", pageData[JV.NODE_PAGE_INFO][JV.NODE_MAIN_INFO_RPT_NAME]);
+                    }
+                    let orgPixelSize = getPixelSize(pageData);
+                    let actArea = getActualArea(pageData);
+                    let svgArr = rptPrintHelper.buildSvgArr(pageData, actArea, G_OFFSET_X, G_OFFSET_Y, closeWaterMark);
+                    let orientation = "纵向";
+                    showPreviewData(svgArr, actArea, scaleFactor, sessionStorage.pageSize, orientation, orgPixelSize);
                 }
-                let orgPixelSize = getPixelSize(pageData);
-                let actArea = getActualArea(pageData);
-                let svgArr = rptPrintHelper.buildSvgArr(pageData, actArea, G_OFFSET_X, G_OFFSET_Y, closeWaterMark);
-                let orientation = "纵向";
-                showPreviewData(svgArr, actArea, scaleFactor, sessionStorage.pageSize, orientation, orgPixelSize);
+                // window.print();
+            },
+            function(failRst){
+                // sessionStorage.currentPageData = null;
+                console.log(failRst);
+            },
+            function(exceptionRst){
+                // sessionStorage.currentPageData = null;
+                console.log(exceptionRst);
             }
-            // window.print();
-        },
-        function(failRst){
-            // sessionStorage.currentPageData = null;
-            console.log(failRst);
-        },
-        function(exceptionRst){
-            // sessionStorage.currentPageData = null;
-            console.log(exceptionRst);
-        }
-    );
+        );
+    }
+}
+
+function printPageDirectLoading() {
+    //审核报表(内容需要互动)
+    let pageData = JSON.parse(sessionStorage.report_direct_data);
+    $(document).attr("title", pageData[JV.NODE_PAGE_INFO][JV.NODE_MAIN_INFO_RPT_NAME]);
+    let orgPixelSize = getPixelSize(pageData);
+    let actArea = getActualArea(pageData);
+    let closeWaterMark = parseInt(sessionStorage.closeWaterMark);
+    let svgArr = rptPrintHelper.buildSvgArr(pageData, actArea, G_OFFSET_X, G_OFFSET_Y, closeWaterMark);
+    let orientation = "纵向";
+    let scaleFactor = 1;
+    showPreviewData(svgArr, actArea, scaleFactor, sessionStorage.pageSize, orientation, orgPixelSize);
 }
 
 function printPageLoading_bk() {

+ 4 - 0
app/public/report/js/rpt_print.js

@@ -161,6 +161,10 @@ let rptPrintHelper = {
                 svgPageArr.push(buildCellSvg(cell, fonts, styles, controls, page[JV.PROP_PAGE_MERGE_BORDER], pagesData[JV.BAND_PROP_MERGE_BAND],
                     offsetX - actAreaOffsetX, offsetY - actAreaOffsetY, adjustY, canvas, isHtoV, pixelSize, actAreaArr[idx]));
             }
+            for (let cell of page.interact_cells) {
+                svgPageArr.push(buildCellSvg(cell, fonts, styles, controls, page[JV.PROP_PAGE_MERGE_BORDER], pagesData[JV.BAND_PROP_MERGE_BAND],
+                    offsetX - actAreaOffsetX, offsetY - actAreaOffsetY, adjustY, canvas, isHtoV, pixelSize, actAreaArr[idx]));
+            }
             // 计量有电子签名,要单独处理
             for (let cell of page.signature_cells) {
                 svgPageArr.push(buildSignatureCellSvg(cell, styles, controls, fonts, page[JV.PROP_PAGE_MERGE_BORDER], pagesData[JV.BAND_PROP_MERGE_BAND],

+ 69 - 0
app/public/report/js/rpt_public.js

@@ -0,0 +1,69 @@
+function getScreenDPI() {
+    if (SCREEN_DPI.length === 0) {
+        if (window.screen.deviceXDPI != undefined) {
+            SCREEN_DPI.push(window.screen.deviceXDPI);
+            SCREEN_DPI.push(window.screen.deviceYDPI);
+        } else {
+            let tmpNode = document.createElement("DIV");
+            tmpNode.style.cssText = "width:1in;height:1in;position:absolute;left:0px;top:0px;z-index:99;visibility:hidden";
+            document.body.appendChild(tmpNode);
+            SCREEN_DPI.push(parseInt(tmpNode.offsetWidth));
+            SCREEN_DPI.push(parseInt(tmpNode.offsetHeight));
+            tmpNode.parentNode.removeChild(tmpNode);
+        }
+    }
+    return SCREEN_DPI;
+}
+
+function setupDateFormat() {
+    Date.prototype.Format = function (fmt) {
+        let o = {
+            "M+": this.getMonth() + 1, //月份
+            "d+": this.getDate(), //日
+            "h+": this.getHours(), //小时
+            "m+": this.getMinutes(), //分
+            "s+": this.getSeconds(), //秒
+            "q+": Math.floor((this.getMonth() + 3) / 3), //季度
+            "S": this.getMilliseconds() //毫秒
+        };
+        if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
+        for (let k in o)
+            if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
+        return fmt;
+    };
+}
+
+function dynamicLoadJs(url, type, callback) {
+    let head = document.getElementsByTagName('head')[0];
+    let script = document.createElement('script');
+    script.type = 'text/javascript';
+    script.src = url;
+    if(callback) {
+        script.onload = script.onreadystatechange = function (event) {
+            callback(type);
+            script.onload = script.onreadystatechange = null;
+        };
+    }
+    head.appendChild(script);
+}
+
+/**
+ * 获取 blob
+ * @param  {String} url 目标文件地址
+ * @return {Promise}
+ */
+ function getBlobPublic(url) {
+    return new Promise(resolve => {
+        const xhr = new XMLHttpRequest();
+        xhr.open('GET', url, true);
+        xhr.responseType = 'blob';
+        xhr.onload = () => {
+            if (xhr.status === 200) {
+                resolve(xhr.response);
+            } else {
+                resolve('not found!');
+            }
+        };
+        xhr.send();
+    });
+}

+ 17 - 2
app/reports/rpt_component/helper/jpc_helper_discrete.js

@@ -249,7 +249,7 @@ const JpcDiscreteHelper = {
         }
         return rst;
     },
-    outputPreviewDiscreteInfo(discreteArray, bands, unitFactor, pageStatus) {
+    outputPreviewDiscreteInfo(discreteArray, bands, unitFactor, pageStatus, $CURRENT_RPT, interactRst) {
         const rst = [];
         for (let i = 0; i < discreteArray.length; i++) {
             const band = bands[discreteArray[i][JV.PROP_BAND_NAME]];
@@ -272,7 +272,22 @@ const JpcDiscreteHelper = {
                         const item = JpcCommonOutputHelper.createCommonOutputWithoutDecorate(df, value, null);
                         // position
                         item[JV.PROP_AREA] = JpcAreaHelper.outputArea(df[JV.PROP_AREA], band, unitFactor, 1, 0, 1, 0, 1, 0, false, false);
-                        rst.push(item);
+                        if (interactRst && JE.isInterActionParam(df[JV.PROP_PARAM_ID], $CURRENT_RPT)) {
+                            if (Array.isArray(interactRst)) {
+                                let pID = 0;
+                                if (df.hasOwnProperty(JV.PROP_PARAM_ID)) {
+                                    pID = df[JV.PROP_PARAM_ID];
+                                } else {
+                                    pID = df[JV.PROP_ID];
+                                }
+                                const iParam = JE.P(pID, $CURRENT_RPT);
+                                item[JV.PROP_BAND_NAME] = band.Name;
+                                item[JV.PROP_DATA_TYPE] = iParam[JV.PROP_DATA_TYPE];
+                                interactRst.push(item);
+                            }
+                        } else {
+                            rst.push(item);
+                        }
                     }
                 }
 

+ 5 - 4
app/reports/rpt_component/jpc_bill_tab.js

@@ -57,8 +57,9 @@ JpcBillTabSrv.prototype.createNew = function() {
         const pageStatus = [true, true, true, true, true, true, true, true];
         JpcBandHelper.setBandArea(bands, rptTpl, pageStatus, true, false);
         const unitFactor = JpcCommonHelper.getUnitFactor(rptTpl);
-        rst = rst.concat(me.outputPreviewContent(rptTpl, bands, unitFactor, controls, pageStatus));
-        rst = rst.concat(JpcDiscreteHelper.outputPreviewDiscreteInfo(rptTpl[JV.NODE_BILL_INFO][JV.NODE_DISCRETE_INFO], bands, unitFactor, pageStatus));
+        me.interactRst = [];
+        rst = rst.concat(me.outputPreviewContent(rptTpl, bands, unitFactor, controls, pageStatus, $CURRENT_RPT));
+        rst = rst.concat(JpcDiscreteHelper.outputPreviewDiscreteInfo(rptTpl[JV.NODE_BILL_INFO][JV.NODE_DISCRETE_INFO], bands, unitFactor, pageStatus, $CURRENT_RPT, me.interactRst));
         return rst;
     };
     JpcBillTabResult.outputAsSimpleJSONPage = function(rptTpl, dataObj, page, bands, controls, fonts, $CURRENT_RPT, customizeCfg) {
@@ -92,7 +93,7 @@ JpcBillTabSrv.prototype.createNew = function() {
         }
         return rst;
     };
-    JpcBillTabResult.outputPreviewContent = function(rptTpl, bands, unitFactor, controls, pageStatus) {
+    JpcBillTabResult.outputPreviewContent = function(rptTpl, bands, unitFactor, controls, pageStatus, $CURRENT_RPT) {
         let rst = [];
         const tab = rptTpl[JV.NODE_BILL_INFO][JV.NODE_BILL_CONTENT];
         const band = bands[tab[JV.PROP_BAND_NAME]];
@@ -116,7 +117,7 @@ JpcBillTabSrv.prototype.createNew = function() {
                     }
                 }
                 if (tab[JV.NODE_DISCRETE_INFO]) {
-                    rst = rst.concat(JpcDiscreteHelper.outputPreviewDiscreteInfo(tab[JV.NODE_DISCRETE_INFO], bands, unitFactor, pageStatus));
+                    rst = rst.concat(JpcDiscreteHelper.outputPreviewDiscreteInfo(tab[JV.NODE_DISCRETE_INFO], bands, unitFactor, pageStatus, $CURRENT_RPT, this.interactRst));
                 }
             }
         }

+ 2 - 1
app/reports/rpt_component/jpc_cross_tab.js

@@ -515,7 +515,8 @@ JpcCrossTabSrv.prototype.createNew = function() {
         // 6.1 交叉行合计
         rst = rst.concat(me.outputPreviewTabSumRow(rptTpl, bands, controls, $CURRENT_RPT, customizeCfg, maxColRec, JV.NODE_CROSS_ROW_SUM, unitFactor));
         // 7. 离散
-        rst = rst.concat(JpcDiscreteHelper.outputPreviewDiscreteInfo(rptTpl[JV.NODE_CROSS_INFO][JV.NODE_DISCRETE_INFO], bands, unitFactor, pageStatus));
+        me.interactRst = [];
+        rst = rst.concat(JpcDiscreteHelper.outputPreviewDiscreteInfo(rptTpl[JV.NODE_CROSS_INFO][JV.NODE_DISCRETE_INFO], bands, unitFactor, pageStatus, $CURRENT_RPT, me.interactRst));
         return rst;
     };
     JpcCrossTabResult.outputPreviewRowTab = function(rptTpl, bands, controls, $CURRENT_RPT, customizeCfg, maxRowRec, unitFactor) {

+ 4 - 1
app/reports/rpt_component/jpc_ex.js

@@ -291,10 +291,13 @@ JpcExSrv.prototype.createNew = function() {
             rstPage[JV.PROP_PAGE_SEQ] = 1;
             if (me.flowTab) {
                 rstPage[JV.PROP_CELLS] = me.flowTab.outputAsPreviewPage(rptTpl, bands, rst[JV.NODE_CONTROL_COLLECTION], me);
+                rstPage[JV.PROP_INTERACT_CELLS] = me.flowTab.interactRst;
             } else if (me.crossTab) {
                 rstPage[JV.PROP_CELLS] = me.crossTab.outputAsPreviewPage(rptTpl, bands, rst[JV.NODE_CONTROL_COLLECTION], me);
+                rstPage[JV.PROP_INTERACT_CELLS] = me.crossTab.interactRst;
             } else if (me.billTab) {
                 rstPage[JV.PROP_CELLS] = me.billTab.outputAsPreviewPage(rptTpl, bands, rst[JV.NODE_CONTROL_COLLECTION], me);
+                rstPage[JV.PROP_INTERACT_CELLS] = me.billTab.interactRst;
             }
             const pageMergeBorder = getPageMergeBorder();
             if (pageMergeBorder) {
@@ -303,7 +306,7 @@ JpcExSrv.prototype.createNew = function() {
             rstPage[JV.PROP_SIGNATURE_CELLS] = [];
             rstPage[JV.PROP_SIGNATURE_DATE_CELLS] = [];
             rstPage[JV.PROP_SIGNATURE_AUDIT_CELLS] = [];
-            rstPage[JV.PROP_INTERACT_CELLS] = [];
+            // rstPage[JV.PROP_INTERACT_CELLS] = [];
             rst.items.push(rstPage);
             // 2.
             if (bands[JV.BAND_PROP_MERGE_BAND]) {

+ 2 - 1
app/reports/rpt_component/jpc_flow_tab.js

@@ -879,7 +879,8 @@ JpcFlowTabSrv.prototype.createNew = function() {
         rst = rst.concat(me.outputPreviewPageSum(rptTpl, bands, unitFactor, controls, pageStatus));
         // 2.5 Group
         // 2.6 Discrete
-        rst = rst.concat(JpcDiscreteHelper.outputPreviewDiscreteInfo(rptTpl[JV.NODE_FLOW_INFO][JV.NODE_DISCRETE_INFO], bands, unitFactor, pageStatus));
+        me.interactRst = [];
+        rst = rst.concat(JpcDiscreteHelper.outputPreviewDiscreteInfo(rptTpl[JV.NODE_FLOW_INFO][JV.NODE_DISCRETE_INFO], bands, unitFactor, pageStatus, $CURRENT_RPT, me.interactRst));
         return rst;
     };
     JpcFlowTabResult.outputAsSimpleJSONPage = function(rptTpl, dataObj, page, bands, controls, fonts, adHocMergePos, $CURRENT_RPT, customizeCfg) {

File diff suppressed because it is too large
+ 3373 - 4
app/view/payment/detail.ejs


+ 1 - 34
app/view/report/index.ejs

@@ -338,6 +338,7 @@
 <script type="text/javascript" src="/public/js/ztree_common.js"></script>
 <script type="text/javascript" src="/public/js/storageUtil.js"></script>
 
+<script type="text/javascript" src="/public/report/js/rpt_public.js"></script>
 <script type="text/javascript" src="/public/report/js/rpt_main.js"></script>
 <script type="text/javascript" src="/public/report/js/rpt_archive.js"></script>
 <script type="text/javascript" src="/public/report/js/rpt_cfg_const.js"></script>
@@ -482,22 +483,6 @@
     }
 
     const SCREEN_DPI = [];
-    function getScreenDPI() {
-        if (SCREEN_DPI.length === 0) {
-            if (window.screen.deviceXDPI != undefined) {
-                SCREEN_DPI.push(window.screen.deviceXDPI);
-                SCREEN_DPI.push(window.screen.deviceYDPI);
-            } else {
-                let tmpNode = document.createElement("DIV");
-                tmpNode.style.cssText = "width:1in;height:1in;position:absolute;left:0px;top:0px;z-index:99;visibility:hidden";
-                document.body.appendChild(tmpNode);
-                SCREEN_DPI.push(parseInt(tmpNode.offsetWidth));
-                SCREEN_DPI.push(parseInt(tmpNode.offsetHeight));
-                tmpNode.parentNode.removeChild(tmpNode);
-            }
-        }
-        return SCREEN_DPI;
-    }
 
     function filterUnchkTplTreeNode(topNode, srcData) {
         const _chkAndSpliceItem = function(pNode, pStr) {
@@ -632,24 +617,6 @@
         // 用户可以设置,但只有审核通过后才显示签名
     }
 
-    function setupDateFormat() {
-        Date.prototype.Format = function (fmt) {
-            let o = {
-                "M+": this.getMonth() + 1, //月份
-                "d+": this.getDate(), //日
-                "h+": this.getHours(), //小时
-                "m+": this.getMinutes(), //分
-                "s+": this.getSeconds(), //秒
-                "q+": Math.floor((this.getMonth() + 3) / 3), //季度
-                "S": this.getMilliseconds() //毫秒
-            };
-            if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
-            for (let k in o)
-                if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
-            return fmt;
-        };
-    }
-
     setupDateFormat();
     rptTplObj.iniPage();