|
@@ -75,6 +75,39 @@ $(document).ready(function () {
|
|
|
const gatherLeafXmjSheet = gatherLeafXmjSpread.getActiveSheet();
|
|
|
SpreadJsObj.initSheet(gatherLeafXmjSheet, gatherLeafXmjSpreadSetting);
|
|
|
|
|
|
+ const changeSpread = SpreadJsObj.createNewSpread($('#change-spread')[0]);
|
|
|
+ const changeSpreadSetting = {
|
|
|
+ cols: [
|
|
|
+ {title: '变更令号', colSpan: '1', rowSpan: '2', field: 'code', hAlign: 0, width: 100, formatter: '@'},
|
|
|
+ {title: '变更名称', colSpan: '1', rowSpan: '2', field: 'name', hAlign: 0, width: 150, formatter: '@'},
|
|
|
+ {title: '原设计|数量', colSpan: '2|1', rowSpan: '1|1', field: 'org_qty', hAlign: 2, width: 80, formatter: '@'},
|
|
|
+ {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'org_tp', hAlign: 2, width: 80, formatter: '@'},
|
|
|
+ {title: '批复变更|数量', colSpan: '2|1', rowSpan: '1|1', field: 'c_qty', hAlign: 2, width: 80, formatter: '@'},
|
|
|
+ {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'c_tp', hAlign: 2, width: 80, formatter: '@'},
|
|
|
+ {title: '本期变更数量', colSpan: '1', rowSpan: '2', field: 'cur_qty', hAlign: 2, width: 100, formatter: '@'},
|
|
|
+ {title: '截止本期变更数量', colSpan: '1', rowSpan: '2', field: 'end_qty', hAlign: 2, width: 100, formatter: '@'},
|
|
|
+ // {title: '本期计量|数量', colSpan: '2|1', rowSpan: '1|1', field: 'cur_qty', hAlign: 2, width: 80, formatter: '@'},
|
|
|
+ // {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'cur_tp', hAlign: 2, width: 80, formatter: '@'},
|
|
|
+ // {title: '截止本期计量|数量', colSpan: '2|1', rowSpan: '1|1', field: 'end_qty', hAlign: 2, width: 80, formatter: '@'},
|
|
|
+ // {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'end_tp', hAlign: 2, width: 80, formatter: '@'},
|
|
|
+ ],
|
|
|
+ emptyRows: 0,
|
|
|
+ headRows: 2,
|
|
|
+ headRowHeight: [25, 25],
|
|
|
+ headColWidth: [30],
|
|
|
+ defaultRowHeight: 21,
|
|
|
+ headerFont: '12px 微软雅黑',
|
|
|
+ font: '12px 微软雅黑',
|
|
|
+ readOnly: true,
|
|
|
+ localCache: {
|
|
|
+ key: 'ledger-gather-change',
|
|
|
+ colWidth: true,
|
|
|
+ },
|
|
|
+ };
|
|
|
+ if (thousandth) sjsSettingObj.setTpThousandthFormat(changeSpreadSetting);
|
|
|
+ const changeSheet = changeSpread.getActiveSheet();
|
|
|
+ SpreadJsObj.initSheet(changeSheet, changeSpreadSetting);
|
|
|
+
|
|
|
let gclGatherData;
|
|
|
// 获取项目节数据
|
|
|
function loadLeafXmjData(iGclRow) {
|
|
@@ -95,6 +128,25 @@ $(document).ready(function () {
|
|
|
SpreadJsObj.loadSheetData(gatherLeafXmjSheet, SpreadJsObj.DataType.Data, []);
|
|
|
}
|
|
|
}
|
|
|
+ function loadChangeData(iGclRow) {
|
|
|
+ const gcl = iGclRow ? gclGatherData[iGclRow] : SpreadJsObj.getSelectObject(gclSheet);
|
|
|
+ SpreadJsObj.resetTopAndSelect(changeSheet);
|
|
|
+ if (gcl) {
|
|
|
+ SpreadJsObj.loadSheetData(changeSheet, SpreadJsObj.DataType.Data, gcl.change);
|
|
|
+ } else {
|
|
|
+ SpreadJsObj.loadSheetData(changeSheet, SpreadJsObj.DataType.Data, []);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ function loadRelaData(iGclRow) {
|
|
|
+ loadLeafXmjData(iGclRow);
|
|
|
+ loadGatherLeafXmjData(iGclRow);
|
|
|
+ loadChangeData(iGclRow);
|
|
|
+ }
|
|
|
+ function refreshRelaSpread() {
|
|
|
+ leafXmjSpread.refresh();
|
|
|
+ gatherLeafXmjSpread.refresh();
|
|
|
+ changeSpread.refresh();
|
|
|
+ }
|
|
|
// 超计显示
|
|
|
function checkOverRange(data) {
|
|
|
const billsGatherOver = function (data, qtyField, tpField, per) {
|
|
@@ -124,10 +176,7 @@ $(document).ready(function () {
|
|
|
// 切换清单行,读取所属项目节数据
|
|
|
gclSpread.getActiveSheet().bind(spreadNS.Events.SelectionChanged, function (e, info) {
|
|
|
const iOldRow = info.oldSelections[0].row, iNewRow = info.newSelections[0].row;
|
|
|
- if (iNewRow !== iOldRow) {
|
|
|
- loadLeafXmjData(iNewRow);
|
|
|
- loadGatherLeafXmjData(iNewRow);
|
|
|
- }
|
|
|
+ if (iNewRow !== iOldRow) loadRelaData(iNewRow);
|
|
|
});
|
|
|
$('.custom-radio').click(() => {
|
|
|
setLocalCache('StageGatherOverType', $('input[name=customRadio]:checked').attr('id'));
|
|
@@ -143,21 +192,21 @@ $(document).ready(function () {
|
|
|
SpreadJsObj.reLoadSheetData(gclSpread.getActiveSheet());
|
|
|
});
|
|
|
|
|
|
- postData(preUrl + '/load', { filter: 'ledger;pos;dealBills;spec;changeBills' }, function (result) {
|
|
|
+ postData(preUrl + '/load', { filter: 'ledger;pos;dealBills;spec;change;stageChange;preStageChange' }, function (result) {
|
|
|
// 解析清单汇总数据
|
|
|
gclGatherModel.loadDecimal(tenderDecimal);
|
|
|
gclGatherModel.loadLedgerData(result.ledgerData);
|
|
|
gclGatherModel.loadPosData(result.posData);
|
|
|
gclGatherModel.loadDealBillsData(result.dealBills);
|
|
|
- gclGatherModel.loadChangeBillsData(result.changeBills);
|
|
|
+ gclGatherModel.loadChangeData(result.change);
|
|
|
+ gclGatherModel.loadStageChangeData(result.stageChange, result.preStageChange);
|
|
|
gclGatherData = gclGatherModel.gatherGclData();
|
|
|
gclGatherModel.checkDiffer(gclGatherData);
|
|
|
gclGatherModel.reGatherLeafXmj();
|
|
|
checkOverRange(gclGatherData);
|
|
|
// 加载清单数据
|
|
|
SpreadJsObj.loadSheetData(gclSpread.getActiveSheet(), SpreadJsObj.DataType.Data, gclGatherData);
|
|
|
- loadLeafXmjData(0);
|
|
|
- loadGatherLeafXmjData(0);
|
|
|
+ loadRelaData(0);
|
|
|
// 章节合计
|
|
|
const chapterData = gclGatherModel.gatherChapterData(chapter, result.spec, ['total_price', 'contract_tp', 'qc_tp', 'pre_contract_tp', 'pre_qc_tp', 'contract_pc_tp', 'qc_pc_tp', 'pc_tp']);
|
|
|
for (const c of chapterData) {
|
|
@@ -209,8 +258,7 @@ $(document).ready(function () {
|
|
|
showTools(tab.hasClass('active'));
|
|
|
}
|
|
|
gclSpread.refresh();
|
|
|
- leafXmjSpread.refresh();
|
|
|
- gatherLeafXmjSpread.refresh();
|
|
|
+ refreshRelaSpread();
|
|
|
});
|
|
|
// 下部设置显示相关
|
|
|
$('a', '[name=pos-tab]').click(function() {
|
|
@@ -223,6 +271,7 @@ $(document).ready(function () {
|
|
|
$(ot).hide();
|
|
|
}
|
|
|
}
|
|
|
+ setTimeout(refreshRelaSpread, 100);
|
|
|
});
|
|
|
$('[name=gather-xmj]').change(function() {
|
|
|
const checkOption = $('[name=gather-xmj]:checked');
|
|
@@ -249,14 +298,14 @@ $(document).ready(function () {
|
|
|
gclSpread.refresh();
|
|
|
let bcontent = $(".bcontent-wrap") ? $(".bcontent-wrap").height() : 0;
|
|
|
$(".sp-wrap").height(bcontent-30);
|
|
|
- leafXmjSpread.refresh();
|
|
|
+ refreshRelaSpread();
|
|
|
}
|
|
|
});
|
|
|
$.divResizer({
|
|
|
select: '#right-spr',
|
|
|
callback: function () {
|
|
|
gclSpread.refresh();
|
|
|
- leafXmjSpread.refresh();
|
|
|
+ refreshRelaSpread();
|
|
|
}
|
|
|
});
|
|
|
// 导航栏
|
|
@@ -275,8 +324,7 @@ $(document).ready(function () {
|
|
|
}
|
|
|
autoFlashHeight();
|
|
|
gclSpread.refresh();
|
|
|
- leafXmjSpread.refresh();
|
|
|
- gatherLeafXmjSpread.refresh();
|
|
|
+ refreshRelaSpread();
|
|
|
}
|
|
|
});
|
|
|
$('#exportExcel').click(function () {
|