feat(costreview): 询价附件支持清单绑定并新增项目筛选、动态明细标签与行结构统一

This commit is contained in:
lianjianwei2024
2026-10-21 20:21:51 +08:00
parent 8235085f26
commit 6f36b2f494
20 changed files with 1521 additions and 332 deletions

View File

@@ -27,7 +27,7 @@ def _load_registry():
return json.load(f)
def seed(server):
def seed(server, with_batch=True):
"""预置样例数据(全部在临时副本里,退出即删):2 个审核会话 + 1 个后台批次。
会话走真实用户路径:上传(进软件目录)→ 审核 —— 否则列表会显示"源文件缺失",
@@ -45,10 +45,13 @@ def seed(server):
"审核工程乙", [config.CAM], [config.LME_CAM])
_audit_via_upload(server, pb, "审核工程乙")
# 历史工程B:入库后台批次(后台列表 + 比对源;与甲的摄像机编码相同 → 类似清单有东西可出)
# with_batch=False:只造会话不造批次——工作台重造样例用,避开「同名同期」防重闸(2026-10-20)
pc = cos4maker.make_cos4(os.path.join(server.src_dir, "样例历史B.cos4"),
"历史工程B", [(config.CAM[0], config.CAM[1], config.CAM[2],
config.CAM[3], 8, 1800)],
[config.LME_CAM, config.LME_CONC])
if not with_batch:
return sid_a
r = server.post("/api/admin/import", dict(config.META, path=pc, name="历史工程B",
file_kind=1))
assert r.get("ok"), "造后台批次失败:%s" % r
@@ -142,7 +145,10 @@ def main():
for pid, p in todo:
print(" ▶ %s" % p.get("名称", pid))
if pid == "workbench":
pages_checks.check_workbench(browser, server, rep, update, sid_a)
# 「最近审核」页的删除测试会把样例会话删空 → 工作台前重造一轮样例,
# 否则 ?sid=N 开的是已删会话,顶栏工程名永远出不来(2026-10-20 实测真因)
sid_wb = seed(server, with_batch=False)
pages_checks.check_workbench(browser, server, rep, update, sid_wb)
else:
pages_checks.CHECKS[pid](browser, server, rep, update)
except SystemExit:
@@ -163,6 +169,14 @@ def main():
server.__exit__(None, None, None)
except Exception:
pass
try:
import importlib.util as _ilu
_sp = os.path.join(_PKG, "清浏览器缓存.py")
_spec = _ilu.spec_from_file_location("clr_cache", _sp)
_m = _ilu.module_from_spec(_spec); _spec.loader.exec_module(_m)
_m.clear() # 2026-10-20 主人定:每次体检收尾自动清空浏览器缓存
except Exception:
pass
html_path, _md = rep.write(os.path.join(_PKG, config.OUT_DIR))
n_ok, n_warn, n_fail, steps_bad, shots_bad = rep.counts()
print("\n" + "=" * 56)