MicroCommunityWeb/public/components/fee/aRoomFeeCallable/aRoomFeeCallable.js

76 lines
2.7 KiB
JavaScript

(function (vc) {
var DEFAULT_PAGE = 1;
var DEFAULT_ROWS = 10;
vc.extends({
data: {
aRoomFeeCallableInfo: {
callables: [],
ownerId: '',
roomId: '',
roomName: '',
total: 0,
records: 0
}
},
_initMethod: function () {
},
_initEvent: function () {
//切换 至费用页面
vc.on('aRoomFeeCallable', 'switch', function (_param) {
if (!_param.roomId) {
return;
}
$that.clearARoomFeeCallableInfo();
vc.copyObject(_param, $that.aRoomFeeCallableInfo)
$that._listARoomFeeCallable(DEFAULT_PAGE, DEFAULT_ROWS);
});
vc.on('aRoomFeeCallable', 'listOwnerData', function (_param) {
$that._listARoomFeeCallable(DEFAULT_PAGE, DEFAULT_ROWS);
});
vc.on('aRoomFeeCallable', 'paginationPlus', 'page_event',
function (_currentPage) {
$that._listARoomFeeCallable(_currentPage, DEFAULT_ROWS);
}
);
},
methods: {
_listARoomFeeCallable: function (_page, _row) {
let param = {
params: {
page: _page,
row: _row,
payerObjId: $that.aRoomFeeCallableInfo.roomId,
}
};
//发送get请求
vc.http.apiGet('/oweFeeCallable.listAdminOweFeeCallable',
param,
function (json) {
let _data = JSON.parse(json);
$that.aRoomFeeCallableInfo.total = _data.total;
$that.aRoomFeeCallableInfo.records = _data.records;
$that.aRoomFeeCallableInfo.callables = _data.data;
vc.emit('simplifyOwnerRepair', 'paginationPlus', 'init', {
total: $that.aRoomFeeCallableInfo.records,
dataCount: $that.aRoomFeeCallableInfo.total,
currentPage: _page
});
},
function () {
console.log('请求失败处理');
});
},
clearARoomFeeCallableInfo: function () {
$that.aRoomFeeCallableInfo = {
callables: [],
ownerId: '',
roomId: '',
roomName: '',
total: 0,
records: 0
}
},
}
});
})(window.vc);