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

Merge branch '1.0.0_online' of http://192.168.1.41:3000/SmartCost/ConstructionCost into 1.0.0_online

zhangweicheng 6 лет назад
Родитель
Сommit
0e04874c6e

+ 17 - 1
modules/main/models/project_consts.js

@@ -49,6 +49,13 @@ let summaryConstList = [
     `SegmentDetail`
 ];
 
+let projectFieldConstList = [
+    `ProjectCostFields`,
+    `ProjectEcoFields`,
+    `ProjectLabMaterialFields`,
+    `ProjectQtyFields`
+];
+
 let commonConst = {
     UT_UPDATE: 'ut_update',
     UT_CREATE: 'ut_create',
@@ -63,4 +70,13 @@ const rationType = {
     gljRation: 3,
     install:4
 };
-module.exports = {projectConst: projectConst, commonConst: commonConst, projectConstList: projectConstList,gljKeyArray:gljKeyArray,rationKeyArray:rationKeyArray,rationType:rationType, summaryConstList: summaryConstList};
+module.exports = {
+    projectConst: projectConst,
+    commonConst: commonConst,
+    projectConstList: projectConstList,
+    gljKeyArray:gljKeyArray,
+    rationKeyArray:rationKeyArray,
+    rationType:rationType,
+    summaryConstList: summaryConstList,
+    projectFieldConstList: projectFieldConstList
+};

+ 358 - 3
modules/reports/controllers/rpt_controller.js

@@ -11,6 +11,347 @@ let Template = mongoose.model('rpt_templates');
 let rptTplDataFacade = require("../facade/rpt_tpl_data_facade");
 let fsUtil = require("../../../public/fsUtil");
 let pm_facade = require('../../../modules/pm/facade/pm_facade');
+let dummyDataObj = {
+    ProjectCostFields: [{
+        "name": "分部分项工程费",
+        "cost": 728819,
+        "unitCost": 728819,
+        "per": 70.08
+    }, {
+        "name": "技术措施费",
+        "cost": 36807.79,
+        "unitCost": 36807.79,
+        "per": 3.54
+    }, {
+        "name": "安全文明施工费",
+        "cost": 62312.37,
+        "unitCost": 62312.37,
+        "per": 5.99
+    }, {
+        "name": "建设工程竣工档案编制费",
+        "cost": 6867.95,
+        "unitCost": 6867.95,
+        "per": 0.66
+    }, {
+        "name": "其他组织措施费",
+        "cost": 36056.75,
+        "unitCost": 36056.75,
+        "per": 3.47
+    }, {
+        "name": "暂列金额",
+        "cost": 0,
+        "unitCost": 0,
+        "per": 0
+    }, {
+        "name": "专业工程暂估价",
+        "cost": 0,
+        "unitCost": 0,
+        "per": 0
+    }, {
+        "name": "计日工",
+        "cost": 0,
+        "unitCost": 0,
+        "per": 0
+    }, {
+        "name": "总承包服务费",
+        "cost": 0,
+        "unitCost": 0,
+        "per": 0
+    }, {
+        "name": "索赔与现场签证",
+        "cost": 0,
+        "unitCost": 0,
+        "per": 0
+    }, {
+        "name": "规费",
+        "cost": 64387.06,
+        "unitCost": 64387.06,
+        "per": 6.19
+    }, {
+        "name": "税金",
+        "cost": 104748.1,
+        "unitCost": 104748.1,
+        "per": 10.07
+    }, {
+        "name": "工程造价",
+        "cost": 1039999.02,
+        "unitCost": 1039999.02,
+        "per": 100
+    }
+    ],
+    ProjectEcoFields: [{
+        "name": "土石方工程",
+        "cost": 31477.97,
+        "unitCost": 29.338,
+        "per": 0.84
+    }, {
+        "name": "地基处理与边坡支护工程",
+        "cost": 0,
+        "unitCost": 0,
+        "per": 0
+    }, {
+        "name": "桩基工程",
+        "cost": 0,
+        "unitCost": 0,
+        "per": 0
+    }, {
+        "name": "砌筑工程",
+        "cost": 312217.05,
+        "unitCost": 290.995,
+        "per": 8.32
+    }, {
+        "name": "混凝土及钢筋混凝土工程",
+        "cost": 2301974.32,
+        "unitCost": 2145.503,
+        "per": 61.34
+    }, {
+        "name": "金属结构工程",
+        "cost": 0,
+        "unitCost": 0,
+        "per": 0
+    }, {
+        "name": "木结构工程",
+        "cost": 0,
+        "unitCost": 0,
+        "per": 0
+    }, {
+        "name": "门窗工程",
+        "cost": 0,
+        "unitCost": 0,
+        "per": 0
+    }, {
+        "name": "屋面及防水工程",
+        "cost": 0,
+        "unitCost": 0,
+        "per": 0
+    }, {
+        "name": "保温、防腐、隔热工程",
+        "cost": 0,
+        "unitCost": 0,
+        "per": 0
+    }, {
+        "name": "楼地面装饰工程",
+        "cost": 0,
+        "unitCost": 0,
+        "per": 0
+    }, {
+        "name": "其他工程",
+        "cost": 0,
+        "unitCost": 0,
+        "per": 0
+    }
+    ],
+    ProjectLabMaterialFields: [{
+        "name": "综合用工",
+        "unit": "工日",
+        "unitPrice": 118.62,
+        "quantity": 5248.2,
+        "unitIndex": 489.147
+    }, {
+        "name": "土石方用工",
+        "unit": "工日",
+        "unitPrice": 100,
+        "quantity": 176.71,
+        "unitIndex": 16.47
+    }, {
+        "name": "钢材",
+        "unit": "t",
+        "unitPrice": 3079.64,
+        "quantity": 1.68,
+        "unitIndex": 0.157
+    }, {
+        "name": "水泥",
+        "unit": "t",
+        "unitPrice": 0,
+        "quantity": 0,
+        "unitIndex": 0
+    }, {
+        "name": "商品混凝土",
+        "unit": "m3",
+        "unitPrice": 403,
+        "quantity": 484.59,
+        "unitIndex": 45.165
+    }, {
+        "name": "锯材",
+        "unit": "m3",
+        "unitPrice": 0,
+        "quantity": 0,
+        "unitIndex": 0
+    }, {
+        "name": "砂",
+        "unit": "t",
+        "unitPrice": 0,
+        "quantity": 0,
+        "unitIndex": 0
+    }, {
+        "name": "石子",
+        "unit": "t",
+        "unitPrice": 0,
+        "quantity": 0,
+        "unitIndex": 0
+    }, {
+        "name": "标砖",
+        "unit": "千块",
+        "unitPrice": 4,
+        "quantity": 11.06,
+        "unitIndex": 1.031
+    }, {
+        "name": "砌块",
+        "unit": "m3",
+        "unitPrice": 0,
+        "quantity": 0,
+        "unitIndex": 0
+    }, {
+        "name": "门",
+        "unit": "m2",
+        "unitPrice": 0,
+        "quantity": 0,
+        "unitIndex": 0
+    }, {
+        "name": "窗",
+        "unit": "m2",
+        "unitPrice": 0,
+        "quantity": 0,
+        "unitIndex": 0
+    }, {
+        "name": "保温材料",
+        "unit": "",
+        "unitPrice": 0,
+        "quantity": 0,
+        "unitIndex": 0
+    }, {
+        "name": "防水材料",
+        "unit": "",
+        "unitPrice": 0,
+        "quantity": 0,
+        "unitIndex": 0
+    }, {
+        "name": "其它材料",
+        "unit": "",
+        "unitPrice": 0,
+        "quantity": 0,
+        "unitIndex": 0
+    }
+    ],
+    ProjectQtyFields: [{
+        "name": "挖土石方量",
+        "quantityIndexUnit": "m3",
+        "quantity": 0
+    }, {
+        "name": "基础混凝土",
+        "quantityIndexUnit": "m3",
+        "quantity": 0
+    }, {
+        "name": "混凝土桩",
+        "quantityIndexUnit": "m3",
+        "quantity": 0
+    }, {
+        "name": "混凝土柱",
+        "quantityIndexUnit": "m3",
+        "quantity": 0
+    }, {
+        "name": "混凝土梁",
+        "quantityIndexUnit": "m3",
+        "quantity": 0
+    }, {
+        "name": "混凝土有梁板",
+        "quantityIndexUnit": "m3",
+        "quantity": 0
+    }, {
+        "name": "混凝土平板",
+        "quantityIndexUnit": "m3",
+        "quantity": 0
+    }, {
+        "name": "混凝土楼梯",
+        "quantityIndexUnit": "m2",
+        "quantity": 0
+    }, {
+        "name": "混凝土墙",
+        "quantityIndexUnit": "m3",
+        "quantity": 0
+    }, {
+        "name": "屋架",
+        "quantityIndexUnit": "m3",
+        "quantity": 0
+    }, {
+        "name": "砌体",
+        "quantityIndexUnit": "m3",
+        "quantity": 0
+    }, {
+        "name": "楼地面",
+        "quantityIndexUnit": "m2",
+        "quantity": 0
+    }, {
+        "name": "隔热、保温",
+        "quantityIndexUnit": "m2",
+        "quantity": 0
+    }, {
+        "name": "天棚装饰",
+        "quantityIndexUnit": "m2",
+        "quantity": 0
+    }, {
+        "name": "内墙装饰",
+        "quantityIndexUnit": "m2",
+        "quantity": 0
+    }, {
+        "name": "外墙装饰",
+        "quantityIndexUnit": "m2",
+        "quantity": 0
+    }, {
+        "name": "防水",
+        "quantityIndexUnit": "m2",
+        "quantity": 0
+    }, {
+        "name": "门",
+        "quantityIndexUnit": "m2",
+        "quantity": 0
+    }, {
+        "name": "窗",
+        "quantityIndexUnit": "m2",
+        "quantity": 0
+    }, {
+        "name": "钢材",
+        "quantityIndexUnit": "t",
+        "quantity": 0
+    }, {
+        "name": "阳台雨蓬挑檐",
+        "quantityIndexUnit": "m3",
+        "quantity": 0
+    }, {
+        "name": "屋面防水",
+        "quantityIndexUnit": "m2",
+        "quantity": 0
+    }, {
+        "name": "基础模板",
+        "quantityIndexUnit": "m2",
+        "quantity": 0
+    }, {
+        "name": "梁模板",
+        "quantityIndexUnit": "m2",
+        "quantity": 0
+    }, {
+        "name": "柱模板",
+        "quantityIndexUnit": "m2",
+        "quantity": 0
+    }, {
+        "name": "墙模板",
+        "quantityIndexUnit": "m2",
+        "quantity": 0
+    }, {
+        "name": "平板模板",
+        "quantityIndexUnit": "m2",
+        "quantity": 0
+    }, {
+        "name": "楼梯模板",
+        "quantityIndexUnit": "m2",
+        "quantity": 0
+    }, {
+        "name": "其他模板",
+        "quantityIndexUnit": "m2",
+        "quantity": 0
+    }
+    ]
+};
 
 import rptTplFacade from "../facade/rpt_template_facade";
 import demoTemplateFacade from "../facade/rpt_tpl_data_demo_facade";
@@ -222,6 +563,9 @@ function setupCustomizeCfg(customizeCfg, rptTpl, defProperties) {
         }
     }
 }
