|
@@ -1,35 +1,75 @@
|
|
|
app.controller('StdRegCtrl', [ '$rootScope', '$scope', '$http', '$timeout', '$state', '$stateParams', function($rootScope, $scope, $http, $timeout, $state, $stateParams) {
|
|
|
$scope.curStep = 'start';
|
|
|
$scope.StdReg = {};
|
|
|
+ $scope.YmStdCategoryArray = [];
|
|
|
+
|
|
|
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});
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
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;
|
|
|
- });
|
|
|
+ });*/
|
|
|
+
|
|
|
+
|
|
|
//邮寄省份
|
|
|
$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({
|
|
@@ -37,17 +77,26 @@ app.controller('StdRegCtrl', [ '$rootScope', '$scope', '$http', '$timeout', '$st
|
|
|
}, function(response) {
|
|
|
$scope.cityArray = response.array;
|
|
|
});
|
|
|
- }
|
|
|
- //alert($rootScope.checkParamValue('EnrolVerifyStdIdentity', 'InActive', 'Active'));
|
|
|
- // alert($rootScope.getParamValue('EnrolVerifyStdIdentity', 'InActive'));
|
|
|
- // console.log($rootScope.FrameParam);
|
|
|
+ }
|
|
|
+
|
|
|
+ //选择考生类型
|
|
|
+ $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.chooseProvince = function(p) {
|
|
|
if(p.reg_status == 'InActive') {
|
|
|
var msg = '未开放【'+p.province_name+'】考生注册!';
|
|
|
- if(p.reg_fetch_param != undefined)
|
|
|
+ if(p.reg_fetch_param != undefined)
|
|
|
msg = p.reg_fetch_param;
|
|
|
$.alert(msg);
|
|
|
return;
|
|
@@ -55,19 +104,19 @@ app.controller('StdRegCtrl', [ '$rootScope', '$scope', '$http', '$timeout', '$st
|
|
|
$scope.currentProvince = p;
|
|
|
$scope.StdReg.std_province = p.province_id;
|
|
|
$scope.StdReg.province_name = p.province_name;
|
|
|
- if ((p.province_id + '') == '0099') {
|
|
|
+ if ((p.province_id + '') == '90') {
|
|
|
// 外国,护照
|
|
|
$scope.curStep = 'PassportWarning';
|
|
|
$scope.StdReg.cert_type = 'Passport';
|
|
|
- } else if ((p.province_id + '') == '0071') {
|
|
|
+ } else if ((p.province_id + '') == '71') {
|
|
|
// 台湾,台湾居民往来大陆通行证,澳门,香港 港澳居民来往内地通行证
|
|
|
$scope.curStep = 'IdCard71Warning';
|
|
|
$scope.StdReg.cert_type = 'TaiWanPass';
|
|
|
- }else if ((p.province_id + '') == '0081' || (p.province_id + '') == '0082') {
|
|
|
+ }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') {
|
|
|
+ } else if (p.ksh_status == 'Active') {
|
|
|
// 必须有高考报名号
|
|
|
$scope.curStep = 'ExamIdWarning';
|
|
|
} else {
|
|
@@ -75,7 +124,7 @@ app.controller('StdRegCtrl', [ '$rootScope', '$scope', '$http', '$timeout', '$st
|
|
|
$scope.curStep = 'IdCardWarning';
|
|
|
$scope.StdReg.cert_type = 'IdCard';
|
|
|
}
|
|
|
- }
|
|
|
+ $scope.findProvinceArtScience();
|
|
|
}
|
|
|
|
|
|
$scope.checkExamId = function() {
|
|
@@ -96,6 +145,12 @@ app.controller('StdRegCtrl', [ '$rootScope', '$scope', '$http', '$timeout', '$st
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ //非大陆考生通行证和证件号码判断
|
|
|
+ $scope.isCert = function(str) {
|
|
|
+ var pat = /^[a-zA-Z0-9()]+$/;
|
|
|
+ return pat.test(str);
|
|
|
+ }
|
|
|
+
|
|
|
/***************************************************************************
|
|
|
* 识别正确,保存用户信息
|
|
|
*/
|
|
@@ -104,34 +159,62 @@ app.controller('StdRegCtrl', [ '$rootScope', '$scope', '$http', '$timeout', '$st
|
|
|
$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('请输入证件号码信息!');
|
|
|
+ $.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('请输入考生姓名信息!');
|
|
|
+ $.alert('请输入考生姓名!');
|
|
|
return false;
|
|
|
}
|
|
|
if ($scope.StdReg.std_sex == undefined || $scope.StdReg.std_sex.length == 0) {
|
|
|
$.alert('请选择考生性别!');
|
|
|
return false;
|
|
|
}
|
|
|
- /*if ($scope.StdReg.link_province == undefined || $scope.StdReg.link_province.length == 0) {
|
|
|
- $.alert('请选择邮寄省份!');
|
|
|
- return false;
|
|
|
- }
|
|
|
- if ($scope.StdReg.link_city == undefined || $scope.StdReg.link_city.length == 0) {
|
|
|
- $.alert('请选择邮寄城市!');
|
|
|
- return false;
|
|
|
- }
|
|
|
- if ($scope.StdReg.link_addr == undefined || $scope.StdReg.link_addr.length == 0) {
|
|
|
- $.alert('请输入试卷邮寄地址!');
|
|
|
- return false;
|
|
|
- }*/
|
|
|
- if ($scope.StdReg.std_mobile == undefined || $scope.StdReg.std_mobile.length != 11) {
|
|
|
+
|
|
|
+ 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;
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
$.showLoading("正在提交考生信息,请稍后...")
|
|
|
$rootScope.ajaxRequest({
|
|
|
url : '../enrol/reg/save.htm',
|
|
@@ -150,22 +233,100 @@ app.controller('StdRegCtrl', [ '$rootScope', '$scope', '$http', '$timeout', '$st
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ //是否是中文
|
|
|
+ $scope.isChinese = function(str){
|
|
|
+ var reg = /^[\u4e00-\u9fa5]+$/;
|
|
|
+ return reg.test(str);
|
|
|
+ }
|
|
|
+
|
|
|
/***************************************************************************
|
|
|
* 完善个人信息
|
|
|
*/
|
|
|
$scope.saveExtendInfo = function() {
|
|
|
|
|
|
// 考生
|
|
|
- if($rootScope.getParamValue('SchoolCode') == '51065' ) {
|
|
|
- if ($scope.StdReg.std_type == undefined || $scope.StdReg.std_type == '') {
|
|
|
+ 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) {
|
|
|
+ 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.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 ($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;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
$.showLoading("正在提交考生信息,请稍后...")
|
|
|
$rootScope.ajaxRequest({
|
|
|
url : '../enrol/std/info/save.htm',
|
|
@@ -237,4 +398,24 @@ app.controller('StdRegCtrl', [ '$rootScope', '$scope', '$http', '$timeout', '$st
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
+
|
|
|
+ //选择毕业日期
|
|
|
+ $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: '日期选择'
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
} ])
|