std_info.js 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. app.controller('StdInfoCtrl', [ '$rootScope', '$scope', '$http', '$timeout', '$state', '$stateParams', function($rootScope, $scope, $http, $timeout, $state, $stateParams) {
  2. $scope.StdReg = angular.copy($rootScope.ArtStdReg);
  3. //生源地
  4. $rootScope.ajaxRequest({
  5. url : '../enrol/reg/province/list.htm'
  6. }, function(response) {
  7. $scope.provinceArray = response.array;
  8. });
  9. //邮寄省份
  10. $rootScope.ajaxRequest({
  11. url : '../enrol/std/reg/province/list.htm'
  12. }, function(response) {
  13. $scope.provArray = response.array;
  14. });
  15. //邮寄城市初始列表
  16. $rootScope.ajaxRequest({
  17. url : '../enrol/std/reg/city/alllist.htm'
  18. }, function(response) {
  19. $scope.cityArray = response.array;
  20. });
  21. //过滤城市
  22. $scope.freshCity = function() {
  23. $rootScope.ajaxRequest({
  24. url : '../enrol/std/reg/city/list.htm?province_id=' + $scope.StdReg.link_province
  25. }, function(response) {
  26. $scope.cityArray = response.array;
  27. });
  28. }
  29. /**************
  30. * 完善个人信息
  31. */
  32. $scope.saveExtendInfo = function(){
  33. // 判断是否修改过属性
  34. var change = false;
  35. for ( var attr in $scope.StdReg) {
  36. if ($scope.StdReg[attr] !== $rootScope.ArtStdReg[attr]) {
  37. change = true;
  38. break;
  39. }
  40. }
  41. /*if(change) {
  42. $.alert("报名时间已过,不允许修改个人信息!");
  43. return;
  44. }
  45. if ($scope.StdReg["link_addr"] !== $rootScope.ArtStdReg["link_addr"]) {
  46. $.alert("已过邮寄地址修改时间[2021-01-12 22:00:00],不能修改!");
  47. return;
  48. }
  49. if ($scope.StdReg["link_province"] !== $rootScope.ArtStdReg["link_province"]) {
  50. $.alert("已过邮寄地址修改时间[2021-01-12 22:00:00],不能修改!");
  51. return;
  52. }
  53. if ($scope.StdReg["link_city"] !== $rootScope.ArtStdReg["link_city"]) {
  54. $.alert("已过邮寄地址修改时间[2021-01-12 22:00:00],不能修改!");
  55. return;
  56. }*/
  57. $.showLoading("正在提交考生信息,请稍后...")
  58. $rootScope.ajaxRequest({
  59. url : '../enrol/std/info/save.htm',
  60. data : $scope.StdReg
  61. }, function(response) {
  62. $.toast("考生信息已保存!");
  63. $.hideLoading();
  64. $rootScope.ArtStdReg = response.entity;
  65. });
  66. }
  67. } ])