std_info.js 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  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. $scope.YmStdCategoryArray = [];
  4. /****************************
  5. * 根据省份-查找该省份的文理区分
  6. */
  7. $scope.findProvinceArtScience = function () {
  8. $rootScope.ajaxRequest({
  9. url: '../conf/std/reg/get/province.htm',
  10. data: {province_id: $scope.StdReg.std_province}
  11. }, function (response) {
  12. if (response.entity) {
  13. $scope.artArr = [];
  14. $scope.artArr = response.entity.art_science_status.split(",");
  15. for (const art of $scope.artArr) {
  16. for (const st of $rootScope.StdCategoryArray) {
  17. if (art == st.dict_value) {
  18. $scope.YmStdCategoryArray.push(st);
  19. break;
  20. }
  21. }
  22. }
  23. if($scope.YmStdCategoryArray.length == 1) {
  24. $scope.StdReg.std_param3 = $scope.YmStdCategoryArray[0].dict_value;
  25. }
  26. $scope.YmStdCategoryArray.unshift({dict_text: '请选择', dict_value: null});
  27. }
  28. });
  29. }
  30. // 获取截止时间标志
  31. $scope.getDeadLineFlag = function() {
  32. $rootScope.ajaxRequest({
  33. url : '../enrol/std/modify/info/flag/get.htm'
  34. }, function(response) {
  35. $scope.modifyFlag = response.entity;
  36. });
  37. }
  38. $scope.findProvinceArtScience();
  39. $scope.getDeadLineFlag();
  40. //是否是中文
  41. $scope.isChinese = function(str){
  42. var reg = /^[\u4e00-\u9fa5]+$/;
  43. return reg.test(str);
  44. }
  45. /**************
  46. * 完善个人信息
  47. */
  48. $scope.saveExtendInfo = function(){
  49. // 判断是否修改过属性
  50. var change = false;
  51. for ( var attr in $scope.StdReg) {
  52. if ($scope.StdReg[attr] !== $rootScope.ArtStdReg[attr]) {
  53. change = true;
  54. break;
  55. }
  56. }
  57. /*if(change) {
  58. $.alert("报名时间已过,不允许修改个人信息!");
  59. return;
  60. }
  61. if ($scope.StdReg["link_addr"] !== $rootScope.ArtStdReg["link_addr"]) {
  62. $.alert("已过邮寄地址修改时间[2021-01-12 22:00:00],不能修改!");
  63. return;
  64. }
  65. if ($scope.StdReg["link_province"] !== $rootScope.ArtStdReg["link_province"]) {
  66. $.alert("已过邮寄地址修改时间[2021-01-12 22:00:00],不能修改!");
  67. return;
  68. }
  69. if ($scope.StdReg["link_city"] !== $rootScope.ArtStdReg["link_city"]) {
  70. $.alert("已过邮寄地址修改时间[2021-01-12 22:00:00],不能修改!");
  71. return;
  72. }*/
  73. if ($scope.StdReg.link_mobile && $scope.StdReg.std_mobile == $scope.StdReg.link_mobile) {
  74. $.alert('紧急联系电话与本人手机号码不能相同!');
  75. return false;
  76. }
  77. //政治面貌
  78. if ($scope.StdReg.std_political == undefined || $scope.StdReg.std_political == '') {
  79. $.alert('请选择政治面貌!');
  80. return false;
  81. }
  82. //科类
  83. if ($scope.StdReg.std_param3 == undefined || $scope.StdReg.std_param3 == '' || $scope.StdReg.std_param3.length == 0) {
  84. $.alert('请选择科类!');
  85. return false;
  86. }
  87. //科类
  88. if ($scope.StdReg.std_param4 == undefined || $scope.StdReg.std_param4 == '' || $scope.StdReg.std_param4.length == 0) {
  89. $.alert('请选择毕业类型!');
  90. return false;
  91. }
  92. //毕业学校
  93. if ($rootScope.getParamValue('EnrolReg_ShowStdSchool','Active') == 'Active' &&
  94. ($scope.StdReg.std_school == undefined || $scope.StdReg.std_school == '')) {
  95. $.alert('请填写毕业学校!');
  96. return false;
  97. }
  98. //考生类别
  99. if ($scope.StdReg.std_param5 == undefined || $scope.StdReg.std_param5 == '') {
  100. $.alert('请选择考生类别!');
  101. return false;
  102. }
  103. /**毕业时间**/
  104. if ($scope.StdReg.end_date == undefined || $scope.StdReg.end_date == '') {
  105. $.alert('请填写毕业时间!');
  106. return false;
  107. }
  108. //紧急联系人
  109. if ($scope.StdReg.link_man == undefined || $scope.StdReg.link_man == '') {
  110. $.alert('请填写紧急联系人!');
  111. return false;
  112. } else if(!$scope.isChinese($scope.StdReg.link_man)) {
  113. $.alert('紧急联系人必须是汉字!');
  114. return false;
  115. }
  116. //家长手机号
  117. if ($scope.StdReg.link_mobile == undefined || $scope.StdReg.link_mobile == '') {
  118. $.alert('请填写联系人手机号!');
  119. return false;
  120. }
  121. //通信地址
  122. if ($rootScope.getParamValue('EnrolReg_LinkAddr','Active') == 'Active' &&
  123. ($scope.StdReg.link_addr == undefined || $scope.StdReg.link_addr == '')) {
  124. $.alert('请填写通讯地址!');
  125. return false;
  126. }
  127. //邮政编码
  128. if ($scope.StdReg.link_postal == undefined || $scope.StdReg.link_postal == '' || $scope.StdReg.link_postal.length==0) {
  129. $.alert('请填写邮政编码!');
  130. return false;
  131. }
  132. //电子邮箱
  133. if ($rootScope.getParamValue('EnrolReg_email','Active') == 'Active') {
  134. if($scope.StdReg.email == undefined || $scope.StdReg.email == '') {
  135. $.alert('请填写电子邮箱!');
  136. return false;
  137. }
  138. }
  139. $.showLoading("正在提交考生信息,请稍后...")
  140. $rootScope.ajaxRequest({
  141. url : '../enrol/std/info/save.htm',
  142. data : $scope.StdReg
  143. }, function(response) {
  144. // $.toast("考生信息已保存!");
  145. $.alert("考生信息已保存!")
  146. $.hideLoading();
  147. $rootScope.ArtStdReg = response.entity;
  148. });
  149. }
  150. //使用weiui自带的默认日期选择器
  151. $('#showDatePicker').on('click', function() {
  152. weui.datePicker({
  153. start: 1990,
  154. end: new Date().getFullYear()+1,
  155. defaultValue: [new Date().getFullYear(), new Date().getMonth()+1, new Date().getDate()],
  156. depth:2,
  157. onChange: function (result) {
  158. //console.log(result);
  159. },
  160. onConfirm: function (result) {
  161. $scope.$apply(function () {
  162. $scope.StdReg.end_date = result[0].label + result[1].label;
  163. });
  164. },
  165. title: '日期选择'
  166. });
  167. });
  168. } ])