<el-form-item
? v-for="(domain, index)in form.domains"
? :label="'编号'"
? :key="domain.key"
? :prop="'domains.' + index +'.caseNos'"
? :rules="rules.caseNos">
<el-input v-model="domain.caseNos"
? ? ? ? ? ? clearable
? ? ? ? ? ? size="small"
? ? ? ? ? ? maxlength="14"
? ? ? ? ? ? style="width:240px"/>
<span style="margin-left:10px"></span>
<el-button plain size="mini" type="primary" @click="addDomain" v-if="index+1 == form.domains.length">+
</el-button>
<el-button plain size="mini" @click.prevent="removeDomain(domain)" v-if="index !==0">-</el-button>
</el-form-item>
?data? 重点
let validateCaseNos = (rule, value, callback) => {
var row_index = rule.field.replace(/[^0-9]/ig,"");
if (!value) {
return callback(new Error('编号不能为空'))
}else if (this.form.domains.length >1) {
for (let index in this.form.domains) {
let item =this.form.domains[index]
if (item.caseNos === value &&index !=row_index) {
callback(new Error('编号唯一性,不能重复'))
return
? ? ? }
}
}else {
callback()
}
}
// 表单参数
form: {
domains: [{
caseNos:''
? }],
},