OWL ITS + 탐지시스템(인터넷 진흥원)
src/main/webapp/scripts/app/issue/issueCompanyFieldDetail.controller.js
@@ -1,69 +1,66 @@
/**
 * Created by wisestone on 2018-02-19.
 * Created by wisestone on 2017-12-15.
 */
'use strict';
define([
        'app'
        'app',
        'angular'
    ],
    function (app) {
        app.controller('companyFieldAddController', ['$scope', '$rootScope', '$log', '$resourceProvider', 'SweetAlert', '$uibModal', '$uibModalInstance', '$state', 'CompanyField', '$filter',
            function ($scope, $rootScope, $log, $resourceProvider, SweetAlert, $uibModal, $uibModalInstance, $state, CompanyField, $filter) {
    function (app, angular) {
        app.controller('issueCompanyFieldDetailController', ['$scope', '$rootScope', '$log', '$resourceProvider', '$uibModalInstance', '$uibModal', '$injector',
            '$controller', '$tableProvider', 'SweetAlert', '$timeout', '$stateParams', '$q', 'Issue', 'CompanyField', 'User', 'AttachedFile', 'IssueType', 'Priority', 'Severity', 'IssueTypeCustomField', '$filter', '$state',
            function ($scope, $rootScope, $log, $resourceProvider, $uibModalInstance, $uibModal,  $injector, $controller, $tableProvider, SweetAlert, $timeout,
                      $stateParams, $q, Issue, CompanyField, User, AttachedFile, IssueType, Priority, Severity, IssueTypeCustomField, $filter, $state) {
                $scope.fn = {
                    cancel : cancel,    //  팝업 창 닫기
                    formSubmit : formSubmit,    //  폼 전송
                    formCheck : formCheck,   //  폼 체크
                    formCheck : formCheck,  //  폼 체크
                };
                $scope.vm = {
                    form : {
                        name : "",  //업체명
                        //companyType : "", //업체분류
                        //profitYN : "",  //영리/비영리
                        //industry : "",  //산업분류
                        //domain : "",  //도메인
                        manager : "",   //담당자
                        tel : "",  //전화번호
                        email : "",  //이메일
                        memo : ""  //비고
                        companyName : "",
                        companyManager : "",
                        companyTel : "",
                        companyEmail : "",
                        companyDesc : ""
                    }
                };
                //  폼 체크
                function formCheck(formInvalid) {
                    if (formInvalid) {
                        return true;
                    }
                    return false;
                }
                //  폼 전송
                function formSubmit(condition) {
                function formSubmit() {
                    $rootScope.spinner = true;
                    var content = {
                        name : $rootScope.preventXss($scope.vm.form.name),    //  업체명
                        //companyType : $scope.vm.form.companyType, //업체분류
                        //profitYN : $scope.vm.form.profitYN,  //영리/비영리
                        //industry : $scope.vm.form.industry,  //산업분류
                        //domain : $scope.vm.form.domain,  //도메인
                        manager : $scope.vm.form.manager,   //담당자
                        tel : $scope.vm.form.tel,  //전화번호
                        email : $scope.vm.form.email,  //이메일
                        memo : $scope.vm.form.memo  //비고
                        companyName :  $rootScope.preventXss($scope.vm.form.companyName),
                        companyManager : $rootScope.preventXss($scope.vm.form.companyManager),
                        companyTel : $rootScope.preventXss($scope.vm.form.companyTel),
                        companyEmail : $rootScope.preventXss($scope.vm.form.companyEmail),
                        companyDesc :  $rootScope.preventXss($scope.vm.form.companyDesc)
                    };
                    CompanyField.add($resourceProvider.getContent(content,
                        $resourceProvider.getPageContent(0, 10))).then(function (result) {
                    CompanyField.modify($resourceProvider.getContent(
                        content,
                        $resourceProvider.getPageContent(0, 0))).then(function (result) {
                        if (result.data.message.status === "success") {
                            $scope.fn.cancel();
                            //  목록 화면 갱신
                            $rootScope.$broadcast("getPageList", {});
                        }
                        else {
                            SweetAlert.error($filter("translate")("companyField.failedCompanyFieldRegistration"), result.data.message.message);
                            SweetAlert.error($filter("translate")("companyField.failedCompanyFieldRegistration"), result.data.message.message); //업체 등록 실패
                        }
                        $rootScope.spinner = false;
@@ -77,9 +74,5 @@
                    $uibModalInstance.dismiss('cancel');
                    $(document).unbind("keydown");  //  단축키 이벤트 제거
                }
            }
        ]);
    }
);
            }]);
    });