QuickApply.Controller.js 927 Bytes
Newer Older
Thitichaipun Wutthisak committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37

'use strict'

angular.module('RECRUIT').controller('QuickApply', function ($scope, $mdDialog, RecService, $log, SwapLang) {

  $scope.test = ($x) => {
    console.log($x)
  }

  $scope.lang = getLang()
  $scope.isEditTitle = []
  $scope.quickApply = {}
  $scope.HrSwlang = SwapLang
  $scope.init = function () {
   RecService.ManageConfig.query({cname: 'QUICKAPPLY'}).$promise.then(function (data) {
     $scope.quickApply = data.result
   })
  }
  $scope.init()

  $scope.submit = function () {
    if ($scope.quickApply.object.active && $scope.cscform.$invalid) {
      return $scope.HrSwlang.getAlert(47)
    }


    $scope.HrSwlang.getConfirm(1).then(function () {
      RecService.ManageConfig.save($scope.quickApply).$promise.then(function () {
        $scope.HrSwlang.getAlert(18).then(function () {
          $scope.init()
        })
      }, function () {
        $scope.HrSwlang.getAlert(17)
      });
    })
  };
})