feat: 添加耗材操作日志修改记录功能; feat: 最大库存支持无限制选项; fix: 修复Ant Design Card组件bodyStyle废弃警告和字体预加载警告

This commit is contained in:
zhang1106
2026-01-30 14:01:23 +08:00
parent 2023a3e0c5
commit 5e3ac98bac
10 changed files with 483 additions and 44 deletions
+3 -2
View File
@@ -33,8 +33,9 @@ const Consumable = sequelize.define('Consumable', {
},
maxStock: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: 100
allowNull: true,
defaultValue: null,
comment: '最大库存,null表示无限制'
},
unitPrice: {
type: DataTypes.DECIMAL(10, 2),
+28 -1
View File
@@ -53,6 +53,31 @@ const ConsumableLog = sequelize.define('ConsumableLog', {
relatedId: {
type: DataTypes.STRING,
comment: '关联ID(如订单号、盘点ID等)'
},
isEditable: {
type: DataTypes.BOOLEAN,
defaultValue: true,
comment: '是否可编辑(创建、导入的记录可编辑,系统生成的出入库记录不可编辑)'
},
originalLogId: {
type: DataTypes.INTEGER,
allowNull: true,
comment: '原始日志ID(用于追踪修改历史链)'
},
modifiedBy: {
type: DataTypes.STRING,
allowNull: true,
comment: '修改人'
},
modifiedAt: {
type: DataTypes.DATE,
allowNull: true,
comment: '修改时间'
},
modificationReason: {
type: DataTypes.STRING,
allowNull: true,
comment: '修改原因'
}
}, {
tableName: 'consumable_logs',
@@ -62,7 +87,9 @@ const ConsumableLog = sequelize.define('ConsumableLog', {
{ fields: ['consumableId'] },
{ fields: ['operationType'] },
{ fields: ['createdAt'] },
{ fields: ['consumableId', 'createdAt'] }
{ fields: ['consumableId', 'createdAt'] },
{ fields: ['originalLogId'] },
{ fields: ['isEditable'] }
]
});