feat(costreview): 询价附件支持清单绑定并新增项目筛选、动态明细标签与行结构统一
This commit is contained in:
@@ -131,6 +131,16 @@ def test_inq_lifecycle(server):
|
||||
assert un["ok"] is True and un["n"] == 1
|
||||
assert get(server, "/api/admin/batch/%d/inq" % b1)["total_bound"] == 0
|
||||
post(server, "/api/admin/batch/%d/inq/bind" % b1, {"file_id": fid, "lme_ids": [lme_b1]})
|
||||
# 决策 152:清单也能绑附件(bill_attach 同口径)+ /inq/bills 列表 + 附件角标含清单数
|
||||
bill_b1 = _q(server["db"], "SELECT id FROM bills WHERE batch_id=?", (b1,))[0][0]
|
||||
bb = post(server, "/api/admin/batch/%d/inq/bind" % b1, {"file_id": fid, "bill_ids": [bill_b1]})
|
||||
assert bb["ok"] is True and bb["n"] == 1
|
||||
bl = get(server, "/api/admin/batch/%d/inq/bills" % b1)
|
||||
assert bl["ok"] is True and bl["rows"] and bl["rows"][0]["file_id"] == fid
|
||||
lst2 = get(server, "/api/admin/batch/%d/inq" % b1)
|
||||
assert lst2["files"][0]["n"] == 2 # 1 工料机 + 1 清单
|
||||
unb = post(server, "/api/admin/batch/%d/inq/unbind" % b1, {"bill_ids": [bill_b1]})
|
||||
assert unb["ok"] is True and unb["n"] == 1
|
||||
stored = _q(server["db"], "SELECT stored_path FROM inquiry_files WHERE id=?", (fid,))[0][0]
|
||||
fp = server["root"] / "CostReview" / "data" / stored
|
||||
assert fp.exists()
|
||||
|
||||
Reference in New Issue
Block a user