From 768fbf20572cc2f0c6f46f2e6abda3fc65641825 Mon Sep 17 00:00:00 2001 From: java110 <928255095@qq.com> Date: Thu, 18 Nov 2021 00:12:53 +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/common/noticeDetail/noticeDetail.js | 77 ++++++++++--------- .../reportFeeSummary/reportFeeSummary.html | 25 +++--- .../reportFeeSummary/reportFeeSummary.js | 69 ++++++++++------- 3 files changed, 88 insertions(+), 83 deletions(-) diff --git a/public/pages/common/noticeDetail/noticeDetail.js b/public/pages/common/noticeDetail/noticeDetail.js index b5e1bbbeb..ea9fbf8ae 100755 --- a/public/pages/common/noticeDetail/noticeDetail.js +++ b/public/pages/common/noticeDetail/noticeDetail.js @@ -1,63 +1,64 @@ /** 入驻小区 **/ -(function(vc){ +(function(vc) { var DEFAULT_PAGE = 1; var DEFAULT_ROWS = 1; vc.extends({ - data:{ - noticeDetailInfo:{ - noticeId:'', - title:'', - context:'', - startTime:'', - endTime:'', - createTime:'' + data: { + noticeDetailInfo: { + noticeId: '', + title: '', + context: '', + startTime: '', + endTime: '', + createTime: '' } }, - _initMethod:function(){ + _initMethod: function() { var tmpNoticeId = vc.getParam('noticeId'); - if(!vc.notNull(tmpNoticeId)){ - return ; + if (!vc.notNull(tmpNoticeId)) { + return; } vc.component.noticeDetailInfo.noticeId = tmpNoticeId; vc.component._listNotices(DEFAULT_PAGE, DEFAULT_ROWS); }, - _initEvent:function(){ + _initEvent: function() { }, - methods:{ - _listNotices:function(_page, _rows){ + methods: { + _listNotices: function(_page, _rows) { var param = { - params:{ - page:_page, - row:_rows, - communityId:vc.getCurrentCommunity().communityId, - noticeId:vc.component.noticeDetailInfo.noticeId + params: { + page: _page, + row: _rows, + communityId: vc.getCurrentCommunity().communityId, + noticeId: vc.component.noticeDetailInfo.noticeId } - }; + }; - //发送get请求 - vc.http.get('noticeDetail', - 'get', - param, - function(json,res){ - var _noticeDetailInfo=JSON.parse(json); + //发送get请求 + vc.http.get('noticeDetail', + 'get', + param, + function(json, res) { + var _noticeDetailInfo = JSON.parse(json); - var _notices = _noticeDetailInfo.notices; - if(_notices.length >0){ - //filterXSS - _notices[0].context = filterXSS(_notices[0].context); - vc.copyObject(_notices[0], vc.component.noticeDetailInfo); - } + var _notices = _noticeDetailInfo.notices; + if (_notices.length > 0) { + //filterXSS + _notices[0].context = filterXSS(_notices[0].context); + vc.copyObject(_notices[0], vc.component.noticeDetailInfo); + } - },function(errInfo,error){ - console.log('请求失败处理'); - } - ); + }, + function(errInfo, error) { + console.log('请求失败处理'); + } + ); } } }); -})(window.vc); +})(window.vc); \ No newline at end of file diff --git a/public/pages/property/reportFeeSummary/reportFeeSummary.html b/public/pages/property/reportFeeSummary/reportFeeSummary.html index 8a9d81729..1a29fc754 100755 --- a/public/pages/property/reportFeeSummary/reportFeeSummary.html +++ b/public/pages/property/reportFeeSummary/reportFeeSummary.html @@ -5,18 +5,16 @@
查询条件
- +
- +
-
@@ -24,8 +22,7 @@
-
- +
-
@@ -53,14 +48,12 @@
- +
- +
@@ -151,7 +144,7 @@
实收: {{reportFeeSummaryInfo.allReceivedAmount}}元
-
欠费: {{reportFeeSummaryInfo.totalPreferentialAmount}}元
+
欠费: {{_computeTotalOweAmount()}}元
欠费: {{reportFeeSummaryInfo.allOweAmount}}元
diff --git a/public/pages/property/reportFeeSummary/reportFeeSummary.js b/public/pages/property/reportFeeSummary/reportFeeSummary.js index 689c90b13..bb07312bb 100755 --- a/public/pages/property/reportFeeSummary/reportFeeSummary.js +++ b/public/pages/property/reportFeeSummary/reportFeeSummary.js @@ -1,7 +1,7 @@ /** 入驻小区 **/ -(function (vc) { +(function(vc) { var DEFAULT_PAGE = 1; var DEFAULT_ROWS = 10; vc.extends({ @@ -33,8 +33,8 @@ } }, watch: { - 'reportFeeSummaryInfo.feeConfigs': function () {//'goodList'是我要渲染的对象,也就是我要等到它渲染完才能调用函数 - this.$nextTick(function () { + 'reportFeeSummaryInfo.feeConfigs': function() { //'goodList'是我要渲染的对象,也就是我要等到它渲染完才能调用函数 + this.$nextTick(function() { $('#configIds').selectpicker({ title: '请选择费用项', styleBase: 'form-control', @@ -43,13 +43,13 @@ }) } }, - _initMethod: function () { + _initMethod: function() { vc.component._initDate(); $that._listFeeConfigs(); vc.component._listFees(DEFAULT_PAGE, DEFAULT_ROWS); }, - _initEvent: function () { - $('#configIds').on('changed.bs.select', function (e, clickedIndex, isSelected, previousValue) { + _initEvent: function() { + $('#configIds').on('changed.bs.select', function(e, clickedIndex, isSelected, previousValue) { // do something... if (isSelected) { $that.reportFeeSummaryInfo.feeConfigNames.push({ @@ -67,17 +67,17 @@ $that.reportFeeSummaryInfo.feeConfigNames = _feeConfigNames; } }); - vc.on('reportFeeSummary', 'chooseFloor', function (_param) { + vc.on('reportFeeSummary', 'chooseFloor', function(_param) { vc.component.reportFeeSummaryInfo.conditions.floorId = _param.floorId; vc.component.reportFeeSummaryInfo.conditions.floorName = _param.floorName; vc.component.loadUnits(_param.floorId); }); - vc.on('pagination', 'page_event', function (_currentPage) { + vc.on('pagination', 'page_event', function(_currentPage) { vc.component._listFees(_currentPage, DEFAULT_ROWS); }); }, methods: { - _initDate: function () { + _initDate: function() { $(".startTime").datetimepicker({ minView: "month", language: 'zh-CN', @@ -99,12 +99,12 @@ todayBtn: true }); $('.startTime').datetimepicker() - .on('changeDate', function (ev) { + .on('changeDate', function(ev) { var value = $(".startTime").val(); vc.component.reportFeeSummaryInfo.conditions.startTime = value; }); $('.endTime').datetimepicker() - .on('changeDate', function (ev) { + .on('changeDate', function(ev) { var value = $(".endTime").val(); vc.component.reportFeeSummaryInfo.conditions.endTime = value; let start = Date.parse(new Date($that.reportFeeSummaryInfo.conditions.startTime)) @@ -128,11 +128,11 @@ } }, //查询 - _queryMethod: function () { + _queryMethod: function() { vc.component._listFees(DEFAULT_PAGE, DEFAULT_ROWS); }, //查询方法 - _listFees: function (_page, _rows) { + _listFees: function(_page, _rows) { vc.component.reportFeeSummaryInfo.conditions.page = _page; vc.component.reportFeeSummaryInfo.conditions.row = _rows; vc.component.reportFeeSummaryInfo.conditions.communityId = vc.getCurrentCommunity().communityId; @@ -143,7 +143,7 @@ //发送get请求 vc.http.apiGet('/reportFeeMonthStatistics/queryReportFeeSummary', param, - function (json, res) { + function(json, res) { var _reportFeeSummaryInfo = JSON.parse(json); vc.component.reportFeeSummaryInfo.total = _reportFeeSummaryInfo.total; vc.component.reportFeeSummaryInfo.records = _reportFeeSummaryInfo.records; @@ -174,13 +174,14 @@ dataCount: vc.component.reportFeeSummaryInfo.total, currentPage: _page }); - }, function (errInfo, error) { + }, + function(errInfo, error) { console.log('请求失败处理'); } ); }, //重置 - _resetMethod: function (_page, _rows) { + _resetMethod: function(_page, _rows) { vc.component.reportFeeSummaryInfo.conditions.floorName = ""; vc.component.reportFeeSummaryInfo.conditions.floorId = ""; vc.component.reportFeeSummaryInfo.conditions.unitId = ""; @@ -189,7 +190,7 @@ vc.component.reportFeeSummaryInfo.conditions.endTime = ""; $that._listFees(DEFAULT_PAGE, DEFAULT_ROWS); }, - loadUnits: function (_floorId) { + loadUnits: function(_floorId) { var param = { params: { floorId: _floorId, @@ -200,7 +201,7 @@ 'room', 'loadUnits', param, - function (json, res) { + function(json, res) { //vm.menus = vm.refreshMenuActive(JSON.parse(json),0); if (res.status == 200) { let tmpUnits = JSON.parse(json); @@ -209,22 +210,22 @@ } vc.toast(json); }, - function (errInfo, error) { + function(errInfo, error) { console.log('请求失败处理'); vc.toast(errInfo); }); }, - _openChooseFloorMethod: function () { + _openChooseFloorMethod: function() { vc.emit('searchFloor', 'openSearchFloorModel', {}); }, - _moreCondition: function () { + _moreCondition: function() { if (vc.component.reportFeeSummaryInfo.moreCondition) { vc.component.reportFeeSummaryInfo.moreCondition = false; } else { vc.component.reportFeeSummaryInfo.moreCondition = true; } }, - _listFeeConfigs: function () { + _listFeeConfigs: function() { var param = { params: { page: 1, @@ -234,15 +235,15 @@ }; //发送get请求 vc.http.get('feeConfigManage', 'list', param, - function (json, res) { + function(json, res) { var _feeConfigManageInfo = JSON.parse(json); vc.component.reportFeeSummaryInfo.feeConfigs = _feeConfigManageInfo.feeConfigs; }, - function (errInfo, error) { + function(errInfo, error) { console.log('请求失败处理'); }); }, - _getFeeReceivedAmountAmount: function (item, fee) { + _getFeeReceivedAmountAmount: function(item, fee) { let _items = fee.items; if (!_items) { return 0; @@ -256,19 +257,29 @@ }) return _value; }, - _exportExcel: function () { + _exportExcel: function() { vc.jumpToPage('/callComponent/exportReportFee/exportData?pagePath=reportFeeSummary&' + vc.objToGetParam($that.reportFeeSummaryInfo.conditions)); }, - _computeSum: function (a, b) { + _computeSum: function(a, b) { return (parseFloat(a) + parseFloat(b)).toFixed(2) }, - _computeOweFee: function (fee) { + _computeOweFee: function(fee) { let _oweFee = (parseFloat(fee.hisOweAmount) + parseFloat(fee.curReceivableAmount) - parseFloat(fee.curReceivedAmount) - parseFloat(fee.hisOweReceivedAmount)).toFixed(2); if (_oweFee < 0) { return _oweFee; } return _oweFee; + }, + _computeTotalOweAmount: function() { + if (!window.$that) { + return 0; + } + let _amount = 0; + $that.reportFeeSummaryInfo.fees.forEach(item => { + _amount += parseFloat($that._computeOweFee(item)); + }) + return _amount.toFixed(2); } } }); -})(window.vc); +})(window.vc); \ No newline at end of file