Quellcode durchsuchen

班组人员去重

wangtao vor 3 Jahren
Ursprung
Commit
773c5443ca

+ 10 - 8
src/views/business/OM/MochaITOM/crew/index.vue

@@ -377,14 +377,16 @@ export default {
             }
           }
           for(let i =0;i<arr.length;i++){
-            if(i<arr.length-1){
-              if(arr[i].name == arr[i+1].name){
-                this.msgError("姓名不能重复");
-                return
-              }
-              if(arr[i].phone == arr[i+1].phone){
-                this.msgError("手机号不能重复");
-                return
+            for(let a= 0;a<arr.length;a++){
+              if(a != i){
+                if(arr[a].name == arr[i].name){
+                  this.msgError("姓名不能重复");
+                  return
+                }
+                if(arr[a].phone == arr[i].phone){
+                  this.msgError("手机号不能重复");
+                  return
+                }
               }
             }
           }

+ 2 - 2
src/views/business/OM/MochaITOM/plan/index.vue

@@ -466,8 +466,8 @@ export default {
             this.msgError("计划结束时间不能小于计划开始时间");
             return
           }
-          if(getTimeFormat(end) < getTimeFormat(start)){
-            this.msgError("执行结束时间不能小于执行开始时间");
+          if(getTimeFormat(end) <= getTimeFormat(start)){
+            this.msgError("执行结束时间不能小于或等于执行开始时间");
             return
           }
           this.loading = true