mirror of
https://gitee.com/java110/MicroCommunityWeb.git
synced 2026-02-24 05:46:03 +08:00
优化欠费缴费功能
This commit is contained in:
parent
e4a48ba831
commit
77047e1ed0
8
app.js
8
app.js
@ -34,10 +34,10 @@ let opts = {
|
||||
//app.use('/callComponent',proxy('https://app.demo.winqi.cn/',opts));
|
||||
//app.use('/callComponent',proxy('http://api.demo.winqi.cn:8012/',opts));
|
||||
//app.use('/callComponent',proxy('http://api.demo.winqi.cn:8012',opts));
|
||||
//app.use('/callComponent',proxy('http://api.demo.winqi.cn:8012',opts));
|
||||
//app.use('/app',proxy('http://api.demo.winqi.cn:8012',opts));
|
||||
app.use('/callComponent',proxy('http://192.168.1.16:8012',opts));
|
||||
app.use('/app',proxy('http://192.168.1.16:8012',opts));
|
||||
app.use('/callComponent',proxy('http://api.demo.winqi.cn:8012',opts));
|
||||
app.use('/app',proxy('http://api.demo.winqi.cn:8012',opts));
|
||||
//app.use('/callComponent',proxy('http://192.168.1.16:8012',opts));
|
||||
//app.use('/app',proxy('http://192.168.1.16:8012',opts));
|
||||
|
||||
//app.listen(3000);
|
||||
app.use(express.json());
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
<table class="footable table table-stripped toggle-arrow-tiny" data-page-size="15">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
<th class="text-center">选择</th>
|
||||
<th class="text-center">费用类型</th>
|
||||
<th class="text-center">费用项目</th>
|
||||
<th class="text-center">费用ID</th>
|
||||
@ -22,7 +22,9 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="oweFee in owePayFeeOrderInfo.oweFees">
|
||||
|
||||
<td class="text-center">
|
||||
<input type="checkbox" class="i-checks checkItem" v-bind:value="oweFee.feeId" v-model="owePayFeeOrderInfo.selectPayFeeIds">
|
||||
</td>
|
||||
<td class="text-center">{{oweFee.feeTypeCdName}}</td>
|
||||
<td class="text-center">{{oweFee.feeName}}</td>
|
||||
<td class="text-center">{{oweFee.feeId}}</td>
|
||||
|
||||
@ -5,20 +5,29 @@
|
||||
vc.extends({
|
||||
data: {
|
||||
owePayFeeOrderInfo: {
|
||||
oweFees: [],
|
||||
oweFees: [],
|
||||
selectPayFeeIds: [],
|
||||
feePrices: 0.00,
|
||||
communityId: vc.getCurrentCommunity().communityId,
|
||||
payObjId:'',
|
||||
payObjType:''
|
||||
payObjId: '',
|
||||
payObjType: ''
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'owePayFeeOrderInfo.selectPayFeeIds': {
|
||||
deep: true,
|
||||
handler: function () {
|
||||
$that._dealSelectFee();
|
||||
}
|
||||
}
|
||||
},
|
||||
_initMethod: function () {
|
||||
let _payObjId = vc.getParam('payObjId');
|
||||
let _payObjType = vc.getParam('payObjType');
|
||||
if(!vc.notNull(_payObjId)){
|
||||
if (!vc.notNull(_payObjId)) {
|
||||
vc.toast('非法操作');
|
||||
vc.getBack();
|
||||
return ;
|
||||
return;
|
||||
}
|
||||
$that.owePayFeeOrderInfo.payObjId = _payObjId;
|
||||
$that.owePayFeeOrderInfo.payObjType = _payObjType;
|
||||
@ -29,45 +38,61 @@
|
||||
},
|
||||
methods: {
|
||||
|
||||
_loadOweFees:function(){
|
||||
_loadOweFees: function () {
|
||||
var param = {
|
||||
params:{
|
||||
page:1,
|
||||
row:50,
|
||||
communityId:vc.getCurrentCommunity().communityId,
|
||||
payObjId:$that.owePayFeeOrderInfo.payObjId,
|
||||
payObjType:$that.owePayFeeOrderInfo.payObjType,
|
||||
params: {
|
||||
page: 1,
|
||||
row: 50,
|
||||
communityId: vc.getCurrentCommunity().communityId,
|
||||
payObjId: $that.owePayFeeOrderInfo.payObjId,
|
||||
payObjType: $that.owePayFeeOrderInfo.payObjType,
|
||||
}
|
||||
};
|
||||
//发送get请求
|
||||
vc.http.apiGet('/feeApi/listOweFees',
|
||||
param,
|
||||
function(json){
|
||||
var _json = JSON.parse(json);
|
||||
let _fees = _json.data;
|
||||
if(_fees.length < 1){
|
||||
vc.toast('当前没有欠费数据');
|
||||
return ;
|
||||
}
|
||||
$that.owePayFeeOrderInfo.oweFees = _fees;
|
||||
let totalFee = 0.00;
|
||||
$that.owePayFeeOrderInfo.oweFees.forEach(item => {
|
||||
totalFee += item.feePrice;
|
||||
});
|
||||
$that.owePayFeeOrderInfo.feePrices = Math.round(totalFee*100,2)/100;
|
||||
},function(){
|
||||
console.log('请求失败处理');
|
||||
}
|
||||
);
|
||||
vc.http.apiGet('/feeApi/listOweFees',
|
||||
param,
|
||||
function (json) {
|
||||
var _json = JSON.parse(json);
|
||||
let _fees = _json.data;
|
||||
if (_fees.length < 1) {
|
||||
vc.toast('当前没有欠费数据');
|
||||
return;
|
||||
}
|
||||
$that.owePayFeeOrderInfo.oweFees = _fees;
|
||||
|
||||
$that.owePayFeeOrderInfo.selectPayFeeIds = [];
|
||||
$that.owePayFeeOrderInfo.oweFees.forEach(item => {
|
||||
$that.owePayFeeOrderInfo.selectPayFeeIds.push(item.feeId);
|
||||
});
|
||||
|
||||
}, function () {
|
||||
console.log('请求失败处理');
|
||||
}
|
||||
);
|
||||
},
|
||||
_payFee: function (_page, _row) {
|
||||
|
||||
vc.toast('缴费暂不开放');
|
||||
return ;
|
||||
vc.http.post(
|
||||
'propertyPay',
|
||||
'payFee',
|
||||
JSON.stringify(vc.component.payFeeOrderInfo),
|
||||
let _fees = [];
|
||||
$that.owePayFeeOrderInfo.selectPayFeeIds.forEach(function (_item) {
|
||||
$that.owePayFeeOrderInfo.oweFees.forEach(function (_oweFeeItem) {
|
||||
if (_item == _oweFeeItem.feeId) {
|
||||
_fees.push({
|
||||
feeId: _item,
|
||||
feePrice: _oweFeeItem.feePrice
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
if (_fees.length < 1) {
|
||||
vc.toast('未选中要缴费的项目');
|
||||
return;
|
||||
}
|
||||
let _data = {
|
||||
communityId: vc.getCurrentCommunity().communityId,
|
||||
fees: _fees
|
||||
}
|
||||
vc.http.apiPost(
|
||||
'/feeApi/payOweFee',
|
||||
JSON.stringify(_data),
|
||||
{
|
||||
emulateJSON: true
|
||||
},
|
||||
@ -95,6 +120,20 @@
|
||||
_printAndBack: function () {
|
||||
$('#payFeeResult').modal("hide");
|
||||
vc.getBack();
|
||||
},
|
||||
_dealSelectFee: function () {
|
||||
let totalFee = 0.00;
|
||||
$that.owePayFeeOrderInfo.selectPayFeeIds.forEach(function (_item) {
|
||||
console.log('_item', _item)
|
||||
$that.owePayFeeOrderInfo.oweFees.forEach(function (_oweFeeItem) {
|
||||
if (_item == _oweFeeItem.feeId) {
|
||||
totalFee += _oweFeeItem.feePrice;
|
||||
}
|
||||
});
|
||||
|
||||
})
|
||||
|
||||
$that.owePayFeeOrderInfo.feePrices = Math.round(totalFee * 100, 2) / 100;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user