| 
					
				 | 
			
			
				@@ -1516,7 +1516,7 @@ const XMLStandard = (function () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         function WorkContent(contentText, fee) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             const attrs = [ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 // 定额工作内容 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                { name: 'Name', dName: '定额工作内容', required: true, value: contentText, minLen: 1 }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                { name: 'Name', dName: '定额工作内容', required: true, value: contentText }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 // 取此工作内容下定额子目/量价/定额同级人材机的综合合价之和 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 { name: 'Total', type: _type.DECIMAL, value: fee }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 { name: 'Remark', value: '' } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1636,7 +1636,7 @@ const XMLStandard = (function () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             const row = node.serialNo() + 1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             const attrs = [ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 // 名称 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                { name: 'Name', dName: '名称', required: true, minLen: 1, value: bills.name, failHint: `第${row}行清单-“项目名称”`}, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                { name: 'Name', dName: '名称', required: true, minLen: 1, value: bills.name, failHint: `第${row}行清单-“项目名称”` }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 // 金额 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 { name: 'Total', type: _type.DECIMAL, value: _util.getFee(bills.fees, 'common.totalFee') }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 // 费用代号 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -2329,7 +2329,7 @@ const XMLStandard = (function () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 // 先计算人材机总消耗量,以供后面需要 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 gljUtil.calcProjectGLJQuantity(tenderDetail.projectGLJ.datas, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     tenderDetail.ration_glj.datas, tenderDetail.Ration.datas, tenderDetail.Bills.datas, Decimal.GLJ, _, scMathUtil); */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 // 单位工程费用汇总 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 const unitWorksSummary = loadUnitWorksSummary(tenderDetail); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 // 获取标准清单编码-取费类别映射表 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -2516,14 +2516,16 @@ const XMLStandard = (function () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         // 加载分部分项清单,这部分是分部分项工程和措施项目共用的 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         function loadFBFX(nodes, kind) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             return nodes.map(node => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                // 措施项目是叶子:如果无单位、且无定额、且综合合价=0时,判断为DivisionalWorks;否则,判断为WorkElement。 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                const isDivisionalMeasure = kind === BillsKind.MEASURE && !node.children.length && !node.data.unit && !+_util.getFee(node.data.fees, 'common.totalFee'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 let ele; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 // 有子清单的是分部 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                if (node.source.children.length) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (node.source.children.length || isDivisionalMeasure) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     ele = new DivisionalWorks(node.data); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     const summaryCost = new SummaryOfBasicCost(tenderDetail.mainTree.items, node); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     // 递归获取子元素 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     ele.children = [summaryCost, ...loadFBFX(node.children, kind)]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                } else { // 无子清单的是分项 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } else { // 无子清单的是分项(分部分项部分) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     ele = loadBills(node, kind); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 return ele; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -2539,16 +2541,27 @@ const XMLStandard = (function () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             // 工程量计算表 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             const expressElement = loadQuantityExpressions(tenderDetail.quantity_detail.datas, true, node.data.ID); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             workElement.children.push(...expressElement); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            // 相同工作内容的定额进行分组 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            // 相同工作内容的定额进行分组。若工作内容为空,则定额直接下挂到清单下 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             const workMap = _.groupBy(node.children, node => node.data.jobContentText || ''); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            const workContents = Object 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            const valueWorks = []; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            const emptyWorkRationNodes = []; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            Object 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 .entries(workMap) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                .map(([contentText, rationNodes]) => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    const workContent = new WorkContent(contentText, _util.getAggregateFee(rationNodes)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    workContent.children = rationNodes.map(node => loadRation(node, kind)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    return workContent; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                .forEach(([contentText, rationNodes]) => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if (contentText) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        valueWorks.push({ contentText, rationNodes }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        emptyWorkRationNodes.push(...rationNodes); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            const workContents = valueWorks.map(({ contentText, rationNodes }) => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                const workContent = new WorkContent(contentText, _util.getAggregateFee(rationNodes)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                workContent.children = rationNodes.map(node => loadRation(node, kind)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                return workContent; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             workElement.children.push(...workContents); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            const rations = emptyWorkRationNodes.map(node => loadRation(node, kind)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            workElement.children.push(...rations); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             return workElement 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -2681,7 +2694,7 @@ const XMLStandard = (function () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (!isValidDepth) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 _failList.push('计日工子项超过两层') 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                // 计日工最底层节点也需要是标题,否则检测平台会报错 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                // 计日工最底层节点也需要是标题,否则检测平台会报错(不过这样的话xsd) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 dayworkRate.children = loadGroupAndItems( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     daywork.children, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     (node) => new DayWorkRateGroup(node), 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -3007,4 +3020,4 @@ const XMLStandard = (function () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         saveAsFile 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-})(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+})(); 
			 |