std_binding_报道.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. app.controller('StdBindingCtrl', [ '$rootScope', '$scope', function($rootScope, $scope) {
  2. $scope.curStep = 'info';
  3. $scope.StdReg = {};
  4. $scope.goStep = function(step) {
  5. $scope.curStep = step;
  6. }
  7. $scope.stdBinding = function() {
  8. $scope.StdReg.cert_id = $.trim($scope.StdReg.cert_id);
  9. $scope.StdReg.std_code = $.trim($scope.StdReg.std_code);
  10. $scope.StdReg.std_name = $.trim($scope.StdReg.std_name);
  11. if ($scope.StdReg.cert_id == undefined || $scope.StdReg.cert_id.length == 0) {
  12. $.alert('请输入证件号码!');
  13. return false;
  14. }
  15. if ($scope.StdReg.std_code == undefined || $scope.StdReg.std_code.length == 0) {
  16. $.alert('请输入新生学号!');
  17. return false;
  18. }
  19. if ($scope.StdReg.std_name == undefined || $scope.StdReg.std_name.length == 0) {
  20. $.alert('请输入新生姓名!');
  21. return false;
  22. }
  23. $rootScope.ajaxRequest({
  24. url : '../enrol/std/aspect/ym.htm',
  25. data : $scope.StdReg
  26. }, function(response) {
  27. if (response.map) {
  28. $scope.std = response.map;
  29. $scope.curStep = 'success';
  30. } else {
  31. $.alert('未找到新生信息,请检查输入信息');
  32. }
  33. });
  34. }
  35. $scope.stdConfirm = function() {
  36. $.confirm("确定要进行报到操作吗?", "报到确认", function() {
  37. $rootScope.ajaxRequest({
  38. url : '../enrol/std/aspect/confirm.htm',
  39. data : $scope.StdReg
  40. }, function(response) {
  41. $scope.std.confirm_time = new Date();
  42. });
  43. }, function() {
  44. // 取消操作
  45. });
  46. }
  47. $scope.exit = function() {
  48. WeixinJSBridge.call('closeWindow');
  49. }
  50. } ])