handleCommit(flag) {
this.$refs["form"].validate((valid, object) => {
if (valid) {
this.form.checkState = flag;
this.form.checkLevel = 1;
this.form.type = 1; //规划
this.form.filingsId = this.form.id;
checkFilings(this.form).then((response) => {
this.$modal.msgSuccess("审核成功");
this.open = false;
this.getList();
});
} else {
let str = [];
for (let key in object) {
object[key].map((item) => {
str.push(item.message);
});
let dom = this.$refs[Object.keys(object)[0]];
if (Object.prototype.toString.call(dom) !== '[object Object]') {
dom = dom[0];
break; //结束语句并跳出语句,进行下个语句执行
}
// 定位代码
dom.$el.scrollIntoView({
block: 'center',
behavior: 'smooth'
});
}
}
});
},