auditSuggestionCtrl.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. angular.module('push')
  2. .controller('auditSuggestionCtrl', function ($scope, $stateParams, AccountService, UtilService, $timeout) {
  3. var messageid = $stateParams.messageid;
  4. var targetid = $stateParams.targetid;
  5. $scope.type = $stateParams.type;
  6. //获取用户反馈建议
  7. var getSysSuggestion = function () {
  8. $scope.showLoadingToast();
  9. AccountService.getSysSuggestion(targetid,messageid).then(function (response) {
  10. // console.log(response);
  11. $scope.suggestion = response;
  12. $scope.hideLoadingToast();
  13. }, function () {
  14. $scope.hideLoadingToast();
  15. })
  16. };
  17. getSysSuggestion();
  18. // 通过
  19. $scope.passApplyInfo = function () {
  20. $scope.showLoadingToast();
  21. AccountService.TurnSysAuthInfo(messageid, 1).then(function () {
  22. UtilService.showMess("已采纳建议");
  23. $scope.suggestion.result = 1;
  24. $timeout(function () {
  25. $scope.goback();
  26. }, 1500);
  27. $scope.hideLoadingToast();
  28. }, function () {
  29. $scope.hideLoadingToast();
  30. })
  31. };
  32. // 拒绝建议
  33. $scope.refuseApplyInfo = function () {
  34. $scope.showLoadingToast();
  35. AccountService.TurnSysAuthInfo(messageid, 2).then(function () {
  36. UtilService.showMess("未采纳建议");
  37. $scope.suggestion.result = 2;
  38. $timeout(function () {
  39. $scope.goback();
  40. }, 1500);
  41. $scope.hideLoadingToast();
  42. }, function () {
  43. $scope.hideLoadingToast();
  44. })
  45. };
  46. });