|  | @@ -174,6 +174,45 @@ function getDaglText(data) {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  $(document).ready(() => {
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    const exportExcelSetting = {
 | 
	
		
			
				|  |  | +        cols: [
 | 
	
		
			
				|  |  | +            {title: '项目节编号', colSpan: '1', rowSpan: '2', field: 'code', hAlign: 0, width: 145, formatter: '@', cellType: 'tree'},
 | 
	
		
			
				|  |  | +            {title: '清单编号', colSpan: '1', rowSpan: '2', field: 'b_code', hAlign: 0, width: 70, formatter: '@'},
 | 
	
		
			
				|  |  | +            {title: '计量单元', colSpan: '1', rowSpan: '2', field: 'pos_code', hAlign: 0, width: 70, formatter: '@'},
 | 
	
		
			
				|  |  | +            {title: '名称', colSpan: '1', rowSpan: '2', field: 'name', hAlign: 0, width: 185, formatter: '@'},
 | 
	
		
			
				|  |  | +            {title: '单位', colSpan: '1', rowSpan: '2', field: 'unit', hAlign: 1, width: 60, formatter: '@', cellType: 'unit'},
 | 
	
		
			
				|  |  | +            {title: '单价', colSpan: '1', rowSpan: '2', field: 'unit_price', hAlign: 2, width: 60, type: 'Number'},
 | 
	
		
			
				|  |  | +            {title: '台账|数量', colSpan: '2|1', rowSpan: '1|1', field: 'quantity', hAlign: 2, width: 60, type: 'Number'},
 | 
	
		
			
				|  |  | +            {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'total_price', hAlign: 2, width: 60, type: 'Number'},
 | 
	
		
			
				|  |  | +            {title: '本期合同计量|数量', colSpan: '2|1', rowSpan: '1|1', field: 'contract_qty', hAlign: 2, width: 60, type: 'Number'},
 | 
	
		
			
				|  |  | +            {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'contract_tp', hAlign: 2, width: 60, type: 'Number'},
 | 
	
		
			
				|  |  | +            {title: '本期数量变更|数量', colSpan: '2|1', rowSpan: '1|1', field: 'qc_qty', hAlign: 2, width: 60, type: 'Number'},
 | 
	
		
			
				|  |  | +            {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'qc_tp', hAlign: 2, width: 60, type: 'Number'},
 | 
	
		
			
				|  |  | +            {title: '本期完成计量|数量', colSpan: '2|1', rowSpan: '1|1', field: 'gather_qty', hAlign: 2, width: 60, type: 'Number'},
 | 
	
		
			
				|  |  | +            {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'gather_tp', hAlign: 2, width: 60, type: 'Number'},
 | 
	
		
			
				|  |  | +            {title: '截止本期合同计量|数量', colSpan: '2|1', rowSpan: '1|1', field: 'end_contract_qty', hAlign: 2, width: 60, type: 'Number'},
 | 
	
		
			
				|  |  | +            {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'end_contract_tp', hAlign: 2, width: 60, type: 'Number'},
 | 
	
		
			
				|  |  | +            {title: '截止本期数量变更|数量', colSpan: '2|1', rowSpan: '1|1', field: 'end_qc_qty', hAlign: 2, width: 60, type: 'Number'},
 | 
	
		
			
				|  |  | +            {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'end_qc_tp', hAlign: 2, width: 60, type: 'Number'},
 | 
	
		
			
				|  |  | +            {title: '截止本期完成计量|数量', colSpan: '3|1', rowSpan: '1|1', field: 'end_gather_qty', hAlign: 2, width: 60, type: 'Number'},
 | 
	
		
			
				|  |  | +            {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'end_gather_tp', hAlign: 2, width: 60, type: 'Number'},
 | 
	
		
			
				|  |  | +            {title: '|完成率(%)', colSpan: '|1', rowSpan: '|1', field: 'end_gather_percent', hAlign: 2, width: 80, type: 'Number'},
 | 
	
		
			
				|  |  | +            {title: '合同|项目节数量1',  colSpan: '2|1', rowSpan: '1|1', field: 'deal_dgn_qty1', hAlign: 2, width: 60, type: 'Number'},
 | 
	
		
			
				|  |  | +            {title: '|项目节数量2',  colSpan: '|1', rowSpan: '|1', field: 'deal_dgn_qty2', hAlign: 2, width: 60, type: 'Number'},
 | 
	
		
			
				|  |  | +            {title: '变更|项目节数量1',  colSpan: '2|1', rowSpan: '1|1', field: 'c_dgn_qty1', hAlign: 2, width: 60, type: 'Number'},
 | 
	
		
			
				|  |  | +            {title: '|项目节数量2',  colSpan: '|1', rowSpan: '|1', field: 'c_dgn_qty2', hAlign: 2, width: 60, type: 'Number'},
 | 
	
		
			
				|  |  | +            {title: '经济指标',  colSpan: '1', rowSpan: '2', field: 'final_dgn_price', hAlign: 2, width: 60, type: 'Number'},
 | 
	
		
			
				|  |  | +            {title: '本期批注', colSpan: '1', rowSpan: '2', field: 'postil', hAlign: 0, width: 100, formatter: '@', cellType: 'autoTip'},
 | 
	
		
			
				|  |  | +            {title: '图(册)号', colSpan: '1', rowSpan: '2', field: 'drawing_code', hAlign: 0, width: 80, formatter: '@'},
 | 
	
		
			
				|  |  | +            {title: '备注', colSpan: '1', rowSpan: '2', field: 'memo', hAlign: 0, width: 100, formatter: '@', cellType: 'ellipsisAutoTip'},
 | 
	
		
			
				|  |  | +        ],
 | 
	
		
			
				|  |  | +        headRows: 2,
 | 
	
		
			
				|  |  | +        headRowHeight: [25, 25],
 | 
	
		
			
				|  |  | +        defaultRowHeight: 21,
 | 
	
		
			
				|  |  | +        headerFont: 'bold 10px 微软雅黑',
 | 
	
		
			
				|  |  | +        font: '10px 微软雅黑'
 | 
	
		
			
				|  |  | +    };
 | 
	
		
			
				|  |  |      let detail, searchLedger, checkedChanges;
 | 
	
		
			
				|  |  |      const checkOption = {
 | 
	
		
			
				|  |  |          sibling: { enable: 0 },
 | 
	
	
		
			
				|  | @@ -1258,6 +1297,45 @@ $(document).ready(() => {
 | 
	
		
			
				|  |  |                  stagePosSpreadObj.loadCurPosData();
 | 
	
		
			
				|  |  |                  $('#calc-by-ratio').modal('hide');
 | 
	
		
			
				|  |  |              });
 | 
	
		
			
				|  |  | +        },
 | 
	
		
			
				|  |  | +        exportExcel: function (filename, nodes) {
 | 
	
		
			
				|  |  | +            const exportNodesData = function (data, nodes) {
 | 
	
		
			
				|  |  | +                for (const node of nodes) {
 | 
	
		
			
				|  |  | +                    data.push({
 | 
	
		
			
				|  |  | +                        code: node.code, b_code: node.b_code, name: node.name, unit: node.unit,
 | 
	
		
			
				|  |  | +                        unit_price: node.unit_price, quantity: node.quantity, total_price: node.total_price,
 | 
	
		
			
				|  |  | +                        contract_qty: node.contract_qty, contract_tp: node.contract_tp,
 | 
	
		
			
				|  |  | +                        qc_qty: node.qc_qty, qc_tp: node.qc_tp,
 | 
	
		
			
				|  |  | +                        gather_qty: node.gather_qty, gather_tp: node.gather_tp,
 | 
	
		
			
				|  |  | +                        end_contract_qty: node.end_contract_qty, end_contract_tp: node.end_contract_tp,
 | 
	
		
			
				|  |  | +                        end_qc_qty: node.end_qc_qty, end_qc_tp: node.end_qc_tp,
 | 
	
		
			
				|  |  | +                        end_gather_qty: node.end_gather_qty, end_gather_tp: node.end_gather_tp, end_gather_percent: node.end_gather_percent,
 | 
	
		
			
				|  |  | +                        deal_dgn_qty1: node.deal_dgn_qty1, deal_dgn_qty2: node.deal_dgn_qty2,
 | 
	
		
			
				|  |  | +                        c_dgn_qty1: node.c_dgn_qty1, c_dgn_qty2: node.c_dgn_qty2,
 | 
	
		
			
				|  |  | +                        final_dgn_price: node.final_dgn_price,
 | 
	
		
			
				|  |  | +                        postil: node.postil, drawing_code: node.drawing_code, memo: node.memo,
 | 
	
		
			
				|  |  | +                    });
 | 
	
		
			
				|  |  | +                    if (node.children && node.children.length > 0) {
 | 
	
		
			
				|  |  | +                        exportNodesData(data, node.children);
 | 
	
		
			
				|  |  | +                    } else {
 | 
	
		
			
				|  |  | +                        const posRange = stagePos.getLedgerPos(node.id);
 | 
	
		
			
				|  |  | +                        if (posRange && posRange.length > 0) {
 | 
	
		
			
				|  |  | +                            for (const [i, p] of posRange.entries()) {
 | 
	
		
			
				|  |  | +                                data.push({
 | 
	
		
			
				|  |  | +                                    pos_code: (i + 1) + '', name: p.name,
 | 
	
		
			
				|  |  | +                                    quantity: p.quantity,
 | 
	
		
			
				|  |  | +                                    contract_qty: p.contract_qty, qc_qty: p.qc_qty, gather_qty: p.gather_qty,
 | 
	
		
			
				|  |  | +                                    end_contract_qty: p.end_contract_qty, end_qc_qty: p.end_qc_qty, end_gather_qty: p.end_gather_qty,
 | 
	
		
			
				|  |  | +                                    drawing_code: p.drawing_code, memo: p.memo
 | 
	
		
			
				|  |  | +                                });
 | 
	
		
			
				|  |  | +                            }
 | 
	
		
			
				|  |  | +                        }
 | 
	
		
			
				|  |  | +                    }
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +            };
 | 
	
		
			
				|  |  | +            const data = [];
 | 
	
		
			
				|  |  | +            exportNodesData(data, nodes ? nodes : stageTree.children);
 | 
	
		
			
				|  |  | +            SpreadExcelObj.exportSimpleXlsxSheet(exportExcelSetting, data, filename);
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |      };
 | 
	
		
			
				|  |  |      slSpread.bind(spreadNS.Events.EditEnded, stageTreeSpreadObj.editEnded);
 | 
	
	
		
			
				|  | @@ -1369,6 +1447,18 @@ $(document).ready(() => {
 | 
	
		
			
				|  |  |                      return !node;
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |              },
 | 
	
		
			
				|  |  | +            exportSpr: '----',
 | 
	
		
			
				|  |  | +            exportSelectNodeXlsx: {
 | 
	
		
			
				|  |  | +                name: '导出选中节点至Excel',
 | 
	
		
			
				|  |  | +                callback: function (key, opt, menu, e) {
 | 
	
		
			
				|  |  | +                    const node = SpreadJsObj.getSelectObject(slSpread.getActiveSheet());
 | 
	
		
			
				|  |  | +                    stageTreeSpreadObj.exportExcel($('.sidebar-title').attr('data-original-title') + `计量台账(${node.name || ''}).xlsx`, [node]);
 | 
	
		
			
				|  |  | +                },
 | 
	
		
			
				|  |  | +                disabled: function (key, opt) {
 | 
	
		
			
				|  |  | +                    const node = SpreadJsObj.getSelectObject(slSpread.getActiveSheet());
 | 
	
		
			
				|  |  | +                    return !node;
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |      });
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -3900,44 +3990,6 @@ $(document).ready(() => {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      $('#exportExcel').click(function () {
 | 
	
		
			
				|  |  |          const data = [];
 | 
	
		
			
				|  |  | -        const setting = {
 | 
	
		
			
				|  |  | -            cols: [
 | 
	
		
			
				|  |  | -                {title: '项目节编号', colSpan: '1', rowSpan: '2', field: 'code', hAlign: 0, width: 145, formatter: '@', cellType: 'tree'},
 | 
	
		
			
				|  |  | -                {title: '清单编号', colSpan: '1', rowSpan: '2', field: 'b_code', hAlign: 0, width: 70, formatter: '@'},
 | 
	
		
			
				|  |  | -                {title: '计量单元', colSpan: '1', rowSpan: '2', field: 'pos_code', hAlign: 0, width: 70, formatter: '@'},
 | 
	
		
			
				|  |  | -                {title: '名称', colSpan: '1', rowSpan: '2', field: 'name', hAlign: 0, width: 185, formatter: '@'},
 | 
	
		
			
				|  |  | -                {title: '单位', colSpan: '1', rowSpan: '2', field: 'unit', hAlign: 1, width: 60, formatter: '@', cellType: 'unit'},
 | 
	
		
			
				|  |  | -                {title: '单价', colSpan: '1', rowSpan: '2', field: 'unit_price', hAlign: 2, width: 60, type: 'Number'},
 | 
	
		
			
				|  |  | -                {title: '台账|数量', colSpan: '2|1', rowSpan: '1|1', field: 'quantity', hAlign: 2, width: 60, type: 'Number'},
 | 
	
		
			
				|  |  | -                {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'total_price', hAlign: 2, width: 60, type: 'Number'},
 | 
	
		
			
				|  |  | -                {title: '本期合同计量|数量', colSpan: '2|1', rowSpan: '1|1', field: 'contract_qty', hAlign: 2, width: 60, type: 'Number'},
 | 
	
		
			
				|  |  | -                {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'contract_tp', hAlign: 2, width: 60, type: 'Number'},
 | 
	
		
			
				|  |  | -                {title: '本期数量变更|数量', colSpan: '2|1', rowSpan: '1|1', field: 'qc_qty', hAlign: 2, width: 60, type: 'Number'},
 | 
	
		
			
				|  |  | -                {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'qc_tp', hAlign: 2, width: 60, type: 'Number'},
 | 
	
		
			
				|  |  | -                {title: '本期完成计量|数量', colSpan: '2|1', rowSpan: '1|1', field: 'gather_qty', hAlign: 2, width: 60, type: 'Number'},
 | 
	
		
			
				|  |  | -                {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'gather_tp', hAlign: 2, width: 60, type: 'Number'},
 | 
	
		
			
				|  |  | -                {title: '截止本期合同计量|数量', colSpan: '2|1', rowSpan: '1|1', field: 'end_contract_qty', hAlign: 2, width: 60, type: 'Number'},
 | 
	
		
			
				|  |  | -                {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'end_contract_tp', hAlign: 2, width: 60, type: 'Number'},
 | 
	
		
			
				|  |  | -                {title: '截止本期数量变更|数量', colSpan: '2|1', rowSpan: '1|1', field: 'end_qc_qty', hAlign: 2, width: 60, type: 'Number'},
 | 
	
		
			
				|  |  | -                {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'end_qc_tp', hAlign: 2, width: 60, type: 'Number'},
 | 
	
		
			
				|  |  | -                {title: '截止本期完成计量|数量', colSpan: '3|1', rowSpan: '1|1', field: 'end_gather_qty', hAlign: 2, width: 60, type: 'Number'},
 | 
	
		
			
				|  |  | -                {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'end_gather_tp', hAlign: 2, width: 60, type: 'Number'},
 | 
	
		
			
				|  |  | -                {title: '|完成率(%)', colSpan: '|1', rowSpan: '|1', field: 'end_gather_percent', hAlign: 2, width: 80, type: 'Number'},
 | 
	
		
			
				|  |  | -                {title: '合同|项目节数量1',  colSpan: '2|1', rowSpan: '1|1', field: 'deal_dgn_qty1', hAlign: 2, width: 60, type: 'Number'},
 | 
	
		
			
				|  |  | -                {title: '|项目节数量2',  colSpan: '|1', rowSpan: '|1', field: 'deal_dgn_qty2', hAlign: 2, width: 60, type: 'Number'},
 | 
	
		
			
				|  |  | -                {title: '变更|项目节数量1',  colSpan: '2|1', rowSpan: '1|1', field: 'c_dgn_qty1', hAlign: 2, width: 60, type: 'Number'},
 | 
	
		
			
				|  |  | -                {title: '|项目节数量2',  colSpan: '|1', rowSpan: '|1', field: 'c_dgn_qty2', hAlign: 2, width: 60, type: 'Number'},
 | 
	
		
			
				|  |  | -                {title: '经济指标',  colSpan: '1', rowSpan: '2', field: 'final_dgn_price', hAlign: 2, width: 60, type: 'Number'},
 | 
	
		
			
				|  |  | -                {title: '本期批注', colSpan: '1', rowSpan: '2', field: 'postil', hAlign: 0, width: 100, formatter: '@', cellType: 'autoTip'},
 | 
	
		
			
				|  |  | -                {title: '图(册)号', colSpan: '1', rowSpan: '2', field: 'drawing_code', hAlign: 0, width: 80, formatter: '@'},
 | 
	
		
			
				|  |  | -                {title: '备注', colSpan: '1', rowSpan: '2', field: 'memo', hAlign: 0, width: 100, formatter: '@', cellType: 'ellipsisAutoTip'},
 | 
	
		
			
				|  |  | -            ],
 | 
	
		
			
				|  |  | -            headRows: 2,
 | 
	
		
			
				|  |  | -            headRowHeight: [25, 25],
 | 
	
		
			
				|  |  | -            defaultRowHeight: 21,
 | 
	
		
			
				|  |  | -            headerFont: 'bold 10px 微软雅黑',
 | 
	
		
			
				|  |  | -            font: '10px 微软雅黑'
 | 
	
		
			
				|  |  | -        };
 | 
	
		
			
				|  |  |          for (const node of stageTree.nodes) {
 | 
	
		
			
				|  |  |              data.push({
 | 
	
		
			
				|  |  |                  code: node.code, b_code: node.b_code, name: node.name, unit: node.unit,
 | 
	
	
		
			
				|  | @@ -3967,7 +4019,7 @@ $(document).ready(() => {
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -        SpreadExcelObj.exportSimpleXlsxSheet(setting, data, $('.sidebar-title').attr('data-original-title') + "计量台账.xlsx");
 | 
	
		
			
				|  |  | +        SpreadExcelObj.exportSimpleXlsxSheet(exportExcelSetting, data, $('.sidebar-title').attr('data-original-title') + "计量台账.xlsx");
 | 
	
		
			
				|  |  |      });
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      $('#cbr-check-all').click(function () {
 |