账号修改,隐藏组织

master
yuan 7 years ago
parent 86b9770257
commit 8e5e533678

@ -94,7 +94,7 @@ public class ManagerAccountServiceImpl implements ManagerAccountsService {
if (manager.isAdmin() || manager.isFinacial() || manager.isOperator() || manager.isServant() || manager.isSitemanager() || manager.isDeveloper()) { if (manager.isAdmin() || manager.isFinacial() || manager.isOperator() || manager.isServant() || manager.isSitemanager() || manager.isDeveloper()) {
throw new BadRequestException("Invalid Role"); throw new BadRequestException("Invalid Role");
} }
//obj.remove("org_id"); obj.remove("org_id");
} }
obj.put("manager_id", userId); obj.put("manager_id", userId);
managerMapper.update(obj); managerMapper.update(obj);

@ -74,7 +74,10 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) {
app.controller('modifyManagerDialogCtrl', ['$scope', '$http', 'manager', function ($scope, $http, manager) { app.controller('modifyManagerDialogCtrl', ['$scope', '$http', 'manager', function ($scope, $http, manager) {
$scope.manager = manager; $scope.manager = manager;
$scope.params = {}; $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) { $http.get('/sys/orgs').then(function (resp) {
$scope.orgs = resp.data; $scope.orgs = resp.data;
}) })
@ -101,7 +104,7 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) {
$scope.manager.org_id2 = $scope.manager.org_id; $scope.manager.org_id2 = $scope.manager.org_id;
$scope.manager.org_id = $scope.manager.parent_org_id; $scope.manager.org_id = $scope.manager.parent_org_id;
$scope.loadOrgsChild($scope.manager.org_id); $scope.loadOrgsChild($scope.manager.org_id);
} }*/
$scope.modify = function () { $scope.modify = function () {
$scope.errmsg = null; $scope.errmsg = null;
if($scope.manager.password && $scope.manager.password.length < 8){ if($scope.manager.password && $scope.manager.password.length < 8){
@ -113,9 +116,9 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) {
// $scope.errmsg = 'The password needs to consist of 8-16 digits and letters !'; // $scope.errmsg = 'The password needs to consist of 8-16 digits and letters !';
// return; // 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; $scope.manager.org_id = $scope.manager.org_id2;
} }*/
$http.put('/sys/manager_accounts/' + manager.manager_id, $scope.manager).then(function () { $http.put('/sys/manager_accounts/' + manager.manager_id, $scope.manager).then(function () {
$scope.$close(); $scope.$close();
}, function (resp) { }, function (resp) {

@ -45,7 +45,7 @@
<input class="form-control" type="text" id="wechat-input" name="wechat" <input class="form-control" type="text" id="wechat-input" name="wechat"
ng-model="manager.wechat"> ng-model="manager.wechat">
</div> </div>
<div class="form-group"> <div class="form-group" ng-if="!isOrgModify&&!isModifyOrgManage">
<label class="control-label">Roles</label> <label class="control-label">Roles</label>
<p class="checkbox-inline checkbox"> <p class="checkbox-inline checkbox">
<label ng-if="('00001'|withRole)"> <label ng-if="('00001'|withRole)">
@ -86,7 +86,18 @@
</label> </label>
</p> </p>
</div> </div>
<div class="form-group" ng-if="('1'|withRole) && !manager.admin && !manager.operator && !manager.sitemanager && orgs!=null"> <div class="form-group" ng-if="isOrgModify&&!isModifyOrgManage">
<label class="control-label">Roles</label>
<p class="checkbox-inline checkbox">
<label ng-if="!manager.admin && !manager.operator">
<input type="checkbox" ng-model="manager.bd" name="bd">BD User
</label>
<label ng-if="('00001'|withRole)">
<input type="checkbox" ng-model="manager.orgmanager" name="orgmanager">Org Manager
</label>
</p>
</div>
<!-- <div class="form-group" ng-if="('1'|withRole) && !manager.admin && !manager.operator && !manager.sitemanager && orgs!=null">
<label class="control-label" for="org-select">Organization</label> <label class="control-label" for="org-select">Organization</label>
<select class="form-control" ng-model="manager.org_id" id="org-select" <select class="form-control" ng-model="manager.org_id" id="org-select"
ng-options="org.org_id as org.name for org in orgs" ng-options="org.org_id as org.name for org in orgs"
@ -101,7 +112,7 @@
ng-options="org.org_id as org.name group by org.org_type for org in orgs_child"> ng-options="org.org_id as org.name group by org.org_type for org in orgs_child">
<option value="">Choose</option> <option value="">Choose</option>
</select> </select>
</div> </div>-->
</form> </form>
</div> </div>
</div> </div>

@ -336,8 +336,9 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) {
app.controller('modifyManagerCtrl', ['$scope', '$http', 'manager', function ($scope, $http, manager) { app.controller('modifyManagerCtrl', ['$scope', '$http', 'manager', function ($scope, $http, manager) {
$scope.manager = manager; $scope.manager = manager;
$scope.isOrgModify = true;
$scope.params = {}; $scope.params = {};
$scope.loadOrgs = function () { /* $scope.loadOrgs = function () {
$http.get('/sys/orgs').then(function (resp) { $http.get('/sys/orgs').then(function (resp) {
$scope.orgs = resp.data; $scope.orgs = resp.data;
}) })
@ -359,7 +360,7 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) {
$scope.manager.org_id2 = $scope.manager.org_id; $scope.manager.org_id2 = $scope.manager.org_id;
$scope.manager.org_id = $scope.manager.parent_org_id; $scope.manager.org_id = $scope.manager.parent_org_id;
$scope.loadOrgsChild($scope.manager.org_id); $scope.loadOrgsChild($scope.manager.org_id);
}; };*/
$scope.modify = function () { $scope.modify = function () {
/*if(($scope.currentUser.role & parseInt('1000000000000', 2)) > 0 && $scope.currentUser.org_id){ /*if(($scope.currentUser.role & parseInt('1000000000000', 2)) > 0 && $scope.currentUser.org_id){
if($scope.manager.org_id2 != "null") { if($scope.manager.org_id2 != "null") {
@ -367,9 +368,9 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) {
} }
delete $scope.manager.org_id2; delete $scope.manager.org_id2;
}*/ }*/
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; $scope.manager.org_id = $scope.manager.org_id2;
} }*/
$scope.errmsg = null; $scope.errmsg = null;
$http.put('/sys/manager_accounts/' + manager.manager_id, $scope.manager).then(function () { $http.put('/sys/manager_accounts/' + manager.manager_id, $scope.manager).then(function () {
$scope.$close(); $scope.$close();

Loading…
Cancel
Save