소스 검색

xielianghe

lange 5 년 전
부모
커밋
1b4b230dfc
1개의 변경된 파일25개의 추가작업 그리고 13개의 파일을 삭제
  1. 25 13
      whepi-ui/templates/home/ribao.js

+ 25 - 13
whepi-ui/templates/home/ribao.js

@@ -440,6 +440,7 @@ function selectinput6(obj) {
 function insertlingyun() {
   var sf = $("#js_input_sf").attr("data-values") == undefined ? 3 : $("#js_input_sf").attr("data-values");
   if (sf == 0 || sf == 3) {
+    cantijiao = true;
     $.alert("请选择是否出行");
     return;
   }
@@ -452,20 +453,24 @@ function insertlingyun() {
   var mddq = $('#js_input_mddq').val();
   var cfdq = $('#js_input_cfdq').val();
   if (mdd != jrszd) {
+    cantijiao = true;
     $.alert("目的地与今晚住地不一致");
     return;
   }
   if (jrszq != mddq) {
+    cantijiao = true;
     $.alert("目的地与今晚住地不一致");
     return;
   }
   if (cfd == 4 && mdd == 4) {
     if (mddq == cfdq) {
+      cantijiao = true;
       $.alert("出发地与目的地不能一致");
       return;
     }
   } else if (cfd != 4 || mdd != 4) {
     if (cfd == mdd) {
+      cantijiao = true;
       $.alert("出发地与目的地不能一致");
       return;
     }
@@ -475,7 +480,7 @@ function insertlingyun() {
 
   for (var i = 0; i < listcx.length; i++) {
     if (listcx[i].tripTypeDesp == cxfsq && listcx[i].tripType == cxfs && listcx[i].startLocal == cfd && listcx[i].startLocalOther == cfdq && listcx[i].endLocal == mdd && listcx[i].endLocalOther == mddq) {
-
+      cantijiao = true;
       $.alert("此行程已添加");
       return;
 
@@ -485,6 +490,7 @@ function insertlingyun() {
   if (cxfs != 4 && cxfs != 0) {
     var val = $('#js_input_cxfsq').val();
     if (val == "") {
+      cantijiao = true;
       $.alert("请填写车次/航班/车牌");
       return;
     }
@@ -501,11 +507,13 @@ function insertlingyun() {
       person.tripTypeStr = "飞机";
     }
   } else if (cxfs == 0) {
+    cantijiao = true;
     $.alert("请选择出行方式");
     return;
   } else if (cxfs == 4) {
     var val6 = $('#js_input_cxfsq').val();
     if (val6 == "") {
+      cantijiao = true;
       $.alert("请填写车次/航班/车牌");
       return;
     }
@@ -516,6 +524,7 @@ function insertlingyun() {
   if (cfd == 4 && cfd != 0) {
     var val2 = $('#js_input_cfdq').val();
     if (val2 == "") {
+      cantijiao = true;
       $.alert("请填写出发地");
       return;
     }
@@ -538,12 +547,14 @@ function insertlingyun() {
     }
 
   } else if (cfd == 0) {
+    cantijiao = true;
     $.alert("请选择出发地");
     return;
   }
   if (mdd == 4 && mdd != 0) {
     var val3 = $('#js_input_mddq').val();
     if (val3 == "") {
+      cantijiao = true;
       $.alert("请填写目的地");
       return;
     }
@@ -565,6 +576,7 @@ function insertlingyun() {
       person.endLocalOther = $('#js_input_mddq').val() == undefined ? "" : $('#js_input_mddq').val();
     }
   } else if (mdd == 0) {
+    cantijiao = true;
     $.alert("请选择目的地");
     return;
   }
@@ -1023,14 +1035,14 @@ function ribaoCommit() {
   var age = $("#js_input_user_age").val();
   //不能同时选择服用和未服用
   if ($("input[name='checkbox1']:checked").val() == "on" && $("input[name='checkbox2']:checked").val() == "on") {
-    $.alert("心脑血管不能同时选择服用和未服用");
     cantijiao = true;
+    $.alert("心脑血管不能同时选择服用和未服用");
     return;
   }
   //男性不能选择妊娠期
   if ($("#js_input_user_sex").attr("data-values") == 1 && $("input[name='checkbox7']:checked").val() == "on") {
-    $.alert("男性不能选择妊娠期");
     cantijiao = true;
+    $.alert("男性不能选择妊娠期");
     return;
   }
   //家庭状态
@@ -1092,34 +1104,34 @@ function ribaoCommit() {
   var score = $("#js_input_score").val() == undefined ? "" : $("#js_input_score").val();
 
   if (userName == undefined || userName == '') {
-    $.alert("请填写姓名");
     cantijiao = true;
+    $.alert("请填写姓名");
     return;
   }
   if (grender == 0) {
-    $.alert("请填写性别");
     cantijiao = true;
+    $.alert("请填写性别");
     return;
   }
   if (age == undefined || age == '') {
-    $.alert("请填写年龄");
     cantijiao = true;
+    $.alert("请填写年龄");
     return;
   }
   if (age > 150 || age < 0) {
-    $.alert("请填写正确的年龄");
     cantijiao = true;
+    $.alert("请填写正确的年龄");
     return;
   }
 
   if (temperature <= 0) {
-    $.alert("请填写体温");
     cantijiao = true;
+    $.alert("请填写体温");
     return;
   }
   if (temperature > 50 || temperature < 30) {
-    $.alert("请填写正确的体温");
     cantijiao = true;
+    $.alert("请填写正确的体温");
     return;
   }
 
@@ -1160,12 +1172,12 @@ function ribaoCommit() {
     var todyLocal = "";
     var todyLocalOther = "";
     if (jrszd == 0) {
-      $.alert("请选择今晚住地");
       cantijiao = true;
+      $.alert("请选择今晚住地");
       return;
     } else if (jrszd == 4 && jrszq == "") {
-      $.alert("请填写今晚住地");
       cantijiao = true;
+      $.alert("请填写今晚住地");
       return;
     } else if (jrszd != 0 && jrszd != 4) {
       if (jrszd == 1) {
@@ -1182,8 +1194,8 @@ function ribaoCommit() {
     var sf = $("#js_input_sf").attr("data-values") == undefined ? 3 : $("#js_input_sf").attr("data-values");
     var isTrip = "";
     if (sf == 3) {
-      $.alert("请选择是否出行");
       cantijiao = true;
+      $.alert("请选择是否出行");
       return;
     } else {
       isTrip = sf;
@@ -1233,8 +1245,8 @@ function ribaoCommit() {
     data: JSON.stringify(data),
     success: function (data) {
       if (data.msgReport == "2") {
-        $.toast("家人姓名不能重复,如果重复,可以带上称呼");
         cantijiao = true;
+        $.toast("家人姓名不能重复,如果重复,可以带上称呼");
         return;
       }
       if ($('#ribao')[0].style.display == 'none') {