From 519ca023d1402848f304e5b792f22a77104141d9 Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 4 Sep 2023 17:47:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=B4=B9=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/fee/feeApi.js | 32 ++++++++++++++++++++++++++++++++ constant/url.js | 1 + pages/fee/roomFee.vue | 37 ++++++++++++++++++++++++------------- 3 files changed, 57 insertions(+), 13 deletions(-) diff --git a/api/fee/feeApi.js b/api/fee/feeApi.js index f32612d..a2af8d9 100644 --- a/api/fee/feeApi.js +++ b/api/fee/feeApi.js @@ -292,6 +292,38 @@ export function computePayFeeCoupon(_objData) { }) } +/** + * 计算算费 + * @param {Object} _objData { + communityId:"", + feeId:"", + cycle:'', + page:1, + row:1 + } + */ +export function computeObjFee(_objData) { + return new Promise((resolve, reject) => { + request({ + url: url.computeObjFee, + method: "GET", + data: _objData, //动态数据 + success: function(res) { + if (res.statusCode == 200) { + //成功情况下跳转 + resolve(res.data); + return; + } + reject(); + }, + fail: function(e) { + reject(); + } + }); + }) +} + + export function receiveParkingCoupon(_objData) { diff --git a/constant/url.js b/constant/url.js index 764d1bb..4881311 100644 --- a/constant/url.js +++ b/constant/url.js @@ -208,6 +208,7 @@ export default { listChargeMonthOrder: baseUrl + "app/chargeCard.listChargeMonthOrder", listChargeMonthCard: baseUrl + "app/chargeCard.listChargeMonthCard", generatorUserQrCode: baseUrl + "app/user.generatorUserQrCode", + computeObjFee: baseUrl + "app/feeApi/listFeeObj", NEED_NOT_LOGIN_PAGE: [ 'pages/login/login', diff --git a/pages/fee/roomFee.vue b/pages/fee/roomFee.vue index db7eaa6..7625a21 100644 --- a/pages/fee/roomFee.vue +++ b/pages/fee/roomFee.vue @@ -168,7 +168,7 @@ dateSubOneDay } from '../../lib/java110/utils/DateUtil.js'; - import {payFeeApp,payFeeWechat} from '@/api/fee/feeApi.js'; + import {payFeeApp,payFeeWechat,computeObjFee} from '@/api/fee/feeApi.js'; export default { components: { @@ -244,9 +244,6 @@ let _receivableAmount = _amount; if (_fee.feeFlag == "2006012") { // 一次性费用 _receivableAmount = _amount; - } else { // 周期性费用 - //_receivableAmount = ((_fee.builtUpArea * _fee.squarePrice + parseFloat(_fee.additionalAmount)) * _fee.paymentCycle).toFixed(2); - _receivableAmount = (_fee.amount * _fee.paymentCycle).toFixed(2); } let _communityInfo = context.getCurrentCommunity(); @@ -288,12 +285,14 @@ let _endTime = addMonth(_lastDate, parseInt(this.feeMonth)); this.endTime = formatDate(_endTime); } - - + + if(_fee.feeFlag != "2006012") { // 周期性费用 + //todo 计算 应收 + this.computeReceivableAmount(); + } + this.$nextTick(() => { - this.$refs.vcDiscountRef._loadFeeDiscount(this.feeId, this.communityId, this.feeMonth); this.$refs.vcUserAccountRef._listOwnerAccount(this.feeId, this.communityId); - this.$refs.giftCoupon.listGiftCoupon(this.feeId, this.communityId, this.feeMonth); }) }, onShow() { @@ -324,10 +323,23 @@ }) }, // (单价×面积+附加费) × 周期 - getReceivableAmount: function() { + computeReceivableAmount: function() { // return ((this.builtUpArea * this.squarePrice + parseFloat(this.additionalAmount)) * this.feeMonth) // .toFixed(2); - return (this.amount * this.feeMonth).toFixed(2); + let _that = this; + computeObjFee({ + communityId:this.communityId, + feeId:this.feeId, + cycle:this.feeMonth, + page:1, + row:1 + }).then(_data=>{ + _that.receivableAmount = _data.data.feeTotalPrice; + _that.$refs.vcDiscountRef._loadFeeDiscount(_that.feeId, _that.communityId, _that.feeMonth); + _that.$refs.giftCoupon.listGiftCoupon(_that.feeId, _that.communityId, _that.feeMonth); + }) + + //return (this.amount * this.feeMonth).toFixed(2); }, // 折扣金额 @@ -371,9 +383,8 @@ this.feeMonthName = _feeMonth + '个月'; this.feeMonth = _feeMonth; this.endTime = formatDate(_newDate); - this.receivableAmount = this.getReceivableAmount(); - this.$refs.vcDiscountRef._loadFeeDiscount(this.feeId, this.communityId, this.feeMonth); - this.$refs.giftCoupon.listGiftCoupon(this.feeId, this.communityId, this.feeMonth); + this.computeReceivableAmount(); + }, onFeeMonthChange: function(e) {