|
@@ -106,6 +106,34 @@ $(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: 'dwgc', hAlign: 0, width: 100, formatter: '@', visible: false},
|
|
|
+ {title: '分部工程', colSpan: '1', rowSpan: '1', field: 'fbgc', hAlign: 0, width: 100, formatter: '@', visible: false},
|
|
|
+ {title: '分项工程', colSpan: '1', rowSpan: '1', field: 'fxgc', hAlign: 0, width: 100, formatter: '@', visible: false},
|
|
|
+ {title: '细目', colSpan: '1', rowSpan: '1', field: 'jldy', hAlign: 0, width: 100, formatter: '@', visible: false},
|
|
|
+ {title: '计量单元', colSpan: '1', rowSpan: '1', field: 'bwmx', hAlign: 0, width: 100, formatter: '@'},
|
|
|
+ {title: '修订台账', colSpan: '1', rowSpan: '1', field: 'new_quantity', hAlign: 2, width: 80, type: 'Number'},
|
|
|
+ {title: '原台账', colSpan: '1', rowSpan: '1', field: 'org_quantity', hAlign: 2, width: 80, type: 'Number'},
|
|
|
+ ],
|
|
|
+ emptyRows: 0,
|
|
|
+ headRows: 1,
|
|
|
+ headRowHeight: [32],
|
|
|
+ headColWidth: [30],
|
|
|
+ defaultRowHeight: 21,
|
|
|
+ headerFont: '12px 微软雅黑',
|
|
|
+ font: '12px 微软雅黑',
|
|
|
+ readOnly: true,
|
|
|
+ localCache: {
|
|
|
+ key: 'ledger-gather-leafXmj',
|
|
|
+ colWidth: true,
|
|
|
+ },
|
|
|
+ };
|
|
|
+ if (thousandth) sjsSettingObj.setTpThousandthFormat(gatherLeafXmjSpreadSetting);
|
|
|
+ const gatherLeafXmjSheet = gatherLeafXmjSpread.getActiveSheet();
|
|
|
+ SpreadJsObj.initSheet(gatherLeafXmjSheet, gatherLeafXmjSpreadSetting);
|
|
|
+
|
|
|
let gclData = [];
|
|
|
// 获取项目节数据
|
|
|
function loadLeafXmjData(iGclRow) {
|
|
@@ -117,11 +145,21 @@ $(document).ready(() => {
|
|
|
SpreadJsObj.loadSheetData(leafXmjSheet, SpreadJsObj.DataType.Data, []);
|
|
|
}
|
|
|
}
|
|
|
+ function loadGatherLeafXmjData(iGclRow) {
|
|
|
+ const gcl = iGclRow ? gclData[iGclRow] : SpreadJsObj.getSelectObject(gclSheet);
|
|
|
+ SpreadJsObj.resetTopAndSelect(gatherLeafXmjSheet);
|
|
|
+ if (gcl) {
|
|
|
+ SpreadJsObj.loadSheetData(gatherLeafXmjSheet, SpreadJsObj.DataType.Data, gcl.gatherLeafXmjs);
|
|
|
+ } else {
|
|
|
+ SpreadJsObj.loadSheetData(gatherLeafXmjSheet, SpreadJsObj.DataType.Data, []);
|
|
|
+ }
|
|
|
+ }
|
|
|
// 切换清单行,读取所属项目节数据
|
|
|
gclSpread.getActiveSheet().bind(spreadNS.Events.SelectionChanged, function (e, info) {
|
|
|
const iNewRow = info.newSelections[0].row;
|
|
|
if (!info.oldSelections || iNewRow !== info.oldSelections[0].row) {
|
|
|
loadLeafXmjData(iNewRow);
|
|
|
+ loadGatherLeafXmjData(iNewRow);
|
|
|
}
|
|
|
});
|
|
|
|
|
@@ -173,8 +211,10 @@ $(document).ready(() => {
|
|
|
gclCompareModel.gatherLedgerData(data.bills, data.pos, setting);
|
|
|
gclCompareModel.gatherDealBills(data.dealBills);
|
|
|
gclCompareModel.checkDiffer();
|
|
|
+ gclCompareModel.reGatherLeafXmj();
|
|
|
SpreadJsObj.loadSheetData(gclSheet, SpreadJsObj.DataType.Data, gclData);
|
|
|
loadLeafXmjData(0);
|
|
|
+ loadGatherLeafXmjData(0);
|
|
|
|
|
|
const chapterData = gclCompareModel.chapterData();
|
|
|
generateChapterHtml(chapterData);
|
|
@@ -196,6 +236,38 @@ $(document).ready(() => {
|
|
|
}
|
|
|
gclSpread.refresh();
|
|
|
leafXmjSpread.refresh();
|
|
|
+ gatherLeafXmjSpread.refresh();
|
|
|
+ });
|
|
|
+ // 下部设置显示相关
|
|
|
+ $('a', '[name=pos-tab]').click(function() {
|
|
|
+ const relaTab = this.getAttribute('href');
|
|
|
+ const optionTab = $('#optionTab').children();
|
|
|
+ for (const ot of optionTab) {
|
|
|
+ if (ot.getAttribute('rela-tab') === relaTab) {
|
|
|
+ $(ot).show();
|
|
|
+ } else {
|
|
|
+ $(ot).hide();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ $('[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);
|
|
|
+ }
|
|
|
+ for (const col of gatherLeafXmjSpreadSetting.cols) {
|
|
|
+ if (col.formatter !== '@') continue;
|
|
|
+ col.visible = col.type === 'Number' || fields.indexOf(col.field) >= 0;
|
|
|
+ }
|
|
|
+ gclCompareModel.reGatherLeafXmj(fields);
|
|
|
+ SpreadJsObj.refreshColumnVisible(gatherLeafXmjSheet);
|
|
|
+ loadGatherLeafXmjData();
|
|
|
});
|
|
|
$.subMenu({
|
|
|
menu: '#sub-menu', miniMenu: '#sub-mini-menu', miniMenuList: '#mini-menu-list',
|
|
@@ -213,6 +285,7 @@ $(document).ready(() => {
|
|
|
autoFlashHeight();
|
|
|
gclSpread.refresh();
|
|
|
leafXmjSpread.refresh();
|
|
|
+ gatherLeafXmjSpread.refresh();
|
|
|
}
|
|
|
});
|
|
|
$.divResizer({
|
|
@@ -222,6 +295,7 @@ $(document).ready(() => {
|
|
|
let bcontent = $(".bcontent-wrap") ? $(".bcontent-wrap").height() : 0;
|
|
|
$(".sp-wrap").height(bcontent-30);
|
|
|
leafXmjSpread.refresh();
|
|
|
+ gatherLeafXmjSpread.refresh();
|
|
|
}
|
|
|
});
|
|
|
$('input[name=compareTag]').change(() => {
|