优化 业主缴费

This commit is contained in:
java110 2021-06-12 01:27:28 +08:00
parent dac712141d
commit 359581cc1b
2 changed files with 102 additions and 10 deletions

View File

@ -5,9 +5,9 @@
<div class="ibox-title">
<h5>业主缴费明细</h5>
<div class="ibox-tools" style="top:10px;">
<button type="button" class="btn btn-primary btn-sm" v-on:click="_exportFee()">
<!-- <button type="button" class="btn btn-primary btn-sm" v-on:click="_exportFee()">
<i class="fa fa-plus"></i> 导出
</button>
</button> -->
</div>
</div>
<div class="ibox-content">
@ -39,10 +39,21 @@
<td class="text-center">{{fee.ownerName}}</td>
<td class="text-center">{{fee.roomName}}</td>
<td class="text-center">{{fee.feeName}}</td>
<td class="text-center">{{fee.month}}</td>
<td class="text-center">{{fee.link}}</td>
<td class="text-center">{{fee.link}}</td>
<td class="text-center">{{fee.link}}</td>
<td class="text-center">{{_getAmountByMonth(fee,1)}}</td>
<td class="text-center">{{_getAmountByMonth(fee,2)}}</td>
<td class="text-center">{{_getAmountByMonth(fee,3)}}</td>
<td class="text-center">{{_getAmountByMonth(fee,4)}}</td>
<td class="text-center">{{_getAmountByMonth(fee,5)}}</td>
<td class="text-center">{{_getAmountByMonth(fee,6)}}</td>
<td class="text-center">{{_getAmountByMonth(fee,7)}}</td>
<td class="text-center">{{_getAmountByMonth(fee,8)}}</td>
<td class="text-center">{{_getAmountByMonth(fee,9)}}</td>
<td class="text-center">{{_getAmountByMonth(fee,10)}}</td>
<td class="text-center">{{_getAmountByMonth(fee,11)}}</td>
<td class="text-center">{{_getAmountByMonth(fee,12)}}</td>
<td class="text-center">{{_getTotalAmount(fee)}}</td>
<td class="text-center">{{_getReceivableTotalAmount(fee)}}</td>
<td class="text-center">{{_getCollectTotalAmount(fee)}}</td>
</tr>
</tbody>
<tfoot>

View File

@ -12,8 +12,8 @@
records: 1,
moreCondition: false,
conditions: {
}
}
},
@ -26,7 +26,7 @@
});
},
methods: {
//查询
_queryMethod: function () {
vc.component._listOwnerPayFees(DEFAULT_PAGE, DEFAULT_ROWS);
@ -47,7 +47,7 @@
vc.component.reportOwnerPayFeeInfo.total = _reportOwnerPayFeeInfo.total;
vc.component.reportOwnerPayFeeInfo.records = _reportOwnerPayFeeInfo.records;
vc.component.reportOwnerPayFeeInfo.ownerPayFees = _reportOwnerPayFeeInfo.data;
vc.emit('pagination', 'init', {
total: vc.component.reportOwnerPayFeeInfo.records,
currentPage: _page,
@ -64,6 +64,87 @@
} else {
vc.component.reportOwnerPayFeeInfo.moreCondition = true;
}
},
_getAmountByMonth: function (_fee, month) {
let _amount = 0;
if (!_fee.hasOwnProperty('reportOwnerPayFeeDtos')) {
return _amount;
}
let _reportOwnerPayFeeDtos = _fee.reportOwnerPayFeeDtos;
if (_reportOwnerPayFeeDtos.length == 0) {
return _amount;
}
_reportOwnerPayFeeDtos.forEach(item => {
if (item.pfMonth == month) {
_amount = item.amount;
return;
}
});
return amount;
},
_getTotalAmount: function (_fee) {
let _amount = 0;
if (!_fee.hasOwnProperty('reportOwnerPayFeeDtos')) {
return _amount;
}
let _reportOwnerPayFeeDtos = _fee.reportOwnerPayFeeDtos;
if (_reportOwnerPayFeeDtos.length == 0) {
return _amount;
}
_reportOwnerPayFeeDtos.forEach(item => {
_amount += item.amount;
});
return amount;
},
_getReceivableTotalAmount: function (_fee) {
let _amount = 0;
if (!_fee.hasOwnProperty('reportOwnerPayFeeDtos')) {
return _amount;
}
let _reportOwnerPayFeeDtos = _fee.reportOwnerPayFeeDtos;
if (_reportOwnerPayFeeDtos.length == 0) {
return _amount;
}
let _now = new Date();
let _month = _now.getMonth() + 1;
_reportOwnerPayFeeDtos.forEach(item => {
if (parseInt(item.pfMonth) <= _month) {
_amount += item.amount;
}
});
return amount;
},
_getCollectTotalAmount: function (_fee) {
let _amount = 0;
if (!_fee.hasOwnProperty('reportOwnerPayFeeDtos')) {
return _amount;
}
let _reportOwnerPayFeeDtos = _fee.reportOwnerPayFeeDtos;
if (_reportOwnerPayFeeDtos.length == 0) {
return _amount;
}
let _now = new Date();
let _month = _now.getMonth() + 1;
_reportOwnerPayFeeDtos.forEach(item => {
if (parseInt(item.pfMonth) > _month) {
_amount += item.amount;
}
});
return amount;
}
}
});