tongluPermissionApplyCtrl.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. angular.module('push')
  2. .controller('tongluPermissionApplyCtrl', function ($scope, $stateParams, AuthorityService, UtilService, $timeout, UserService, ConstantService, CommonService) {
  3. if ($scope.app) {
  4. $scope.setStatusBar(0);
  5. }
  6. var resource = $stateParams.resource;
  7. $scope.applymessage = {content: ""};
  8. //初始化当前信息
  9. var authoritydata = angular.fromJson($stateParams.authoritydata);
  10. // console.log(authoritydata);
  11. $scope.goToTaskHoll = function(){
  12. $scope.go('taskHoll');
  13. }
  14. $scope.apply = function () {
  15. if ($scope.applymessage.content.length < 1) {
  16. if ($scope.app) {
  17. UtilService.showMess("申请理由不能为空");
  18. } else {
  19. CommonService.showMessage('申请理由不能为空', $scope);
  20. }
  21. return;
  22. }
  23. AuthorityService.applyAuthorityForTonglu(resource.unique, resource.creator, $scope.applymessage.content).then(function (response) {
  24. if (response.code == ConstantService.INTERFACE_STATUS_CODE_3350) {
  25. if ($scope.app) {
  26. UtilService.showMess("权限申请发送成功,请耐心等待");
  27. } else {
  28. CommonService.showMessage('权限申请发送成功,请耐心等待', $scope);
  29. }
  30. }
  31. $timeout(function () {
  32. $scope.goToTaskHoll();
  33. }, 1000);
  34. }, function () {
  35. });
  36. };
  37. });