|
|
|
@ -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({
|
|
|
|
@ -83,7 +82,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 +89,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){
|
|
|
|
@ -121,20 +123,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 +152,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 +173,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 +180,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) {
|
|
|
|
|