|
@@ -42,6 +42,7 @@ $(document).ready(() => {
|
|
|
const compareTypeKey = 'budget-compareType';
|
|
|
const stackedBarCoverKey = 'budget-stackedBarCover';
|
|
|
const stackedBarKey = 'budget-stackedBar';
|
|
|
+ const comparePhaseKey = 'budget-comparePhase';
|
|
|
autoFlashHeight();
|
|
|
const compareSpread = SpreadJsObj.createNewSpread($('#cost-compare')[0]);
|
|
|
const compareSheet = compareSpread.getActiveSheet();
|
|
@@ -112,6 +113,8 @@ $(document).ready(() => {
|
|
|
const selectHtml = this.getCompareSelectHtml();
|
|
|
$('#compare1').html(selectHtml);
|
|
|
$('#compare2').html(selectHtml);
|
|
|
+ const comparePhase = Cookies.get(comparePhaseKey).split(',');
|
|
|
+ this.setComparePhase(comparePhase[0] || this.comparePhase1, comparePhase[1] || this.comparePhase2);
|
|
|
},
|
|
|
getCompareHint(phase1, phase2) {
|
|
|
if (!phase1) phase1 = this.comparePhase1;
|
|
@@ -120,6 +123,14 @@ $(document).ready(() => {
|
|
|
const cp2 = comparePhase.find(x => { return x.key === phase2; });
|
|
|
return `增减幅度=(${cp2.name}-${cp1.name})/${cp1.name}*100%`;
|
|
|
},
|
|
|
+ setComparePhase(phase1, phase2) {
|
|
|
+ compareObj.comparePhase1 = phase1;
|
|
|
+ compareObj.comparePhase2 = phase2;
|
|
|
+ $('#compare-hint').html(compareObj.getCompareHint());
|
|
|
+ compareObj.reCalculateCompareData();
|
|
|
+ $('#compare-set').modal('hide');
|
|
|
+ Cookies.set(comparePhaseKey, phase1 + ',' + phase2);
|
|
|
+ },
|
|
|
curFinalId() {
|
|
|
return this.finalInfo ? this.finalInfo.id : undefined;
|
|
|
},
|
|
@@ -586,11 +597,7 @@ $(document).ready(() => {
|
|
|
$('#compare-active-hint').html(compareObj.getCompareHint(phase1, phase2));
|
|
|
});
|
|
|
$('#compare-set-ok').click(() => {
|
|
|
- compareObj.comparePhase1 = $('#compare1').val();
|
|
|
- compareObj.comparePhase2 = $('#compare2').val();
|
|
|
- $('#compare-hint').html(compareObj.getCompareHint());
|
|
|
- compareObj.reCalculateCompareData();
|
|
|
- $('#compare-set').modal('hide');
|
|
|
+ compareObj.setComparePhase($('#compare1').val(), $('#compare2').val());
|
|
|
});
|
|
|
$('#export-excel').click(function() {
|
|
|
const excelSetting = JSON.parse(JSON.stringify(compareSheet.zh_setting));
|