From 359581cc1b0b2202591bbe46be0b8fffa872b603 Mon Sep 17 00:00:00 2001 From: java110 <928255095@qq.com> Date: Sat, 12 Jun 2021 01:27:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E4=B8=9A=E4=B8=BB?= =?UTF-8?q?=E7=BC=B4=E8=B4=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../reportOwnerPayFee/reportOwnerPayFee.html | 23 +++-- .../reportOwnerPayFee/reportOwnerPayFee.js | 89 ++++++++++++++++++- 2 files changed, 102 insertions(+), 10 deletions(-) diff --git a/public/pages/property/reportOwnerPayFee/reportOwnerPayFee.html b/public/pages/property/reportOwnerPayFee/reportOwnerPayFee.html index 0baffb9a7..3a2e4100f 100644 --- a/public/pages/property/reportOwnerPayFee/reportOwnerPayFee.html +++ b/public/pages/property/reportOwnerPayFee/reportOwnerPayFee.html @@ -5,9 +5,9 @@
业主缴费明细
-
@@ -39,10 +39,21 @@ {{fee.ownerName}} {{fee.roomName}} {{fee.feeName}} - {{fee.month}} - {{fee.link}} - {{fee.link}} - {{fee.link}} + {{_getAmountByMonth(fee,1)}} + {{_getAmountByMonth(fee,2)}} + {{_getAmountByMonth(fee,3)}} + {{_getAmountByMonth(fee,4)}} + {{_getAmountByMonth(fee,5)}} + {{_getAmountByMonth(fee,6)}} + {{_getAmountByMonth(fee,7)}} + {{_getAmountByMonth(fee,8)}} + {{_getAmountByMonth(fee,9)}} + {{_getAmountByMonth(fee,10)}} + {{_getAmountByMonth(fee,11)}} + {{_getAmountByMonth(fee,12)}} + {{_getTotalAmount(fee)}} + {{_getReceivableTotalAmount(fee)}} + {{_getCollectTotalAmount(fee)}} diff --git a/public/pages/property/reportOwnerPayFee/reportOwnerPayFee.js b/public/pages/property/reportOwnerPayFee/reportOwnerPayFee.js index 5ad73aa79..7f51ce532 100644 --- a/public/pages/property/reportOwnerPayFee/reportOwnerPayFee.js +++ b/public/pages/property/reportOwnerPayFee/reportOwnerPayFee.js @@ -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; } } });