|
@@ -36,7 +36,68 @@
|
|
|
const current_stage_status = 3;
|
|
|
const PAGE_SHOW = {closeWatermark: 0, closeExportPdf: 0, closeExportExcel: 0, showArchive: 0};
|
|
|
const pdfFont = {'SmartSimsun': [], 'simhei': [], 'simkai': []};
|
|
|
- let CUST_CFG = null;
|
|
|
+ const CUST_CFG = {
|
|
|
+ "fonts": [
|
|
|
+ {
|
|
|
+ "ID": "ReportTitle_Main",
|
|
|
+ "Name": "宋体",
|
|
|
+ "FontBold": "T",
|
|
|
+ "FontHeight": 32,
|
|
|
+ "FontItalic": "F",
|
|
|
+ "CfgDispName": "表标题",
|
|
|
+ "FontUnderline": "F"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "ID": "Column",
|
|
|
+ "Name": "宋体",
|
|
|
+ "FontBold": "F",
|
|
|
+ "FontHeight": 12,
|
|
|
+ "FontItalic": "F",
|
|
|
+ "CfgDispName": "列标题",
|
|
|
+ "FontUnderline": "F"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "ID": "Content",
|
|
|
+ "Name": "宋体",
|
|
|
+ "FontBold": "F",
|
|
|
+ "FontHeight": 12,
|
|
|
+ "FontItalic": "F",
|
|
|
+ "CfgDispName": "正文内容",
|
|
|
+ "FontUnderline": "F"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "ID": "Total",
|
|
|
+ "Name": "宋体",
|
|
|
+ "FontBold": "F",
|
|
|
+ "FontHeight": 12,
|
|
|
+ "FontItalic": "F",
|
|
|
+ "CfgDispName": "合计",
|
|
|
+ "FontUnderline": "F"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "ID": "Header",
|
|
|
+ "Name": "宋体",
|
|
|
+ "FontBold": "F",
|
|
|
+ "FontHeight": 12,
|
|
|
+ "FontItalic": "F",
|
|
|
+ "CfgDispName": "表眉/表脚",
|
|
|
+ "FontUnderline": "F"
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "margins": {
|
|
|
+ "Top": 12,
|
|
|
+ "Left": 15,
|
|
|
+ "Right": 15,
|
|
|
+ "Bottom": 15
|
|
|
+ },
|
|
|
+ "fillZero": false,
|
|
|
+ "isNarrow": false,
|
|
|
+ "borderThick": 2,
|
|
|
+ "showVerticalLine": true,
|
|
|
+ "closeWarterMark": true,
|
|
|
+ "continuousOutput": false
|
|
|
+ };
|
|
|
+ const PAGE_SIZE = '<%- size %>';
|
|
|
let currentPageRst = null;
|
|
|
let currentDownloadUrl = null;
|
|
|
let currentDownloadIdx = 0;
|
|
@@ -49,22 +110,23 @@
|
|
|
function pageLoading() {
|
|
|
let req_params = JSON.parse(sessionStorage.req_params);
|
|
|
let params = {};
|
|
|
- params.pageSize = 'A4';
|
|
|
- // params.rpt_tpl_id = req_params.refId;
|
|
|
- params.rpt_tpl_id = 1784;
|
|
|
+ params.rpt_tpl_id = req_params.rpt_tpl_id;
|
|
|
+// params.rpt_tpl_id = 1784;
|
|
|
+ params.pageSize = PAGE_SIZE;
|
|
|
+// params.pageSize = 'A4';
|
|
|
params.project_id = req_params.project_id;
|
|
|
params.tender_id = req_params.tender_id;
|
|
|
params.stage_id = req_params.stage_id;
|
|
|
params.stage_status = 3;
|
|
|
params.closeWatermark = 1;
|
|
|
- params.custCfg = req_params.custCfg;
|
|
|
- CUST_CFG = req_params.custCfg;
|
|
|
+ params.custCfg = CUST_CFG;
|
|
|
|
|
|
CommonAjax.postXsrfEx("/tender/report_api/getReport", params, 300000, true, getCookie('csrfToken_j'),
|
|
|
function(result){
|
|
|
currentPageRst = result.data;
|
|
|
_replaceKeyValue(currentPageRst);
|
|
|
- _addQRCode(currentPageRst, '/public/upload/qr_code/icon-qrcode.png');
|
|
|
+ let qrCodePath = sessionStorage.qrCodePath;
|
|
|
+ _addQRCode(currentPageRst, qrCodePath);
|
|
|
let canvas = document.getElementById("rptIndividualCanvas");
|
|
|
|
|
|
if (currentPageRst && currentPageRst.items && currentPageRst.items.length > 0) {
|
|
@@ -94,12 +156,12 @@
|
|
|
function _replaceKeyValue(pageRst) {
|
|
|
if (sessionStorage.replace_key_params) {
|
|
|
let replace_key_params = JSON.parse(sessionStorage.replace_key_params);
|
|
|
- if (pageRst && pageRst.length > 0) {
|
|
|
- for (let pageItem of pageRst) {
|
|
|
+ if (pageRst.items && pageRst.items.length > 0) {
|
|
|
+ for (let pageItem of pageRst.items) {
|
|
|
for (let cell of pageItem.cells) {
|
|
|
- for (let keyP of replace_key_params) {
|
|
|
- if (cell.Value === keyP.key) {
|
|
|
- cell.Value = keyP.Value;
|
|
|
+ for (let keyP in replace_key_params) {
|
|
|
+ if (cell.Value === keyP) {
|
|
|
+ cell.Value = replace_key_params[keyP];
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -116,7 +178,8 @@
|
|
|
maxRight = (cell.area.Right > maxRight) ? cell.area.Right : maxRight;
|
|
|
minTop = (cell.area.Top < minTop) ? cell.area.Top : minTop;
|
|
|
}
|
|
|
- let offset = pageRst.MergeBand.Top - minTop - 5;
|
|
|
+// let offset = pageRst.MergeBand.Top - minTop - 5;
|
|
|
+ let offset = 86;
|
|
|
let left = maxRight - offset;
|
|
|
let bottom = minTop + offset;
|
|
|
let signCell = {area: {Left: left, Right: maxRight, Top: minTop, Bottom: bottom}, control: 'Column', path: qrCodePath, pic: null, signature_name: 'dummy_pic', style: 'Default_Normal'};
|