From 8f901e3f087768e162937e440eba00b3d81db98a Mon Sep 17 00:00:00 2001 From: DXC Date: Thu, 4 Jun 2026 13:27:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9F=BA=E7=A1=80=E4=BF=A1=E6=81=AF=E9=A1=B5?= =?UTF-8?q?=EF=BC=9A=E7=B1=BB=E5=88=AB=E2=86=92=E8=A7=84=E6=A0=BC=E5=9E=8B?= =?UTF-8?q?=E5=8F=B7=E8=87=AA=E5=8A=A8=E6=8F=90=E5=8F=96=E6=AD=A3=E5=88=99?= =?UTF-8?q?=E6=89=A9=E5=B1=95=E4=B8=BA=E6=94=AF=E6=8C=81=E5=AD=97=E6=AF=8D?= =?UTF-8?q?+=E6=95=B0=E5=AD=97=EF=BC=88=E5=A6=82=20Opt9=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- inventory-web/src/views/material/list.vue | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/inventory-web/src/views/material/list.vue b/inventory-web/src/views/material/list.vue index 546d5ce..09aa4e0 100644 --- a/inventory-web/src/views/material/list.vue +++ b/inventory-web/src/views/material/list.vue @@ -1034,18 +1034,19 @@ const onCategoryChange = () => { // 1) 收起下拉 categoryCascaderRef.value.togglePopperVisible(false); - // 2) 从末级节点 Label 提取英文字母后缀 (例如 "电子半成品HH" -> "HH"),写入规格型号 + // 2) 从末级节点 Label 末尾提取连续的英文字母/数字 (例如 "电子半成品HH" -> "HH", + // "ASD定标实验室Opt9" -> "Opt9"),写入规格型号。 // 仅在 @change 触发时赋一次值,用户可继续手动修改;未匹配到则保持原值 try { const nodes = categoryCascaderRef.value.getCheckedNodes?.() || []; const node = nodes[0]; const label: string = (node && node.label) || ''; - const match = label.match(/[a-zA-Z]+$/); + const match = label.match(/[a-zA-Z0-9]+$/); if (match) { form.value.spec = match[0]; } } catch (e) { - console.error('提取类别英文后缀失败', e); + console.error('提取类别编码后缀失败', e); } };