优化费用

This commit is contained in:
Your Name 2023-09-04 17:47:50 +08:00
parent 407a6219c6
commit 519ca023d1
3 changed files with 57 additions and 13 deletions

View File

@ -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) { export function receiveParkingCoupon(_objData) {

View File

@ -208,6 +208,7 @@ export default {
listChargeMonthOrder: baseUrl + "app/chargeCard.listChargeMonthOrder", listChargeMonthOrder: baseUrl + "app/chargeCard.listChargeMonthOrder",
listChargeMonthCard: baseUrl + "app/chargeCard.listChargeMonthCard", listChargeMonthCard: baseUrl + "app/chargeCard.listChargeMonthCard",
generatorUserQrCode: baseUrl + "app/user.generatorUserQrCode", generatorUserQrCode: baseUrl + "app/user.generatorUserQrCode",
computeObjFee: baseUrl + "app/feeApi/listFeeObj",
NEED_NOT_LOGIN_PAGE: [ NEED_NOT_LOGIN_PAGE: [
'pages/login/login', 'pages/login/login',

View File

@ -168,7 +168,7 @@
dateSubOneDay dateSubOneDay
} from '../../lib/java110/utils/DateUtil.js'; } 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 { export default {
components: { components: {
@ -244,9 +244,6 @@
let _receivableAmount = _amount; let _receivableAmount = _amount;
if (_fee.feeFlag == "2006012") { // if (_fee.feeFlag == "2006012") { //
_receivableAmount = _amount; _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(); let _communityInfo = context.getCurrentCommunity();
@ -288,12 +285,14 @@
let _endTime = addMonth(_lastDate, parseInt(this.feeMonth)); let _endTime = addMonth(_lastDate, parseInt(this.feeMonth));
this.endTime = formatDate(_endTime); this.endTime = formatDate(_endTime);
} }
if(_fee.feeFlag != "2006012") { //
//todo
this.computeReceivableAmount();
}
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.vcDiscountRef._loadFeeDiscount(this.feeId, this.communityId, this.feeMonth);
this.$refs.vcUserAccountRef._listOwnerAccount(this.feeId, this.communityId); this.$refs.vcUserAccountRef._listOwnerAccount(this.feeId, this.communityId);
this.$refs.giftCoupon.listGiftCoupon(this.feeId, this.communityId, this.feeMonth);
}) })
}, },
onShow() { onShow() {
@ -324,10 +323,23 @@
}) })
}, },
// ×+ × // ×+ ×
getReceivableAmount: function() { computeReceivableAmount: function() {
// return ((this.builtUpArea * this.squarePrice + parseFloat(this.additionalAmount)) * this.feeMonth) // return ((this.builtUpArea * this.squarePrice + parseFloat(this.additionalAmount)) * this.feeMonth)
// .toFixed(2); // .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.feeMonthName = _feeMonth + '个月';
this.feeMonth = _feeMonth; this.feeMonth = _feeMonth;
this.endTime = formatDate(_newDate); this.endTime = formatDate(_newDate);
this.receivableAmount = this.getReceivableAmount(); this.computeReceivableAmount();
this.$refs.vcDiscountRef._loadFeeDiscount(this.feeId, this.communityId, this.feeMonth);
this.$refs.giftCoupon.listGiftCoupon(this.feeId, this.communityId, this.feeMonth);
}, },
onFeeMonthChange: function(e) { onFeeMonthChange: function(e) {