96 lines
3.9 KiB
JavaScript
96 lines
3.9 KiB
JavaScript
/**
|
|
入驻小区
|
|
**/
|
|
(function (vc) {
|
|
var DEFAULT_PAGE = 1;
|
|
var DEFAULT_ROWS = 10;
|
|
vc.extends({
|
|
data: {
|
|
adminInspectionPlanInfo: {
|
|
plans: [],
|
|
total: 0,
|
|
records: 1,
|
|
moreCondition: false,
|
|
inspectionPlanName: '',
|
|
states: '',
|
|
inspectionPlanStaffModel: false,
|
|
conditions: {
|
|
inspectionPlanName: '',
|
|
staffName: '',
|
|
state: '',
|
|
inspectionPlanId: '',
|
|
staffNameLike:'',
|
|
communityId:'',
|
|
}
|
|
}
|
|
},
|
|
_initMethod: function () {
|
|
vc.on('selectAdminCommunity','changeCommunity',function(_community){
|
|
$that.adminInspectionPlanInfo.conditions.communityId = _community.communityId;
|
|
$that._listAdminInspectionPlans(DEFAULT_PAGE, DEFAULT_ROWS);
|
|
})
|
|
$that._listAdminInspectionPlans(DEFAULT_PAGE, DEFAULT_ROWS);
|
|
vc.getDict('inspection_plan', "state", function (_data) {
|
|
$that.adminInspectionPlanInfo.states = _data;
|
|
});
|
|
},
|
|
_initEvent: function () {
|
|
vc.on('adminInspectionPlan', 'listInspectionPlan', function (_param) {
|
|
$that._listAdminInspectionPlans(DEFAULT_PAGE, DEFAULT_ROWS);
|
|
});
|
|
vc.on('pagination', 'page_event', function (_currentPage) {
|
|
$that._listAdminInspectionPlans(_currentPage, DEFAULT_ROWS);
|
|
});
|
|
},
|
|
methods: {
|
|
_listAdminInspectionPlans: function (_page, _rows) {
|
|
$that.adminInspectionPlanInfo.conditions.page = _page;
|
|
$that.adminInspectionPlanInfo.conditions.row = _rows;
|
|
let param = {
|
|
params: $that.adminInspectionPlanInfo.conditions
|
|
};
|
|
//发送get请求
|
|
vc.http.apiGet('/inspectionPlan.listAdminInspectionPlans',
|
|
param,
|
|
function (json, res) {
|
|
let _json = JSON.parse(json);
|
|
$that.adminInspectionPlanInfo.total = _json.total;
|
|
$that.adminInspectionPlanInfo.records = _json.records;
|
|
$that.adminInspectionPlanInfo.plans = _json.data;
|
|
vc.emit('pagination', 'init', {
|
|
total: $that.adminInspectionPlanInfo.records,
|
|
dataCount: $that.adminInspectionPlanInfo.total,
|
|
currentPage: _page
|
|
});
|
|
},
|
|
function (errInfo, error) {
|
|
console.log('请求失败处理');
|
|
}
|
|
);
|
|
},
|
|
|
|
_toInspectionPlanDetail:function(_plan){
|
|
window.open('/#/pages/inspection/aInspectionPlanDetail?inspectionPlanId='+_plan.inspectionPlanId)
|
|
},
|
|
|
|
//查询
|
|
_queryInspectionPlanMethod: function () {
|
|
$that._listAdminInspectionPlans(DEFAULT_PAGE, DEFAULT_ROWS);
|
|
},
|
|
//重置
|
|
_resetInspectionPlanMethod: function () {
|
|
$that.adminInspectionPlanInfo.conditions.inspectionPlanName = "";
|
|
$that.adminInspectionPlanInfo.conditions.inspectionPlanId = "";
|
|
$that.adminInspectionPlanInfo.conditions.state = "";
|
|
$that._listAdminInspectionPlans(DEFAULT_PAGE, DEFAULT_ROWS);
|
|
},
|
|
_moreCondition: function () {
|
|
if ($that.adminInspectionPlanInfo.moreCondition) {
|
|
$that.adminInspectionPlanInfo.moreCondition = false;
|
|
} else {
|
|
$that.adminInspectionPlanInfo.moreCondition = true;
|
|
}
|
|
},
|
|
}
|
|
});
|
|
})(window.vc); |