|
|
|
@ -15,7 +15,8 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) {
|
|
|
|
|
$scope.search = {role:'111111111111'};
|
|
|
|
|
$scope.params = {};
|
|
|
|
|
$scope.listManagers = function () {
|
|
|
|
|
$http.get('/sys/manager_accounts').then(function (resp) {
|
|
|
|
|
var params = angular.copy($scope.params);
|
|
|
|
|
$http.get('/sys/manager_accounts',{params: params}).then(function (resp) {
|
|
|
|
|
$scope.managers = resp.data;
|
|
|
|
|
})
|
|
|
|
|
};
|
|
|
|
@ -35,8 +36,6 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) {
|
|
|
|
|
})
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$scope.listManagers();
|
|
|
|
|
$scope.modifyManager = function (manager) {
|
|
|
|
|
$uibModal.open({
|
|
|
|
@ -75,7 +74,10 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) {
|
|
|
|
|
app.controller('modifyManagerDialogCtrl', ['$scope', '$http', 'manager', function ($scope, $http, manager) {
|
|
|
|
|
$scope.manager = manager;
|
|
|
|
|
$scope.params = {};
|
|
|
|
|
$scope.loadOrgs = function () {
|
|
|
|
|
if(($scope.currentUser.role & parseInt('1000000000000', 2)) > 0 && $scope.currentUser.org_id){
|
|
|
|
|
$scope.isModifyOrgManage = true;
|
|
|
|
|
}
|
|
|
|
|
/*$scope.loadOrgs = function () {
|
|
|
|
|
$http.get('/sys/orgs').then(function (resp) {
|
|
|
|
|
$scope.orgs = resp.data;
|
|
|
|
|
})
|
|
|
|
@ -83,7 +85,6 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) {
|
|
|
|
|
$scope.loadOrgs();
|
|
|
|
|
|
|
|
|
|
$scope.loadOrgsChild= function (org_id) {
|
|
|
|
|
$scope.is_org2 = 'not_is';
|
|
|
|
|
$scope.choose_org = org_id;
|
|
|
|
|
var params = angular.copy($scope.params);
|
|
|
|
|
params.org_id = org_id;
|
|
|
|
@ -91,15 +92,19 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) {
|
|
|
|
|
$scope.orgs_child = resp.data;
|
|
|
|
|
})
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
if(!$scope.manager.parent_org_id){
|
|
|
|
|
$scope.is_org2 = 'not_is'
|
|
|
|
|
}else {
|
|
|
|
|
if(($scope.currentUser.role & parseInt('1000000000000', 2)) > 0 && $scope.currentUser.org_id){
|
|
|
|
|
var params = angular.copy($scope.params);
|
|
|
|
|
params.org_id = $scope.currentUser.org_id;
|
|
|
|
|
$http.get('/sys/orgs/orgChild',{params: params}).then(function (resp) {
|
|
|
|
|
$scope.orgs_child = resp.data;
|
|
|
|
|
})
|
|
|
|
|
$scope.manager.org_id2 = $scope.manager.org_id;
|
|
|
|
|
}
|
|
|
|
|
if($scope.manager.parent_org_id){
|
|
|
|
|
$scope.manager.org_id2 = $scope.manager.org_id;
|
|
|
|
|
$scope.manager.org_id = $scope.manager.parent_org_id;
|
|
|
|
|
$scope.loadOrgsChild($scope.manager.org_id);
|
|
|
|
|
$scope.is_org2 = 'is';
|
|
|
|
|
};
|
|
|
|
|
}*/
|
|
|
|
|
$scope.modify = function () {
|
|
|
|
|
$scope.errmsg = null;
|
|
|
|
|
if($scope.manager.password && $scope.manager.password.length < 8){
|
|
|
|
@ -111,9 +116,9 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) {
|
|
|
|
|
// $scope.errmsg = 'The password needs to consist of 8-16 digits and letters !';
|
|
|
|
|
// return;
|
|
|
|
|
// }
|
|
|
|
|
if($scope.manager.org_id2 != null && $scope.manager.org_id2 != 'null') {
|
|
|
|
|
/* if($scope.manager.org_id2 != null && $scope.manager.org_id2 != 'null') {
|
|
|
|
|
$scope.manager.org_id = $scope.manager.org_id2;
|
|
|
|
|
}
|
|
|
|
|
}*/
|
|
|
|
|
$http.put('/sys/manager_accounts/' + manager.manager_id, $scope.manager).then(function () {
|
|
|
|
|
$scope.$close();
|
|
|
|
|
}, function (resp) {
|
|
|
|
@ -121,20 +126,16 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) {
|
|
|
|
|
})
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$scope.changeIsOrg2 = function (choose_org2) {
|
|
|
|
|
if($scope.choose_org != choose_org2){
|
|
|
|
|
$scope.is_org2 = 'is';
|
|
|
|
|
}else {
|
|
|
|
|
$scope.is_org2 = 'not_is'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}]);
|
|
|
|
|
app.controller('newManagerDialogCtrl', ['$scope', '$http', function ($scope, $http) {
|
|
|
|
|
$scope.params = {};
|
|
|
|
|
$scope.is_org2 = 'not_is';
|
|
|
|
|
if(($scope.currentUser.role & parseInt('1000000000000', 2)) > 0 && $scope.currentUser.org_id){
|
|
|
|
|
var params = angular.copy($scope.params);
|
|
|
|
|
params.org_id = $scope.currentUser.org_id;
|
|
|
|
|
$http.get('/sys/orgs/orgChild',{params: params}).then(function (resp) {
|
|
|
|
|
$scope.orgs_child = resp.data;
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
$scope.save = function (form) {
|
|
|
|
|
$scope.errmsg = null;
|
|
|
|
|
if (form.$invalid) {
|
|
|
|
@ -154,6 +155,9 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) {
|
|
|
|
|
// $scope.errmsg = 'The password needs to consist of 8-16 digits and letters !';
|
|
|
|
|
// return;
|
|
|
|
|
// }
|
|
|
|
|
if(($scope.currentUser.role & parseInt('1000000000000', 2)) > 0 && $scope.currentUser.org_id){
|
|
|
|
|
$scope.manager.bd = true;
|
|
|
|
|
}
|
|
|
|
|
if($scope.manager.org_id2 != "null") {
|
|
|
|
|
$scope.manager.org_id = $scope.manager.org_id2;
|
|
|
|
|
}
|
|
|
|
@ -172,7 +176,6 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) {
|
|
|
|
|
$scope.loadOrgs();
|
|
|
|
|
|
|
|
|
|
$scope.loadOrgsChild= function (org_id) {
|
|
|
|
|
$scope.is_org2 = 'not_is';
|
|
|
|
|
$scope.choose_org = org_id;
|
|
|
|
|
var params = angular.copy($scope.params);
|
|
|
|
|
params.org_id = org_id;
|
|
|
|
@ -180,14 +183,6 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) {
|
|
|
|
|
$scope.orgs_child = resp.data;
|
|
|
|
|
})
|
|
|
|
|
};
|
|
|
|
|
$scope.changeIsOrg2 = function (choose_org2) {
|
|
|
|
|
if($scope.choose_org != choose_org2){
|
|
|
|
|
$scope.is_org2 = 'is';
|
|
|
|
|
}else {
|
|
|
|
|
$scope.is_org2 = 'not_is'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}]);
|
|
|
|
|
app.filter('managersFilter', [function () {
|
|
|
|
|
return function (arr, filterObj) {
|
|
|
|
|