Browse Source

Merge remote-tracking branch 'origin/master'

vian 5 years ago
parent
commit
33949e794b

+ 9 - 1
modules/main/facade/project_facade.js

@@ -30,6 +30,7 @@ let ration_glj_model = mongoose.model('ration_glj');
 let rationTemplateModel = mongoose.model('ration_template');
 let project_glj_model = mongoose.model('glj_list');
 let ration_glj_facade = require("../../ration_glj/facade/ration_glj_facade");
+let glj_calculate_facade = require("../../ration_glj/facade/glj_calculate_facade");
 const uuidV1 = require('uuid/v1');
 const gljUtil = require('../../../public/gljUtil');
 let stdColSettingModel = mongoose.model('std_main_col_lib');
@@ -281,6 +282,11 @@ async function updateNodes(datas){
             if(type == projectConsts.BILLS){
                 billTasks.push(getTask(node));
             }else if(type == projectConsts.RATION){
+                //处理面积增加费的数据
+                if(node.data.hasOwnProperty("areaIncreaseFee")){
+                    let t = await glj_calculate_facade.calculateQuantity({rationID:node.data.ID},true,false,node.data.areaIncreaseFee);
+                    node.data.adjustState = t.adjustState;
+                }
                 rationTasks.push(getTask(node));
             }else if(type == projectConsts.RATION_GLJ){
                 rationGLJTasks.push(getTask(node));
@@ -317,7 +323,9 @@ async function updateNodes(datas){
     projectGLJTasks.length>0?asyncTasks.push(project_glj_model.bulkWrite(projectGLJTasks)):"";
     projectTasks.length>0?asyncTasks.push(projectsModel.bulkWrite(projectTasks)):"";
     rationTemplateTasks.length>0?asyncTasks.push(rationTemplateModel.bulkWrite(rationTemplateTasks)):"";
-    return  asyncTasks.length>0?await Promise.all(asyncTasks):"";
+    asyncTasks.length>0?await Promise.all(asyncTasks):"";
+    return datas;
+
 
     function getTask(node,idFiled = 'ID') {
 

+ 1 - 0
modules/reports/rpt_component/jpc_flow_tab.js

@@ -706,6 +706,7 @@ JpcFlowTabSrv.prototype.createNew = function(){
                             pageStatus[JV.STATUS_SEGMENT_END] = true;
                             pageStatus[JV.STATUS_REPORT_END] = (segIdx === me.segments.length - 1);
                             private_addPage(segIdx, grpSeqInfo, false, false, -1);
+                            pageStatus[JV.STATUS_SEGMENT_END] = false; // 加完章统计页后,记得把章尾页设置为false
                         } else {
                             private_addPage(segIdx, grpSeqInfo, false, false, -1);
                         }

+ 3 - 0
public/web/gljUtil.js

@@ -432,6 +432,7 @@ let gljUtil = {
         for(let e of economics){
             let tem = {
                 name:e.name,
+                exportName:e.exportName,
                 cost:0,
                 unitCost:0,
                 per:0
@@ -515,6 +516,7 @@ let gljUtil = {
             let tem = {
                 name:m.name,
                 unit:m.unit,
+                exportName:m.exportName,
                 unitPrice:0,
                 quantity:0,
                 unitIndex:0
@@ -550,6 +552,7 @@ let gljUtil = {
             let tem = {
                 name : m.name,
                 quantityIndexUnit:m.unit,
+                exportName:m.exportName,
                 quantity:0
             };
             if(billsGroup[m.name]) setQuantities(billsGroup[m.name],tem);

+ 3 - 3
web/building_saas/main/js/models/exportSEIInterface.js

@@ -36,11 +36,11 @@ async function exportSEI(projectID) {
     let project = getProject(result);
     await prepareTenderDatas(tenderProjects,project);
 
-
     if(!_.isEmpty(errorMap)){
         showError(errorMap);
         return pr.end();
     }
+
     toXml(project);
 
     pr.end();
@@ -112,7 +112,7 @@ async function exportSEI(projectID) {
             valuationType:source.property.valuationType,
             taxType:source.property.taxType,
             property:source.property,
-            name:source.name
+            projectName:source.name
         };
         return tender;
     }
@@ -315,7 +315,7 @@ async function exportSEI(projectID) {
     function setEngineerInfo(tender) {//设置工程信息
         let infos = tender.property.engineerInfos?tender.property.engineerInfos:[];
         let errors =  infoRequireChecking(infos);
-        if(errors.length > 0) errorMap[tender.name] = errors;
+        if(errors.length > 0) errorMap[tender.projectName] = errors;
         let info = {
             name:"工程信息",
             attrs:[

+ 46 - 0
web/building_saas/main/js/views/area_increase_fee_view.js

@@ -0,0 +1,46 @@
+/**
+ * Created by zhang on 2020/1/10.
+ */
+let areaIncreaseFeeObj = {
+    setDefaultSetting:function () {
+        if(!gljUtil.isDef(projectObj.project.property.areaSetting)){
+            let data={
+                labour:10,
+                machine:1.5,
+                material:0
+            };
+            projectObj.project.updateProjectProperty(data,"areaSetting")
+        }
+
+    },
+    casCadeUpdate:async function (node,newval,fieldName) {
+        let datas = [];
+        let data =  {
+            type:node.sourceType,
+            data:{ID:node.data.ID}
+        };
+        setData(data.data,newval,fieldName);
+        datas.push(data);
+        setChildren(node,newval,datas);//同步设置所有子项
+        let nodes = await projectObj.project.syncUpdateNodesAndRefresh(datas);
+
+        function setChildren(pnode,newValue,datas) {//同步设置所有子项
+            if(pnode.children.length > 0 && (pnode.children[0].sourceType == ModuleNames.bills || pnode.children[0].sourceType == ModuleNames.ration)){//设置子项
+                for(let c of pnode.children){
+                    let data =  {
+                        type:c.sourceType,
+                        data:{ID:c.data.ID}
+                    };
+                    setData(data.data,newval,fieldName);
+                    datas.push(data);
+                    setChildren(c,newValue,datas)
+                }
+            }
+        }
+        function setData(data,avalue,fieldName) {
+            data[fieldName] = avalue;
+            if(fieldName == "outPutMaxPrice") data.maxPrice = null;
+        }
+    }
+    
+};

+ 9 - 0
web/over_write/js/guangdong_2018.js

@@ -27,6 +27,15 @@ function overwriteRationCalcBases (){
     rationCalcBases['设备费'] = function (node, isTender) {
         return calcTools.rationBaseFee(node, [gljType.EQUIPMENT], priceTypes.ptMarketPrice, isTender);
     };
+    // 广东建筑管理费特殊计算:管理费=ROUND(∑(人工费+施工机具费)*定额的管理费费率*0.01,精度)。与定额同级的量价、人材机则按管理费费率为0计算。
+    rationCalcBases['管理费'] = function (node, isTender) {
+        let rst = 0;
+        if (calcTools.isRationItem(node) && node.data.gljList && node.data.manageFeeRate) {
+            rst = (rationCalcBases['人工费'](node, isTender) + rationCalcBases['施工机具费'](node, isTender)) * node.data.manageFeeRate * 0.01;
+            rst = rst.toDecimal(decimalObj.ration.unitPrice);
+        };
+        return rst;
+    };
     rationCalcBases['工日合计'] = function (node, isTender) {
         return calcTools.labourDays(node, isTender);
     };