mirror of
https://gitee.com/java110/WechatOwnerService.git
synced 2026-02-23 21:36:38 +08:00
支持账户扣款功能
This commit is contained in:
parent
0f3b9efd64
commit
c9d481ec80
@ -5,11 +5,11 @@
|
|||||||
<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">
|
||||||
<checkbox :value="account.acctId" :checked="account.checked" />{{account.acctTypeName}}
|
<checkbox :value="account.acctId" :checked="account.checked" /> {{account.acctTypeName}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -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,
|
||||||
|
|||||||
@ -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: '',
|
||||||
@ -121,12 +124,15 @@
|
|||||||
payerObjs: [],
|
payerObjs: [],
|
||||||
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;
|
||||||
@ -152,9 +162,9 @@
|
|||||||
page: 1,
|
page: 1,
|
||||||
row: 50,
|
row: 50,
|
||||||
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({
|
||||||
@ -182,12 +193,16 @@
|
|||||||
//payOweFee(this);
|
//payOweFee(this);
|
||||||
let _receivedAmount = this.receivableAmount;
|
let _receivedAmount = this.receivableAmount;
|
||||||
let _tradeType = 'JSAPI';
|
let _tradeType = 'JSAPI';
|
||||||
if(!this.feeIds || this.feeIds.length < 1){
|
if (!this.feeIds || this.feeIds.length < 1) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
icon:'none',
|
icon: 'none',
|
||||||
title:'未选择费用'
|
title: '未选择费用'
|
||||||
});
|
});
|
||||||
return ;
|
return;
|
||||||
|
}
|
||||||
|
let _acctId = '';
|
||||||
|
if(this.selectUserAccount && this.selectUserAccount.length>0){
|
||||||
|
_acctId = this.selectUserAccount[0].acctId;
|
||||||
}
|
}
|
||||||
let _objData = {
|
let _objData = {
|
||||||
business: "oweFee",
|
business: "oweFee",
|
||||||
@ -199,7 +214,8 @@
|
|||||||
tradeType: _tradeType,
|
tradeType: _tradeType,
|
||||||
//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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@ -278,7 +278,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs.vcUserAccountRef._listOwnerAccount(this.feeId, this.communityId);
|
this.$refs.vcUserAccountRef._listOwnerAccount( this.communityId);
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user