fix:工装类具类型新增中的保养周期增加校验-必须为数字

This commit is contained in:
zhangxuanming 2024-12-20 16:54:09 +08:00
parent f09dc5ad83
commit b726af2e5d

View File

@ -268,6 +268,9 @@ export default {
],
remark: [
{ max: 250, message: '长度必须小于250个字符', trigger: 'blur' }
],
maintenPeriod: [
{ pattern: /^-?\d+(\.\d+)?$/, message: '输入必须为数字类型', trigger: 'blur' }
]
}
};
@ -357,19 +360,19 @@ export default {
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.toolTypeId != null) {
updateTooltype(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addTooltype(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
// if (this.form.toolTypeId != null) {
// updateTooltype(this.form).then(response => {
// this.$modal.msgSuccess("");
// this.open = false;
// this.getList();
// });
// } else {
// addTooltype(this.form).then(response => {
// this.$modal.msgSuccess("");
// this.open = false;
// this.getList();
// });
// }
}
});
},