支持账户扣款功能

This commit is contained in:
wuxw 2023-11-27 20:08:10 +08:00
parent 0f3b9efd64
commit c9d481ec80
3 changed files with 55 additions and 21 deletions

View File

@ -5,7 +5,7 @@
<checkbox-group @change="checkboxChange"> <checkbox-group @change="checkboxChange">
<view class="cu-list menu" v-for="(account, idx) in accounts" :key="idx" :data-item="account" <view class="cu-list menu" v-for="(account, idx) in accounts" :key="idx" :data-item="account"
@click="_viewAccountDetail(account)"> @click="_viewAccountDetail(account)">
<view class="cu-item arrow"> <view class="cu-item ">
<view class="content padding-tb-sm"> <view class="content padding-tb-sm">
<view> <view>
<view class="text-cut" style="width:220px"> <view class="text-cut" style="width:220px">
@ -87,7 +87,7 @@
}); });
}, },
_listOwnerAccount: function(_feeId, _communityId) { _listOwnerAccount: function(_communityId) {
// 2023.6.12 // 2023.6.12
let _that = this; let _that = this;
context.getOwner(function(_ownerInfo) { context.getOwner(function(_ownerInfo) {
@ -97,7 +97,7 @@
} }
queryOwnerAccount({ queryOwnerAccount({
page: 1, page: 1,
row: 20, row: 1,
idCard: _ownerInfo.idCard, idCard: _ownerInfo.idCard,
link: _ownerInfo.link, link: _ownerInfo.link,
communityId: _communityId, communityId: _communityId,

View File

@ -2,7 +2,8 @@
<view> <view>
<view class="cu-form-group arrow margin-top" v-if="payerObjs &&payerObjs.length >1"> <view class="cu-form-group arrow margin-top" v-if="payerObjs &&payerObjs.length >1">
<view class="title" style="width: 200upx;">按房屋缴费</view> <view class="title" style="width: 200upx;">按房屋缴费</view>
<picker bindchange="PickerChange" :value="payerObjIndex" :range="payerObjs" :range-key="'payerObjName'" @change="_payerObjectChange"> <picker bindchange="PickerChange" :value="payerObjIndex" :range="payerObjs" :range-key="'payerObjName'"
@change="_payerObjectChange">
<view class="picker"> <view class="picker">
{{payerObjName?payerObjName:'请选择'}} {{payerObjName?payerObjName:'请选择'}}
</view> </view>
@ -49,6 +50,9 @@
</view> </view>
</view> </view>
</view> </view>
<vcUserAccount ref="vcUserAccountRef" @getUserAmount="getUserAmount"></vcUserAccount>
</view> </view>
<view v-else> <view v-else>
<no-data-page></no-data-page> <no-data-page></no-data-page>
@ -64,15 +68,13 @@
</view> </view>
</view> </view>
</view> </view>
</view>
</template> </template>
<script> <script>
// pages/fee/payParkingFee.js // pages/fee/payParkingFee.js
import context from '../../lib/java110/Java110Context.js'; import context from '../../lib/java110/Java110Context.js';
const constant = context.constant; const constant = context.constant;
import vcUserAccount from '@/components/vc-user-account/vc-user-account.vue';
import noDataPage from '../../components/no-data-page/no-data-page.vue' import noDataPage from '../../components/no-data-page/no-data-page.vue'
import { import {
@ -112,6 +114,7 @@
scrollLeft: 0, scrollLeft: 0,
amount: 0, amount: 0,
receivableAmount: 0.00, receivableAmount: 0.00,
orgReceivableAmount: 0.00,
communityId: '', communityId: '',
communityName: '', communityName: '',
appId: '', appId: '',
@ -122,11 +125,14 @@
payerObjId: '', payerObjId: '',
payerObjName: '', payerObjName: '',
payerObjIndex: 0, payerObjIndex: 0,
feeIds:[] feeIds: [],
selectUserAccount: [], //
accountAmount: 0.0, //
}; };
}, },
components: { components: {
noDataPage noDataPage,
vcUserAccount,
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
@ -134,6 +140,10 @@
onLoad: function(options) { onLoad: function(options) {
context.onLoad(options); context.onLoad(options);
autoLogin(options); autoLogin(options);
let _that = this;
setTimeout(function() {
_that.$refs.vcUserAccountRef._listOwnerAccount('', _that.communityId);
}, 1500)
}, },
onShow() { onShow() {
let _that = this; let _that = this;
@ -154,7 +164,7 @@
communityId: this.communityId, communityId: this.communityId,
payObjId: this.payerObjId payObjId: this.payerObjId
} }
_that.receivableAmount = 0; _that.orgReceivableAmount = 0;
_that.feeIds = []; _that.feeIds = [];
getRoomOweFees(_objData) getRoomOweFees(_objData)
.then(function(_fees) { .then(function(_fees) {
@ -164,12 +174,13 @@
_that.fees = _fees; _that.fees = _fees;
_fees.forEach(function(_item) { _fees.forEach(function(_item) {
if (_item.payOnline == 'Y') { if (_item.payOnline == 'Y') {
_that.receivableAmount += _item.feeTotalPrice; _that.orgReceivableAmount += _item.feeTotalPrice;
_that.feeIds.push(_item.feeId); _that.feeIds.push(_item.feeId);
} }
}); });
_that.receivableAmount = _that.receivableAmount.toFixed(2); _that.orgReceivableAmount = _that.orgReceivableAmount.toFixed(2);
_that.computeFeeObj(_fees); _that.computeFeeObj(_fees);
_that.computeReceivableAmount();
return _fees; return _fees;
}, function(error) { }, function(error) {
uni.showToast({ uni.showToast({
@ -189,6 +200,10 @@
}); });
return; return;
} }
let _acctId = '';
if(this.selectUserAccount && this.selectUserAccount.length>0){
_acctId = this.selectUserAccount[0].acctId;
}
let _objData = { let _objData = {
business: "oweFee", business: "oweFee",
cycles: this.feeMonth, cycles: this.feeMonth,
@ -200,6 +215,7 @@
//appId: uni.getStorageSync(mapping.W_APP_ID), //appId: uni.getStorageSync(mapping.W_APP_ID),
storeId: this.storeId, storeId: this.storeId,
feeIds: this.feeIds, feeIds: this.feeIds,
acctId:_acctId,
}; };
uni.setStorageSync('doing_cashier', _objData); uni.setStorageSync('doing_cashier', _objData);
uni.navigateTo({ uni.navigateTo({
@ -255,6 +271,24 @@
this.payerObjId = _curPayerObj.payerObjId; this.payerObjId = _curPayerObj.payerObjId;
this.payerObjName = _curPayerObj.payerObjName; this.payerObjName = _curPayerObj.payerObjName;
this._loadOweFee(); this._loadOweFee();
},
getUserAmount: function(_accInfo) {
//
this.selectUserAccount = _accInfo.selectedAccounts;
//
this.accountAmount = _accInfo.totalUserAmount;
this.computeReceivableAmount();
},
computeReceivableAmount() {
let orgReceivableAmount = this.orgReceivableAmount;
let _receivableAmount = parseFloat(orgReceivableAmount);
if (this.accountAmount) {
_receivableAmount = _receivableAmount - parseFloat(this.accountAmount);
}
_receivableAmount = _receivableAmount.toFixed(2);
_receivableAmount = _receivableAmount < 0 ? 0.00:_receivableAmount;
this.receivableAmount = _receivableAmount;
} }
} }
}; };

View File

@ -278,7 +278,7 @@
} }
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.vcUserAccountRef._listOwnerAccount(this.feeId, this.communityId); this.$refs.vcUserAccountRef._listOwnerAccount( this.communityId);
}) })
}, },
onShow() { onShow() {