| 
					
				 | 
			
			
				@@ -73,6 +73,7 @@ $(document).ready(() => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     if (thousandth) sjsSettingObj.setTpThousandthFormat(gclSpreadSetting); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     SpreadJsObj.initSheet(gclSpread.getActiveSheet(), gclSpreadSetting); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     const gclSheet = gclSpread.getActiveSheet(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     const leafXmjSpread = SpreadJsObj.createNewSpread($('#leaf-xmj-spread')[0]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     const leafXmjSpreadSetting = { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         cols: [ 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -103,6 +104,36 @@ $(document).ready(() => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     SpreadJsObj.initSheet(leafXmjSpread.getActiveSheet(), leafXmjSpreadSetting); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     const leafXmjSheet = leafXmjSpread.getActiveSheet(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    const gatherLeafXmjSpread = SpreadJsObj.createNewSpread($('#leaf-xmj-gather-spread')[0]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    const gatherLeafXmjSpreadSetting = { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        cols: [ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            {title: '项目节编号', colSpan: '1', rowSpan: '1', field: 'code', hAlign: 0, width: 120, formatter: '@'}, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            {title: '台账数量', colSpan: '1', rowSpan: '1', field: 'quantity', hAlign: 2, width: 80, type: 'Number'}, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            {title: '单位工程', colSpan: '1', rowSpan: '1', field: 'dwgc', hAlign: 0, width: 100, formatter: '@'}, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            {title: '分部工程', colSpan: '1', rowSpan: '1', field: 'fbgc', hAlign: 0, width: 100, formatter: '@'}, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            {title: '分项工程', colSpan: '1', rowSpan: '1', field: 'fxgc', hAlign: 0, width: 100, formatter: '@'}, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            {title: '细目', colSpan: '1', rowSpan: '1', field: 'jldy', hAlign: 0, width: 100, formatter: '@'}, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            {title: '计量单元', colSpan: '1', rowSpan: '1', field: 'bwmx', hAlign: 0, width: 100, formatter: '@'}, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            {title: '图册号', colSpan: '1', rowSpan: '1', field: 'drawing_code', hAlign: 0, width: 120, formatter: '@'}, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        ], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        emptyRows: 0, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        headRows: 1, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        headRowHeight: [32], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        headColWidth: [30], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        defaultRowHeight: 21, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        headerFont: '12px 微软雅黑', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        font: '12px 微软雅黑', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        readOnly: true, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        localCache: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            key: 'ledger-gather-leafXmj', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            colWidth: true, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    }; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    if (!isTz) gatherLeafXmjSpreadSetting.cols.splice(1, 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    if (thousandth) sjsSettingObj.setTpThousandthFormat(gatherLeafXmjSpreadSetting); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    const gatherLeafXmjSheet = gatherLeafXmjSpread.getActiveSheet(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    SpreadJsObj.initSheet(gatherLeafXmjSheet, gatherLeafXmjSpreadSetting); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     let gclGatherData; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     // 获取项目节数据 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     function loadLeafXmjData(iGclRow) { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -114,6 +145,16 @@ $(document).ready(() => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             SpreadJsObj.loadSheetData(leafXmjSheet, SpreadJsObj.DataType.Data, []); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    function loadGatherLeafXmjData(iGclRow) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        const gcl = iGclRow ? gclGatherData[iGclRow] : SpreadJsObj.getSelectObject(gclSheet); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        SpreadJsObj.resetTopAndSelect(gatherLeafXmjSheet); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        console.log(gcl.gatherLeafXmjs); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (gcl) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            SpreadJsObj.loadSheetData(gatherLeafXmjSheet, SpreadJsObj.DataType.Data, gcl.gatherLeafXmjs); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            SpreadJsObj.loadSheetData(gatherLeafXmjSheet, SpreadJsObj.DataType.Data, []); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     // 标红显示 签约-台账≠0 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     function checkCompareData() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         const sheet = gclSheet; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -134,6 +175,7 @@ $(document).ready(() => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         const iNewRow = info.newSelections[0].row; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if (!info.oldSelections || iNewRow !== info.oldSelections[0].row) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             loadLeafXmjData(iNewRow); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            loadGatherLeafXmjData(iNewRow); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -168,6 +210,7 @@ $(document).ready(() => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         gclGatherModel.loadDealBillsData(data.dealBills); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         gclGatherData = gclGatherModel.gatherGclData(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         gclGatherModel.checkDiffer(gclGatherData); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        gclGatherModel.reGatherLeafXmj(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         for (const gcl of gclGatherData) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             gcl.compare_qty = ZhCalc.sub(gcl.quantity, gcl.deal_bills_qty); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             gcl.compare_tp = ZhCalc.sub(gcl.total_price, gcl.deal_bills_tp); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -176,6 +219,7 @@ $(document).ready(() => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         SpreadJsObj.loadSheetData(gclSheet, SpreadJsObj.DataType.Data, gclGatherData); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         checkCompareData(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         loadLeafXmjData(0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        loadGatherLeafXmjData(0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         const chapterData = gclGatherModel.gatherChapterData(chapter, data.spec, ['total_price']); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         for (const c of chapterData) { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -222,6 +266,7 @@ $(document).ready(() => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         afterLocated: function () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             loadLeafXmjData(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            loadGatherLeafXmjData(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         calcSum: function (result) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             const sum = { name: '合计', searchIndex: -1 }; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -252,6 +297,21 @@ $(document).ready(() => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         leafXmjSpread.refresh(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    $('[name=gather-xmj]').change(function() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        const checkOption = $('[name=gather-xmj]:checked'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (checkOption.length === 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            toastr.warning('请至少选择一个汇总条件'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            return; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        const fields = []; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        for (const co of checkOption) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            fields.push(co.value); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        gclGatherModel.reGatherLeafXmj(fields); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        loadGatherLeafXmjData(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     $.subMenu({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         menu: '#sub-menu', miniMenu: '#sub-mini-menu', miniMenuList: '#mini-menu-list', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         toMenu: '#to-menu', toMiniMenu: '#to-mini-menu', 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -268,6 +328,7 @@ $(document).ready(() => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             autoFlashHeight(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             gclSpread.refresh(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             leafXmjSpread.refresh(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            gatherLeafXmjSpread.refresh(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     $.divResizer({ 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -277,6 +338,7 @@ $(document).ready(() => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             let bcontent = $(".bcontent-wrap") ? $(".bcontent-wrap").height() : 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $(".sp-wrap").height(bcontent-30); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             leafXmjSpread.refresh(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            gatherLeafXmjSpread.refresh(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     $.divResizer({ 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -284,6 +346,7 @@ $(document).ready(() => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         callback: function () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             gclSpread.refresh(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             leafXmjSpread.refresh(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            gatherLeafXmjSpread.refresh(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     $('#exportExcel').click(function () { 
			 |