|
@@ -65,7 +65,7 @@
|
|
|
:key="index"
|
|
|
:prop="`codeList.${index}.value`"
|
|
|
:rules="rules.codeList"
|
|
|
- :error="fromError"
|
|
|
+ :error="item.fromError"
|
|
|
>
|
|
|
<el-input
|
|
|
v-model="item.value"
|
|
@@ -157,7 +157,9 @@
|
|
|
ruleForm: {
|
|
|
main: '',
|
|
|
codeList: [{
|
|
|
- value: ''
|
|
|
+ value: '',
|
|
|
+ fromError: '',
|
|
|
+ key: +new Date()
|
|
|
}]
|
|
|
},
|
|
|
rules: {
|
|
@@ -202,6 +204,7 @@
|
|
|
if (valid) {
|
|
|
let arr = []
|
|
|
for(let item of this.ruleForm.codeList) {
|
|
|
+ item.fromError = ''
|
|
|
if(item.value) {
|
|
|
arr = arr.concat(item.value)
|
|
|
}
|
|
@@ -220,7 +223,15 @@
|
|
|
// this.mainError = res.data.Message
|
|
|
this.$nextTick(()=>{this.mainError = res.data.Message})
|
|
|
} else if(res.data.ErrorType == 2) {
|
|
|
- this.$nextTick(()=>{this.fromError = res.data.Message})
|
|
|
+ const str = res.data.Message.split(':')
|
|
|
+ this.$nextTick(()=>{
|
|
|
+ this.ruleForm.codeList.forEach(t => {
|
|
|
+ if (str.length > 1 && t.value == str[0]) {
|
|
|
+ t.fromError = res.data.Message;
|
|
|
+ t.key = +new Date()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
} else {
|
|
|
this.$message.error(res.data.Message);
|
|
|
}
|