+function getEcoFieldsData() {
+    return dummyDataObj;
+}
 function getAllPagesCommon(user_id, prj_id, rpt_id, pageSize, orientation, customizeCfg, option, outputType, cb) {
     let rptTpl = null;
     rptTplFacade.getRptTemplate(rpt_id).then(function(rst) {
@@ -229,9 +573,9 @@ function getAllPagesCommon(user_id, prj_id, rpt_id, pageSize, orientation, custo
         if (rptTpl) {
             let rptDataUtil = new rptDataExtractor();
             rptDataUtil.initialize((rptTpl._doc)?rptTpl._doc:rptTpl);
-            let summaryRst = [];
-            let filter = rptDataUtil.getDataRequestFilter(summaryRst);
-            let promiseArr = [null, null];
+            let summaryRst = [], economicRst = [];
+            let filter = rptDataUtil.getDataRequestFilter(summaryRst, economicRst);
+            let promiseArr = [null, null, null];
             if (summaryRst.length > 0) {
                 if (summaryRst.indexOf(`Construct`) >= 0 || summaryRst.indexOf(`ConstructDetail`) >= 0) {
                     promiseArr[0] = pm_facade.getSummaryInfoByTender(prj_id, pm_facade.projectType.project);
@@ -240,6 +584,9 @@ function getAllPagesCommon(user_id, prj_id, rpt_id, pageSize, orientation, custo
                     promiseArr[1] = pm_facade.getSummaryInfoByTender(prj_id, pm_facade.projectType.engineering);
                 }
             }
+            if (economicRst.length > 0) {
+                promiseArr[2] = getEcoFieldsData();
+            }
             rptTplDataFacade.prepareProjectData(user_id, prj_id, filter, function (err, msg, rawDataObj) {
                 if (!err) {
                     let buildPageData = function() {
@@ -296,6 +643,13 @@ function getAllPagesCommon(user_id, prj_id, rpt_id, pageSize, orientation, custo
                             buildPageData(rawDataObj, rptDataUtil, rptTpl);
                         });
                     } else {
+                        if (promiseArr[2] !== null) {
+                            //暂时这样测试
+                            rawDataObj.prjData.push({moduleName: 'ProjectCostFields', data: promiseArr[2].ProjectCostFields});
+                            rawDataObj.prjData.push({moduleName: 'ProjectEcoFields', data: promiseArr[2].ProjectEcoFields});
+                            rawDataObj.prjData.push({moduleName: 'ProjectLabMaterialFields', data: promiseArr[2].ProjectLabMaterialFields});
+                            rawDataObj.prjData.push({moduleName: 'ProjectQtyFields', data: promiseArr[2].ProjectQtyFields});
+                        }
                         buildPageData(rawDataObj, rptDataUtil, rptTpl);
                     }
                     /*/
@@ -745,3 +1099,4 @@ module.exports = {
 
     }
 };
+

+ 22 - 0
modules/reports/rpt_component/jpc_rte.js

@@ -47,6 +47,24 @@ let JE = {
         }
         return rst;
     },
+    getFieldDataLen: function(field, dataObj) {
+        let rst = 0;
+        if (field.DataNodeName === 'NA') {
+            if (!field[JV.PROP_AD_HOC_DATA]) {
+                field[JV.PROP_AD_HOC_DATA] = [];
+            }
+            rst = field[JV.PROP_AD_HOC_DATA].length;
+        } else {
+            if (!field.DataNodeName) {
+                // that means this is a self-defined discrete field!
+                field.DataNodeName = JV.DATA_DISCRETE_DATA;
+                field.DataSeq = dataObj[JV.DATA_DISCRETE_DATA];
+                dataObj[JV.DATA_DISCRETE_DATA].push([]);
+            }
+            rst = dataObj[field.DataNodeName][field.DataSeq].length;
+        }
+        return rst;
+    },
     setFieldValue: function (field, dataObj, valIdx, newValue) {
         if (field.DataNodeName === "NA") {
             if (!field[JV.PROP_AD_HOC_DATA]) {
@@ -109,10 +127,14 @@ let JE = {
         if (field.DataNodeName === "NA") {
             if (field[JV.PROP_AD_HOC_DATA].length > valIdx && valIdx >= 0) {
                 field[JV.PROP_AD_HOC_DATA].splice(valIdx, 0, newValue);
+            } else if (field[JV.PROP_AD_HOC_DATA].length <= valIdx) {
+                field[JV.PROP_AD_HOC_DATA][field[JV.PROP_AD_HOC_DATA].length] = newValue;
             }
         } else {
             if (dataObj[field.DataNodeName][field.DataSeq].length > valIdx && valIdx >= 0) {
                 dataObj[field.DataNodeName][field.DataSeq].splice(valIdx, 0, newValue);
+            } else if (dataObj[field.DataNodeName][field.DataSeq].length <= valIdx) {
+                dataObj[field.DataNodeName][field.DataSeq][dataObj[field.DataNodeName][field.DataSeq].length] = newValue;
             }
         }
     }

+ 12 - 1
modules/reports/util/rpt_construct_data_util.js

@@ -133,7 +133,7 @@ class Rpt_Data_Extractor {
     };
 
     //-- 根据报表模板映射指标(非离散指标)的定义,罗列出所有需要用到的data对象key,作为数据请求的过滤依据
-    getDataRequestFilter(summaryRst) {
+    getDataRequestFilter(summaryRst, economicRst) {
         let rst = [];
         let tpl = this.rptTpl;
         let pri_func_chk_filter = function (field) {
@@ -177,6 +177,17 @@ class Rpt_Data_Extractor {
                     }
                 }
             }
+            if (economicRst instanceof Array) {
+                for (let key of consts.projectFieldConstList) {
+                    if (economicRst.indexOf(key) < 0) {
+                        if (field[JV.PROP_FIELD_EXP_MAP]) {
+                            if (field[JV.PROP_FIELD_EXP_MAP].indexOf('.' + key + '.') >= 0) {
+                                economicRst.push(key);
+                            }
+                        }
+                    }
+                }
+            }
         };
         let pri_setup_filter = function (FIELD_LIST_KEY) {
             if (tpl[JV.NODE_FIELD_MAP][FIELD_LIST_KEY]) {

+ 3 - 2
test/unit/reports/test_rpt_test_template.js

@@ -49,7 +49,8 @@ let demoPrjId = - 1;
 // let demoRptId = 756; //江西 封1
 // let demoRptId = 710; //qa 01
 // let demoRptId = 931; //qa 内蒙古2017 【扉-1】招标工程量清单扉页
-let demoRptId = 957; //qa 内蒙古2017 12-4
+// let demoRptId = 957; //qa 内蒙古2017 12-4
+let demoRptId = 1006; //qa 重庆2018 A03
 // let demoRptId = 475; //计日工
 // let demoRptId = 551; //表05
 let pagesize = "A4";
@@ -66,7 +67,7 @@ let userId_me = "5b6a60b1c4ba33000dd417c0"; //我的
 // demoPrjId = 2260; //QA:
 // demoPrjId = 5029; //
 // demoPrjId = 5029; //项目名称过长
-demoPrjId = 8417; //
+demoPrjId = 8464; //
 // demoPrjId = 4107; //UAT:
 //*/
 let userId_Dft = userId_Leng;

+ 5 - 1
web/building_saas/main/js/models/calc_program.js

@@ -98,7 +98,11 @@ let calcTools = {
     getNodeByID: function (ID){
         return cbTools.getNodeByID(ID);
     },
-
+    // 是否是标题清单
+    isTitleBills: function (node) {
+        let flag = node.getFlag();
+        return titleFlags.includes(flag);
+    },
     isBill: function(treeNode){
         return treeNode.sourceType === ModuleNames.bills;
     },

+ 12 - 11
web/building_saas/main/js/models/exportStandardInterface.js

@@ -546,7 +546,7 @@ const XMLStandard = (function () {
                     failHint: `第${source.row}行清单-“名称”`},
                 {name: '计算基础表达式', value: source.calcBase, required: true},
                 {name: '计算基础说明', value: source.calcBaseState},
-                {name: '费率', value: exportKind === _config.EXPORT_KIND.Tender ? source.feeRate : '100', required: true},
+                {name: '费率', value: exportKind === _config.EXPORT_KIND.Tender ? source.feeRate : '0', required: true},
                 {name: '金额', value: exportKind === _config.EXPORT_KIND.Tender ? _util.getFee(source.fees, 'common.totalFee') : '0', required: true},
                 {name: '暂估价标志', value: !!source.isEstimate, type: _config.TYPE.BOOL},
                 {name: '备注', value: source.remark},
@@ -585,7 +585,7 @@ const XMLStandard = (function () {
         //暂列金额定义
         function Provisional(source) {
             let attrs = [
-                {name: '金额', value: exportKind === _config.EXPORT_KIND.Tender ? _util.getFee(source.fees, 'common.totalFee') : '0', type: _config.TYPE.NUM2}
+                {name: '金额', value: _util.getFee(source.fees, 'common.totalFee'), type: _config.TYPE.NUM2}
             ];
             XML_EXPORT_BASE.Element.call(this, '暂列金额', attrs);
         }
@@ -598,7 +598,7 @@ const XMLStandard = (function () {
                     failHint: `第${source.row}行暂列金额清单-“名称”`},
                 {name: '计量单位', value: source.unit, maxLen: 20, required: true,
                     failHint: `第${source.row}行暂列金额清单-“单位”`},
-                {name: '金额', value: exportKind === _config.EXPORT_KIND.Tender ? _util.getFee(source.fees, 'common.totalFee') : '0',
+                {name: '金额', value: _util.getFee(source.fees, 'common.totalFee'),
                     type: _config.TYPE.NUM2, required: true},
                 {name: '备注', value: source.remark, required: true}
             ];
@@ -607,7 +607,7 @@ const XMLStandard = (function () {
         //专业工程暂估价定义
         function EngEstimate(source) {
             let attrs = [
-                {name: '金额', value: exportKind === _config.EXPORT_KIND.Tender ? _util.getFee(source.fees, 'common.totalFee') : '0'}
+                {name: '金额', value: _util.getFee(source.fees, 'common.totalFee')}
             ];
             XML_EXPORT_BASE.Element.call(this, '专业工程暂估价', attrs);
         }
@@ -620,7 +620,7 @@ const XMLStandard = (function () {
                     failHint: `第${source.row}行专业工程暂估清单-“名称”`},
                 {name: '工程内容', value: source.engineeringContent, maxLen: 2000, required: true,
                     failHint: `第${source.row}行专业工程暂估清单-“工程内容”`},
-                {name: '金额', value: exportKind === _config.EXPORT_KIND.Tender ? _util.getFee(source.fees, 'common.totalFee') : '0',
+                {name: '金额', value: _util.getFee(source.fees, 'common.totalFee'),
                     type: _config.TYPE.NUM2, required: true},
                 {name: '备注', value: source.remark, required: true}
             ];
@@ -704,9 +704,9 @@ const XMLStandard = (function () {
                 {name: '项目名称', value: source.name, required: true},
                 {name: '计量单位', value: source.unit, required: true},
                 {name: '数量', value: source.quantity, type: _config.TYPE.DECIMAL, required: true},
-                {name: '单价', value: exportKind === _config.EXPORT_KIND.Tender ? _util.getFee(source.fees, 'common.unitFee') : '0',
+                {name: '单价', value: _util.getFee(source.fees, 'common.unitFee'),
                     type: _config.TYPE.DECIMAL, required: true},
-                {name: '合价', value: exportKind === _config.EXPORT_KIND.Tender ? _util.getFee(source.fees, 'common.totalFee') : '0',
+                {name: '合价', value: _util.getFee(source.fees, 'common.totalFee'),
                     type: _config.TYPE.NUM2, required: true},
                 {name: '依据', value: source.claimVisa, required: true},
             ];
@@ -748,10 +748,10 @@ const XMLStandard = (function () {
                 {name: '行代号', value: source.rowCode, maxLen: 20, required: true},
                 {name: '名称', value: source.name, minLen: 1, maxLen: 255, whiteSpace: _config.WHITE_SPACE.COLLAPSE, required: true,
                     failHint: `第${source.row}行清单-“名称”`},
-                {name: '计算基础表达式', value: exportKind === _config.EXPORT_KIND.Tender ? source.calcBase : '', maxLen: 255, required: true,
+                {name: '计算基础表达式', value: source.calcBase, maxLen: 255, required: true,
                     failHint: `第${source.row}行清单-“计算基础表达式”`},
-                {name: '计算基础说明', value: exportKind === _config.EXPORT_KIND.Tender ? source.calcBaseState : '', maxLen: 255},
-                {name: '费率', value: exportKind === _config.EXPORT_KIND.Tender ? source.feeRate : '100', type: _config.TYPE.DECIMAL, required: true},
+                {name: '计算基础说明', value: source.calcBaseState, maxLen: 255},
+                {name: '费率', value: exportKind === _config.EXPORT_KIND.Tender ? source.feeRate : '0', type: _config.TYPE.DECIMAL, required: true},
                 {name: '金额', value: exportKind === _config.EXPORT_KIND.Tender ? _util.getFee(source.fees, 'common.totalFee') : '0', type: _config.TYPE.NUM2, required: true},
                 {name: '费用类别', value: source.feeType, enumeration: ['800', '900', '9001', '9002', '9003'], required: true,
                     enumerationHint: ['规费', '税金', '增值税', '附加税', '环境保护税'],
@@ -1727,7 +1727,7 @@ const XMLStandard = (function () {
                             code: node.data.code,
                             name: node.data.name,
                             serviceContent: node.data.serviceContent,
-                            calcBaseValue: node.data.calcBase,
+                            calcBaseValue: node.data.calcBaseValue,
                             feeRate: _util.hasValue(node.data.feeRate) ? node.data.feeRate : 100,
                             fees: node.data.fees,
                             remark: node.data.remark
@@ -1735,6 +1735,7 @@ const XMLStandard = (function () {
                         if (hasBillsClass) {
                             _failList.push(`第${source.row}行清单应是清单分类,其下必须有清单项目。<span style="color: red">(错误清单结构)</span>`);
                         }
+                        debugger;
                         parent.children.push(new TurnKeyContractItem(source));
                     }
                 }

+ 13 - 9
web/building_saas/main/js/models/importStandardInterface.js

@@ -709,9 +709,9 @@ const ImportXML = (() => {
                     unit: getValue(src, ['_计量单位']),
                     remark: getValue(src, ['_备注'])
                 };
-                if (importFileKind === FileKind.tender) {
+                //if (importFileKind === FileKind.tender) {
                     obj.fees = [{fieldName: 'common', totalFee: getValue(src, ['_金额']) || '0'},];
-                }
+                //}
                 return obj;
             })};
             //专业工程暂估价
@@ -723,9 +723,9 @@ const ImportXML = (() => {
                     engineeringContent: getValue(src, ['_工程内容']),
                     remark: getValue(src, ['_备注'])
                 };
-                if (importFileKind === FileKind.tender) {
+                //if (importFileKind === FileKind.tender) {
                     obj.fees = [{fieldName: 'common', totalFee: getValue(src, ['_金额']) || '0'},];
-                }
+                //}
                 return obj;
             })};
             //计日工
@@ -788,11 +788,11 @@ const ImportXML = (() => {
                     quantity: getValue(src, ['_数量']),
                     claimVisa: getValue(src, ['_依据'])
                 };
-                if (importFileKind === FileKind.tender) {
+                //if (importFileKind === FileKind.tender) {
                     obj.fees = [
                         {fieldName: 'common', unitFee: getValue(src, ['_单价']) || '0', totalFee: getValue(src, ['_合价']) || '0'}
                     ];
-                }
+                //}
                 return obj;
             }
             let claim = {items: arrayValue(otherSrc, ['索赔计价汇总', '签证索赔计价汇总费用项']).map(extractClaimVisa)},
@@ -1021,10 +1021,11 @@ const ImportXML = (() => {
                         ParentID: addtionalTax.ID,
                         NextSiblingID: -1,
                         name: feeBills.name,
+                        rowCode: feeBills.rowCode,
                         feeRate: feeBills.feeRate,
                     };
                     if (importFileKind === FileKind.tender) {
-                        subTaxData.rowCode = feeBills.rowCode;
+                        //subTaxData.rowCode = feeBills.rowCode;
                         subTaxData.fees = feeBills.fees;
                     }
                     if (preSubTax) {
@@ -1062,12 +1063,13 @@ const ImportXML = (() => {
                         isMatched = true;
                         findBills.calcBase = feeBills.calcBase;
                         findBills.feeRate = feeBills.feeRate;
+                        findBills.rowCode = feeBills.rowCode;
                         //后台配置的feeRateID优先级比feeRate高,导入数据有费率值时,需要清空这个配置
                         if (findBills.feeRate && parseFloat(findBills.feeRate) !== 0) {
                             findBills.feeRateID = null;
                         }
                         if (importFileKind === FileKind.tender) {
-                            findBills.rowCode = feeBills.rowCode;
+                            //findBills.rowCode = feeBills.rowCode;
                             findBills.fees = feeBills.fees;
                         }
                         break;
@@ -1079,11 +1081,12 @@ const ImportXML = (() => {
                             ParentID: -1,
                             NextSiblingID: -1,
                             name: feeBills.name,
+                            rowCode: feeBills.rowCode,
                             calcBase: feeBills.calcBase,
                             feeRate: feeBills.feeRate,
                         };
                         if (importFileKind === FileKind.tender) {
-                            dxfyData.rowCode = feeBills.rowCode;
+                            //dxfyData.rowCode = feeBills.rowCode;
                             dxfyData.fees = feeBills.fees;
                         }
                         if (!preDXFY) {
@@ -1119,6 +1122,7 @@ const ImportXML = (() => {
                     matchBills.calcBase = curBills.calcBase;
                     matchBills.feeRate = curBills.feeRate;
                     matchBills.fees = curBills.fees || [];
+                    matchBills.rowCode = curBills.rowCode;
                     if (curBills.flags && curBills.flags.length) {
                         matchBills.flags = curBills.flags;
                     }

+ 14 - 0
web/building_saas/main/js/models/main_consts.js

@@ -272,6 +272,20 @@ const fixedFlag = {
     //组织措施费
     ORGANIZATION:32,
 };
+// 只读的固定类别(工程量、单价、综合合价只读,相当于是标题)
+const titleFlags = [
+    fixedFlag.PROVISIONAL,
+    fixedFlag.ESTIMATE,
+    fixedFlag.ENGINEERING_ESITIMATE,
+    fixedFlag.DAYWORK,
+    fixedFlag.LABOUR,
+    fixedFlag.MATERIAL,
+    fixedFlag.MACHINE,
+    fixedFlag.TURN_KEY_CONTRACT,
+    fixedFlag.CLAIM_VISA,
+    fixedFlag.CLAIM,
+    fixedFlag.VISA
+];
 const gljKeyArray =['code','name','specs','unit','type'];
 const rationKeyArray =['code','name','specs','unit','subType'];
 const gljLibKeyArray =['code', 'name', 'specs', 'unit', 'gljType'];

+ 8 - 4
web/building_saas/main/js/models/project.js

@@ -30,7 +30,7 @@ var PROJECT = {
             });
 
         };
-        tools.doAfterLoad = function(result, callback){
+        tools.doAfterLoad = function(result, showProjectInfo, callback){
             var counter;
             //必须要先load ProjectInfo的信息
             let projectInfoModule = result.find(data => data.moduleName === ModuleNames.projectInfo);
@@ -56,7 +56,9 @@ var PROJECT = {
                     me.modules[module].setMaxID(counter[module]);
                 }
             }
-            projectInfoObj.showProjectInfo(me._project.projectInfo);
+            if (showProjectInfo) {
+                projectInfoObj.showProjectInfo(me._project.projectInfo);
+            }
             me._project.loadMainTree();
             //me.test(result[0].data[0]);
             if (callback) {
@@ -236,7 +238,8 @@ var PROJECT = {
                 timeout: 50000,
                 success: function (result) {
                     if (!result.error) {
-                        tools.doAfterLoad(result.data, callback);
+                        let showProjectInfo = true;
+                        tools.doAfterLoad(result.data, showProjectInfo, callback);
                         // for test calc
                         //tools.doAfterLoad([{moduleName: 'bills', data: BillsData}, {'moduleName': 'ration', data: DrawingData}], callback);
                     } else {
@@ -252,7 +255,8 @@ var PROJECT = {
         project.prototype.loadDataSync = async function () {
             let data = await ajaxPost('/project/getData', {user_id: tools._userID, project_id: tools._ID});
             if (data) {
-                tools.doAfterLoad(data);
+                let showProjectInfo = false;
+                tools.doAfterLoad(data, showProjectInfo);
             }
         };
 

+ 2 - 0
web/building_saas/main/js/views/export_view.js

@@ -82,6 +82,7 @@ const ExportView = (() => {
                         _exportCache.push(...exportData);
                     }
                 }
+                failList = [...new Set(failList)];
                 //设置提示弹窗
                 if (failList.length * 20 > 400) {
                     $('#hintBox_caption').addClass('export-check');
@@ -125,6 +126,7 @@ const ExportView = (() => {
                     }
                     pr.end();
                 }
+                failList = [...new Set(failList)];
                 //错误-设置提示弹窗
                 if (failList.length * 20 > 400) {
                     $('#hintBox_caption').addClass('export-check');

+ 28 - 0
web/building_saas/main/js/views/main_tree_col.js

@@ -114,6 +114,10 @@ let MainTreeCol = {
             // 2018-11-15 zhang
             let Bills =projectObj.project.Bills;
             if(node.sourceType == ModuleNames.bills){//针对清单、分项部分
+                // 属于标题清单,只读
+                if (calcTools.isTitleBills(node)) {
+                    return true;
+                }
                 // 当前属于分部分项、施工技术措施项目,综合单价只读。
                 if(Bills.isFBFX(node)||Bills.isTechMeasure(node)) return true;
                 // 不属于分部分项、施工技术措施项目的部分,如果不是叶子清单,或有基数计算/定额/量价/人材机 只读
@@ -124,6 +128,11 @@ let MainTreeCol = {
             return false;
         },
         commonTotalFee: function (node) {
+            // 属于标题清单,只读
+            if (node.sourceType == ModuleNames.bills &&
+                calcTools.isTitleBills(node)) {
+                return true;
+            }
             // 09-29 zhang
             let Bills =projectObj.project.Bills;
             // 当前属于分部分项、施工技术措施项目,综合单价只读。
@@ -195,6 +204,11 @@ let MainTreeCol = {
             return (!MainTreeCol.readOnly.billsParent(node)) && (node.children.length > 0);
         },
         forCalcBase: function (node) {
+            // 属于标题清单,只读
+            if (node.sourceType == ModuleNames.bills &&
+                calcTools.isTitleBills(node)) {
+                return true;
+            }
             // to do according to billsParentType
             return MainTreeCol.readOnly.billsParent(node) || MainTreeCol.readOnly.non_bills(node) || MainTreeCol.readOnly.leafBillsWithDetail(node) || MainTreeCol.readOnly.calcBaseType(node);
         },
@@ -209,6 +223,11 @@ let MainTreeCol = {
         },
         forFeeRate: function (node) {
             let readOnly = true;
+            // 属于标题清单,只读
+            if (node.sourceType == ModuleNames.bills &&
+                calcTools.isTitleBills(node)) {
+                return true;
+            }
             let Bills = projectObj.project.Bills;
             //只有当选中节点是清单,并且不属于“分部分项工程”或“技术措施项目”,并且是叶子清单且没有定额/量价/工料机时,费率列才可编辑
             if(MainTreeCol.readOnly.bills(node)){
@@ -220,6 +239,10 @@ let MainTreeCol = {
         },
         forQuantity: function (node) {
             if(node.sourceType === projectObj.project.Bills.getSourceType()){
+                // 属于标题清单,只读
+                if (calcTools.isTitleBills(node)) {
+                    return true;
+                }
                 if(node.data.type==billType.DXFY||node.data.type==billType.FB||(node.data.type==billType.BILL&&MainTreeCol.readOnly.billsParent(node))){//大项费用、分部、清单父项行,工程量只读。
                     return true;
                 }
@@ -247,6 +270,11 @@ let MainTreeCol = {
             return false;
         },
         forName:function (node) {
+            // 属于标题清单,只读
+            if (node.sourceType == ModuleNames.bills &&
+                calcTools.isTitleBills(node)) {
+                return true;
+            }
             if(projectObj.project.Bills.isTopThreeNode(node)){//是大项1、2、3项的编号设置为只读
                 return true;
             }