129 lines
5.5 KiB
JavaScript
129 lines
5.5 KiB
JavaScript
/**
|
|
入驻小区
|
|
**/
|
|
(function (vc) {
|
|
var DEFAULT_PAGE = 1;
|
|
var DEFAULT_ROWS = 10;
|
|
vc.extends({
|
|
data: {
|
|
repairSettingInfo: {
|
|
repairSettings: [],
|
|
total: 0,
|
|
records: 1,
|
|
moreCondition: false,
|
|
settingId: '',
|
|
repairWays: [],
|
|
repairSettingTypes: [],
|
|
publicAreas: [],
|
|
returnVisitFlags: [],
|
|
conditions: {
|
|
repairSettingType: '',
|
|
repairTypeName: '',
|
|
repairWay: '',
|
|
repairType: '',
|
|
publicArea: '',
|
|
returnVisitFlag: ''
|
|
}
|
|
}
|
|
},
|
|
_initMethod: function () {
|
|
console.debug("开始初始化");
|
|
$that._listRepairSettings(DEFAULT_PAGE, DEFAULT_ROWS);
|
|
//与字典表关联
|
|
vc.getDict('r_repair_setting', "repair_way", function (_data) {
|
|
$that.repairSettingInfo.repairWays = _data;
|
|
});
|
|
//与字典表关联
|
|
vc.getDict('r_repair_setting', "repair_setting_type", function (_data) {
|
|
console.debug("报修类型",_data);
|
|
$that.repairSettingInfo.repairSettingTypes = _data;
|
|
});
|
|
//与字典表关联
|
|
vc.getDict('r_repair_setting', "public_area", function (_data) {
|
|
$that.repairSettingInfo.publicAreas = _data;
|
|
});
|
|
//与字典表关联
|
|
vc.getDict('r_repair_setting', "return_visit_flag", function (_data) {
|
|
$that.repairSettingInfo.returnVisitFlags = _data;
|
|
});
|
|
},
|
|
_initEvent: function () {
|
|
vc.on('repairSetting', 'listRepairSetting', function (_param) {
|
|
$that._listRepairSettings(DEFAULT_PAGE, DEFAULT_ROWS);
|
|
});
|
|
vc.on('pagination', 'page_event', function (_currentPage) {
|
|
$that._listRepairSettings(_currentPage, DEFAULT_ROWS);
|
|
});
|
|
},
|
|
methods: {
|
|
//查询方法
|
|
_listRepairSettings: function (_page, _rows) {
|
|
$that.repairSettingInfo.conditions.page = _page;
|
|
$that.repairSettingInfo.conditions.row = _rows;
|
|
$that.repairSettingInfo.conditions.communityId = vc.getCurrentCommunity().communityId;
|
|
var param = {
|
|
params: $that.repairSettingInfo.conditions
|
|
};
|
|
//类型名称去空
|
|
param.params.repairTypeName = param.params.repairTypeName.trim();
|
|
//派单类型去空
|
|
param.params.repairType = param.params.repairType.trim();
|
|
//发送get请求
|
|
vc.http.apiGet('/repair.listRepairSettings',
|
|
param,
|
|
function (json, res) {
|
|
let _json = JSON.parse(json);
|
|
$that.repairSettingInfo.total = _json.total;
|
|
$that.repairSettingInfo.records = _json.records;
|
|
$that.repairSettingInfo.repairSettings = _json.data;
|
|
vc.emit('pagination', 'init', {
|
|
total: $that.repairSettingInfo.records,
|
|
dataCount: $that.repairSettingInfo.total,
|
|
currentPage: _page
|
|
});
|
|
},
|
|
function (errInfo, error) {
|
|
console.log('请求失败处理');
|
|
}
|
|
);
|
|
},
|
|
//重置方法
|
|
_resetListRepairSettings: function (_page, _rows) {
|
|
$that.repairSettingInfo.conditions.repairTypeName = '';
|
|
$that.repairSettingInfo.conditions.repairWay = '';
|
|
$that.repairSettingInfo.conditions.repairType = '';
|
|
$that.repairSettingInfo.conditions.repairSettingType = '';
|
|
$that.repairSettingInfo.conditions.publicArea = '';
|
|
$that.repairSettingInfo.conditions.returnVisitFlag = '';
|
|
$that._listRepairSettings(DEFAULT_PAGE, DEFAULT_ROWS);
|
|
},
|
|
_openAddRepairSettingModal: function () {
|
|
vc.emit('addRepairSetting', 'openAddRepairSettingModal', {});
|
|
},
|
|
_openEditRepairSettingModel: function (_repairSetting) {
|
|
vc.emit('editRepairSetting', 'openEditRepairSettingModal', _repairSetting);
|
|
},
|
|
_openDeleteRepairSettingModel: function (_repairSetting) {
|
|
vc.emit('deleteRepairSetting', 'openDeleteRepairSettingModal', _repairSetting);
|
|
},
|
|
//查询
|
|
_queryRepairSettingMethod: function () {
|
|
$that._listRepairSettings(DEFAULT_PAGE, DEFAULT_ROWS);
|
|
},
|
|
//重置
|
|
_queryResetRepairSettingMethod: function () {
|
|
$that._resetListRepairSettings(DEFAULT_PAGE, DEFAULT_ROWS);
|
|
},
|
|
_moreCondition: function () {
|
|
if ($that.repairSettingInfo.moreCondition) {
|
|
$that.repairSettingInfo.moreCondition = false;
|
|
} else {
|
|
$that.repairSettingInfo.moreCondition = true;
|
|
}
|
|
},
|
|
_viewRepairTypeUser: function (_repairSetting) {
|
|
vc.jumpToPage('/#/pages/property/repairTypeUser?' + vc.objToGetParam(_repairSetting));
|
|
}
|
|
}
|
|
});
|
|
})(window.vc); |