From e7e6129367d29d05ed1310363f1b682f9ba26f2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=97=A0=E9=97=BB=E9=A3=8E?= Date: Tue, 16 Jun 2026 15:06:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=A0=B9=E8=A7=86=E5=9B=BE?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E6=9C=AA=E5=85=A5=E5=BA=93=E7=89=A9=E5=93=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/my_work/routers/apiWarehouse.go | 3 +++ .../src/views/warehouse/WarehouseContainerDetail.vue | 2 +- .../ops_vue_js/src/views/warehouse/WarehouseOverview.vue | 7 +++++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/backend/my_work/routers/apiWarehouse.go b/backend/my_work/routers/apiWarehouse.go index 7b4cdb3..7d53bf2 100644 --- a/backend/my_work/routers/apiWarehouse.go +++ b/backend/my_work/routers/apiWarehouse.go @@ -945,6 +945,7 @@ func ApiWarehouse(r *gin.RouterGroup) { type FromList struct { Search string `json:"search"` ContainerID *uint `json:"container_id"` + Unstored bool `json:"unstored"` // 仅返回未入库(container_id IS NULL)的物品 Entries int `json:"entries"` Page int `json:"page"` } @@ -968,6 +969,8 @@ func ApiWarehouse(r *gin.RouterGroup) { } if from.ContainerID != nil { query = query.Where("container_id = ?", *from.ContainerID) + } else if from.Unstored { + query = query.Where("container_id IS NULL") } query.Count(&count) diff --git a/frontend/ops_vue_js/src/views/warehouse/WarehouseContainerDetail.vue b/frontend/ops_vue_js/src/views/warehouse/WarehouseContainerDetail.vue index 6108abc..eaf6f60 100644 --- a/frontend/ops_vue_js/src/views/warehouse/WarehouseContainerDetail.vue +++ b/frontend/ops_vue_js/src/views/warehouse/WarehouseContainerDetail.vue @@ -49,7 +49,7 @@ const notFound = ref(false) // ═══════════════════════════════════════════════════════ // 合并列表(子容器 + 物品,类似文件管理器) // ═══════════════════════════════════════════════════════ -const FETCH_LIMIT = 500 +const FETCH_LIMIT = 300 const subContainers = ref([]) const items = ref([]) diff --git a/frontend/ops_vue_js/src/views/warehouse/WarehouseOverview.vue b/frontend/ops_vue_js/src/views/warehouse/WarehouseOverview.vue index a883a49..139d046d 100644 --- a/frontend/ops_vue_js/src/views/warehouse/WarehouseOverview.vue +++ b/frontend/ops_vue_js/src/views/warehouse/WarehouseOverview.vue @@ -42,8 +42,8 @@ const stats = reactive({ // 在前端合并为统一的 entries 列表(容器在前、物品在后), // 共用一个搜索框 + 一个分页器。 -// 一次性向后端取的最大条数(足够覆盖大多数前端分页场景) -const FETCH_LIMIT = 500 +// 一次性向后端取的最大条数(后端上限 300) +const FETCH_LIMIT = 300 const containers = ref([]) // 原始容器列表 const items = ref([]) // 原始物品列表 @@ -102,6 +102,7 @@ async function fetchAll() { }), warehouseApi.getItems({ search: search.value.trim(), + unstored: true, entries: FETCH_LIMIT, page: 1, }), @@ -114,6 +115,8 @@ async function fetchAll() { containerTotal.value = 0 } if (iRes.errCode === 0) { + // 根目录类比文件管理器:只显示「未入库」的物品(unstored=true 由后端过滤); + // 已归入容器的物品在对应容器详情页里显示。 items.value = iRes.data.items ?? [] itemTotal.value = iRes.data.all_count ?? 0 } else {