第一步
<a-form-item style="display: flex">
<a-input-number
v-model:value="where.repairCapacityMIN"
style="width: 109px;"
:min="0"
@change="handleMinChange"
placeholder="请输入最小范围"
/>
~
<a-input-number
v-model:value="where.repairCapacityMAX"
style="width: 108px;"
:min="0"
@change="handleMaxChange"
placeholder="请输入最大范围"
/>
</a-form-item>
然后在metods中
// 最小值
handleMinChange() {
this.verification();
},
// 最大值
handleMaxChange() {
this.verification();
},
//字段验证
verification() {
if (this.queryParam.repairCapacityMIN > this.queryParam.repairCapacityMAX) {
this.$message.warning('起始数不能大于结束数');
return false;
} else {
return true;
}
},
searchQuery() {
if (this.verification()) {
this.loadData(1);
} else {
this.$message.warning('起始数不能大于结束数');
}
},