|
@@ -1,420 +1,590 @@
|
|
|
-app.controller('StdRegCtrl', [ '$rootScope', '$scope', '$http', '$timeout', '$state', '$stateParams', function($rootScope, $scope, $http, $timeout, $state, $stateParams) {
|
|
|
- $scope.curStep = 'start';
|
|
|
- $scope.StdReg = {};
|
|
|
- $scope.YmStdCategoryArray = [];
|
|
|
+app.controller("StdRegCtrl", [
|
|
|
+ "$rootScope",
|
|
|
+ "$scope",
|
|
|
+ "$http",
|
|
|
+ "$timeout",
|
|
|
+ "$state",
|
|
|
+ "$stateParams",
|
|
|
+ function ($rootScope, $scope, $http, $timeout, $state, $stateParams) {
|
|
|
+ $scope.showLiveCheckLoading = false;
|
|
|
+ $scope.curStep = "start";
|
|
|
+ $scope.StdReg = {};
|
|
|
+ $scope.YmStdCategoryArray = [];
|
|
|
|
|
|
- if(!$rootScope.loginSuccess)
|
|
|
- return;
|
|
|
+ if (!$rootScope.loginSuccess) return;
|
|
|
|
|
|
- /****************************
|
|
|
- * 根据省份-查找该省份的文理区分
|
|
|
- */
|
|
|
- $scope.findProvinceArtScience = function () {
|
|
|
- $rootScope.ajaxRequest({
|
|
|
- url: '../conf/std/reg/get/province.htm',
|
|
|
- data: {province_id: $scope.StdReg.std_province}
|
|
|
- }, function (response) {
|
|
|
- if (response.entity) {
|
|
|
- $scope.artArr = [];
|
|
|
- $scope.artArr = response.entity.art_science_status.split(",");
|
|
|
- for (const art of $scope.artArr) {
|
|
|
- for (const st of $rootScope.StdCategoryArray) {
|
|
|
- if (art == st.dict_value) {
|
|
|
- $scope.YmStdCategoryArray.push(st);
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- if($scope.YmStdCategoryArray.length == 1) {
|
|
|
- $scope.StdReg.std_param3 = $scope.YmStdCategoryArray[0].dict_value;
|
|
|
- }
|
|
|
- $scope.YmStdCategoryArray.unshift({dict_text: '请选择', dict_value: null});
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
+ /****************************
|
|
|
+ * 根据省份-查找该省份的文理区分
|
|
|
+ */
|
|
|
+ $scope.findProvinceArtScience = function () {
|
|
|
+ $rootScope.ajaxRequest(
|
|
|
+ {
|
|
|
+ url: "../conf/std/reg/get/province.htm",
|
|
|
+ data: { province_id: $scope.StdReg.std_province },
|
|
|
+ },
|
|
|
+ function (response) {
|
|
|
+ if (response.entity) {
|
|
|
+ $scope.artArr = [];
|
|
|
+ $scope.artArr = response.entity.art_science_status.split(",");
|
|
|
+ for (const art of $scope.artArr) {
|
|
|
+ for (const st of $rootScope.StdCategoryArray) {
|
|
|
+ if (art == st.dict_value) {
|
|
|
+ $scope.YmStdCategoryArray.push(st);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if ($scope.YmStdCategoryArray.length == 1) {
|
|
|
+ $scope.StdReg.std_param3 =
|
|
|
+ $scope.YmStdCategoryArray[0].dict_value;
|
|
|
+ }
|
|
|
+ $scope.YmStdCategoryArray.unshift({
|
|
|
+ dict_text: "请选择",
|
|
|
+ dict_value: null,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ );
|
|
|
+ };
|
|
|
|
|
|
- if ($rootScope.ArtStdReg !== undefined) {
|
|
|
- $scope.StdReg = angular.extend({}, $rootScope.ArtStdReg);
|
|
|
- if ($scope.StdReg.reg_status == 'IdCard') {
|
|
|
- $scope.curStep = 'NoCrownPhotoWarning';
|
|
|
- } else if ($scope.StdReg.reg_status == 'NoCrownPhoto') {
|
|
|
- $scope.curStep = 'StdExtendInfo';
|
|
|
- $scope.findProvinceArtScience();
|
|
|
- }
|
|
|
- }
|
|
|
+ if ($rootScope.ArtStdReg !== undefined) {
|
|
|
+ $scope.StdReg = angular.extend({}, $rootScope.ArtStdReg);
|
|
|
+ if ($scope.StdReg.reg_status == "IdCard") {
|
|
|
+ $scope.curStep = "NoCrownPhotoWarning";
|
|
|
+ } else if ($scope.StdReg.reg_status == "NoCrownPhoto") {
|
|
|
+ $scope.curStep = "StdExtendInfo";
|
|
|
+ $scope.findProvinceArtScience();
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- $scope.getCategory = function() {
|
|
|
- if($scope.YmStdCategoryArray.length<1) {
|
|
|
- $scope.findProvinceArtScience();
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- /*//生源地
|
|
|
- $rootScope.ajaxRequest({
|
|
|
- url : '../enrol/reg/province/list.htm'
|
|
|
- }, function(response) {
|
|
|
- $scope.provinceArray = response.array;
|
|
|
- });*/
|
|
|
+ $scope.getCategory = function () {
|
|
|
+ if ($scope.YmStdCategoryArray.length < 1) {
|
|
|
+ $scope.findProvinceArtScience();
|
|
|
+ }
|
|
|
+ };
|
|
|
|
|
|
+ //生源地
|
|
|
+ $rootScope.ajaxRequest(
|
|
|
+ {
|
|
|
+ url: "../enrol/reg/province/list.htm",
|
|
|
+ },
|
|
|
+ function (response) {
|
|
|
+ $scope.provinceArray = response.array;
|
|
|
+ }
|
|
|
+ );
|
|
|
|
|
|
- //邮寄省份
|
|
|
- $rootScope.ajaxRequest({
|
|
|
- url : '../enrol/std/reg/province/list.htm'
|
|
|
- }, function(response) {
|
|
|
- $scope.provArray = response.array;
|
|
|
- });
|
|
|
- /*//邮寄城市初始列表
|
|
|
+ //邮寄省份
|
|
|
+ $rootScope.ajaxRequest(
|
|
|
+ {
|
|
|
+ url: "../enrol/std/reg/province/list.htm",
|
|
|
+ },
|
|
|
+ function (response) {
|
|
|
+ $scope.provArray = response.array;
|
|
|
+ }
|
|
|
+ );
|
|
|
+ /*//邮寄城市初始列表
|
|
|
$rootScope.ajaxRequest({
|
|
|
url : '../enrol/std/reg/city/alllist.htm'
|
|
|
}, function(response) {
|
|
|
$scope.cityArray = response.array;
|
|
|
}); */
|
|
|
- //过滤城市
|
|
|
- $scope.freshCity = function() {
|
|
|
- $rootScope.ajaxRequest({
|
|
|
- url : '../enrol/std/reg/city/list.htm?province_id=' + $scope.StdReg.link_province
|
|
|
- }, function(response) {
|
|
|
- $scope.cityArray = response.array;
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
- //选择考生类型
|
|
|
- $scope.chooseStdType = function(d) {
|
|
|
- $rootScope.ajaxRequest({
|
|
|
- url : '../enrol/province/list/stdType.htm',
|
|
|
- data : {std_type: d.dict_value}
|
|
|
- }, function(response) {
|
|
|
- $scope.provinceArray = response.array;
|
|
|
- $scope.curStep = 'province';
|
|
|
- });
|
|
|
- }
|
|
|
+ //过滤城市
|
|
|
+ $scope.freshCity = function () {
|
|
|
+ $rootScope.ajaxRequest(
|
|
|
+ {
|
|
|
+ url:
|
|
|
+ "../enrol/std/reg/city/list.htm?province_id=" +
|
|
|
+ $scope.StdReg.link_province,
|
|
|
+ },
|
|
|
+ function (response) {
|
|
|
+ $scope.cityArray = response.array;
|
|
|
+ }
|
|
|
+ );
|
|
|
+ };
|
|
|
|
|
|
- /***************************************************************************
|
|
|
- * 选择生源地
|
|
|
- */
|
|
|
- $scope.chooseProvince = function(p) {
|
|
|
- if(p.reg_status == 'InActive') {
|
|
|
- var msg = '未开放【'+p.province_name+'】考生注册!';
|
|
|
- if(p.reg_fetch_param != undefined)
|
|
|
- msg = p.reg_fetch_param;
|
|
|
- $.alert(msg);
|
|
|
- return;
|
|
|
- }
|
|
|
- $scope.currentProvince = p;
|
|
|
- $scope.StdReg.std_province = p.province_id;
|
|
|
- $scope.StdReg.province_name = p.province_name;
|
|
|
- if ((p.province_id + '') == '90') {
|
|
|
- // 外国,护照
|
|
|
- $scope.curStep = 'PassportWarning';
|
|
|
- $scope.StdReg.cert_type = 'Passport';
|
|
|
- } else if ((p.province_id + '') == '71') {
|
|
|
- // 台湾,台湾居民往来大陆通行证,澳门,香港 港澳居民来往内地通行证
|
|
|
- $scope.curStep = 'IdCard71Warning';
|
|
|
- $scope.StdReg.cert_type = 'TaiWanPass';
|
|
|
- }else if ((p.province_id + '') == '80' || (p.province_id + '') == '81' || (p.province_id + '') == '82') {
|
|
|
- // 澳门,香港 港澳居民来往内地通行证
|
|
|
- $scope.curStep = 'HongKongMacaoPass';
|
|
|
- $scope.StdReg.cert_type = 'TaiWanPass';
|
|
|
- } else if (p.ksh_status == 'Active') {
|
|
|
- // 必须有高考报名号
|
|
|
- $scope.curStep = 'ExamIdWarning';
|
|
|
- } else {
|
|
|
- // 大陆,需要上传身份证
|
|
|
- $scope.curStep = 'IdCardWarning';
|
|
|
- $scope.StdReg.cert_type = 'IdCard';
|
|
|
- }
|
|
|
- $scope.findProvinceArtScience();
|
|
|
- }
|
|
|
+ //选择考生类型
|
|
|
+ $scope.chooseStdType = function (d) {
|
|
|
+ $rootScope.ajaxRequest(
|
|
|
+ {
|
|
|
+ url: "../enrol/province/list/stdType.htm",
|
|
|
+ data: { std_type: d.dict_value },
|
|
|
+ },
|
|
|
+ function (response) {
|
|
|
+ $scope.provinceArray = response.array;
|
|
|
+ $scope.curStep = "province";
|
|
|
+ }
|
|
|
+ );
|
|
|
+ };
|
|
|
|
|
|
- $scope.checkExamId = function() {
|
|
|
- $scope.StdReg.exam_id = $.trim($scope.StdReg.exam_id);
|
|
|
- if ($scope.StdReg.exam_id == undefined || $scope.StdReg.exam_id.length == 0) {
|
|
|
- $.alert('高考报名号必须填写!');
|
|
|
- return false;
|
|
|
- }
|
|
|
- $.showLoading("正在提交考生信息,请稍后...")
|
|
|
- $rootScope.ajaxRequest({
|
|
|
- url : '../enrol/reg/province/check.htm',
|
|
|
- data : $scope.StdReg
|
|
|
- }, function(response) {
|
|
|
- $.hideLoading();
|
|
|
- // 大陆,需要上传身份证
|
|
|
- $scope.curStep = 'IdCardWarning';
|
|
|
- $scope.StdReg.cert_type = 'IdCard';
|
|
|
- });
|
|
|
- }
|
|
|
+ /***************************************************************************
|
|
|
+ * 选择生源地
|
|
|
+ */
|
|
|
+ $scope.chooseProvince = function (p) {
|
|
|
+ if (p.reg_status == "InActive") {
|
|
|
+ var msg = "未开放【" + p.province_name + "】考生注册!";
|
|
|
+ if (p.reg_fetch_param != undefined) msg = p.reg_fetch_param;
|
|
|
+ $.alert(msg);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ $scope.currentProvince = p;
|
|
|
+ $scope.StdReg.std_province = p.province_id;
|
|
|
+ $scope.StdReg.province_name = p.province_name;
|
|
|
+ if (p.province_id + "" == "90") {
|
|
|
+ // 外国,护照
|
|
|
+ $scope.curStep = "PassportWarning";
|
|
|
+ $scope.StdReg.cert_type = "Passport";
|
|
|
+ } else if (p.province_id + "" == "71") {
|
|
|
+ // 台湾,台湾居民往来大陆通行证,澳门,香港 港澳居民来往内地通行证
|
|
|
+ $scope.curStep = "IdCard71Warning";
|
|
|
+ $scope.StdReg.cert_type = "TaiWanPass";
|
|
|
+ } else if (
|
|
|
+ p.province_id + "" == "80" ||
|
|
|
+ p.province_id + "" == "81" ||
|
|
|
+ p.province_id + "" == "82"
|
|
|
+ ) {
|
|
|
+ // 澳门,香港 港澳居民来往内地通行证
|
|
|
+ $scope.curStep = "HongKongMacaoPass";
|
|
|
+ $scope.StdReg.cert_type = "TaiWanPass";
|
|
|
+ } else if (p.ksh_status == "Active") {
|
|
|
+ // 必须有高考报名号
|
|
|
+ $scope.curStep = "ExamIdWarning";
|
|
|
+ } else {
|
|
|
+ // 大陆,需要上传身份证
|
|
|
+ $scope.curStep = "IdCardWarning";
|
|
|
+ $scope.StdReg.cert_type = "IdCard";
|
|
|
+ }
|
|
|
+ $scope.findProvinceArtScience();
|
|
|
+ };
|
|
|
|
|
|
- //非大陆考生通行证和证件号码判断
|
|
|
- $scope.isCert = function(str) {
|
|
|
- var pat = /^[a-zA-Z0-9()]+$/;
|
|
|
- return pat.test(str);
|
|
|
- }
|
|
|
+ $scope.checkExamId = function () {
|
|
|
+ $scope.StdReg.exam_id = $.trim($scope.StdReg.exam_id);
|
|
|
+ if (
|
|
|
+ $scope.StdReg.exam_id == undefined ||
|
|
|
+ $scope.StdReg.exam_id.length == 0
|
|
|
+ ) {
|
|
|
+ $.alert("高考报名号必须填写!");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ $.showLoading("正在提交考生信息,请稍后...");
|
|
|
+ $rootScope.ajaxRequest(
|
|
|
+ {
|
|
|
+ url: "../enrol/reg/province/check.htm",
|
|
|
+ data: $scope.StdReg,
|
|
|
+ },
|
|
|
+ function (response) {
|
|
|
+ $.hideLoading();
|
|
|
+ // 大陆,需要上传身份证
|
|
|
+ $scope.curStep = "IdCardWarning";
|
|
|
+ $scope.StdReg.cert_type = "IdCard";
|
|
|
+ }
|
|
|
+ );
|
|
|
+ };
|
|
|
|
|
|
- /***************************************************************************
|
|
|
- * 识别正确,保存用户信息
|
|
|
- */
|
|
|
- $scope.saveIdCard = function() {
|
|
|
- $scope.StdReg.cert_id = $.trim($scope.StdReg.cert_id);
|
|
|
- $scope.StdReg.std_name = $.trim($scope.StdReg.std_name);
|
|
|
- $scope.StdReg.std_sex = $.trim($scope.StdReg.std_sex);
|
|
|
- $scope.StdReg.std_mobile = $.trim($scope.StdReg.std_mobile);
|
|
|
- $scope.StdReg.std_name_confirm = $.trim($scope.StdReg.std_name_confirm);
|
|
|
- if ($scope.StdReg.cert_id == undefined || $scope.StdReg.cert_id.length == 0) {
|
|
|
- $.alert('请输入证件号码!');
|
|
|
- return false;
|
|
|
- }
|
|
|
- if(flag == 2) {
|
|
|
- if ($scope.StdReg.std_param2 == undefined || $scope.StdReg.std_param2.length == 0) {
|
|
|
- $.alert('请输入身份证号码!');
|
|
|
- return false;
|
|
|
- }
|
|
|
- if($scope.StdReg.cert_id.indexOf('(') !=-1 || $scope.StdReg.cert_id.indexOf(')')!= -1) {
|
|
|
- $.alert('证件号码请输入半角括号!');
|
|
|
- return false;
|
|
|
- }
|
|
|
- if($scope.StdReg.std_param2.indexOf('(') !=-1 || $scope.StdReg.std_param2.indexOf(')') != -1) {
|
|
|
- $.alert('身份证号码请输入半角括号!');
|
|
|
- return false;
|
|
|
- }
|
|
|
- if(!$scope.isCert($scope.StdReg.cert_id)) {
|
|
|
- if($scope.StdReg.std_province == '90') {
|
|
|
- $.alert('护照号只能为数字、字母、半角括号!');
|
|
|
- return false;
|
|
|
- } else {
|
|
|
- $.alert('证件号码只能为数字、字母、半角括号!');
|
|
|
- return false;
|
|
|
- }
|
|
|
- }
|
|
|
- if(!$scope.isCert($scope.StdReg.std_param2)) {
|
|
|
- $.alert('居民身份证只能为数字、字母、半角括号!');
|
|
|
- return false;
|
|
|
- }
|
|
|
- }
|
|
|
- if ($scope.StdReg.std_name == undefined || $scope.StdReg.std_name.length == 0) {
|
|
|
- $.alert('请输入考生姓名!');
|
|
|
- return false;
|
|
|
- }
|
|
|
- if ($scope.StdReg.std_sex == undefined || $scope.StdReg.std_sex.length == 0) {
|
|
|
- $.alert('请选择考生性别!');
|
|
|
- return false;
|
|
|
- }
|
|
|
+ //非大陆考生通行证和证件号码判断
|
|
|
+ $scope.isCert = function (str) {
|
|
|
+ var pat = /^[a-zA-Z0-9()]+$/;
|
|
|
+ return pat.test(str);
|
|
|
+ };
|
|
|
|
|
|
- if ($scope.StdReg.std_mobile === undefined || $scope.StdReg.std_mobile.length !== 11) {
|
|
|
- $.alert('请输入正确的手机号码!');
|
|
|
- return false;
|
|
|
- }
|
|
|
- // 识别姓名和自输入姓名不相等
|
|
|
- if($scope.StdReg.std_name_confirm !== $scope.StdReg.std_name) {
|
|
|
- $.confirm("识别出的姓名和确认姓名不一样,是否以确认姓名为准", "信息确认", function() {
|
|
|
- $scope.StdReg.std_name = $scope.StdReg.std_name_confirm;
|
|
|
- }, function() {
|
|
|
- // 取消操作
|
|
|
- $.alert('识别出的姓名和确认姓名不一样,请修改!');
|
|
|
- return false;
|
|
|
- });
|
|
|
- }
|
|
|
+ /***************************************************************************
|
|
|
+ * 识别正确,保存用户信息
|
|
|
+ */
|
|
|
+ $scope.saveIdCard = function () {
|
|
|
+ $scope.StdReg.cert_id = $.trim($scope.StdReg.cert_id);
|
|
|
+ $scope.StdReg.std_name = $.trim($scope.StdReg.std_name);
|
|
|
+ $scope.StdReg.std_sex = $.trim($scope.StdReg.std_sex);
|
|
|
+ $scope.StdReg.std_mobile = $.trim($scope.StdReg.std_mobile);
|
|
|
+ $scope.StdReg.std_name_confirm = $.trim($scope.StdReg.std_name_confirm);
|
|
|
+ if (
|
|
|
+ $scope.StdReg.cert_id == undefined ||
|
|
|
+ $scope.StdReg.cert_id.length == 0
|
|
|
+ ) {
|
|
|
+ $.alert("请输入证件号码!");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (flag == 2) {
|
|
|
+ if (
|
|
|
+ $scope.StdReg.std_param2 == undefined ||
|
|
|
+ $scope.StdReg.std_param2.length == 0
|
|
|
+ ) {
|
|
|
+ $.alert("请输入身份证号码!");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (
|
|
|
+ $scope.StdReg.cert_id.indexOf("(") != -1 ||
|
|
|
+ $scope.StdReg.cert_id.indexOf(")") != -1
|
|
|
+ ) {
|
|
|
+ $.alert("证件号码请输入半角括号!");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (
|
|
|
+ $scope.StdReg.std_param2.indexOf("(") != -1 ||
|
|
|
+ $scope.StdReg.std_param2.indexOf(")") != -1
|
|
|
+ ) {
|
|
|
+ $.alert("身份证号码请输入半角括号!");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (!$scope.isCert($scope.StdReg.cert_id)) {
|
|
|
+ if ($scope.StdReg.std_province == "90") {
|
|
|
+ $.alert("护照号只能为数字、字母、半角括号!");
|
|
|
+ return false;
|
|
|
+ } else {
|
|
|
+ $.alert("证件号码只能为数字、字母、半角括号!");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!$scope.isCert($scope.StdReg.std_param2)) {
|
|
|
+ $.alert("居民身份证只能为数字、字母、半角括号!");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (
|
|
|
+ $scope.StdReg.std_name == undefined ||
|
|
|
+ $scope.StdReg.std_name.length == 0
|
|
|
+ ) {
|
|
|
+ $.alert("请输入考生姓名!");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (
|
|
|
+ $scope.StdReg.std_sex == undefined ||
|
|
|
+ $scope.StdReg.std_sex.length == 0
|
|
|
+ ) {
|
|
|
+ $.alert("请选择考生性别!");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
|
|
|
- $.showLoading("正在提交考生信息,请稍后...")
|
|
|
- $rootScope.ajaxRequest({
|
|
|
- url : '../enrol/reg/save.htm',
|
|
|
- data : $scope.StdReg
|
|
|
- }, function(response) {
|
|
|
- $.hideLoading();
|
|
|
- $scope.StdReg = response.entity;
|
|
|
- $rootScope.ArtStdReg = $scope.StdReg;
|
|
|
- // 上传免冠证件照
|
|
|
- if($scope.StdReg.std_image) {
|
|
|
- $scope.curStep = 'StdExtendInfo';
|
|
|
- } else {
|
|
|
- // 上传免冠证件照
|
|
|
- $scope.curStep = 'NoCrownPhotoWarning';
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
+ if (
|
|
|
+ $scope.StdReg.std_mobile === undefined ||
|
|
|
+ $scope.StdReg.std_mobile.length !== 11
|
|
|
+ ) {
|
|
|
+ $.alert("请输入正确的手机号码!");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ // 识别姓名和自输入姓名不相等
|
|
|
+ if ($scope.StdReg.std_name_confirm !== $scope.StdReg.std_name) {
|
|
|
+ $.confirm(
|
|
|
+ "识别出的姓名和确认姓名不一样,是否以确认姓名为准",
|
|
|
+ "信息确认",
|
|
|
+ function () {
|
|
|
+ $scope.StdReg.std_name = $scope.StdReg.std_name_confirm;
|
|
|
+ },
|
|
|
+ function () {
|
|
|
+ // 取消操作
|
|
|
+ $.alert("识别出的姓名和确认姓名不一样,请修改!");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ );
|
|
|
+ }
|
|
|
|
|
|
- //是否是中文
|
|
|
- $scope.isChinese = function(str){
|
|
|
- var reg = /^[\u4e00-\u9fa5]+$/;
|
|
|
- return reg.test(str);
|
|
|
- }
|
|
|
+ $.showLoading("正在提交考生信息,请稍后...");
|
|
|
+ $rootScope.ajaxRequest(
|
|
|
+ {
|
|
|
+ url: "../enrol/reg/save.htm",
|
|
|
+ data: $scope.StdReg,
|
|
|
+ },
|
|
|
+ function (response) {
|
|
|
+ $.hideLoading();
|
|
|
+ $scope.StdReg = response.entity;
|
|
|
+ $rootScope.ArtStdReg = $scope.StdReg;
|
|
|
+ // 上传免冠证件照
|
|
|
+ if ($scope.StdReg.std_image) {
|
|
|
+ $scope.curStep = "StdExtendInfo";
|
|
|
+ } else {
|
|
|
+ // 上传免冠证件照
|
|
|
+ $scope.curStep = "NoCrownPhotoWarning";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ );
|
|
|
+ };
|
|
|
|
|
|
- /***************************************************************************
|
|
|
- * 完善个人信息
|
|
|
- */
|
|
|
- $scope.saveExtendInfo = function() {
|
|
|
+ //是否是中文
|
|
|
+ $scope.isChinese = function (str) {
|
|
|
+ var reg = /^[\u4e00-\u9fa5]+$/;
|
|
|
+ return reg.test(str);
|
|
|
+ };
|
|
|
|
|
|
- // 考生
|
|
|
- if($rootScope.getParamValue('SchoolCode') === '51065' ) {
|
|
|
- if ($scope.StdReg.std_type === undefined || $scope.StdReg.std_type === '') {
|
|
|
- $.alert('请选择考生类型!');
|
|
|
- return false;
|
|
|
- }
|
|
|
- }
|
|
|
- if ($scope.StdReg.link_mobile && $scope.StdReg.std_mobile === $scope.StdReg.link_mobile) {
|
|
|
- $.alert('紧急联系电话与本人手机号码不能相同!');
|
|
|
- return false;
|
|
|
- }
|
|
|
+ /***************************************************************************
|
|
|
+ * 完善个人信息
|
|
|
+ */
|
|
|
+ $scope.saveExtendInfo = function () {
|
|
|
+ // 考生
|
|
|
+ if ($rootScope.getParamValue("SchoolCode") === "51065") {
|
|
|
+ if (
|
|
|
+ $scope.StdReg.std_type === undefined ||
|
|
|
+ $scope.StdReg.std_type === ""
|
|
|
+ ) {
|
|
|
+ $.alert("请选择考生类型!");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (
|
|
|
+ $scope.StdReg.link_mobile &&
|
|
|
+ $scope.StdReg.std_mobile === $scope.StdReg.link_mobile
|
|
|
+ ) {
|
|
|
+ $.alert("紧急联系电话与本人手机号码不能相同!");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
|
|
|
- //政治面貌
|
|
|
- if ($scope.StdReg.std_political === undefined || $scope.StdReg.std_political === '') {
|
|
|
- $.alert('请选择政治面貌!');
|
|
|
- return false;
|
|
|
- }
|
|
|
- //科类
|
|
|
- if ($scope.StdReg.std_param3 === undefined || $scope.StdReg.std_param3 === '' || $scope.StdReg.std_param3.length === 0) {
|
|
|
- $.alert('请选择科类!');
|
|
|
- return false;
|
|
|
- }
|
|
|
- //科类
|
|
|
- if ($scope.StdReg.std_param4 === undefined || $scope.StdReg.std_param4 === '' || $scope.StdReg.std_param4.length === 0) {
|
|
|
- $.alert('请选择毕业类型!');
|
|
|
- return false;
|
|
|
- }
|
|
|
- //毕业学校
|
|
|
- if ($rootScope.getParamValue('EnrolReg_ShowStdSchool','Active') === 'Active' &&
|
|
|
- ($scope.StdReg.std_school === undefined || $scope.StdReg.std_school === '')) {
|
|
|
- $.alert('请填写毕业学校!');
|
|
|
- return false;
|
|
|
- }
|
|
|
- //考生类别
|
|
|
- if ($scope.StdReg.std_param5 === undefined || $scope.StdReg.std_param5 === '') {
|
|
|
- $.alert('请选择考生类别!');
|
|
|
- return false;
|
|
|
- }
|
|
|
- /**毕业时间**/
|
|
|
- if ($scope.StdReg.end_date === undefined || $scope.StdReg.end_date === '') {
|
|
|
- $.alert('请填写毕业时间!');
|
|
|
- return false;
|
|
|
- }
|
|
|
- //紧急联系人
|
|
|
- if ($scope.StdReg.link_man === undefined || $scope.StdReg.link_man === '') {
|
|
|
- $.alert('请填写紧急联系人!');
|
|
|
- return false;
|
|
|
- } else if(!$scope.isChinese($scope.StdReg.link_man)) {
|
|
|
- $.alert('紧急联系人必须是汉字!');
|
|
|
- return false;
|
|
|
- }
|
|
|
+ //政治面貌
|
|
|
+ if (
|
|
|
+ $scope.StdReg.std_political === undefined ||
|
|
|
+ $scope.StdReg.std_political === ""
|
|
|
+ ) {
|
|
|
+ $.alert("请选择政治面貌!");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ //科类
|
|
|
+ if (
|
|
|
+ $scope.StdReg.std_param3 === undefined ||
|
|
|
+ $scope.StdReg.std_param3 === "" ||
|
|
|
+ $scope.StdReg.std_param3.length === 0
|
|
|
+ ) {
|
|
|
+ $.alert("请选择科类!");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ //科类
|
|
|
+ if (
|
|
|
+ $scope.StdReg.std_param4 === undefined ||
|
|
|
+ $scope.StdReg.std_param4 === "" ||
|
|
|
+ $scope.StdReg.std_param4.length === 0
|
|
|
+ ) {
|
|
|
+ $.alert("请选择毕业类型!");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ //毕业学校
|
|
|
+ if (
|
|
|
+ $rootScope.getParamValue("EnrolReg_ShowStdSchool", "Active") ===
|
|
|
+ "Active" &&
|
|
|
+ ($scope.StdReg.std_school === undefined ||
|
|
|
+ $scope.StdReg.std_school === "")
|
|
|
+ ) {
|
|
|
+ $.alert("请填写毕业学校!");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ //考生类别
|
|
|
+ if (
|
|
|
+ $scope.StdReg.std_param5 === undefined ||
|
|
|
+ $scope.StdReg.std_param5 === ""
|
|
|
+ ) {
|
|
|
+ $.alert("请选择考生类别!");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ /**毕业时间**/
|
|
|
+ if (
|
|
|
+ $scope.StdReg.end_date === undefined ||
|
|
|
+ $scope.StdReg.end_date === ""
|
|
|
+ ) {
|
|
|
+ $.alert("请填写毕业时间!");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ //紧急联系人
|
|
|
+ if (
|
|
|
+ $scope.StdReg.link_man === undefined ||
|
|
|
+ $scope.StdReg.link_man === ""
|
|
|
+ ) {
|
|
|
+ $.alert("请填写紧急联系人!");
|
|
|
+ return false;
|
|
|
+ } else if (!$scope.isChinese($scope.StdReg.link_man)) {
|
|
|
+ $.alert("紧急联系人必须是汉字!");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
|
|
|
- //家长手机号
|
|
|
- if ($scope.StdReg.link_mobile === undefined || $scope.StdReg.link_mobile === '') {
|
|
|
- $.alert('请填写联系人手机号!');
|
|
|
- return false;
|
|
|
- }
|
|
|
+ //家长手机号
|
|
|
+ if (
|
|
|
+ $scope.StdReg.link_mobile === undefined ||
|
|
|
+ $scope.StdReg.link_mobile === ""
|
|
|
+ ) {
|
|
|
+ $.alert("请填写联系人手机号!");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
|
|
|
- //通信地址
|
|
|
- if ($rootScope.getParamValue('EnrolReg_LinkAddr','Active') === 'Active' &&
|
|
|
- ($scope.StdReg.link_addr === undefined || $scope.StdReg.link_addr === '')) {
|
|
|
- $.alert('请填写通讯地址!');
|
|
|
- return false;
|
|
|
- }
|
|
|
+ //通信地址
|
|
|
+ if (
|
|
|
+ $rootScope.getParamValue("EnrolReg_LinkAddr", "Active") === "Active" &&
|
|
|
+ ($scope.StdReg.link_addr === undefined ||
|
|
|
+ $scope.StdReg.link_addr === "")
|
|
|
+ ) {
|
|
|
+ $.alert("请填写通讯地址!");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
|
|
|
- //邮政编码
|
|
|
- if ($scope.StdReg.link_postal === undefined || $scope.StdReg.link_postal === '' || $scope.StdReg.link_postal.length===0) {
|
|
|
- $.alert('请填写邮政编码!');
|
|
|
- return false;
|
|
|
- }
|
|
|
- if ($scope.StdReg.link_postal.length !== 6 || $scope.isChinese($scope.StdReg.link_postal)) {
|
|
|
- $.alert('请输入6位的邮政编码!');
|
|
|
- return false;
|
|
|
- }
|
|
|
+ //邮政编码
|
|
|
+ if (
|
|
|
+ $scope.StdReg.link_postal === undefined ||
|
|
|
+ $scope.StdReg.link_postal === "" ||
|
|
|
+ $scope.StdReg.link_postal.length === 0
|
|
|
+ ) {
|
|
|
+ $.alert("请填写邮政编码!");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (
|
|
|
+ $scope.StdReg.link_postal.length !== 6 ||
|
|
|
+ $scope.isChinese($scope.StdReg.link_postal)
|
|
|
+ ) {
|
|
|
+ $.alert("请输入6位的邮政编码!");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
|
|
|
- //电子邮箱
|
|
|
- if ($rootScope.getParamValue('EnrolReg_email','Active') === 'Active') {
|
|
|
- if($scope.StdReg.email === undefined || $scope.StdReg.email === '') {
|
|
|
- $.alert('请填写电子邮箱!');
|
|
|
- return false;
|
|
|
- }
|
|
|
- }
|
|
|
+ //电子邮箱
|
|
|
+ if ($rootScope.getParamValue("EnrolReg_email", "Active") === "Active") {
|
|
|
+ if ($scope.StdReg.email === undefined || $scope.StdReg.email === "") {
|
|
|
+ $.alert("请填写电子邮箱!");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- $.showLoading("正在提交考生信息,请稍后...")
|
|
|
- $rootScope.ajaxRequest({
|
|
|
- url : '../enrol/std/info/save.htm',
|
|
|
- data : $scope.StdReg
|
|
|
- }, function(response) {
|
|
|
- $.hideLoading();
|
|
|
- // 显示注册成功
|
|
|
- $scope.curStep = 'RegSuccess';
|
|
|
- });
|
|
|
- }
|
|
|
+ $.showLoading("正在提交考生信息,请稍后...");
|
|
|
+ $rootScope.ajaxRequest(
|
|
|
+ {
|
|
|
+ url: "../enrol/std/info/save.htm",
|
|
|
+ data: $scope.StdReg,
|
|
|
+ },
|
|
|
+ function (response) {
|
|
|
+ $.hideLoading();
|
|
|
+ // 显示注册成功
|
|
|
+ $scope.curStep = "RegSuccess";
|
|
|
+ }
|
|
|
+ );
|
|
|
+ };
|
|
|
|
|
|
- /***************************************************************************
|
|
|
- * 上传免冠证件照
|
|
|
- */
|
|
|
- $scope.uploadNoCrownPhoto = function() {
|
|
|
- $rootScope.uploadStdMaterialPhoto('NoCrownPhoto', function() {
|
|
|
- // $scope.curStep = 'StdExtendInfo';
|
|
|
- if ($rootScope.checkParamValue('EnrolVerifyStdIdentity', 'InActive', 'Active')) {
|
|
|
- $scope.curStep = 'VerifySuccess';
|
|
|
- } else {
|
|
|
- $scope.curStep = 'StdExtendInfo';
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
+ /***************************************************************************
|
|
|
+ * 上传免冠证件照
|
|
|
+ */
|
|
|
+ // $scope.uploadNoCrownPhoto = function () {
|
|
|
+ // $rootScope.uploadStdMaterialPhoto("NoCrownPhoto", function () {
|
|
|
+ // // $scope.curStep = 'StdExtendInfo';
|
|
|
+ // if (
|
|
|
+ // $rootScope.checkParamValue(
|
|
|
+ // "EnrolVerifyStdIdentity",
|
|
|
+ // "InActive",
|
|
|
+ // "Active"
|
|
|
+ // )
|
|
|
+ // ) {
|
|
|
+ // $scope.curStep = "VerifySuccess";
|
|
|
+ // } else {
|
|
|
+ // $scope.curStep = "StdExtendInfo";
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // };
|
|
|
|
|
|
- $scope.goStep = function(step) {
|
|
|
- $scope.curStep = step;
|
|
|
- }
|
|
|
+ let bizToken = sessionStorage.getItem("biz_token");
|
|
|
+ if (bizToken) {
|
|
|
+ $scope.showLiveCheckLoading = true;
|
|
|
+ $rootScope.ajaxRequest(
|
|
|
+ {
|
|
|
+ url: "../std/register/live/result.htm",
|
|
|
+ data: {
|
|
|
+ bizToken: bizToken,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ function (res) {
|
|
|
+ $scope.showLiveCheckLoading = false;
|
|
|
+ // location.reload();
|
|
|
+ $.hideLoading();
|
|
|
+ if (res && res.result == 1) {
|
|
|
+ $scope.curStep = "StdExtendInfo";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ );
|
|
|
+ sessionStorage.removeItem("biz_token");
|
|
|
+ }
|
|
|
+ $scope.uploadNoCrownPhoto = function () {
|
|
|
+ console.log("$scope.StdReg:", $scope.StdReg);
|
|
|
+ $rootScope.ajaxRequest(
|
|
|
+ {
|
|
|
+ url: "../std/register/live/token.htm",
|
|
|
+ data: {
|
|
|
+ stdName: $scope.StdReg.std_name,
|
|
|
+ certId: $scope.StdReg.cert_id,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ function (res) {
|
|
|
+ $.hideLoading();
|
|
|
+ if (res && res.url && res.bizToken) {
|
|
|
+ sessionStorage.setItem("biz_token", res.bizToken);
|
|
|
+ location.href = res.url;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ );
|
|
|
+ };
|
|
|
|
|
|
- $scope.openIdCard = function() {
|
|
|
- wx.chooseImage({
|
|
|
- count : 1, // 默认9
|
|
|
- sizeType : [ 'compressed' ], // 可以指定是原图还是压缩图,默认二者都有'original',
|
|
|
- sourceType : [ 'album', 'camera' ], // 可以指定来源是相册还是相机,默认二者都有
|
|
|
- success : function(res) {
|
|
|
- var localIds = res.localIds; // 返回选定照片的本地ID列表,localId可以作为img标签的src属性显示图片
|
|
|
- wx.uploadImage({
|
|
|
- localId : localIds[0], // 需要上传的图片的本地ID,由chooseImage接口获得
|
|
|
- isShowProgressTips : 1, // 默认为1,显示进度提示
|
|
|
- success : function(serverRes) {
|
|
|
- var serverId = serverRes.serverId; // 返回图片的服务器端ID
|
|
|
- $.showLoading("证件照片上传中,请稍后...")
|
|
|
- // 上传成功,去服务器取图片
|
|
|
- $rootScope.ajaxRequest({
|
|
|
- url : '../enrol/wx/reg/idcard/' + ($scope.StdReg.std_province < '70' ? '' : 'other/') + 'upload.htm',
|
|
|
- data : {
|
|
|
- media_id : serverId
|
|
|
- }
|
|
|
- }, function(response) {
|
|
|
- $.hideLoading();
|
|
|
- if ($scope.StdReg.std_province < '70') {
|
|
|
- $scope.StdReg.cert_id = response.map.IdCardInfo.person_code;
|
|
|
- $scope.StdReg.std_name = response.map.IdCardInfo.person_name;
|
|
|
- $scope.StdReg.std_sex = response.map.IdCardInfo.person_sex;
|
|
|
- $scope.StdReg.std_nation = response.map.IdCardInfo.person_nation;
|
|
|
- $scope.StdReg.cert_addr = response.map.IdCardInfo.person_addr;
|
|
|
- $scope.curStep = 'IdCardResult';
|
|
|
- } else {
|
|
|
- $scope.curStep = 'IdCardOther';
|
|
|
- }
|
|
|
- $scope.StdReg.idcard_file_name = response.map.IdCardFileName;
|
|
|
- });
|
|
|
- },
|
|
|
- fail : function(error) {
|
|
|
- $.hideLoading();
|
|
|
- $.alert('图片服务器暂时无法访问,请稍侯再试', '错误提示');
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
+ $scope.goStep = function (step) {
|
|
|
+ $scope.curStep = step;
|
|
|
+ };
|
|
|
|
|
|
- //选择毕业日期
|
|
|
- $scope.getGraduateDate = function() {
|
|
|
- weui.datePicker({
|
|
|
- start: 1990,
|
|
|
- end: new Date().getFullYear(),
|
|
|
- defaultValue: [new Date().getFullYear(), new Date().getMonth()+1, new Date().getDate()],
|
|
|
- depth:2,
|
|
|
- onChange: function (result) {
|
|
|
- //console.log(result);
|
|
|
- },
|
|
|
- onConfirm: function (result) {
|
|
|
- $scope.$apply(function () {
|
|
|
- $scope.StdReg.end_date = result[0].label + result[1].label;
|
|
|
- });
|
|
|
- },
|
|
|
- title: '日期选择'
|
|
|
- });
|
|
|
- }
|
|
|
+ $scope.openIdCard = function () {
|
|
|
+ wx.chooseImage({
|
|
|
+ count: 1, // 默认9
|
|
|
+ sizeType: ["compressed"], // 可以指定是原图还是压缩图,默认二者都有'original',
|
|
|
+ sourceType: ["album", "camera"], // 可以指定来源是相册还是相机,默认二者都有
|
|
|
+ success: function (res) {
|
|
|
+ var localIds = res.localIds; // 返回选定照片的本地ID列表,localId可以作为img标签的src属性显示图片
|
|
|
+ wx.uploadImage({
|
|
|
+ localId: localIds[0], // 需要上传的图片的本地ID,由chooseImage接口获得
|
|
|
+ isShowProgressTips: 1, // 默认为1,显示进度提示
|
|
|
+ success: function (serverRes) {
|
|
|
+ var serverId = serverRes.serverId; // 返回图片的服务器端ID
|
|
|
+ $.showLoading("证件照片上传中,请稍后...");
|
|
|
+ // 上传成功,去服务器取图片
|
|
|
+ $rootScope.ajaxRequest(
|
|
|
+ {
|
|
|
+ url:
|
|
|
+ "../enrol/wx/reg/idcard/" +
|
|
|
+ ($scope.StdReg.std_province < "70" ? "" : "other/") +
|
|
|
+ "upload.htm",
|
|
|
+ data: {
|
|
|
+ media_id: serverId,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ function (response) {
|
|
|
+ $.hideLoading();
|
|
|
+ if ($scope.StdReg.std_province < "70") {
|
|
|
+ $scope.StdReg.cert_id = response.map.IdCardInfo.person_code;
|
|
|
+ $scope.StdReg.std_name =
|
|
|
+ response.map.IdCardInfo.person_name;
|
|
|
+ $scope.StdReg.std_sex = response.map.IdCardInfo.person_sex;
|
|
|
+ $scope.StdReg.std_nation =
|
|
|
+ response.map.IdCardInfo.person_nation;
|
|
|
+ $scope.StdReg.cert_addr =
|
|
|
+ response.map.IdCardInfo.person_addr;
|
|
|
+ $scope.curStep = "IdCardResult";
|
|
|
+ } else {
|
|
|
+ $scope.curStep = "IdCardOther";
|
|
|
+ }
|
|
|
+ $scope.StdReg.idcard_file_name = response.map.IdCardFileName;
|
|
|
+ }
|
|
|
+ );
|
|
|
+ },
|
|
|
+ fail: function (error) {
|
|
|
+ $.hideLoading();
|
|
|
+ $.alert("图片服务器暂时无法访问,请稍侯再试", "错误提示");
|
|
|
+ },
|
|
|
+ });
|
|
|
+ },
|
|
|
+ });
|
|
|
+ };
|
|
|
|
|
|
-} ])
|
|
|
+ //选择毕业日期
|
|
|
+ $scope.getGraduateDate = function () {
|
|
|
+ weui.datePicker({
|
|
|
+ start: 1990,
|
|
|
+ end: new Date().getFullYear(),
|
|
|
+ defaultValue: [
|
|
|
+ new Date().getFullYear(),
|
|
|
+ new Date().getMonth() + 1,
|
|
|
+ new Date().getDate(),
|
|
|
+ ],
|
|
|
+ depth: 2,
|
|
|
+ onChange: function (result) {
|
|
|
+ //console.log(result);
|
|
|
+ },
|
|
|
+ onConfirm: function (result) {
|
|
|
+ $scope.$apply(function () {
|
|
|
+ $scope.StdReg.end_date = result[0].label + result[1].label;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ title: "日期选择",
|
|
|
+ });
|
|
|
+ };
|
|
|
+ },
|
|
|
+]);
|