实现原料逻辑删除功能

- 为fabrics表添加is_deleted字段用于标记删除状态
- 修改delete_raw方法实现逻辑删除而非物理删除
- 更新所有查询语句过滤已删除的原料数据
- 更新库存视图过滤已删除的原料和相关记录
- 保留历史数据,支持数据恢复

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
2025-12-27 19:09:16 +08:00
parent fa70f62099
commit 6322cb0caa
6 changed files with 42 additions and 30 deletions

View File

@@ -659,7 +659,7 @@ class GarmentEditDialog(QDialog):
try:
with self.get_conn() as conn:
cursor = conn.execute(
"SELECT category, fabric_type, unit FROM fabrics WHERE model = ?",
"SELECT category, fabric_type, unit FROM fabrics WHERE model = ? AND (is_deleted IS NULL OR is_deleted = 0)",
(base_model,)
)
row_db = cursor.fetchone()