|
@@ -11,6 +11,347 @@ let Template = mongoose.model('rpt_templates');
|
|
|
let rptTplDataFacade = require("../facade/rpt_tpl_data_facade");
|
|
let rptTplDataFacade = require("../facade/rpt_tpl_data_facade");
|
|
|
let fsUtil = require("../../../public/fsUtil");
|
|
let fsUtil = require("../../../public/fsUtil");
|
|
|
let pm_facade = require('../../../modules/pm/facade/pm_facade');
|
|
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 rptTplFacade from "../facade/rpt_template_facade";
|
|
|
import demoTemplateFacade from "../facade/rpt_tpl_data_demo_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) {
|
|
function getAllPagesCommon(user_id, prj_id, rpt_id, pageSize, orientation, customizeCfg, option, outputType, cb) {
|
|
|
let rptTpl = null;
|
|
let rptTpl = null;
|
|
|
rptTplFacade.getRptTemplate(rpt_id).then(function(rst) {
|
|
rptTplFacade.getRptTemplate(rpt_id).then(function(rst) {
|
|
@@ -229,9 +573,9 @@ function getAllPagesCommon(user_id, prj_id, rpt_id, pageSize, orientation, custo
|
|
|
if (rptTpl) {
|
|
if (rptTpl) {
|
|
|
let rptDataUtil = new rptDataExtractor();
|
|
let rptDataUtil = new rptDataExtractor();
|
|
|
rptDataUtil.initialize((rptTpl._doc)?rptTpl._doc:rptTpl);
|
|
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.length > 0) {
|
|
|
if (summaryRst.indexOf(`Construct`) >= 0 || summaryRst.indexOf(`ConstructDetail`) >= 0) {
|
|
if (summaryRst.indexOf(`Construct`) >= 0 || summaryRst.indexOf(`ConstructDetail`) >= 0) {
|
|
|
promiseArr[0] = pm_facade.getSummaryInfoByTender(prj_id, pm_facade.projectType.project);
|
|
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);
|
|
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) {
|
|
rptTplDataFacade.prepareProjectData(user_id, prj_id, filter, function (err, msg, rawDataObj) {
|
|
|
if (!err) {
|
|
if (!err) {
|
|
|
let buildPageData = function() {
|
|
let buildPageData = function() {
|
|
@@ -296,6 +643,13 @@ function getAllPagesCommon(user_id, prj_id, rpt_id, pageSize, orientation, custo
|
|
|
buildPageData(rawDataObj, rptDataUtil, rptTpl);
|
|
buildPageData(rawDataObj, rptDataUtil, rptTpl);
|
|
|
});
|
|
});
|
|
|
} else {
|
|
} 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);
|
|
buildPageData(rawDataObj, rptDataUtil, rptTpl);
|
|
|
}
|
|
}
|
|
|
/*/
|
|
/*/
|
|
@@ -745,3 +1099,4 @@ module.exports = {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
+
|