mirror of
https://gitee.com/java110/MicroCommunityWeb.git
synced 2026-06-12 18:11:00 +08:00
91 lines
3.7 KiB
JavaScript
91 lines
3.7 KiB
JavaScript
/**
|
|
入驻小区
|
|
**/
|
|
(function(vc) {
|
|
var DEFAULT_PAGE = 1;
|
|
var DEFAULT_ROWS = 10;
|
|
vc.extends({
|
|
data: {
|
|
ownerCommitteeManageInfo: {
|
|
ownerCommittees: [],
|
|
total: 0,
|
|
records: 1,
|
|
moreCondition: false,
|
|
ocId: '',
|
|
conditions: {
|
|
name: '',
|
|
link: '',
|
|
state: '',
|
|
communityId: vc.getCurrentCommunity().communityId
|
|
}
|
|
}
|
|
},
|
|
_initMethod: function() {
|
|
vc.component._listOwnerCommittees(DEFAULT_PAGE, DEFAULT_ROWS);
|
|
},
|
|
_initEvent: function() {
|
|
|
|
vc.on('ownerCommitteeManage', 'listOwnerCommittee', function(_param) {
|
|
vc.component._listOwnerCommittees(DEFAULT_PAGE, DEFAULT_ROWS);
|
|
});
|
|
vc.on('pagination', 'page_event', function(_currentPage) {
|
|
vc.component._listOwnerCommittees(_currentPage, DEFAULT_ROWS);
|
|
});
|
|
},
|
|
methods: {
|
|
_listOwnerCommittees: function(_page, _rows) {
|
|
|
|
vc.component.ownerCommitteeManageInfo.conditions.page = _page;
|
|
vc.component.ownerCommitteeManageInfo.conditions.row = _rows;
|
|
let param = {
|
|
params: vc.component.ownerCommitteeManageInfo.conditions
|
|
};
|
|
|
|
//发送get请求
|
|
vc.http.apiGet('/ownerCommittee.listOwnerCommittee',
|
|
param,
|
|
function(json, res) {
|
|
let _ownerCommitteeManageInfo = JSON.parse(json);
|
|
vc.component.ownerCommitteeManageInfo.total = _ownerCommitteeManageInfo.total;
|
|
vc.component.ownerCommitteeManageInfo.records = _ownerCommitteeManageInfo.records;
|
|
vc.component.ownerCommitteeManageInfo.ownerCommittees = _ownerCommitteeManageInfo.data;
|
|
vc.emit('pagination', 'init', {
|
|
total: vc.component.ownerCommitteeManageInfo.records,
|
|
currentPage: _page
|
|
});
|
|
},
|
|
function(errInfo, error) {
|
|
console.log('请求失败处理');
|
|
}
|
|
);
|
|
},
|
|
_openAddOwnerCommitteeModal: function() {
|
|
vc.jumpToPage('/#/pages/owner/addOwnerCommittee')
|
|
},
|
|
_openEditOwnerCommitteeModel: function(_ownerCommittee) {
|
|
//vc.emit('editOwnerCommittee', 'openEditOwnerCommitteeModal', _ownerCommittee);
|
|
vc.jumpToPage('/#/pages/owner/editOwnerCommittee?ocId=' + _ownerCommittee.ocId);
|
|
},
|
|
_openDeleteOwnerCommitteeModel: function(_ownerCommittee) {
|
|
vc.emit('deleteOwnerCommittee', 'openDeleteOwnerCommitteeModal', _ownerCommittee);
|
|
},
|
|
_openOwnerCommitteeDetail: function(_ownerCommittee) {
|
|
//vc.emit('editOwnerCommittee', 'openEditOwnerCommitteeModal', _ownerCommittee);
|
|
vc.jumpToPage('/#/pages/owner/ownerCommitteeDetail?ocId=' + _ownerCommittee.ocId);
|
|
},
|
|
_queryOwnerCommitteeMethod: function() {
|
|
vc.component._listOwnerCommittees(DEFAULT_PAGE, DEFAULT_ROWS);
|
|
|
|
},
|
|
_moreCondition: function() {
|
|
if (vc.component.ownerCommitteeManageInfo.moreCondition) {
|
|
vc.component.ownerCommitteeManageInfo.moreCondition = false;
|
|
} else {
|
|
vc.component.ownerCommitteeManageInfo.moreCondition = true;
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
});
|
|
})(window.vc); |