|
@@ -26,7 +26,7 @@ $(function () {
|
|
|
// markFoldKey: 'bills-fold',
|
|
|
// markFoldSubKey: window.location.pathname.split('/')[2],
|
|
|
};
|
|
|
- const ledgerTree = createNewPathTree('filter', treeSetting);
|
|
|
+
|
|
|
|
|
|
const static_cols = [
|
|
|
{title: '编号', colSpan: '1', rowSpan: '2', field: 'code', hAlign: 0, width: 145, formatter: '@', readOnly: true, cellType: 'tree'},
|
|
@@ -51,6 +51,7 @@ $(function () {
|
|
|
}
|
|
|
};
|
|
|
const monthsCols = [];
|
|
|
+ const calcCols = [];
|
|
|
if(scheduleMonth.length > 0) {
|
|
|
for (const sm of scheduleMonth) {
|
|
|
if (sm.stage_gcl_used === 1) {
|
|
@@ -63,9 +64,15 @@ $(function () {
|
|
|
monthsCols.push(cols2);
|
|
|
monthsCols.push(cols3);
|
|
|
monthsCols.push(cols4);
|
|
|
+ calcCols.push(sm.yearmonth + '_plan_gcl');
|
|
|
+ calcCols.push(sm.yearmonth + '_plan_tp');
|
|
|
+ calcCols.push(sm.yearmonth + '_sj_gcl');
|
|
|
+ calcCols.push(sm.yearmonth + '_sj_tp');
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ treeSetting.calcFields = calcCols;
|
|
|
+ const ledgerTree = createNewPathTree('filter', treeSetting);
|
|
|
const spreadHeaderCols = static_cols.concat(monthsCols);
|
|
|
ledgerSpreadSetting.cols = spreadHeaderCols;
|
|
|
|
|
@@ -133,6 +140,7 @@ $(function () {
|
|
|
}
|
|
|
console.log(ledgerTree);
|
|
|
ledgerTree.sortTreeNode(true);
|
|
|
+ treeCalc.calculateAll(ledgerTree);
|
|
|
// console.log(ledgerTree);
|
|
|
SpreadJsObj.loadSheetData(ledgerSpread.getActiveSheet(), SpreadJsObj.DataType.Tree, ledgerTree);
|
|
|
}, null, true);
|
|
@@ -222,9 +230,13 @@ $(function () {
|
|
|
console.log(updateData);
|
|
|
postData(window.location.pathname + '/save', {type: 'ledger_edit', postData: updateData}, function (result) {
|
|
|
select[yearmonth + '_sj_tp'] = sj_tp;
|
|
|
+ const nodes = treeCalc.calculateParent(info.sheet.zh_tree, select);
|
|
|
+ SpreadJsObj.reLoadNodesData(info.sheet, nodes);
|
|
|
SpreadJsObj.reLoadRowData(info.sheet, info.row);
|
|
|
},function () {
|
|
|
select[col.field] = orgValue;
|
|
|
+ const nodes = treeCalc.calculateParent(info.sheet.zh_tree, select);
|
|
|
+ SpreadJsObj.reLoadNodesData(info.sheet, nodes);
|
|
|
SpreadJsObj.reLoadRowData(info.sheet, info.row);
|
|
|
})
|
|
|
}
|
|
@@ -277,9 +289,13 @@ $(function () {
|
|
|
console.log(updateData);
|
|
|
postData(window.location.pathname + '/save', {type: 'ledger_edit', postData: updateData}, function (result) {
|
|
|
select[yearmonth + '_sj_tp'] = sj_tp;
|
|
|
+ const nodes = treeCalc.calculateParent(info.sheet.zh_tree, select);
|
|
|
+ SpreadJsObj.reLoadNodesData(info.sheet, nodes);
|
|
|
SpreadJsObj.reLoadRowData(info.sheet, info.cellRange.row, info.cellRange.rowCount);
|
|
|
},function () {
|
|
|
select[col.field] = orgValue;
|
|
|
+ const nodes = treeCalc.calculateParent(info.sheet.zh_tree, select);
|
|
|
+ SpreadJsObj.reLoadNodesData(info.sheet, nodes);
|
|
|
SpreadJsObj.reLoadRowData(info.sheet, info.cellRange.row, info.cellRange.rowCount);
|
|
|
})
|
|
|
},
|
|
@@ -412,24 +428,36 @@ $(function () {
|
|
|
SpreadJsObj.loadSheetData(huizongSpread.getActiveSheet(), SpreadJsObj.DataType.Tree, huizongTree);
|
|
|
}, null, true);
|
|
|
}, null, true);
|
|
|
+ },
|
|
|
+ dropDownHtml: function (order) {
|
|
|
+ let html = '';
|
|
|
+ for (const ss of scheduleStage) {
|
|
|
+ if (ss.order !== order) {
|
|
|
+ html += '<a class="dropdown-item change-tp" data-order="'+ ss.order +'" href="javascript:void(0);">'+ ss.yearmonth.split('-')[0] + '年' + parseInt(ss.yearmonth.split('-')[1]) +'月(第'+ ss.order +'期)</a>';
|
|
|
+ } else {
|
|
|
+ $('#dropdownMenuButton').text(ss.yearmonth.split('-')[0] + '年' + parseInt(ss.yearmonth.split('-')[1]) +'月(第'+ ss.order +'期)');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $('.dropdown-menu').html(html);
|
|
|
}
|
|
|
};
|
|
|
|
|
|
if (curScheduleStage && curScheduleStage.order) {
|
|
|
- huizongObj.setSjs(curScheduleStage.order);
|
|
|
+ let order = parseInt(localStorage.getItem('tender_' + getTenderId() + '_schedule_tp_sjs') ? localStorage.getItem('tender_' + getTenderId() + '_schedule_tp_sjs') : curScheduleStage.order);
|
|
|
+ const ssinfo = _.find(scheduleStage, { order });
|
|
|
+ if (!ssinfo) {
|
|
|
+ order = curScheduleStage.order;
|
|
|
+ }
|
|
|
+ huizongObj.dropDownHtml(order);
|
|
|
+ huizongObj.setSjs(order);
|
|
|
}
|
|
|
|
|
|
// 汇总切换
|
|
|
$('body').on('click', '.change-tp', function () {
|
|
|
const order = parseInt($(this).data('order'));
|
|
|
- $('#dropdownMenuButton').text($(this).text());
|
|
|
- let html = '';
|
|
|
- for (const ss of scheduleStage) {
|
|
|
- if (ss.order !== order)
|
|
|
- html += '<a class="dropdown-item change-tp" data-order="'+ ss.order +'" href="javascript:void(0);">'+ ss.yearmonth.split('-')[0] + '年' + parseInt(ss.yearmonth.split('-')[1]) +'月(第'+ ss.order +'期)</a>';
|
|
|
- }
|
|
|
- $('.dropdown-menu').html(html);
|
|
|
+ huizongObj.dropDownHtml(order);
|
|
|
huizongObj.setSjs(order);
|
|
|
+ localStorage.setItem('tender_' + getTenderId() + '_schedule_tp_sjs', order);
|
|
|
});
|
|
|
|
|
|
// 月份添加
|