|
@@ -1352,7 +1352,7 @@ const XMLStandard = (function () {
|
|
|
{
|
|
|
name: 'DivisionalAndElementalWorks', type: _type.DECIMAL,
|
|
|
// TODO value的处理速度可能需要优化
|
|
|
- value: node.isBelongToFlags([fixedFlag.SUB_ENGINERRING]) ? _util.getFeeByFlag(items, fixedFlag.SUB_ENGINERRING, 'common.totalFee') : '0'
|
|
|
+ value: node.isBelongToFlags([fixedFlag.SUB_ENGINERRING]) ? _util.getFeeByFlag(items, fixedFlag.SUB_ENGINERRING, 'common.totalFee') : '0'
|
|
|
},
|
|
|
// 措施项目费
|
|
|
{
|
|
@@ -2071,8 +2071,6 @@ const XMLStandard = (function () {
|
|
|
|
|
|
// 建设项目节点
|
|
|
let constructionProjectEle = null;
|
|
|
- // 建设项目评标材料
|
|
|
- const constructionBidEvaluations = [];
|
|
|
|
|
|
/*
|
|
|
* 加载数据,分两种数据类型
|
|
@@ -2118,7 +2116,7 @@ const XMLStandard = (function () {
|
|
|
});
|
|
|
// 建设项目表的人材机汇总、评标材料汇总
|
|
|
const constructionGLJSummary = loadConstructionGLJSummary();
|
|
|
- console.log(constructionGLJSummary);
|
|
|
+ const constructionBidEvaluations = loadConstructionBidEval();
|
|
|
const projectInstallationWorkCost = constructionProjectEle.children.find(ele => ele.name === 'ProjectInstallationWorkCost');
|
|
|
projectInstallationWorkCost.children.push(...constructionGLJSummary, ...constructionBidEvaluations);
|
|
|
return extractData;
|
|
@@ -2273,8 +2271,6 @@ const XMLStandard = (function () {
|
|
|
const gljSummary = loadGLJSummary();
|
|
|
// 评标材料
|
|
|
const bidEvaluations = loadBidEvaluation();
|
|
|
- // 建设项目需要显示的评标材料
|
|
|
- constructionBidEvaluations.push(...bidEvaluations);
|
|
|
unitWork.children.push(
|
|
|
attrInfo,
|
|
|
addiInfo,
|
|
@@ -2614,7 +2610,6 @@ const XMLStandard = (function () {
|
|
|
// 映射除了消耗量的字段,字段与字段间用特殊符号隔开,并作为映射的key,消耗量作为value
|
|
|
// 当除了消耗量和用消耗量关联计算的数据以外的字段都相等(包括组成物数据)时,认为是相同的人材机,不汇总消耗量,否则汇总消耗量
|
|
|
const allGLJMap = {};
|
|
|
- console.log(allGLJMap);
|
|
|
const splitStr = '{@}'; // 字段间分割符
|
|
|
const splitKeys = [
|
|
|
'code', 'name', 'specs', 'unit', 'riskCoe', 'standardPrice',
|
|
@@ -2702,6 +2697,47 @@ const XMLStandard = (function () {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ // 建设项目评标材料的映射表
|
|
|
+ // 映射除了消耗量的字段,字段与字段间用特殊符号隔开,并作为映射的key,消耗量作为value
|
|
|
+ const allBidEvalMap = {};
|
|
|
+ const bidEvalSplitKeys = [
|
|
|
+ 'seq', 'code', 'name', 'specs', 'unit', 'marketPrice', 'delivery',
|
|
|
+ 'delivery_address', 'originPlace', 'vender', 'qualityGrace', 'remark'
|
|
|
+ ];
|
|
|
+ // 合并数据(合并消耗量)
|
|
|
+ function mergeBidEval(glj) {
|
|
|
+ const connectKey = bidEvalSplitKeys.reduce((acc, key, index) => {
|
|
|
+ return `${acc}${index === 0 ? '' : splitStr}${glj[key]}`;
|
|
|
+ }, '');
|
|
|
+ glj.quantity = +glj.quantity; // 防止汇总的时候变成字符串拼接
|
|
|
+ if (!allBidEvalMap[connectKey]) {
|
|
|
+ allBidEvalMap[connectKey] = { serialNo: Object.keys(allBidEvalMap).length, quantity: glj.quantity };
|
|
|
+ } else {
|
|
|
+ allBidEvalMap[connectKey].quantity = scMathUtil.roundForObj(allBidEvalMap[connectKey].quantity + glj.quantity, Decimal.GLJ);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 加载建设项目评标材料数据
|
|
|
+ function loadConstructionBidEval() {
|
|
|
+ const gljList = [];
|
|
|
+ Object
|
|
|
+ .entries(allBidEvalMap)
|
|
|
+ .forEach(([connectKey, { serialNo, quantity }]) => {
|
|
|
+ const glj = connectKey
|
|
|
+ .split(splitStr)
|
|
|
+ .reduce((obj, value, index) => {
|
|
|
+ const attr = bidEvalSplitKeys[index];
|
|
|
+ obj[attr] = value;
|
|
|
+ return obj;
|
|
|
+ }, {});
|
|
|
+ glj.quantity = quantity;
|
|
|
+ glj.serialNo = serialNo;
|
|
|
+ gljList.push(glj);
|
|
|
+ });
|
|
|
+ return gljList
|
|
|
+ .sort((a, b) => a.serialNo - b.serialNo)
|
|
|
+ .map(glj => new BidEvaluationMainMaterial(glj));
|
|
|
+ }
|
|
|
+
|
|
|
// 加载评标材料
|
|
|
function loadBidEvaluation() {
|
|
|
const gljList = tenderDetail.projectGLJ.datas.gljList;
|
|
@@ -2717,6 +2753,21 @@ const XMLStandard = (function () {
|
|
|
glj.vender = projectGLJ.vender;
|
|
|
glj.qualityGrace = projectGLJ.qualityGrace;
|
|
|
}
|
|
|
+ const toMergeGLJ = _.cloneDeep(glj);
|
|
|
+ // 需要提前处理空值的情况,将合并数据需要判断的字段值进行空值统一处理,防止空值值不同(null, undefined, '')造成连接key判断错误
|
|
|
+ toMergeGLJ.seq = toMergeGLJ.seq || '';
|
|
|
+ toMergeGLJ.code = toMergeGLJ.code || '';
|
|
|
+ toMergeGLJ.name = toMergeGLJ.name || '';
|
|
|
+ toMergeGLJ.specs = toMergeGLJ.specs || '';
|
|
|
+ toMergeGLJ.unit = toMergeGLJ.unit || '';
|
|
|
+ toMergeGLJ.marketPrice = toMergeGLJ.marketPrice || '0';
|
|
|
+ toMergeGLJ.delivery = toMergeGLJ.delivery || '';
|
|
|
+ toMergeGLJ.delivery_address = toMergeGLJ.delivery_address || '';
|
|
|
+ toMergeGLJ.originPlace = toMergeGLJ.originPlace || '';
|
|
|
+ toMergeGLJ.vender = toMergeGLJ.vender || '';
|
|
|
+ toMergeGLJ.qualityGrace = toMergeGLJ.qualityGrace || '';
|
|
|
+ toMergeGLJ.remark = toMergeGLJ.remark || '';
|
|
|
+ mergeBidEval(toMergeGLJ);
|
|
|
return new BidEvaluationMainMaterial(glj);
|
|
|
});
|
|
|
}
|