| | |
| | | formSubmit : formSubmit, // 폼 전송 |
| | | formCheck : formCheck, // 폼 체크 |
| | | removeUsr : removeUsr, // 일반 사용자 제거 |
| | | removeDepartment : removeDepartment // 부서 제거 |
| | | }; |
| | | |
| | | $scope.vm = { |
| | |
| | | id : $rootScope.user.id |
| | | }], // 관리자 |
| | | users : [], // 일반 사용자 |
| | | departments : [] |
| | | }, |
| | | userName : "", // 일반 사용자 이름 검색 |
| | | projectName : "", // 상위 프로젝트 이름 검색 |
| | |
| | | $scope.vm.form.users.splice(index, 1); |
| | | } |
| | | |
| | | // 담당부서 삭제 |
| | | function removeDepartment(index) { |
| | | $scope.vm.form.departments.splice(index, 1); |
| | | } |
| | | |
| | | function formCheck(formInvalid) { |
| | | if (formInvalid) { |
| | | return true; |
| | | } |
| | | |
| | | if (!$rootScope.isDefined($scope.vm.form.startEndDateRange)) { |
| | | return true; |
| | | } |
| | | |
| | |
| | | }); |
| | | return managerIds; |
| | | })(), |
| | | userIds : (function () { |
| | | var userIds = []; |
| | | angular.forEach($scope.vm.form.users, function (user) { |
| | | userIds.push(user.id); |
| | | // 부서 id 추가 필요 |
| | | departmentIds : (function () { |
| | | var departmentIds = []; |
| | | angular.forEach($scope.vm.form.departments, function (department) { |
| | | departmentIds.push(department.id); |
| | | }); |
| | | return userIds; |
| | | return departmentIds; |
| | | })() |
| | | }; |
| | | |
| | | if ($rootScope.isDefined($scope.vm.form.startEndDateRange)) { |
| | | if ($scope.vm.form.startEndDateRange === null || $scope.vm.form.startEndDateRange === "") { |
| | | content.startDate = ""; |
| | | content.endDate = ""; |
| | | } else { |
| | | var startEndDateRange = $scope.vm.form.startEndDateRange.split("~"); |
| | | content.startDate = startEndDateRange[0].trim(); |
| | | content.endDate = startEndDateRange[1].trim(); |
| | |
| | | |
| | | if (result.data.message.status === "success") { |
| | | $scope.fn.cancel(); |
| | | $rootScope.user.lastProjectId = result.data.data.id; |
| | | // $rootScope.user.lastProjectId = result.data.data.id; |
| | | // 목록 화면 갱신 |
| | | $rootScope.$broadcast("getProjectList", {}); |
| | | } |