93 lines
3.9 KiB
JavaScript
93 lines
3.9 KiB
JavaScript
/**
|
|
入驻小区
|
|
**/
|
|
(function (vc) {
|
|
var DEFAULT_PAGE = 1;
|
|
var DEFAULT_ROWS = 10;
|
|
vc.extends({
|
|
data: {
|
|
inspectionItemManageInfo: {
|
|
inspectionItems: [],
|
|
total: 0,
|
|
records: 1,
|
|
moreCondition: false,
|
|
itemId: '',
|
|
conditions: {
|
|
itemId: '',
|
|
itemName: '',
|
|
communityId: '',
|
|
}
|
|
}
|
|
},
|
|
_initMethod: function () {
|
|
$that._listInspectionItems(DEFAULT_PAGE, DEFAULT_ROWS);
|
|
},
|
|
_initEvent: function () {
|
|
vc.on('inspectionItemManage', 'listInspectionItem', function (_param) {
|
|
$that._listInspectionItems(DEFAULT_PAGE, DEFAULT_ROWS);
|
|
});
|
|
vc.on('pagination', 'page_event', function (_currentPage) {
|
|
$that._listInspectionItems(_currentPage, DEFAULT_ROWS);
|
|
});
|
|
},
|
|
methods: {
|
|
_listInspectionItems: function (_page, _rows) {
|
|
$that.inspectionItemManageInfo.conditions.page = _page;
|
|
$that.inspectionItemManageInfo.conditions.row = _rows;
|
|
$that.inspectionItemManageInfo.conditions.communityId = vc.getCurrentCommunity().communityId;
|
|
let param = {
|
|
params: $that.inspectionItemManageInfo.conditions
|
|
};
|
|
param.params.itemId = param.params.itemId.trim();
|
|
param.params.itemName = param.params.itemName.trim();
|
|
//发送get请求
|
|
vc.http.apiGet('/inspectionItem.listInspectionItem',
|
|
param,
|
|
function (json, res) {
|
|
let _json = JSON.parse(json);
|
|
$that.inspectionItemManageInfo.total = _json.total;
|
|
$that.inspectionItemManageInfo.records = _json.records;
|
|
$that.inspectionItemManageInfo.inspectionItems = _json.data;
|
|
vc.emit('pagination', 'init', {
|
|
total: $that.inspectionItemManageInfo.records,
|
|
dataCount: $that.inspectionItemManageInfo.total,
|
|
currentPage: _page
|
|
});
|
|
},
|
|
function (errInfo, error) {
|
|
console.log('请求失败处理');
|
|
}
|
|
);
|
|
},
|
|
_openAddInspectionItemModal: function () {
|
|
vc.emit('addInspectionItem', 'openAddInspectionItemModal', {});
|
|
},
|
|
_openEditInspectionItemModel: function (_inspectionItem) {
|
|
vc.emit('editInspectionItem', 'openEditInspectionItemModal', _inspectionItem);
|
|
},
|
|
_openDeleteInspectionItemModel: function (_inspectionItem) {
|
|
vc.emit('deleteInspectionItem', 'openDeleteInspectionItemModal', _inspectionItem);
|
|
},
|
|
//查询
|
|
_queryInspectionItemMethod: function () {
|
|
$that._listInspectionItems(DEFAULT_PAGE, DEFAULT_ROWS);
|
|
},
|
|
//重置
|
|
_resetInspectionItemMethod: function () {
|
|
$that.inspectionItemManageInfo.conditions.itemId = "";
|
|
$that.inspectionItemManageInfo.conditions.itemName = "";
|
|
$that._listInspectionItems(DEFAULT_PAGE, DEFAULT_ROWS);
|
|
},
|
|
_moreCondition: function () {
|
|
if ($that.inspectionItemManageInfo.moreCondition) {
|
|
$that.inspectionItemManageInfo.moreCondition = false;
|
|
} else {
|
|
$that.inspectionItemManageInfo.moreCondition = true;
|
|
}
|
|
},
|
|
_toTitle: function (_item) {
|
|
vc.jumpToPage('/#/pages/property/inspectionItemTitleManage?itemId=' + _item.itemId)
|
|
}
|
|
}
|
|
});
|
|
})(window.vc); |