From 709aeefedaa25d72ba45f4354e73d473d347dcb6 Mon Sep 17 00:00:00 2001 From: yueli Date: Fri, 11 Sep 2026 14:29:13 +0800 Subject: [PATCH] =?UTF-8?q?feat(stocktake):=20=E6=B4=BB=E8=B7=83=E5=A4=A9?= =?UTF-8?q?=E6=95=B0=E5=8F=AF=E7=BC=96=E8=BE=91=EF=BC=88=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=2090=20=E5=A4=A9=EF=BC=89=E5=B9=B6=E8=A1=A5=E5=85=85=E5=8B=BE?= =?UTF-8?q?=E9=80=89=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 把写死的 30 天改为响应式 recommendDays(默认 90,范围 1~365), 界面上是一个 el-input-number;【获取推荐】按 ?days=&top_n= 动态传参,不再固定 30。 - 推荐条数默认由 50 调整为 10(与「前 N 个」的实际使用节奏一致)。 - el-tree 上方加一行灰色小字提示: 「💡 提示:勾选父级货架,将自动涵盖其下属的所有末级库位及库存。」 对应已确认的决策——保持 el-tree 原生级联、后端精确匹配, 勾父节点时其全部子孙 full_path 都会进入提交范围,故提示属实。 已确认的两项决策(本轮无代码改动,记录备查): - 不使用 check-strictly,保留原生级联;右侧计数已足以提示规模 - 后端保持精确匹配,不做前缀匹配 --- .../src/views/stock/stocktake/index.vue | 34 +++++++++++++++---- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/inventory-web/src/views/stock/stocktake/index.vue b/inventory-web/src/views/stock/stocktake/index.vue index 92088d2..43d4034 100644 --- a/inventory-web/src/views/stock/stocktake/index.vue +++ b/inventory-web/src/views/stock/stocktake/index.vue @@ -98,7 +98,16 @@
- 近 {{ RECOMMEND_DAYS }} 天最活跃的前 + + + 天最活跃的前
+
+ 💡 提示:勾选父级货架,将自动涵盖其下属的所有末级库位及库存。 +
(m ? MODE_LABELS[m] || m : '') const scopeLabel = (s?: string | null) => (s ? SCOPE_LABELS[s] || s : '') // ★ 抽盘范围:系统推荐 + 人工在库位树上微调 -const RECOMMEND_DAYS = 30 -const recTopN = ref(50) // 推荐「近 N 天最活跃的前 X 个库位」中的 X +const recommendDays = ref(90) // 推荐「近 N 天最活跃的前 X 个库位」中的 N(可编辑) +const recTopN = ref(10) // 同上,X const recLoading = ref(false) // 获取推荐中 const treeLoading = ref(false) // 库位树加载中 const locTreeData = ref([]) // 库位树(已按当前公司前缀过滤) @@ -825,11 +837,11 @@ const fetchRecommendLocations = async () => { const res: any = await request({ url: '/v1/inbound/stock/stocktake/recommend-locations', method: 'get', - params: withCompany({ days: RECOMMEND_DAYS, top_n: recTopN.value }) + params: withCompany({ days: recommendDays.value, top_n: recTopN.value }) }) const locs: string[] = res?.data?.locations || [] if (!locs.length) { - ElMessage.warning(`最近 ${RECOMMEND_DAYS} 天没有找到活跃库位`) + ElMessage.warning(`最近 ${recommendDays.value} 天没有找到活跃库位`) return } @@ -860,7 +872,7 @@ const buildScopeConfig = () => { const nodes = locTreeRef.value?.getCheckedNodes() || [] return { locations: nodes.map((n: any) => n.full_path).filter(Boolean), - recommend_days: RECOMMEND_DAYS, + recommend_days: recommendDays.value, recommend_top_n: recTopN.value } } @@ -1868,7 +1880,15 @@ const goToVarianceReview = () => { margin-bottom: 8px; } .scope-recommend-text { font-size: 12px; color: #606266; } -.scope-topn-input { width: 100px; } +.scope-topn-input { width: 96px; } +.scope-days-input { width: 96px; } +/* 操作提示:柔和的灰色小字 */ +.scope-hint { + font-size: 12px; + color: #909399; + line-height: 1.5; + margin-bottom: 6px; +} /* 左右双栏:左 60% 库位树 | 右 40% 已选明细 */ .scope-columns {