Browse Source

高企自评加条件

liting2017 6 years ago
parent
commit
e7c628a9ea
1 changed files with 52 additions and 10 deletions
  1. 52 10
      src/js/newMenu/evaluate.js

+ 52 - 10
src/js/newMenu/evaluate.js

@@ -11,23 +11,48 @@ import 'js/newMenu/bootstrap-datetimepicker.min.js';
 
 $(function () {
     var loginTxt ;
-    $('.basic_nav li').click(function () {
-        $(this).addClass('active').siblings().removeClass('active');
-        $('.table').removeClass('show');
-        $('.tab' + $(this).index()).addClass('show');
-    });
+    // $('.basic_nav li').click(function () {
+    //     $(this).addClass('active').siblings().removeClass('active');
+    //     $('.table').removeClass('show');
+    //     $('.tab' + $(this).index()).addClass('show');
+    // });
     $('.form-horizontal button[type!="submit"]').click(function (e) {
         e.preventDefault();
         loginTxt=$('.head_login')[0];
-        if(loginTxt&&($(loginTxt).text())=='登录'){
-            $('.head_login').click();
-            return false;
+        if($(this)[0].value=='1'){
+            if(loginTxt&&($(loginTxt).text())=='登录'){
+                $('.head_login').click();
+                return false;
+            }else{
+                let tab0 = $('.tab0 input'); 
+                let data = $('#registDate').val(),prov=$('#province').val(),tech=$('#technicalField').val();
+                if(data.length&&prov.length&&tech.length){
+                    for(let i=0;i<tab0.length;i++){
+                        if(!(tab0[i].value)){
+                            msg('请填写带*号项')
+                            return;
+                        }
+                    }
+                }else{
+                    msg('请填写带*号项')
+                    return;
+                }
+            }
+        }
+        if($(this)[0].value=='2'){
+           let tab1Arr = $('.tab1 input');
+           for(let j=0;j<tab1Arr.length;j++){
+            if(!(tab1Arr[j].value)){
+                msg('请填写带 * 号项')
+                return;
+            }
+           }
         }
         $('.basic_nav li').removeClass('active');
         $('.basic_nav .li' + $(this).prop('value')).addClass('active');
         $('.table').removeClass('show');
         $('.tab' + $(this).prop('value')).addClass('show');
-    })
+    });
     $(".dateTime").datetimepicker({
 		format: "yyyy-mm-dd",
 		language:  'zh-CN',
@@ -48,6 +73,11 @@ $(function () {
     $("#province").change(function () {
         var city = "";
         var i = parseInt($(this).find("option:selected").prop('id'));
+        if(isNaN(i)){
+            city+='<option id="0000">不限 </option>';
+            $('#city').html(city);
+            return;
+        } 
         $.each(provinceList[i].cityList, function (index, obj) {
             city += '<option id="' + obj.id + '">' + obj.name + '</option>';
         })
@@ -156,6 +186,18 @@ $(function () {
 
         $('.result_txt').addClass('show');
     });
-
+     /* 提示 */
+    //提示框渐隐函数    
+    function msg(txt) {
+        if($('.smg').hasClass('active')){
+			return ;
+		}
+        $('.smg').addClass('active');
+        var lit = $('#msg').val(txt);
+        setTimeout(function () {
+            $('.smg').removeClass('active')
+            $('#msg').val('');
+        }, 2000)
+    }
     
 })