/** 入驻小区 **/ (function(vc) { var DEFAULT_PAGE = 1; var DEFAULT_ROWS = 10; vc.extends({ data: { dataReportFeeStatisticsInfo: { fees: [], feeTypeCds: [], ownerId: '', roomNum: '', startDate: '', endDate: '', feeTypeCd: '', feeAmount: '0' } }, _initMethod: function() { vc.getDict('pay_fee_config', "fee_type_cd_show", function(_data) { $that.dataReportFeeStatisticsInfo.feeTypeCds = _data }); }, _initEvent: function() { vc.on('dataReportFeeStatistics', 'switch', function(_data) { $that.dataReportFeeStatisticsInfo.startDate = _data.startDate; $that.dataReportFeeStatisticsInfo.endDate = _data.endDate; $that._loadDataReportFeeStatisticsData(DEFAULT_PAGE, DEFAULT_ROWS); }); vc.on('dataReportFeeStatistics', 'paginationPlus', 'page_event', function(_currentPage) { $that._loadDataReportFeeStatisticsData(_currentPage, DEFAULT_ROWS); }); vc.on('dataReportFeeStatistics', 'notify', function(_data) { $that._loadDataReportFeeStatisticsData(DEFAULT_PAGE, DEFAULT_ROWS); }) }, methods: { _loadDataReportFeeStatisticsData: function(_page, _row) { let param = { params: { communityId: vc.getCurrentCommunity().communityId, startDate: $that.dataReportFeeStatisticsInfo.startDate, endDate: $that.dataReportFeeStatisticsInfo.endDate, objName: $that.dataReportFeeStatisticsInfo.objName, ownerName: $that.dataReportFeeStatisticsInfo.ownerName, link: $that.dataReportFeeStatisticsInfo.link, page: _page, row: _row } }; //发送get请求 vc.http.apiGet('/dataReport.queryOweDetailStatistics', param, function(json) { let _json = JSON.parse(json); $that.dataReportFeeStatisticsInfo.fees = _json.data; vc.emit('dataReportFeeStatistics', 'paginationPlus', 'init', { total: _json.records, dataCount: _json.total, currentPage: _page }); let _feeAmount = 0.0; if (_json.data && _json.data.length > 0) { _json.data.forEach(item => { _feeAmount += parseFloat(item.receivedFee); }); } $that.dataReportFeeStatisticsInfo.feeAmount = _feeAmount.toFixed(2); }, function() { console.log('请求失败处理'); } ); }, //查询 _qureyDataReportFeeStatistics: function() { $that._loadDataReportFeeStatisticsData(DEFAULT_PAGE, DEFAULT_ROWS); }, } }); })(window.vc);