Browse Source

归档分割调整

Tony Kang 1 year ago
parent
commit
0cc16b504d

+ 3 - 1
app/controller/report_archive_controller.js

@@ -331,7 +331,9 @@ module.exports = app => {
                 const rptId = ctx.params.rptId;
                 // const childAmt = parseInt(ctx.params.childAmt); // 子分页数量
                 const childInfo = ctx.params.childAmt.split(';'); // 这个参数带比较多的信息,包含分割指标的:1. 名称 2. ID 3. 内容
-                const childAmt = parseInt(childInfo[0]);
+                const splitArcPages = JSON.parse(childInfo[0]);
+                // console.log(splitArcPages);
+                const childAmt = splitArcPages.length;
                 const splitFieldObj = JSON.parse(childInfo[1]);
                 // console.log(splitFieldObj);
                 const parentUuid = uuidV1();

+ 2 - 2
app/public/report/js/rpt_archive.js

@@ -635,7 +635,7 @@ let rptArchiveObj = {
                 if (!rptArchiveObj._chkIfFullArchives(currentNode)) {
                     let archiveUrl = `/tender/report_api/addArchive/${PROJECT_ID}/${current_stage_id}/${currentNode.refId}`;
                     if (currentRptPageRst.splitArcPages && currentRptPageRst.splitArcPages.length > 0) {
-                        archiveUrl = `/tender/report_api/addParentChildrenArchive/${PROJECT_ID}/${current_stage_id}/${currentNode.refId}/${currentRptPageRst.splitArcPages.length};${JSON.stringify(currentRptPageRst.splitArcPagesInfo)}`;
+                        archiveUrl = `/tender/report_api/addParentChildrenArchive/${PROJECT_ID}/${current_stage_id}/${currentNode.refId}/${JSON.stringify(currentRptPageRst.splitArcPages)};${JSON.stringify(currentRptPageRst.splitArcPagesInfo)}`;
                     }
                     postDataWithFile(archiveUrl, formData, function (result) {
                     // postDataWithFile('/tender/report_api/addArchive/' + PROJECT_ID + '/' + current_stage_id + '/' + currentNode.refId, formData, function (result) {
@@ -704,7 +704,7 @@ let rptArchiveObj = {
                         let archiveUrl = `/tender/report_api/updateArchive/${PROJECT_ID}/${current_stage_id}/${currentNode.refId}/${orgName}`;
                         if (currentRptPageRst.splitArcPages && currentRptPageRst.splitArcPages.length > 0) {
                             // archiveUrl = `/tender/report_api/addParentChildrenArchive/${PROJECT_ID}/${current_stage_id}/${currentNode.refId}/${orgName}`;
-                            archiveUrl = `/tender/report_api/addParentChildrenArchive/${PROJECT_ID}/${current_stage_id}/${currentNode.refId}/${currentRptPageRst.splitArcPages.length};${JSON.stringify(currentRptPageRst.splitArcPagesInfo)}`; // 分页方式不需要 orgName 
+                            archiveUrl = `/tender/report_api/addParentChildrenArchive/${PROJECT_ID}/${current_stage_id}/${currentNode.refId}/${JSON.stringify(currentRptPageRst.splitArcPages)};${JSON.stringify(currentRptPageRst.splitArcPagesInfo)}`; // 分页方式不需要 orgName 
                         }
                         postDataWithFile(archiveUrl, formData, function (result) {
                         // postDataWithFile('/tender/report_api/updateArchive/' + PROJECT_ID + '/' + current_stage_id + '/' + currentNode.refId + '/' + orgName, formData, function (result) {

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

@@ -699,11 +699,14 @@ JpcFlowTabSrv.prototype.createNew = function() {
                 }
             };
             const pagesForPreSplit = [];
-            const splitFieldInfo = { Name: dataObj.splitField.Name, ID: dataObj.splitField.ID, splitPageValues: [] };
+            let splitFieldInfo;
             for (let segIdx = 0; segIdx < me.segments.length; segIdx++) {
                 if (dataObj.splitArcVals) {
                     // 流水式的分页强制以主数据划分,如果不是,那后果由做模板的人负责
                     pagesForPreSplit.push(Math.ceil((pageIdx + 1) / me.multiCols));
+                    if (segIdx === 0) {
+                        splitFieldInfo = { Name: dataObj.splitField.Name, ID: dataObj.splitField.ID, splitPageValues: [] };
+                    }
                     splitFieldInfo.splitPageValues.push(dataObj.splitArcVals[segIdx]);
                 }
                 const grpSeqInfo = (me.group_node_info) ? me.group_node_info[segIdx] : null;