From 78afb37e9d3170b4f13f43592a2c5be34eadc967 Mon Sep 17 00:00:00 2001 From: yinq Date: Mon, 20 Jan 2025 13:45:55 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E7=BB=93=E6=9E=84BOM=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/mes/baseStructureBom/index.vue | 52 +++++++++++++----------- 1 file changed, 29 insertions(+), 23 deletions(-) diff --git a/src/views/mes/baseStructureBom/index.vue b/src/views/mes/baseStructureBom/index.vue index 73bd219..fbce05c 100644 --- a/src/views/mes/baseStructureBom/index.vue +++ b/src/views/mes/baseStructureBom/index.vue @@ -131,7 +131,7 @@ check-strictly /> - + - - - + + + - - - - - - {{dict.label}} - - + + + + + + + + + + + + { } } -/* -/!*点击id同时赋值name*!/ -const handleMaterialTypeIdChange = (data: BaseMaterialTypeVO) =>{ - form.value.materialTypeName = data.matrialTypeName; - form.value.materialTypeId = data.matrialTypeId; -} +// 监控 form.materialTypeId 的变化 +watch(() => form.value.materialTypeId, (newValue) => { + // 从 baseMaterialTypeOptions 中查找对应的 materialTypeName + const selectedMaterial = baseMaterialTypeOptions.value.find( + (item) => item.matrialTypeId == newValue + ); + console.log("selectedMaterial:",newValue,selectedMaterial); + if (selectedMaterial) { + form.value.materialTypeName = selectedMaterial.matrialTypeName; + } else { + form.value.materialTypeName = undefined; + } +}); -*/ onMounted(() => { getList();