From e318644e857d04e28acf5489e2bc0e09a77efa30 Mon Sep 17 00:00:00 2001 From: java110 <928255095@qq.com> Date: Sat, 15 May 2021 20:03:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/property/listOweFee/listOweFee.html | 10 ++--- .../pages/property/listOweFee/listOweFee.js | 40 ++++++++++++++++--- 2 files changed, 39 insertions(+), 11 deletions(-) diff --git a/public/pages/property/listOweFee/listOweFee.html b/public/pages/property/listOweFee/listOweFee.html index 264a83cba..2cf9b00f1 100755 --- a/public/pages/property/listOweFee/listOweFee.html +++ b/public/pages/property/listOweFee/listOweFee.html @@ -79,21 +79,21 @@ 业主名称 开始时间 结束时间 - 面积 + {{item.configName}} 合计 更新时间 - - {{index+1}} + + {{i+1}} {{fee.payerObjName}} {{fee.ownerName}} {{fee.endTime}} {{fee.deadlineTime}} - {{_getFeeOweAmount(item,fee)}} - {{fee.amountOwed}} + {{_getFeeOweAmount(item,fee)}} + {{_getAllFeeOweAmount(fee)}} {{fee.updateTime}} diff --git a/public/pages/property/listOweFee/listOweFee.js b/public/pages/property/listOweFee/listOweFee.js index 54a0556bf..b59949294 100755 --- a/public/pages/property/listOweFee/listOweFee.js +++ b/public/pages/property/listOweFee/listOweFee.js @@ -28,8 +28,8 @@ this.$nextTick(function () { $('#configIds').selectpicker({ title: '请选择费用项', - styleBase:'form-control', - width:'auto' + styleBase: 'form-control', + width: 'auto' }); }) } @@ -73,12 +73,12 @@ vc.component.listOweFeeInfo.conditions.row = _row; vc.component.listOweFeeInfo.conditions.communityId = vc.getCurrentCommunity().communityId; let _configIds = ""; - $that.listOweFeeInfo.feeConfigNames.forEach(item=>{ + $that.listOweFeeInfo.feeConfigNames.forEach(item => { _configIds += (item.configId + ',') }) - if(_configIds.endsWith(',')){ - _configIds = _configIds.substring(0,_configIds.length-1); + if (_configIds.endsWith(',')) { + _configIds = _configIds.substring(0, _configIds.length - 1); } $that.listOweFeeInfo.conditions.configIds = _configIds; @@ -139,7 +139,35 @@ }); }, _getFeeOweAmount: function (item, fee) { - return "0"; + let _items = fee.items; + if (!_items) { + return 0; + } + let _value = 0; + _items.forEach(tmp => { + if (tmp.configId == item.configId) { + _value = tmp.amountOwed + return; + } + }) + return _value; + }, + _getAllFeeOweAmount: function (_fee) { + let _feeConfigNames = $that.listOweFeeInfo.feeConfigNames; + if (_feeConfigNames.length < 1) { + return _fee.amountOwed; + } + + let _amountOwed = 0.0; + let _items = _fee.items; + _feeConfigNames.forEach(_feeItem =>{ + _items.forEach(_item=>{ + if(_feeItem.configId == _item.configId){ + _amountOwed += parseFloat(_item.amountOwed); + } + }) + }) + return _amountOwed; } }