优化代码

This commit is contained in:
wuxw 2021-11-18 23:39:08 +08:00
parent 5b05c0e8d2
commit 4179cb5491
4 changed files with 39 additions and 5 deletions

View File

@ -166,6 +166,10 @@
<div class="row">欠费: {{_computeTotalOweAmount()}}元</div>
<div class="row">欠费: {{reportFeeBreakdownInfo.allOweAmount}}元</div>
</span>
<span class="col-md-2">
<div class="row">欠费追回: {{_computeTotalHisOweReceivedAmount()}}元</div>
<div class="row">欠费追回: {{reportFeeBreakdownInfo.allHisOweReceivedAmount}}元</div>
</span>
</div>
<div class="row margin-top-xs">
<div class="col-sm-9">

View File

@ -20,6 +20,7 @@
totalReceivedAmount: 0.0,
allReceivedAmount: 0.0,
totalPreferentialAmount: 0.0,
allHisOweReceivedAmount: 0.0,
allOweAmount: 0.0,
conditions: {
floorId: '',
@ -149,6 +150,7 @@
$that.reportFeeBreakdownInfo.allReceivableAmount = _reportFeeBreakdownInfo.data[0].allReceivableAmount;
$that.reportFeeBreakdownInfo.allReceivedAmount = _reportFeeBreakdownInfo.data[0].allReceivedAmount;
$that.reportFeeBreakdownInfo.allOweAmount = _reportFeeBreakdownInfo.data[0].allOweAmount;
$that.reportFeeBreakdownInfo.allHisOweReceivedAmount = _reportFeeBreakdownInfo.data[0].allHisOweReceivedAmount;
}
vc.emit('pagination', 'init', {
@ -249,6 +251,19 @@
}
return year + '' + month;
},
_computeTotalHisOweReceivedAmount: function () {
if (!window.$that) {
return 0;
}
if (!$that.reportFloorUnitFeeSummaryInfo) {
return 0;
}
let _amount = 0;
$that.reportFloorUnitFeeSummaryInfo.fees.forEach(item => {
_amount += parseFloat(item.hisOweReceivedAmount);
})
return _amount.toFixed(2);
}
}
});

View File

@ -155,10 +155,10 @@
<div class="row">实收: {{reportFloorUnitFeeSummaryInfo.totalReceivedAmount}}元</div>
<div class="row">实收: {{reportFloorUnitFeeSummaryInfo.allReceivedAmount}}元</div>
</span>
<!-- <span class="col-md-2">
<div class="row">欠费: {{_computeTotalOweAmount()}}元</div>
<div class="row">欠费: {{reportFloorUnitFeeSummaryInfo.allOweAmount}}元</div>
</span> -->
<span class="col-md-2">
<div class="row">欠费追回: {{_computeTotalHisOweReceivedAmount()}}元</div>
<div class="row">欠费追回: {{reportFloorUnitFeeSummaryInfo.allHisOweReceivedAmount}}元</div>
</span>
</div>
<div class="row margin-top-xs">
<div class="col-sm-9">

View File

@ -20,6 +20,7 @@
totalReceivedAmount:0.0,
allReceivedAmount:0.0,
totalPreferentialAmount:0.0,
allHisOweReceivedAmount: 0.0,
allOweAmount:0.0,
conditions: {
floorId: '',
@ -173,11 +174,12 @@
$that.reportFloorUnitFeeSummaryInfo.totalReceivableAmount = _totalReceivableAmount.toFixed(2);
$that.reportFloorUnitFeeSummaryInfo.totalReceivedAmount = _totalReceivedAmount.toFixed(2);
$that.reportFloorUnitFeeSummaryInfo.totalPreferentialAmount = _totalPreferentialAmount.toFixed(2);
$that.reportFloorUnitFeeSummaryInfo.totalPreferentialAmount = _totalPreferentialAmount.toFixed(2);
if(_reportFloorUnitFeeSummaryInfo.data.length>0){
$that.reportFloorUnitFeeSummaryInfo.allReceivableAmount = _reportFloorUnitFeeSummaryInfo.data[0].allReceivableAmount;
$that.reportFloorUnitFeeSummaryInfo.allReceivedAmount = _reportFloorUnitFeeSummaryInfo.data[0].allReceivedAmount;
$that.reportFloorUnitFeeSummaryInfo.allOweAmount = _reportFloorUnitFeeSummaryInfo.data[0].allOweAmount;
$that.reportFloorUnitFeeSummaryInfo.allHisOweReceivedAmount = _reportFloorUnitFeeSummaryInfo.data[0].allHisOweReceivedAmount;
}
vc.emit('pagination', 'init', {
total: vc.component.reportFloorUnitFeeSummaryInfo.records,
@ -292,6 +294,19 @@
})
console.log(_amount)
return _amount.toFixed(2);
},
_computeTotalHisOweReceivedAmount: function () {
if (!window.$that) {
return 0;
}
if (!$that.reportFloorUnitFeeSummaryInfo) {
return 0;
}
let _amount = 0;
$that.reportFloorUnitFeeSummaryInfo.fees.forEach(item => {
_amount += parseFloat(item.hisOweReceivedAmount);
})
return _amount.toFixed(2);
}
}
});