admin 5 роки тому
батько
коміт
e25432017d

+ 4 - 4
src/main/resources/static/app/system/controller/orgCtrl.js

@@ -305,10 +305,10 @@ function($scope, $rootScope, $state, $stateParams, $filter, orgService, enumServ
305 305
 		if (validator.form()) {
306 306
 			// 行政区划
307 307
 			$scope.getArea();
308
-			if ($scope.orgInfo.orgClassId == "5318") {
309
-				if($scope.orgInfo.depotClass != undefined && $scope.orgInfo.depotClass != ""){
310
-					$scope.orgInfo.depotClass = $scope.orgInfo.depotClass[0].id;
311
-				}
308
+			if($scope.orgInfo.depotClass != undefined && $scope.orgInfo.depotClass != "" && $scope.orgInfo.depotClass.length > 0){
309
+				$scope.orgInfo.depotClass = $scope.orgInfo.depotClass[0].id;
310
+			} else {
311
+				$scope.orgInfo.depotClass = null;
312 312
 			}
313 313
 			orgService.saveOrg($scope.orgInfo).then(function(data) {
314 314
 				if (data.status == 'success') {

+ 4 - 4
src/main/resources/static/build/app.js

@@ -30134,10 +30134,10 @@ function($scope, $rootScope, $state, $stateParams, $filter, orgService, enumServ
30134 30134
 		if (validator.form()) {
30135 30135
 			// 行政区划
30136 30136
 			$scope.getArea();
30137
-			if ($scope.orgInfo.orgClassId == "5318") {
30138
-				if($scope.orgInfo.depotClass != undefined && $scope.orgInfo.depotClass != ""){
30139
-					$scope.orgInfo.depotClass = $scope.orgInfo.depotClass[0].id;
30140
-				}
30137
+			if($scope.orgInfo.depotClass != undefined && $scope.orgInfo.depotClass != "" && $scope.orgInfo.depotClass.length > 0){
30138
+				$scope.orgInfo.depotClass = $scope.orgInfo.depotClass[0].id;
30139
+			} else {
30140
+				$scope.orgInfo.depotClass = null;
30141 30141
 			}
30142 30142
 			orgService.saveOrg($scope.orgInfo).then(function(data) {
30143 30143
 				if (data.status == 'success') {