for (var i = 0; i < arr.length - 1; i++) { for (var j = i + 1; j < arr.length; j++) { if (arr[i].deptName === arr[j].deptName) { this.$showWarningMsg('事业部重名了,请重新输入') this.loading = false return false } } }