Commit 5d7e694d by 潘际乾

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

parent aa661ba7
...@@ -52,7 +52,12 @@ export default { ...@@ -52,7 +52,12 @@ export default {
if (!this.getRoot().$refs.modelForm) { if (!this.getRoot().$refs.modelForm) {
return 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 fields = this.getRoot().$refs.modelForm.fields;
const tab = Utils.positioningErrorMsg(fieldErrors, fields); const tab = Utils.positioningErrorMsg(fieldErrors, fields);
return tab; return tab;
......
...@@ -92,7 +92,10 @@ export default { ...@@ -92,7 +92,10 @@ export default {
const tab = this.showBackendErrors(fieldErrors) const tab = this.showBackendErrors(fieldErrors)
if (tab) { if (tab) {
// tab切换之后,需出发tab-click的事件 // tab切换之后,需出发tab-click的事件
this.tabClick(tab); if (tab.name !== this.tabVal) {
this.isChecking = true
this.myTabClick ? this.myTabClick(tab) : this.tabClick(tab);
}
this.$notify({ this.$notify({
title: "错误", title: "错误",
message: "校核失败", message: "校核失败",
......
...@@ -14,7 +14,8 @@ export default { ...@@ -14,7 +14,8 @@ export default {
columnStr: '', columnStr: '',
data: [], data: [],
rulePath: '' rulePath: ''
} },
isChecking: false
} }
}, },
created() { created() {
...@@ -122,7 +123,7 @@ export default { ...@@ -122,7 +123,7 @@ export default {
* Tabs切换事件 * Tabs切换事件
* @param {VM} tab * @param {VM} tab
*/ */
tabClick(tab) { async tabClick(tab) {
if (this.isInDisplay) { if (this.isInDisplay) {
return return
} }
......
...@@ -153,6 +153,9 @@ export default class Utils { ...@@ -153,6 +153,9 @@ export default class Utils {
} }
static positioningErrorMsg(fieldErrors, formFields) { static positioningErrorMsg(fieldErrors, formFields) {
if (Object.keys(fieldErrors).length === 0) {
return null;
}
let firstErrorItem = null let firstErrorItem = null
// 顺序 // 顺序
for (let i = 0; i < formFields.length; i++) { for (let i = 0; i < formFields.length; i++) {
...@@ -190,7 +193,7 @@ export default class Utils { ...@@ -190,7 +193,7 @@ export default class Utils {
} }
if (firstErrorTab) { if (firstErrorTab) {
const tabs = firstErrorTab.$parent const tabs = firstErrorTab.$parent
tabs.currentName = firstErrorTab.paneName tabs.value = firstErrorTab.name
} }
setTimeout(() => { setTimeout(() => {
// 滚动到指定节点 // 滚动到指定节点
......
...@@ -15,15 +15,17 @@ ...@@ -15,15 +15,17 @@
</el-table-column> </el-table-column>
<el-table-column prop="matdat" label="Maturity" width="150px"> <el-table-column prop="matdat" label="Maturity" width="150px">
<template slot-scope="scope"> <template slot-scope="scope">
<c-date-picker <el-form-item label-width="0" :prop="'liaall.liaallg.' + scope.$index + '.matdat'">
type="date" <c-date-picker
v-model="scope.row.matdat" type="date"
value-format="yyyy-MM-dd" v-model="scope.row.matdat"
placeholder="请选择Date" value-format="yyyy-MM-dd"
style="width: 100%" placeholder="请选择Date"
@change="executeDefault('liaall.liaallg.matdat')" style="width: 100%"
> @change="executeDefault('liaall.liaallg.matdat')"
</c-date-picker> >
</c-date-picker>
</el-form-item>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="tenday" label="Tenor" width="70px"> <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