Просмотр исходного кода

Merge branch 'master' of http://192.168.1.41:3000/SmartCost/YangHuCost

vian 5 лет назад
Родитель
Сommit
42b174a1ea

+ 3 - 3
modules/main/facade/project_facade.js

@@ -369,15 +369,15 @@ function getReportData(nameList,items,prjTypeNames,compilationScopes,decimal,isP
         let temTotalPrice = 0;
         for(let c of children){
             if(level == 0) rootFlag = c.flag;//取最顶层节点的固定清单类别
-            let sumChildren = setChildrenDatas(c.children,arr,level+1,rootFlag);
             let tbill = getBillDatas(c,level,rootFlag);
+            arr.push(tbill);
+            let sumChildren = setChildrenDatas(c.children,arr,level+1,rootFlag);  
             if(isProgressiveType && progressiveInterval && rootFlag == fixedFlag.MAINTENANCE_EXPENSES){//如果要累进的,父节点要重新汇总
               if(level>0) temTotalPrice = scMathUtil.roundForObj(tbill.billsTtlPrice + temTotalPrice,decimal.bills.totalPrice); 
               if(c.children.length > 0) tbill.billsTtlPrice = sumChildren;
             }
-            arr.push(tbill);
         }
-        return temTotalPrice
+        return temTotalPrice;
     }
 
     function getBillDatas(bills,level,rootFlag) {

+ 2 - 1
modules/reports/controllers/rpt_controller.js

@@ -433,6 +433,7 @@ function getBillsSummaryReportPages(req, user_id, prjIds, rpt_id, pageSize, orie
             rptDataUtil.initialize((rptTpl._doc)?rptTpl._doc:rptTpl);
             try {
                 let tplData = rptDataUtil.assembleData(summaryRawDataRst);
+                // fsUtil.writeObjToFile(summaryRawDataRst, "D:/GitHome/temp/billsSummaryRawDataRstRawData.jsp");
                 let printCom = JpcEx.createNew();
                 if (pageSize) rptTpl[JV.NODE_MAIN_INFO][JV.NODE_PAGE_INFO][JV.PROP_PAGE_SIZE] = pageSize;
                 //console.log("orientation: " + (orientation === 'null'));
@@ -559,7 +560,7 @@ function getGljSummaryReportPages(user_id, prjIds, rpt_id, pageSize, orientation
             let rptDataUtil = new rptDataExtractor();
             rptDataUtil.initialize((rptTpl._doc)?rptTpl._doc:rptTpl);
             try {
-                // fsUtil.writeObjToFile(summaryRawDataRst, "D:/GitHome/temp/summaryRawDataRstRawData.jsp");
+                // fsUtil.writeObjToFile(summaryRawDataRst, "D:/GitHome/temp/gljSummaryRawDataRstRawData.jsp");
                 let tplData = rptDataUtil.assembleData(summaryRawDataRst);
                 let printCom = JpcEx.createNew();
                 if (pageSize) rptTpl[JV.NODE_MAIN_INFO][JV.NODE_PAGE_INFO][JV.PROP_PAGE_SIZE] = pageSize;

+ 2 - 2
modules/reports/util/rpt_excel_util.js

@@ -808,9 +808,9 @@ function writeSheet(pageData, sheetData, paperSize, sharedStrList, stylesObj, ap
     let colStr = private_getCellIdxStr(xPos.length - 3);
     rst.push('<dimension ref="A1:' + colStr + '' + yPos.length + '"/>');
     if (isFirstSheet) {
-        rst.push('<sheetViews><sheetView tabSelected="1" workbookViewId="0">');
+        rst.push('<sheetViews><sheetView showGridLines="1" tabSelected="1" workbookViewId="0">');
     } else {
-        rst.push('<sheetViews><sheetView workbookViewId="0">');
+        rst.push('<sheetViews><sheetView showGridLines="1" workbookViewId="0">');
     }
     //rst.push('<selection sqref="A1:' + colStr + '1"/>');
     rst.push('<selection sqref="A1:A1"/>');

+ 4 - 1
modules/unit_price_file/controllers/unit_price_controller.js

@@ -22,13 +22,15 @@ module.exports={
       let mixRatioList = await mixRatioModel.find({unit_price_file_id:unitPriceFileID}).lean();
       let mixRatioMap = _.groupBy(mixRatioList,"connect_key");
       let com_electrovalence = await com_electrovalence_model.findOne({"unit_price_file_id":unitPriceFileID}).lean();
+      let projectID = null;
 
       let gljTypeMap = glj_type_util.getStdGljTypeCacheObj().innerGljTypeObj;
       let usedTenderList = [];
-      if (tenderData !== null) {
+      if (tenderData !== null && tenderData.length > 0) {
           for (let tmp of tenderData) {
               usedTenderList.push(tmp.name);
           }
+          projectID = tenderData[0].ID;
       }
       let usedTenderString = "人材机单价的变化,将自动影响以下单位工程造价:<br>"+usedTenderList.join("<br>");
       res.render('building_saas/unit_price_file/index.html',
@@ -36,6 +38,7 @@ module.exports={
           userAccount: req.session.userAccount,
           userID: req.session.sessionUser.id,
           unitPriceFileID:unitPriceFileID,
+          projectID:projectID,
           versionName: req.session.compilationVersion,
           unitFileName:unitPriceFile.name,
           rootProjectName:project.name,

Разница между файлами не показана из-за своего большого размера
+ 552 - 143
package-lock.json


+ 1 - 1
web/building_saas/pm/js/pm_newMain.js

@@ -3634,7 +3634,7 @@ function a_updateFiles(updateDatas, callback){
                 callback();
             }
         }
-    })
+    }) 
 }
 
 function set_file_table(target, poj_tenders, fileList, type){

+ 7 - 7
web/building_saas/report/js/rpt_main.js

@@ -8,7 +8,7 @@ const NEXT_PAGE_OFFSET = 160;
 const FIRST_PAGE_OFFSET = 50;
 const LAST_PAGE_OFFSET = 60;
 
-const WAIT_TIME_EXPORT = 12000;
+const WAIT_TIME_EXPORT = 300000;
 
 let fontSuffixMapObj = {"表标题": "title", "列标题": "column", "正文内容": "content", "合计": "summary", "表眉/表脚": "header_footer"};
 
@@ -298,7 +298,7 @@ let zTreeOprObj = {
                     params.rpt_bill_tpl_ids = refBillSumPrjsIds;
                     params.rpt_glj_tpl_ids = refGljSumPrjsIds;
                     params.custCfg = me.reportPageCfg;
-                    CommonAjax.postEx("report_api/getMultiReports", params, 10000, true,
+                    CommonAjax.postEx("report_api/getMultiReports", params, 300000, true,
                         function(result){
                             hintBox.unWaitBox();
                             let pageRst = result[0];
@@ -457,7 +457,7 @@ let zTreeOprObj = {
                 params.prjIds.push(node.ID);
                 me.selectedPrjIDs.push(node.ID);
             }
-            CommonAjax.postEx("report_api/getBillsSummaryReport", params, 26000, true,
+            CommonAjax.postEx("report_api/getBillsSummaryReport", params, 60000, true,
                 function(result){
                     hintBox.unWaitBox();
                     let pageRst = result;
@@ -504,7 +504,7 @@ let zTreeOprObj = {
                 params.prjIds.push(node.ID);
                 zTreeOprObj.selectedPrjIDs.push(node.ID);
             }
-            CommonAjax.postEx("report_api/getGljSummaryReport", params, 26000, true,
+            CommonAjax.postEx("report_api/getGljSummaryReport", params, 60000, true,
                 function(result){
                     hintBox.unWaitBox();
                     let pageRst = result;
@@ -567,7 +567,7 @@ let zTreeOprObj = {
         params.sum_rpt_names = bill_rpt_names.concat(glj_rpt_names);
         params.rpt_names = rpt_names;
         params.isOneSheet = true;
-        CommonAjax.postEx("report_api/getMultiReports", params, 30000, true,
+        CommonAjax.postEx("report_api/getMultiReports", params, WAIT_TIME_EXPORT, true,
             function(result){
                 let pageSize = rptControlObj.getCurrentPageSize();
                 for (let idx = 0; idx < result.length; idx++) {
@@ -1043,7 +1043,7 @@ let rptControlObj = {
                 params.rpt_names = rpt_names;
                 params.isOneSheet = true;
                 params.rptName = projectObj.project.projectInfo.name;
-                CommonAjax.postEx("report_api/getMultiReports", params, 30000, true,
+                CommonAjax.postEx("report_api/getMultiReports", params, WAIT_TIME_EXPORT, true,
                     function(result){
                         $.bootstrapLoading.end();
                         if ($('#ini_PDF_cover').is(':visible')) {
@@ -1091,7 +1091,7 @@ let rptControlObj = {
                         params.orientation = ((zTreeOprObj.checkedRptTplNodes.length > 1)?null:me.getCurrentOrientation());
                         params.custCfg = zTreeOprObj.reportPageCfg;
                         params.option = "normal";
-                        CommonAjax.postEx("report_api/getMultiReports", params, 30000, true,
+                        CommonAjax.postEx("report_api/getMultiReports", params, WAIT_TIME_EXPORT, true,
                             function(result){
                                 $.bootstrapLoading.end();
                                 if ($('#ini_PDF_cover').is(':visible')) {

+ 2 - 0
web/building_saas/unit_price_file/index.html

@@ -38,6 +38,8 @@
 </head>
 <script type="text/javascript">
   let unitPriceFileID = parseInt('<%- unitPriceFileID %>');
+  let userID = '<%- userID %>';
+  let projectID = '<%- projectID %>';
   let unitPriceList = JSON.parse(`<%- unitpriceList %>`);
   let gljTypeMap = JSON.parse(`<%- gljTypeMap %>`);
   let mixRatioMap = JSON.parse(`<%- mixRatioMap %>`);

+ 1 - 1
web/building_saas/unit_price_file/index.js

@@ -562,7 +562,7 @@ let unitPriceObj = {
     unitPriceObj.showSubDatas();
     try {
       await ajaxPost("/project/markUpdateProject",{updateInfo:{unitFileID:unitPriceFileID,isInclude:true},type:"unitFile"});
-      socket.emit('unitFileChangeNotify', {'unitFileID':unitPriceFileID});
+      socket.emit('unitFileChangeNotify', {projectID:_.isEmpty(projectID)?null:parseInt(projectID),'unitFileID':unitPriceFileID,userID:userID});
     } catch (error) {
       console.log(error)
       alert(error)