main2.js 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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. $scope.getEnrolArray2 = function() {
  10. $rootScope.ajaxRequest({
  11. url : '../enrol/std/enrol/list.htm'
  12. }, function(response) {
  13. $scope.EnrolArray2 = response.array;
  14. console.log(response.array);
  15. });
  16. }
  17. $scope.getScoreArray = function() {
  18. var today = $rootScope.shortDateString(new Date());
  19. var now = new Date();
  20. $rootScope.ajaxRequest({
  21. url : '../enrol/std/score/ym/final/list.htm'
  22. //data : {batch: "first"}
  23. }, function(response) {
  24. $rootScope.ScoreArray = response.array;
  25. for (var i=0;i<response.array.length;i++) {
  26. if (response.array[i].batch == 'first') {
  27. $scope.hasFirstScore = true;
  28. } else if (response.array[i].batch == 'final') {
  29. $scope.hasFinalScore = true;
  30. }
  31. }
  32. /*var qualified_total = 0;
  33. for(var i=0;i<response.array.length;i++){
  34. if(response.array[i].aspect_qualified !='不合格')
  35. qualified_total ++;
  36. }
  37. $rootScope.qualified_total = qualified_total ;*/
  38. });
  39. }
  40. //初试成绩
  41. $scope.goFirstScore = function(e) {
  42. //debugger;
  43. $rootScope.goLocation('ym/score/' + e.aspect_name + '/first');//初试成绩
  44. }
  45. //复试成绩
  46. $scope.goFinalScore = function(e) {
  47. //debugger;
  48. $rootScope.goLocation('ym/score/' + e.aspect_name + '/final');//复试成绩
  49. }
  50. $scope.goAddr = function(e) {
  51. //debugger;
  52. $rootScope.goLocation('ym/addr');//邮寄地址修改界面
  53. }
  54. $scope.getEnrolArray2();
  55. $scope.getScoreArray();
  56. //志愿填报
  57. $scope.stdWish = function(e){
  58. if(e) {
  59. $rootScope.goLocation('wish/std/' + e.aspect_id);
  60. } else {
  61. $rootScope.goLocation('wish/std/null');
  62. }
  63. }
  64. } ])