|
@@ -131,6 +131,35 @@ $(document).ready(() => {
|
|
const gatherLeafXmjSheet = gatherLeafXmjSpread.getActiveSheet();
|
|
const gatherLeafXmjSheet = gatherLeafXmjSpread.getActiveSheet();
|
|
SpreadJsObj.initSheet(gatherLeafXmjSheet, gatherLeafXmjSpreadSetting);
|
|
SpreadJsObj.initSheet(gatherLeafXmjSheet, gatherLeafXmjSpreadSetting);
|
|
|
|
|
|
|
|
+ const gatherAncGclSpread = SpreadJsObj.createNewSpread($('#anc-gcl-gather-spread')[0]);
|
|
|
|
+ const gatherAncGclSpreadSetting = {
|
|
|
|
+ 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: '@'},
|
|
|
|
+ {title: '辅材', colSpan: '1', rowSpan: '1', field: 'is_aux', hAlign: 1, width: 60, formatter: '@', fixed: 1, cellType: 'checkbox'},
|
|
|
|
+ {title: '名称', colSpan: '1', rowSpan: '1', field: 'name', hAlign: 0, width: 100, formatter: '@', fixed: 1},
|
|
|
|
+ {title: '单位', colSpan: '1', rowSpan: '1', field: 'unit', hAlign: 1, width: 50, formatter: '@', fixed: 1},
|
|
|
|
+ {title: '设计量', colSpan: '1', rowSpan: '1', field: 'quantity', hAlign: 2, width: 80, type: 'Number', fixed: 1},
|
|
|
|
+ ],
|
|
|
|
+ emptyRows: 0,
|
|
|
|
+ headRows: 1,
|
|
|
|
+ headRowHeight: [32],
|
|
|
|
+ headColWidth: [30],
|
|
|
|
+ defaultRowHeight: 21,
|
|
|
|
+ headerFont: '12px 微软雅黑',
|
|
|
|
+ font: '12px 微软雅黑',
|
|
|
|
+ readOnly: true,
|
|
|
|
+ localCache: {
|
|
|
|
+ key: 'ledger-gather-ancGcl',
|
|
|
|
+ colWidth: true,
|
|
|
|
+ },
|
|
|
|
+ };
|
|
|
|
+ if (thousandth) sjsSettingObj.setTpThousandthFormat(gatherAncGclSpreadSetting);
|
|
|
|
+ const gatherAncGclSheet = gatherAncGclSpread.getActiveSheet();
|
|
|
|
+ SpreadJsObj.initSheet(gatherAncGclSheet, gatherAncGclSpreadSetting);
|
|
|
|
+
|
|
let gclGatherData;
|
|
let gclGatherData;
|
|
// 获取项目节数据
|
|
// 获取项目节数据
|
|
function loadLeafXmjData(iGclRow) {
|
|
function loadLeafXmjData(iGclRow) {
|
|
@@ -145,13 +174,22 @@ $(document).ready(() => {
|
|
function loadGatherLeafXmjData(iGclRow) {
|
|
function loadGatherLeafXmjData(iGclRow) {
|
|
const gcl = iGclRow ? gclGatherData[iGclRow] : SpreadJsObj.getSelectObject(gclSheet);
|
|
const gcl = iGclRow ? gclGatherData[iGclRow] : SpreadJsObj.getSelectObject(gclSheet);
|
|
SpreadJsObj.resetTopAndSelect(gatherLeafXmjSheet);
|
|
SpreadJsObj.resetTopAndSelect(gatherLeafXmjSheet);
|
|
- console.log(gcl.gatherLeafXmjs);
|
|
|
|
if (gcl) {
|
|
if (gcl) {
|
|
SpreadJsObj.loadSheetData(gatherLeafXmjSheet, SpreadJsObj.DataType.Data, gcl.gatherLeafXmjs);
|
|
SpreadJsObj.loadSheetData(gatherLeafXmjSheet, SpreadJsObj.DataType.Data, gcl.gatherLeafXmjs);
|
|
} else {
|
|
} else {
|
|
SpreadJsObj.loadSheetData(gatherLeafXmjSheet, SpreadJsObj.DataType.Data, []);
|
|
SpreadJsObj.loadSheetData(gatherLeafXmjSheet, SpreadJsObj.DataType.Data, []);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ function loadGatherAncGclData(iGclRow) {
|
|
|
|
+ const gcl = iGclRow ? gclGatherData[iGclRow] : SpreadJsObj.getSelectObject(gclSheet);
|
|
|
|
+ SpreadJsObj.resetTopAndSelect(gatherAncGclSheet);
|
|
|
|
+ console.log(gcl.ancGcl, gcl.gatherAncGcl);
|
|
|
|
+ if (gcl) {
|
|
|
|
+ SpreadJsObj.loadSheetData(gatherAncGclSheet, SpreadJsObj.DataType.Data, gcl.gatherAncGcl);
|
|
|
|
+ } else {
|
|
|
|
+ SpreadJsObj.loadSheetData(gatherAncGclSheet, SpreadJsObj.DataType.Data, []);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
// 标红显示 签约-台账≠0
|
|
// 标红显示 签约-台账≠0
|
|
function checkCompareData() {
|
|
function checkCompareData() {
|
|
const sheet = gclSheet;
|
|
const sheet = gclSheet;
|
|
@@ -173,6 +211,7 @@ $(document).ready(() => {
|
|
if (!info.oldSelections || iNewRow !== info.oldSelections[0].row) {
|
|
if (!info.oldSelections || iNewRow !== info.oldSelections[0].row) {
|
|
loadLeafXmjData(iNewRow);
|
|
loadLeafXmjData(iNewRow);
|
|
loadGatherLeafXmjData(iNewRow);
|
|
loadGatherLeafXmjData(iNewRow);
|
|
|
|
+ loadGatherAncGclData(iNewRow);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
@@ -205,9 +244,11 @@ $(document).ready(() => {
|
|
gclGatherModel.loadLedgerData(data.bills);
|
|
gclGatherModel.loadLedgerData(data.bills);
|
|
gclGatherModel.loadPosData(data.pos);
|
|
gclGatherModel.loadPosData(data.pos);
|
|
gclGatherModel.loadDealBillsData(data.dealBills);
|
|
gclGatherModel.loadDealBillsData(data.dealBills);
|
|
|
|
+ gclGatherModel.loadAncillaryGclData(data.ancGcl);
|
|
gclGatherData = gclGatherModel.gatherGclData();
|
|
gclGatherData = gclGatherModel.gatherGclData();
|
|
gclGatherModel.checkDiffer(gclGatherData);
|
|
gclGatherModel.checkDiffer(gclGatherData);
|
|
gclGatherModel.reGatherLeafXmj();
|
|
gclGatherModel.reGatherLeafXmj();
|
|
|
|
+ gclGatherModel.reGatherAncillaryGcl();
|
|
for (const gcl of gclGatherData) {
|
|
for (const gcl of gclGatherData) {
|
|
gcl.compare_qty = ZhCalc.sub(gcl.quantity, gcl.deal_bills_qty);
|
|
gcl.compare_qty = ZhCalc.sub(gcl.quantity, gcl.deal_bills_qty);
|
|
gcl.compare_tp = ZhCalc.sub(gcl.total_price, gcl.deal_bills_tp);
|
|
gcl.compare_tp = ZhCalc.sub(gcl.total_price, gcl.deal_bills_tp);
|
|
@@ -217,6 +258,7 @@ $(document).ready(() => {
|
|
checkCompareData();
|
|
checkCompareData();
|
|
loadLeafXmjData(0);
|
|
loadLeafXmjData(0);
|
|
loadGatherLeafXmjData(0);
|
|
loadGatherLeafXmjData(0);
|
|
|
|
+ loadGatherAncGclData(0);
|
|
|
|
|
|
const chapterData = gclGatherModel.gatherChapterData(chapter, data.spec, ['total_price']);
|
|
const chapterData = gclGatherModel.gatherChapterData(chapter, data.spec, ['total_price']);
|
|
for (const c of chapterData) {
|
|
for (const c of chapterData) {
|
|
@@ -264,6 +306,7 @@ $(document).ready(() => {
|
|
afterLocated: function () {
|
|
afterLocated: function () {
|
|
loadLeafXmjData();
|
|
loadLeafXmjData();
|
|
loadGatherLeafXmjData();
|
|
loadGatherLeafXmjData();
|
|
|
|
+ loadGatherAncGclData();
|
|
},
|
|
},
|
|
calcSum: function (result) {
|
|
calcSum: function (result) {
|
|
const sum = { name: '合计', searchIndex: -1 };
|
|
const sum = { name: '合计', searchIndex: -1 };
|
|
@@ -293,6 +336,7 @@ $(document).ready(() => {
|
|
gclSpread.refresh();
|
|
gclSpread.refresh();
|
|
leafXmjSpread.refresh();
|
|
leafXmjSpread.refresh();
|
|
gatherLeafXmjSpread.refresh();
|
|
gatherLeafXmjSpread.refresh();
|
|
|
|
+ gatherAncGclSpread.refresh();
|
|
});
|
|
});
|
|
|
|
|
|
// 下部设置显示相关
|
|
// 下部设置显示相关
|
|
@@ -306,6 +350,11 @@ $(document).ready(() => {
|
|
$(ot).hide();
|
|
$(ot).hide();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ setTimeout(function() {
|
|
|
|
+ leafXmjSpread.refresh();
|
|
|
|
+ gatherLeafXmjSpread.refresh();
|
|
|
|
+ gatherAncGclSpread.refresh();
|
|
|
|
+ }, 100);
|
|
});
|
|
});
|
|
$('[name=gather-xmj]').change(function() {
|
|
$('[name=gather-xmj]').change(function() {
|
|
const checkOption = $('[name=gather-xmj]:checked');
|
|
const checkOption = $('[name=gather-xmj]:checked');
|
|
@@ -325,6 +374,24 @@ $(document).ready(() => {
|
|
SpreadJsObj.refreshColumnVisible(gatherLeafXmjSheet);
|
|
SpreadJsObj.refreshColumnVisible(gatherLeafXmjSheet);
|
|
loadGatherLeafXmjData();
|
|
loadGatherLeafXmjData();
|
|
});
|
|
});
|
|
|
|
+ $('[name=gather-anc-gcl]').change(function() {
|
|
|
|
+ const checkOption = $('[name=gather-anc-gcl]:checked');
|
|
|
|
+ if (checkOption.length === 0) {
|
|
|
|
+ toastr.warning('请至少选择一个汇总条件');
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ const fields = [];
|
|
|
|
+ for (const co of checkOption) {
|
|
|
|
+ fields.push(co.value);
|
|
|
|
+ }
|
|
|
|
+ for (const col of gatherAncGclSpreadSetting.cols) {
|
|
|
|
+ col.visible = col.fixed || fields.indexOf(col.field) >= 0;
|
|
|
|
+ }
|
|
|
|
+ gclGatherModel.reGatherAncillaryGcl(fields);
|
|
|
|
+ SpreadJsObj.refreshColumnVisible(gatherAncGclSheet);
|
|
|
|
+ loadGatherAncGclData();
|
|
|
|
+ });
|
|
|
|
|
|
$.subMenu({
|
|
$.subMenu({
|
|
menu: '#sub-menu', miniMenu: '#sub-mini-menu', miniMenuList: '#mini-menu-list',
|
|
menu: '#sub-menu', miniMenu: '#sub-mini-menu', miniMenuList: '#mini-menu-list',
|
|
@@ -343,6 +410,7 @@ $(document).ready(() => {
|
|
gclSpread.refresh();
|
|
gclSpread.refresh();
|
|
leafXmjSpread.refresh();
|
|
leafXmjSpread.refresh();
|
|
gatherLeafXmjSpread.refresh();
|
|
gatherLeafXmjSpread.refresh();
|
|
|
|
+ gatherAncGclSpread.refresh();
|
|
}
|
|
}
|
|
});
|
|
});
|
|
$.divResizer({
|
|
$.divResizer({
|
|
@@ -353,6 +421,7 @@ $(document).ready(() => {
|
|
$(".sp-wrap").height(bcontent-30);
|
|
$(".sp-wrap").height(bcontent-30);
|
|
leafXmjSpread.refresh();
|
|
leafXmjSpread.refresh();
|
|
gatherLeafXmjSpread.refresh();
|
|
gatherLeafXmjSpread.refresh();
|
|
|
|
+ gatherAncGclSpread.refresh();
|
|
}
|
|
}
|
|
});
|
|
});
|
|
$.divResizer({
|
|
$.divResizer({
|
|
@@ -361,6 +430,7 @@ $(document).ready(() => {
|
|
gclSpread.refresh();
|
|
gclSpread.refresh();
|
|
leafXmjSpread.refresh();
|
|
leafXmjSpread.refresh();
|
|
gatherLeafXmjSpread.refresh();
|
|
gatherLeafXmjSpread.refresh();
|
|
|
|
+ gatherAncGclSpread.refresh();
|
|
}
|
|
}
|
|
});
|
|
});
|
|
$('#exportExcel').click(function () {
|
|
$('#exportExcel').click(function () {
|