From 447570d3c337d8de5d873ecbc4f6803bdbe76319 Mon Sep 17 00:00:00 2001 From: wuxw <928255095@qq.com> Date: Tue, 7 Nov 2023 02:01:29 +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 --- .../simplifyRoomFee/simplifyRoomFee.js | 53 +++++++++---------- 1 file changed, 26 insertions(+), 27 deletions(-) diff --git a/public/components/property/simplifyRoomFee/simplifyRoomFee.js b/public/components/property/simplifyRoomFee/simplifyRoomFee.js index 6ceebac10..2996e5bb8 100644 --- a/public/components/property/simplifyRoomFee/simplifyRoomFee.js +++ b/public/components/property/simplifyRoomFee/simplifyRoomFee.js @@ -1,7 +1,7 @@ /** 入驻小区 **/ -(function (vc) { + (function (vc) { var DEFAULT_PAGE = 1; var DEFAULT_ROWS = 10; vc.extends({ @@ -50,7 +50,7 @@ $that._listSimplifyRoomFee(DEFAULT_PAGE, DEFAULT_ROWS); }); vc.on('simplifyRoomFee', 'paginationPlus', 'page_event', - function (_currentPage) { + function(_currentPage) { $that._listSimplifyRoomFee(_currentPage, DEFAULT_ROWS); }); }, @@ -91,13 +91,11 @@ $that.simplifyRoomFeeInfo.total = _feeConfigInfo.total; $that.simplifyRoomFeeInfo.records = _feeConfigInfo.records; let _totalAmount = 0.0; - if (_totalAmount && _totalAmount.length > 0) { - _feeConfigInfo.fees.forEach(item => { - _totalAmount += parseFloat(item.amountOwed); - }) - $that.simplifyRoomFeeInfo.totalAmount = _totalAmount.toFixed(2); - $that.simplifyRoomFeeInfo.fees = _feeConfigInfo.fees.sort($that._roomFeeCompare); - } + _feeConfigInfo.fees.forEach(item => { + _totalAmount += parseFloat(item.amountOwed); + }) + $that.simplifyRoomFeeInfo.totalAmount = _totalAmount.toFixed(2); + $that.simplifyRoomFeeInfo.fees = _feeConfigInfo.fees.sort($that._roomFeeCompare); vc.emit('simplifyRoomFee', 'paginationPlus', 'init', { total: $that.simplifyRoomFeeInfo.records, dataCount: $that.simplifyRoomFeeInfo.total, @@ -123,6 +121,7 @@ _toOwnerPayFee: function () { vc.jumpToPage('/#/pages/property/owePayFeeOrder?payObjId=' + $that.simplifyRoomFeeInfo.roomId + "&payObjType=3333&roomName=" + $that.simplifyRoomFeeInfo.roomName); }, + _openRoomCreateFeeAddModal: function () { $that.simplifyRoomFeeInfo.ownerName = $that.simplifyRoomFeeInfo.name; vc.emit('roomCreateFeeAdd', 'openRoomCreateFeeAddModal', { @@ -140,15 +139,13 @@ }, _getAttrValue: function (_attrs, _specCd) { let _value = ""; - if (_attrs && _attrs.length > 0) { - _attrs.forEach(item => { - if (item.specCd == _specCd) { - _value = item.value; - return; - } - }); - return _value; - } + _attrs.forEach(item => { + if (item.specCd == _specCd) { + _value = item.value; + return; + } + }); + return _value; }, _getDeadlineTime: function (_fee) { if (_fee.amountOwed == 0 && _fee.endTime == _fee.deadlineTime) { @@ -278,20 +275,20 @@ _openBatchPayRoomFeeModal: function () { vc.jumpToPage('/#/pages/property/batchPayFeeOrder?ownerId=' + $that.simplifyRoomFeeInfo.ownerId + "&payerObjType=3333") }, - _openMonthPayRoomFeeModal: function () { + _openMonthPayRoomFeeModal: function() { vc.jumpToPage('/#/pages/property/payFeeMonthOrder?payerObjId=' + $that.simplifyRoomFeeInfo.roomId + "&payerObjType=3333"); }, - _openRoomCreateFeeComboModal: function () { + _openRoomCreateFeeComboModal: function() { vc.jumpToPage('/#/pages/property/createFeeByCombo?payerObjId=' + $that.simplifyRoomFeeInfo.roomId + "&payerObjName=" + $that.simplifyRoomFeeInfo.roomName + "&payerObjType=3333") }, - _openPrestoreAccountModal: function () { + _openPrestoreAccountModal: function() { window.open('/#/pages/owner/ownerDetail?ownerId=' + $that.simplifyRoomFeeInfo.ownerId + "¤tTab=ownerDetailAccount") }, - _viewRoomFeeConfig: function (_fee) { + _viewRoomFeeConfig: function(_fee) { let param = { params: { page: 1, @@ -320,6 +317,7 @@ "公式": _feeConfig.computingFormulaName, "计费单价": _feeConfig.computingFormula == '2002' ? '-' : _feeConfig.squarePrice, "附加/固定费用": _feeConfig.additionalAmount, + } }) }, @@ -327,6 +325,7 @@ console.log('请求失败处理'); } ); + }, _viewRoomFee: function (_fee) { let _data = { @@ -349,14 +348,14 @@ data: _data }); }, - _changeSimplifyRoomShowFlag: function () { + _changeSimplifyRoomShowFlag: function() { if ($that.simplifyRoomFeeInfo.showFlag == 'MONTH') { $that._listSimplifyRoomMonthFee(DEFAULT_PAGE, DEFAULT_ROWS) } else { $that._listSimplifyRoomFee(DEFAULT_PAGE, DEFAULT_ROWS); } }, - _listSimplifyRoomMonthFee: function (_page, _row) { + _listSimplifyRoomMonthFee: function(_page, _row) { let param = { params: { page: 1, @@ -378,7 +377,7 @@ //发送get请求 vc.http.apiGet('/fee.listMonthFee', param, - function (json) { + function(json) { let _feeConfigInfo = JSON.parse(json); $that.simplifyRoomFeeInfo.total = _feeConfigInfo.total; $that.simplifyRoomFeeInfo.records = _feeConfigInfo.records; @@ -389,11 +388,11 @@ $that.simplifyRoomFeeInfo.totalAmount = _totalAmount.toFixed(2); $that.simplifyRoomFeeInfo.monthFees = _feeConfigInfo.data; }, - function () { + function() { console.log('请求失败处理'); } ); }, } }); -})(window.vc); \ No newline at end of file +})(window.vc);