优化代码

This commit is contained in:
java110 2022-05-24 16:37:27 +08:00
parent d96d09e84e
commit ffca412f97
3 changed files with 13 additions and 9 deletions

View File

@ -101,15 +101,17 @@
}, },
function(json, res) { function(json, res) {
//vm.menus = vm.refreshMenuActive(JSON.parse(json),0); //vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
if (res.status == 200) { let _json = JSON.parse(json);
if (_json.code == 0) {
//关闭model //关闭model
$('#addFloorModel').modal('hide'); $('#addFloorModel').modal('hide');
vc.component.clearAddFloorInfo(); vc.component.clearAddFloorInfo();
vc.emit('listFloor', 'listFloorData', {}); vc.emit('listFloor', 'listFloorData', {});
vc.emit('floorUnitTree','refreshTree',{}) vc.emit('floorUnitTree', 'refreshTree', {})
return; return;
} }
vc.component.addFloorInfo.errorInfo = json; //vc.component.addFloorInfo.errorInfo = json;
vc.toast(_json.msg);
}, },
function(errInfo, error) { function(errInfo, error) {
console.log('请求失败处理'); console.log('请求失败处理');

View File

@ -101,18 +101,18 @@
}, },
function(json, res) { function(json, res) {
//vm.menus = vm.refreshMenuActive(JSON.parse(json),0); //vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
if (res.status == 200) { let _json = JSON.parse(json);
if (_json.code == 0) {
//关闭model //关闭model
$('#editFloorModel').modal('hide'); $('#editFloorModel').modal('hide');
vc.component.clearEditFloorInfo(); vc.component.clearEditFloorInfo();
vc.emit('listFloor', 'listFloorData', {}); vc.emit('listFloor', 'listFloorData', {});
vc.emit('floorUnitTree','refreshTree',{ vc.emit('floorUnitTree', 'refreshTree', {
floorId:$that.editFloorInfo.floorId floorId: $that.editFloorInfo.floorId
}) })
return; return;
} }
vc.component.editFloorInfo.errorInfo = json; vc.toast(_json.msg);
}, },
function(errInfo, error) { function(errInfo, error) {
console.log('请求失败处理'); console.log('请求失败处理');

View File

@ -17,6 +17,7 @@
paymentCds: [], paymentCds: [],
billTypes: [], billTypes: [],
isDefaults: [], isDefaults: [],
curPage: DEFAULT_PAGE,
conditions: { conditions: {
configId: '', configId: '',
feeFlag: '', feeFlag: '',
@ -54,10 +55,11 @@
_initEvent: function() { _initEvent: function() {
vc.on('feeConfigManage', 'listFeeConfig', vc.on('feeConfigManage', 'listFeeConfig',
function(_param) { function(_param) {
vc.component._listFeeConfigs(DEFAULT_PAGE, DEFAULT_ROWS); vc.component._listFeeConfigs($that.feeConfigManageInfo.curPage, DEFAULT_ROWS);
}); });
vc.on('pagination', 'page_event', vc.on('pagination', 'page_event',
function(_currentPage) { function(_currentPage) {
$that.feeConfigManageInfo.curPage = _currentPage;
vc.component._listFeeConfigs(_currentPage, DEFAULT_ROWS); vc.component._listFeeConfigs(_currentPage, DEFAULT_ROWS);
}); });
}, },