实现原料逻辑删除功能

- 为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

@@ -58,10 +58,10 @@ class StockInDialog(QDialog):
try:
with self.get_conn() as conn:
# 查询面料基础信息
query = "SELECT model, color, supplier, unit FROM fabrics"
query = "SELECT model, color, supplier, unit FROM fabrics WHERE (is_deleted IS NULL OR is_deleted = 0)"
params = []
if keyword:
query += " WHERE model LIKE ? OR color LIKE ?"
query += " AND (model LIKE ? OR color LIKE ?)"
params = ["%" + keyword + "%", "%" + keyword + "%"]
query += " ORDER BY timestamp DESC"
cursor = conn.execute(query, params)