78 lines
3.4 KiB
JavaScript
78 lines
3.4 KiB
JavaScript
/**
|
|
入驻小区
|
|
**/
|
|
(function (vc) {
|
|
var DEFAULT_PAGE = 1;
|
|
var DEFAULT_ROWS = 10;
|
|
vc.extends({
|
|
data: {
|
|
inspectionRoutePointInfo: {
|
|
inspectionPoints: [],
|
|
inspectionRouteId: '',
|
|
total: 0,
|
|
records: 1,
|
|
routeName: ''
|
|
}
|
|
},
|
|
_initMethod: function () {
|
|
//$that._listInspectionRoutePoints(DEFAULT_PAGE, DEFAULT_ROWS);
|
|
},
|
|
_initEvent: function () {
|
|
vc.on('inspectionRoutePoint','switch', function (_param) {
|
|
$that.inspectionRoutePointInfo.inspectionRouteId = _param.inspectionRouteId;
|
|
$that._listInspectionRoutePoints(DEFAULT_PAGE, DEFAULT_ROWS);
|
|
});
|
|
vc.on('inspectionRoutePoint','listInspectionPoint', function (_param) {
|
|
$that._listInspectionRoutePoints(DEFAULT_PAGE, DEFAULT_ROWS);
|
|
});
|
|
|
|
vc.on('inspectionRoutePoint', 'paginationPlus', 'page_event', function (_currentPage) {
|
|
$that._listInspectionRoutePoints(_currentPage, DEFAULT_ROWS);
|
|
});
|
|
},
|
|
methods: {
|
|
_listInspectionRoutePoints: function (_page, _rows) {
|
|
var param = {
|
|
params: {
|
|
page: _page,
|
|
row: _rows,
|
|
communityId: vc.getCurrentCommunity().communityId,
|
|
inspectionRouteId: $that.inspectionRoutePointInfo.inspectionRouteId
|
|
}
|
|
};
|
|
//发送get请求
|
|
vc.http.apiGet('/inspectionRoute.listInspectionRoutePoints',
|
|
param,
|
|
function (json, res) {
|
|
let _json = JSON.parse(json);
|
|
$that.inspectionRoutePointInfo.total = _json.total;
|
|
$that.inspectionRoutePointInfo.records = _json.records;
|
|
$that.inspectionRoutePointInfo.inspectionPoints = _json.inspectionPoints;
|
|
vc.emit('inspectionRoutePoint', 'paginationPlus', 'init', {
|
|
total: $that.inspectionRoutePointInfo.records,
|
|
dataCount: $that.inspectionRoutePointInfo.total,
|
|
currentPage: _page
|
|
});
|
|
},
|
|
function (errInfo, error) {
|
|
console.log('请求失败处理');
|
|
}
|
|
);
|
|
},
|
|
_openAddInspectionRoutePointModal: function () {
|
|
vc.emit('chooseInspectionRoutePoint', 'openchooseInspectionRoutePointModal', $that.inspectionRoutePointInfo);
|
|
},
|
|
_openDeleteInspectionRoutePointModel: function (_inspectionPoint) {
|
|
_inspectionPoint.inspectionRouteId = $that.inspectionRoutePointInfo.inspectionRouteId;
|
|
vc.emit('deleteInspectionRoutePoint', 'openDeleteInspectionRoutePointModal', _inspectionPoint);
|
|
},
|
|
_openEditInspectionRoutePointModel: function (_inspectionPoint) {
|
|
_inspectionPoint.inspectionRouteId = $that.inspectionRoutePointInfo.inspectionRouteId;
|
|
vc.emit('editInspectionRoutePoint', 'openEditInspectionRoutePointModal', _inspectionPoint);
|
|
},
|
|
_goBack: function () {
|
|
vc.emit('inspectionRoute', 'goBack', {});
|
|
}
|
|
}
|
|
});
|
|
})(window.vc); |