Files
KCGL/inventory-web
yueli 1ef9ae4ad9 feat(records): 报废记录接入高级筛选
复用 app/utils/advanced_filter.py,但报废有两处与出库/借还不同,需特殊处理:

一、scrap_request_no 可为 NULL(历史直接报废)
  出库/借还可直接对单号列做 IN,报废不行——「单号 IN」永远匹配不上 NULL 行,
  会把历史单整体漏掉。此处统一用「行级等价键」表达同单关系:
    有单号 → scrap_request_no 相等
    无单号 → 同一分钟(date_trunc) + 同一操作人(与 Python 侧分组逻辑完全一致)

二、物料名不能用单号传递结果
  物料名需三表联查,但联查结果若用「单号 IN」回接,同样会漏掉 NULL 单号行。
  改用 tuple_(source_table, stock_id).in_(pairs) 元组定位报废行。

三、否定操作符
  命中行 → 折算同单等价键谓词 → 否定时整体取反(~pred),实现整单排除。

前端 scrap/index.vue 新增「高级筛选」el-popover,与出库/借还版式一致。

验证(库中当前唯一报废单含 SKU 0000000272):
  sku contains 0000000272 → 1 单
  sku ne 0000000272       → 0 单(整单排除,符合预期)
  material_name not_contains 白板 → 0 单(该单物料名含白板,被排除)
  单号 ne(父级)          → 1 单(父级否定语义不变)
2026-09-10 13:06:07 +08:00
..
2026-01-28 17:44:39 +08:00
2026-01-26 13:47:53 +08:00
2026-01-26 13:47:53 +08:00
2026-01-26 13:47:53 +08:00
2026-01-26 13:47:53 +08:00

Vue 3 + TypeScript + Vite

This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 <script setup> SFCs, check out the script setup docs to learn more.

Learn more about the recommended Project Setup and IDE Support in the Vue Docs TypeScript Guide.