MicroCommunityWeb/public/pages/machine/chargeMonthOrderManage/chargeMonthOrderManage.js
2023-09-04 00:50:33 +08:00

84 lines
3.2 KiB
JavaScript

/**
入驻小区
**/
(function(vc) {
var DEFAULT_PAGE = 1;
var DEFAULT_ROWS = 10;
vc.extends({
data: {
chargeMonthOrderManageInfo: {
chargeMonthOrders: [],
total: 0,
records: 1,
moreCondition: false,
orderId: '',
conditions: {
cardId: '',
personName: '',
personTel: '',
communityId: '',
primeRate: '',
receivableAmount: '',
receivedAmount: '',
communityId: vc.getCurrentCommunity().communityId
}
}
},
_initMethod: function() {
$that._listChargeMonthOrders(DEFAULT_PAGE, DEFAULT_ROWS);
},
_initEvent: function() {
vc.on('chargeMonthOrderManage', 'listChargeMonthOrder', function(_param) {
$that._listChargeMonthOrders(DEFAULT_PAGE, DEFAULT_ROWS);
});
vc.on('pagination', 'page_event', function(_currentPage) {
$that._listChargeMonthOrders(_currentPage, DEFAULT_ROWS);
});
},
methods: {
_listChargeMonthOrders: function(_page, _rows) {
$that.chargeMonthOrderManageInfo.conditions.page = _page;
$that.chargeMonthOrderManageInfo.conditions.row = _rows;
let param = {
params: $that.chargeMonthOrderManageInfo.conditions
};
//发送get请求
vc.http.apiGet('/chargeCard.listChargeMonthOrder',
param,
function(json, res) {
var _chargeMonthOrderManageInfo = JSON.parse(json);
$that.chargeMonthOrderManageInfo.total = _chargeMonthOrderManageInfo.total;
$that.chargeMonthOrderManageInfo.records = _chargeMonthOrderManageInfo.records;
$that.chargeMonthOrderManageInfo.chargeMonthOrders = _chargeMonthOrderManageInfo.data;
vc.emit('pagination', 'init', {
total: $that.chargeMonthOrderManageInfo.records,
currentPage: _page
});
},
function(errInfo, error) {
console.log('请求失败处理');
}
);
},
_openAddChargeMonthOrderModal: function() {
vc.emit('addChargeMonthOrder', 'openAddChargeMonthOrderModal', {});
},
_queryChargeMonthOrderMethod: function() {
$that._listChargeMonthOrders(DEFAULT_PAGE, DEFAULT_ROWS);
},
_moreCondition: function() {
if ($that.chargeMonthOrderManageInfo.moreCondition) {
$that.chargeMonthOrderManageInfo.moreCondition = false;
} else {
$that.chargeMonthOrderManageInfo.moreCondition = true;
}
},
_settingOrderCard: function() {
vc.jumpToPage('/#/pages/machine/chargeMonthCardManage')
}
}
});
})(window.vc);