Commit 5d7e694d by 潘际乾

checkAll时,ModuleList的表格数据校验错误信息

parent aa661ba7
......@@ -52,7 +52,12 @@ export default {
if (!this.getRoot().$refs.modelForm) {
return
}
this.getRoot().$refs.modelForm.clearValidate();
if (!this.isChecking) {
this.getRoot().$refs.modelForm.clearValidate();
} else {
// 当 checkAll 操作时,由面板切换所触发的 executeRule 请求时,不清空 checkAll 的错误信息
this.isChecking = false;
}
const fields = this.getRoot().$refs.modelForm.fields;
const tab = Utils.positioningErrorMsg(fieldErrors, fields);
return tab;
......
......@@ -92,7 +92,10 @@ export default {
const tab = this.showBackendErrors(fieldErrors)
if (tab) {
// tab切换之后,需出发tab-click的事件
this.tabClick(tab);
if (tab.name !== this.tabVal) {
this.isChecking = true
this.myTabClick ? this.myTabClick(tab) : this.tabClick(tab);
}
this.$notify({
title: "错误",
message: "校核失败",
......
......@@ -14,7 +14,8 @@ export default {
columnStr: '',
data: [],
rulePath: ''
}
},
isChecking: false
}
},
created() {
......@@ -122,7 +123,7 @@ export default {
* Tabs切换事件
* @param {VM} tab
*/
tabClick(tab) {
async tabClick(tab) {
if (this.isInDisplay) {
return
}
......
......@@ -153,6 +153,9 @@ export default class Utils {
}
static positioningErrorMsg(fieldErrors, formFields) {
if (Object.keys(fieldErrors).length === 0) {
return null;
}
let firstErrorItem = null
// 顺序
for (let i = 0; i < formFields.length; i++) {
......@@ -190,7 +193,7 @@ export default class Utils {
}
if (firstErrorTab) {
const tabs = firstErrorTab.$parent
tabs.currentName = firstErrorTab.paneName
tabs.value = firstErrorTab.name
}
setTimeout(() => {
// 滚动到指定节点
......
......@@ -15,15 +15,17 @@
</el-table-column>
<el-table-column prop="matdat" label="Maturity" width="150px">
<template slot-scope="scope">
<c-date-picker
type="date"
v-model="scope.row.matdat"
value-format="yyyy-MM-dd"
placeholder="请选择Date"
style="width: 100%"
@change="executeDefault('liaall.liaallg.matdat')"
>
</c-date-picker>
<el-form-item label-width="0" :prop="'liaall.liaallg.' + scope.$index + '.matdat'">
<c-date-picker
type="date"
v-model="scope.row.matdat"
value-format="yyyy-MM-dd"
placeholder="请选择Date"
style="width: 100%"
@change="executeDefault('liaall.liaallg.matdat')"
>
</c-date-picker>
</el-form-item>
</template>
</el-table-column>
<el-table-column prop="tenday" label="Tenor" width="70px">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment