fix(consumable): 修复最大库存字段逻辑并改进耗材管理

将 maxStock 字段从允许 null 改为默认 0 表示无限制
添加耗材创建时的数据验证和错误处理
优化前端耗材管理页面的表单初始化和显示逻辑
添加数据库迁移脚本处理现有数据
This commit is contained in:
zhang1106
2026-02-05 16:26:51 +08:00
parent ebd4b5faa9
commit 384a1a9246
4 changed files with 135 additions and 14 deletions
+3 -3
View File
@@ -33,9 +33,9 @@ const Consumable = sequelize.define('Consumable', {
},
maxStock: {
type: DataTypes.INTEGER,
allowNull: true,
defaultValue: null,
comment: '最大库存,null表示无限制'
allowNull: false,
defaultValue: 0,
comment: '最大库存,0表示无限制'
},
unitPrice: {
type: DataTypes.DECIMAL(10, 2),