From 242d933c62adf57abc573b15c16199ee19fc207e Mon Sep 17 00:00:00 2001 From: hwj Date: Tue, 21 Apr 2026 09:51:13 +0800 Subject: [PATCH] =?UTF-8?q?style=EF=BC=9A=E7=94=9F=E4=BA=A7=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8-=E5=9F=BA=E7=A1=80=E4=BF=A1=E6=81=AF-=E6=9F=A5?= =?UTF-8?q?=E7=9C=8B=E4=BA=A7=E5=93=81=E4=BF=A1=E6=81=AF=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/ProductInfoDialog.vue | 56 ++++++++++--------- .../components/ProductionReportBasicInfo.vue | 4 +- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/src/views/mes/productionReport/components/ProductInfoDialog.vue b/src/views/mes/productionReport/components/ProductInfoDialog.vue index 5713912b..2826fd88 100644 --- a/src/views/mes/productionReport/components/ProductInfoDialog.vue +++ b/src/views/mes/productionReport/components/ProductInfoDialog.vue @@ -1,20 +1,17 @@ @@ -26,29 +23,34 @@ defineOptions({ name: 'ProductInfoDialog' }) const dialogVisible = ref(false) const loading = ref(false) -const productList = ref([]) +const materialList = ref([]) +const productInfo = ref({}) -const open = async (productId: number) => { +const open = async (row: any) => { dialogVisible.value = true + productInfo.value = row || {} loading.value = true try { - const data = await BomApi.getBomByProductId(productId) - productList.value = data || [] + const data = await BomApi.getBomByProductId(row.productId) + materialList.value = data || [] } catch (error) { - console.error('Failed to fetch product info:', error) - productList.value = [] + console.error('Failed to fetch material list:', error) + materialList.value = [] } finally { loading.value = false } } const handleClose = () => { - productList.value = [] + materialList.value = [] + productInfo.value = {} } -defineExpose({ - open -}) +defineExpose({ open }) - + diff --git a/src/views/mes/productionReport/components/ProductionReportBasicInfo.vue b/src/views/mes/productionReport/components/ProductionReportBasicInfo.vue index 0e937ce1..eb83aa11 100644 --- a/src/views/mes/productionReport/components/ProductionReportBasicInfo.vue +++ b/src/views/mes/productionReport/components/ProductionReportBasicInfo.vue @@ -72,9 +72,7 @@ watch( /** 打开产品信息对话框 */ const openProductInfo = (row: any) => { - if (row?.productId) { - productInfoDialogRef.value?.open(row.productId) - } + productInfoDialogRef.value?.open(row) }