feat(耗材管理): 添加扫码功能及SN查询接口

实现耗材SN扫码功能,包括扫码添加、入库和出库操作
添加后端API接口根据SN查询耗材信息
优化耗材表单UI,分步骤展示不同信息区块
同步数据库模型确保耗材相关表结构正确
This commit is contained in:
zhang1106
2026-03-10 11:10:04 +08:00
parent 686089c21a
commit a316fa4d38
5 changed files with 865 additions and 179 deletions
+36
View File
@@ -43,6 +43,24 @@ sequelize.authenticate()
const SystemSetting = require('./models/SystemSetting');
return SystemSetting.sync();
})
.then(() => {
// 同步耗材模型
const Consumable = require('./models/Consumable');
const ConsumableLog = require('./models/ConsumableLog');
const ConsumableCategory = require('./models/ConsumableCategory');
const ConsumableRecord = require('./models/ConsumableRecord');
const ConsumableLogArchive = require('./models/ConsumableLogArchive');
return Promise.all([
Consumable.sync({ alter: true }),
ConsumableLog.sync(),
ConsumableCategory.sync(),
ConsumableRecord.sync(),
ConsumableLogArchive.sync()
]);
})
.then(() => {
console.log('耗材模型同步完成');
})
.then(() => {
// 同步盘点模型
const InventoryPlan = require('./models/InventoryPlan');
@@ -57,6 +75,24 @@ sequelize.authenticate()
.then(() => {
console.log('盘点模型同步完成');
})
.then(() => {
// 同步耗材相关模型
const Consumable = require('./models/Consumable');
const ConsumableLog = require('./models/ConsumableLog');
const ConsumableCategory = require('./models/ConsumableCategory');
const ConsumableRecord = require('./models/ConsumableRecord');
const ConsumableLogArchive = require('./models/ConsumableLogArchive');
return Promise.all([
Consumable.sync({ alter: true }),
ConsumableLog.sync(),
ConsumableCategory.sync(),
ConsumableRecord.sync(),
ConsumableLogArchive.sync()
]);
})
.then(() => {
console.log('耗材模型同步完成');
})
.then(() => {
// 初始化系统设置默认值(关键:确保部署时数据正确初始化)
console.log('开始初始化系统设置默认值...');