From e5aced11100ffd999b67dd0292cd5e9a662029d6 Mon Sep 17 00:00:00 2001
From: yyb <995253665@qq.com>
Date: 星期四, 30 四月 2026 13:17:21 +0800
Subject: [PATCH] 更新工序相关逻辑,改用部件类型字典 `product_process_type`,并调整界面显示和数据格式化以兼容新字段名
---
src/views/qualityManagement/metricBinding/index.vue | 32 +++++++-------------------------
1 files changed, 7 insertions(+), 25 deletions(-)
diff --git a/src/views/qualityManagement/metricBinding/index.vue b/src/views/qualityManagement/metricBinding/index.vue
index 1ac268a..19c7551 100644
--- a/src/views/qualityManagement/metricBinding/index.vue
+++ b/src/views/qualityManagement/metricBinding/index.vue
@@ -158,7 +158,6 @@
import {
qualityTestStandardListPage
} from '@/api/qualityManagement/metricMaintenance.js'
-import { productProcessListPage } from '@/api/basicData/productProcess.js'
import {
qualityTestStandardBindingList,
qualityTestStandardBindingAdd,
@@ -166,6 +165,9 @@
} from '@/api/qualityManagement/qualityTestStandardBinding.js'
const { proxy } = getCurrentInstance()
+
+// 閮ㄤ欢绫诲瀷瀛楀吀锛氱敤浜庡垪琛ㄥ洖鏄�
+const { product_process_type } = proxy.useDict('product_process_type')
// 宸︿晶鏍囧噯鍒楄〃锛氭暣琛屽唴瀹瑰眳涓紙閰嶅悎鏍峰紡锛�
const rowClassNameCenter = () => 'row-center'
@@ -185,24 +187,6 @@
const tableLoading = ref(false)
const page = reactive({ current: 1, size: 10, total: 0 })
-// 宸ュ簭涓嬫媺锛堢敤浜庡垪琛ㄥ洖鏄撅級
-const processOptions = ref([])
-
-const getProcessList = async () => {
- try {
- const res = await productProcessListPage({ current: 1, size: 1000 })
- if (res?.code === 200) {
- const records = res?.data?.records || []
- processOptions.value = records.map((item) => ({
- label: item.processName || item.name || item.label,
- value: item.id || item.processId || item.value
- }))
- }
- } catch (error) {
- console.error('鑾峰彇宸ュ簭鍒楄〃澶辫触:', error)
- }
-}
-
const standardColumns = ref([
{ label: '鏍囧噯缂栧彿', prop: 'standardNo', dataType: 'slot', slot: 'standardNoCell', minWidth: 160, align: 'center', headerSlot: 'standardNoHeader' },
{ label: '鏍囧噯鍚嶇О', prop: 'standardName', minWidth: 180, align: 'center', headerSlot: 'standardNameHeader' },
@@ -218,15 +202,14 @@
}
},
{
- label: '宸ュ簭',
+ label: '閮ㄤ欢绫诲瀷',
prop: 'processId',
align: 'center',
dataType: 'tag',
formatData: (val) => {
- const target = processOptions.value.find(
- (item) => String(item.value) === String(val)
- )
- return target?.label || val
+ const dictItems = product_process_type?.value || []
+ const hit = dictItems.find(i => String(i.value) === String(val))
+ return hit?.label || val
}
},
{
@@ -427,7 +410,6 @@
onMounted(() => {
getStandardList()
- getProcessList()
})
</script>
--
Gitblit v1.9.3