feat(client): 库存查询新增规格/系列/入库时间;筛选组件支持搜索+滚动+标签

- 库存查询加规格、系列服务端筛选(后端 IN 条件,前端从 product-options API 加载全量选项)
- 库存查询新增「入库时间」列,导出 Excel 同步带上
- 入库单商品明细:隐藏商品编码列,生产日期从选填折叠区移至主行常显
- 筛选弹窗重构:顶部搜索框实时过滤 + 滚动列表(ConstrainedBox maxHeight)根治溢出
- 已选项以 Chip 标签置顶展示,每个标签带 × 可单独取消
- FilterableColumnHeader 筛选图标改为常驻,不再需要 hover 才显示

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
wangjia
2026-06-15 11:15:43 +08:00
parent 316e9b6fc9
commit eac3e8825c
8 changed files with 316 additions and 179 deletions
+1
View File
@@ -865,6 +865,7 @@ func parseUploadedExcel(c *gin.Context) ([][]string, error) {
if len(rows) < 2 {
return nil, fmt.Errorf("empty or invalid sheet")
}
log.Printf("[import] parseUploadedExcel: file=%s rows=%d (incl. header)", file.Filename, len(rows))
return rows, nil
}
+19
View File
@@ -3,6 +3,7 @@ package handler
import (
"net/http"
"strconv"
"strings"
"time"
"github.com/gin-gonic/gin"
@@ -63,6 +64,8 @@ func (h *InventoryHandler) List(c *gin.Context) {
keyword := c.Query("keyword")
warehouseIDStr := c.Query("warehouse_id")
inStock := c.Query("in_stock")
seriesStr := c.Query("series")
specStr := c.Query("spec")
if keyword != "" {
baseWhere += " AND (COALESCE(NULLIF(p.name,''), inv.product_name) LIKE ? OR COALESCE(NULLIF(p.code,''), inv.product_code) LIKE ? OR p.name_pinyin LIKE ? OR p.name_initials LIKE ?)"
@@ -76,6 +79,22 @@ func (h *InventoryHandler) List(c *gin.Context) {
if inStock == "1" {
baseWhere += " AND inv.quantity > 0"
}
if seriesStr != "" {
parts := strings.Split(seriesStr, ",")
placeholders := strings.Repeat("?,", len(parts))
baseWhere += " AND COALESCE(NULLIF(p.series,''), inv.series, '') IN (" + placeholders[:len(placeholders)-1] + ")"
for _, s := range parts {
args = append(args, strings.TrimSpace(s))
}
}
if specStr != "" {
parts := strings.Split(specStr, ",")
placeholders := strings.Repeat("?,", len(parts))
baseWhere += " AND COALESCE(NULLIF(p.spec,''), inv.spec, '') IN (" + placeholders[:len(placeholders)-1] + ")"
for _, s := range parts {
args = append(args, strings.TrimSpace(s))
}
}
// Count query
countSQL := `