main.js 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. app.controller('MainCtrl', [ '$rootScope', '$scope', '$timeout', function($rootScope, $scope, $timeout) {
  2. if (!$rootScope.loginSuccess)
  3. return;
  4. $scope.showAppointment = false;
  5. $scope.showTicket = false;
  6. $scope.showInfo = false;
  7. $scope.hasFirstScore = false;
  8. $scope.hasFinalScore = false;
  9. /*$rootScope.can_sc = true;
  10. $rootScope.can_yxtb = true;
  11. $rootScope.can_jbyl = true;*/
  12. $scope.showEnrolFlag = false;
  13. $scope.firstScoreTimeFlag = false;
  14. $scope.finalScoreTimeFlag = false
  15. $scope.getEnrolArray2 = function() {
  16. $rootScope.ajaxRequest({
  17. url : '../enrol/std/enrol/list.htm'
  18. }, function(response) {
  19. $scope.EnrolArray2 = response.array;
  20. for(const ea of $scope.EnrolArray2) {
  21. if(ea.aspect_id === 20701 || ea.aspect_id === 22001) {
  22. $scope.showEnrolFlag = true;
  23. break;
  24. }
  25. }
  26. });
  27. }
  28. $scope.getScoreArray = function () {
  29. $rootScope.ajaxRequest({
  30. url: '../enrol/std/score/ym/final/list.htm'
  31. }, function (response) {
  32. $rootScope.ScoreArray = response.array;
  33. for (var i = 0; i < response.array.length; i++) {
  34. if (response.array[i].batch === 'first') {
  35. $scope.hasFirstScore = true;
  36. } else if (response.array[i].batch === 'final') {
  37. $scope.hasFinalScore = true;
  38. }
  39. }
  40. });
  41. }
  42. //初试成绩
  43. $scope.goFirstScore = function(e) {
  44. // 考生有违纪 提示
  45. if($rootScope.ArtStdReg.discipline_flag == 'Active') {
  46. $.confirm("有违纪,请下载违纪告知书", function() {
  47. $rootScope.goLocation('ym/score/' + e.aspect_name + '/first');//初试成绩
  48. $scope.$apply();
  49. }, function() {
  50. // 点击取消后的回调函数
  51. });
  52. } else {
  53. $rootScope.goLocation('ym/score/' + e.aspect_name + '/first');//初试成绩
  54. }
  55. }
  56. //复试成绩
  57. $scope.goFinalScore = function(e) {
  58. $rootScope.goLocation('ym/score/' + e.aspect_name + '/final');//复试成绩
  59. }
  60. $scope.goAddr = function(e) {
  61. $rootScope.goLocation('ym/addr');//邮寄地址修改界面
  62. }
  63. //报考是否过期
  64. $scope.enrolTime = function() {
  65. $rootScope.ajaxRequest({
  66. url : '../enrol/agent/expire.htm',
  67. data: {}
  68. }, function(data) {
  69. $scope.enrolTimeFlag = data.entity;
  70. });
  71. }
  72. $scope.getAgent = function() {
  73. $rootScope.ajaxRequest({
  74. url : '../enrol/agent/find.htm?agent_id=100'
  75. }, function(response) {
  76. $scope.Agent = response.map;
  77. var now = $rootScope.parseLongString(response.map.now);
  78. // 准考证下载
  79. if ($rootScope.parseLongString(response.map.ticket_start_time) < now
  80. && $rootScope.parseLongString(response.map.ticket_end_time) > now) {
  81. $scope.showTicket = true;
  82. }
  83. // 报考按钮显示
  84. if ($rootScope.parseLongString(response.map.enrol_start_time) < now
  85. && $rootScope.parseLongString(response.map.enrol_end_time) > now) {
  86. $scope.enrolTimeFlag = true;
  87. }
  88. //初试成绩显示
  89. if ($rootScope.parseLongString(response.map.first_score_start_time) < now
  90. && $rootScope.parseLongString(response.map.first_score_end_time) > now) {
  91. $scope.firstScoreTimeFlag = true;
  92. $scope.getScoreArray();
  93. }
  94. //复试成绩显示
  95. if ($rootScope.parseLongString(response.map.final_score_start_time) < now
  96. && $rootScope.parseLongString(response.map.final_score_end_time) > now) {
  97. $scope.finalScoreTimeFlag = true;
  98. $scope.getScoreArray();
  99. }
  100. });
  101. }
  102. $scope.getEnrolArray2();
  103. //$scope.getScoreArray();
  104. $scope.getAgent();
  105. //$scope.enrolTime();
  106. //进入申请页面
  107. $scope.goExamApply = function(subject_name) {
  108. $rootScope.goLocation('std/apply/' + subject_name);
  109. }
  110. //查询考生之前提交申请
  111. // $rootScope.ajaxRequest({
  112. // url : '../enrol/ny/exam/query.htm'
  113. // }, function(response) {
  114. // debugger;
  115. // if (response.array) {
  116. // for (var i=0; i<response.array.length; i++) {
  117. // $scope.apply_msg = response.array[i].apply_msg;
  118. // if (response.array[i].subject_name == '视唱') {
  119. // $rootScope.can_sc = false;
  120. // } else if (response.array[i].subject_name == '音响听辩、声学常识') {
  121. // $rootScope.can_yxtb = false;
  122. // } else if (response.array[i].subject_name == '基本乐理、听音') {
  123. // $rootScope.can_jbyl = false;
  124. // }
  125. // }
  126. // if (response.array.length > 0) {
  127. // $scope.can_apply = false;//不能申请,申请过了
  128. // }
  129. // }
  130. // });
  131. $scope.goEnrol = function(e) {
  132. $rootScope.goLocation('enrol/info/' + e.enrol_id + '/InActive');
  133. }
  134. } ])