fix(consumable): 修复最大库存字段逻辑并改进耗材管理
将 maxStock 字段从允许 null 改为默认 0 表示无限制 添加耗材创建时的数据验证和错误处理 优化前端耗材管理页面的表单初始化和显示逻辑 添加数据库迁移脚本处理现有数据
This commit is contained in:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user