chore(order-delivery-reply): 前端页面调整、细节修改、优化逻辑等
This commit is contained in:
1 parent
7fb36b301c
commit
36868f875c
36 files changed
+1577
-376
No files matched your search
@@ -73,3 +73,31 @@ def test_keyword_and_date_status_filters_stack(app):
|
||||
assert result["total"] == 0
|
||||
# 断言:status=not_fully_replied(未锁定)两行都算;有批次的行仍是未锁定(部分回复)
|
||||
assert list_lines({"keyword": "齿轮", "status": "not_fully_replied"})["total"] == 2
|
||||
|
||||
|
||||
def test_keyword_matches_salesperson_and_reply_person(app):
|
||||
"""keyword 命中业务员(姓名/工号)与交期回复人员(姓名/工号)即返回(2026-09-23 增补)。"""
|
||||
from app.models.order_delivery_reply import OrderDeliveryLineState
|
||||
|
||||
salesperson_line = _line("8301-P1", 1, cust_no="C-A")
|
||||
salesperson_line.salesperson_name = "王瑞雪"
|
||||
salesperson_line.salesperson_code = "26070045"
|
||||
replied_line = _line("8301-P2", 2, cust_no="C-B")
|
||||
replied_line.salesperson_name = "张小奇"
|
||||
db.session.flush()
|
||||
# 交期回复人员快照存于行状态表(notified_user_name / notified_employee_id)
|
||||
db.session.add(OrderDeliveryLineState(
|
||||
line_id=replied_line.id, notified_user_name="李生", notified_employee_id="10002",
|
||||
))
|
||||
db.session.commit()
|
||||
|
||||
# 断言:业务员姓名命中 → 只返回 8301-P1
|
||||
assert [i["order_no"] for i in list_lines({"keyword": "王瑞雪"})["items"]] == ["8301-P1"]
|
||||
# 断言:业务员工号命中 → 只返回 8301-P1
|
||||
assert [i["order_no"] for i in list_lines({"keyword": "26070045"})["items"]] == ["8301-P1"]
|
||||
# 断言:交期回复人员姓名命中(状态表 EXISTS 子查询)→ 只返回 8301-P2
|
||||
assert [i["order_no"] for i in list_lines({"keyword": "李生"})["items"]] == ["8301-P2"]
|
||||
# 断言:交期回复人员工号命中 → 只返回 8301-P2
|
||||
assert [i["order_no"] for i in list_lines({"keyword": "10002"})["items"]] == ["8301-P2"]
|
||||
# 断言:未命中任何人员 → 空
|
||||
assert list_lines({"keyword": "不存在的名字"})["items"] == []
|
||||
Reference in new issue
Block a user