feat: 库存管理系统 MaterialWMS 初始版本

- Flask + SQLAlchemy 物料/入库/出库/BOM/生产订单全模块管理
- PyInstaller 打包为单文件 EXE (双击运行, 自动建库)
- 物料维度: 入库总数量 / 消耗总数量 / 逐次入库流水(含时间)
- BOM 详情展示组成物料的规格型号与单套用量
- 支持 Altium / 嘉立创 BOM 批量导入(文本与 Excel 双通道)
- 内置端到端验证脚本(tools/_exe_util.py 等, 清理进程树防残留)
This commit is contained in:
2026-09-11 15:41:56 +08:00
commit 7d34a481b3
38 changed files with 3601 additions and 0 deletions
+90
View File
@@ -0,0 +1,90 @@
* { box-sizing: border-box; }
body {
margin: 0; font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
background: #f4f6f8; color: #1f2733; font-size: 15px;
}
.topbar {
display: flex; align-items: center; justify-content: space-between;
background: #1f3a5f; color: #fff; padding: 0 20px; height: 52px;
}
.topbar .brand { font-weight: 700; font-size: 17px; }
.topbar .ver { background: #2e8b57; border-radius: 4px; padding: 1px 6px; font-size: 12px; margin-left: 6px; }
.topbar nav a { color: #dce6f2; text-decoration: none; margin-left: 18px; font-size: 14px; }
.topbar nav a:hover { color: #fff; }
.topbar .who { margin-left: 18px; color: #9fb3cc; font-size: 13px; }
main { max-width: 1100px; margin: 18px auto; padding: 0 16px; }
.stats { display: flex; gap: 14px; margin-bottom: 16px; }
.stat { flex: 1; background: #fff; border-radius: 8px; padding: 16px; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.stat .num { font-size: 30px; font-weight: 700; }
.stat .lbl { color: #6b7785; font-size: 13px; margin-top: 4px; }
.stat.warn .num { color: #d48806; }
.stat.danger .num { color: #d4380d; }
h3 { margin: 18px 0 10px; }
.card { background: #fff; border-radius: 8px; padding: 18px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.login-wrap { display: flex; justify-content: center; margin-top: 60px; }
.login-card { width: 320px; }
.login-card h2 { margin-top: 0; }
label { display: block; margin: 10px 0 4px; font-size: 13px; color: #44525f; }
input, select, textarea {
width: 100%; padding: 8px 10px; border: 1px solid #cdd5df; border-radius: 6px; font-size: 14px;
}
button, .btn {
display: inline-block; cursor: pointer; border: none; border-radius: 6px;
padding: 9px 16px; font-size: 14px; text-decoration: none; background: #eef1f5; color: #1f2733;
}
button.primary, .btn.primary { background: #1f3a5f; color: #fff; }
button:hover, .btn:hover { filter: brightness(.96); }
.row-actions { margin-top: 14px; display: flex; gap: 10px; }
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.search input { width: 280px; }
.search button { margin-left: 8px; }
.tbl { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.tbl th, .tbl td { padding: 9px 12px; text-align: left; border-bottom: 1px solid #eef1f5; }
.tbl th { background: #f0f3f7; font-size: 13px; color: #44525f; }
.tbl td.num, .stat .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl a { color: #1f3a5f; text-decoration: none; }
.row-danger { background: #fff1f0; }
.row-warn { background: #fffbe6; }
.badge { padding: 2px 8px; border-radius: 10px; font-size: 12px; }
.badge.ok { background: #e6f7ed; color: #1a7f47; }
.badge.warn { background: #fff7e6; color: #ad6800; }
.badge.danger { background: #fff1f0; color: #cf1322; }
.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 12px; font-size: 14px; }
.flash.ok { background: #e6f7ed; color: #1a7f47; }
.flash.error { background: #fff1f0; color: #cf1322; }
.muted { color: #8a96a3; }
.small { font-size: 12px; }
.txn-form { max-width: 520px; margin-bottom: 22px; }
/* 批量导入窗口(模态) */
.modal-mask {
position: fixed; inset: 0; background: rgba(15,23,35,.5);
display: flex; align-items: center; justify-content: center; z-index: 50;
}
.modal {
background: #fff; border-radius: 10px; width: 720px; max-width: 94vw;
max-height: 90vh; display: flex; flex-direction: column; overflow: hidden;
box-shadow: 0 10px 40px rgba(0,0,0,.25);
}
.modal-head {
background: #1f3a5f; color: #fff; padding: 12px 16px;
display: flex; justify-content: space-between; align-items: center; font-weight: 600;
}
.modal-head .x { background: transparent; color: #fff; font-size: 18px; padding: 0 6px; }
.modal-body { padding: 16px; overflow: auto; }
.modal-body textarea { font-family: Consolas, "Courier New", monospace; font-size: 13px; }
.modal-body label.btn { margin: 0; }
/* 批量导入窗口: 多 BOM 卡片 */
.bom-card { border: 1px solid #e3e8ef; border-radius: 8px; margin-bottom: 10px; overflow: hidden; }
.bom-card.card-danger { border-color: #ffccc7; }
.bom-card .bom-head { background: #f0f3f7; padding: 8px 12px; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.bom-card.card-danger .bom-head { background: #fff1f0; }
.bom-card .tbl { box-shadow: none; border-radius: 0; margin: 0; }