浏览代码

班组人员去重

wangtao 3 年之前
父节点
当前提交
773c5443ca
共有 2 个文件被更改,包括 12 次插入10 次删除
  1. 10 8
      src/views/business/OM/MochaITOM/crew/index.vue
  2. 2 2
      src/views/business/OM/MochaITOM/plan/index.vue

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

@@ -377,14 +377,16 @@ export default {
             }
             }
           }
           }
           for(let i =0;i<arr.length;i++){
           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("计划结束时间不能小于计划开始时间");
             this.msgError("计划结束时间不能小于计划开始时间");
             return
             return
           }
           }
-          if(getTimeFormat(end) < getTimeFormat(start)){
-            this.msgError("执行结束时间不能小于执行开始时间");
+          if(getTimeFormat(end) <= getTimeFormat(start)){
+            this.msgError("执行结束时间不能小于或等于执行开始时间");
             return
             return
           }
           }
           this.loading = true
           this.loading = true