| | |
| | | qualityTestStandardParamUpdate, |
| | | qualityTestStandardParamDel |
| | | } from '@/api/qualityManagement/metricMaintenance.js' |
| | | import { productProcessListPage } from '@/api/basicData/productProcess.js' |
| | | import StandardFormDialog from './StandardFormDialog.vue' |
| | | import ParamFormDialog from './ParamFormDialog.vue' |
| | | |
| | |
| | | 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) |
| | | } |
| | | } |
| | | // 工序下拉:来源于字典 product_process_type |
| | | const { product_process_type } = proxy.useDict('product_process_type') |
| | | const processOptions = computed(() => { |
| | | return (product_process_type?.value || []).map(item => ({ |
| | | label: item.label, |
| | | value: item.value |
| | | })) |
| | | }) |
| | | |
| | | // 当前选中的标准 & 右侧详情 |
| | | const currentStandard = ref(null) |
| | |
| | | } |
| | | }, |
| | | { |
| | | label: '工序', |
| | | label: '部件类型', |
| | | prop: 'processId', |
| | | align: 'center', |
| | | dataType: 'tag', |
| | |
| | | current: page.current, |
| | | size: page.size |
| | | } |
| | | // processType:字典 product_process_type 的 value |
| | | // 兼容:如果后端仍接受 processId,这里两者都会带上 |
| | | params.processType = params.processId |
| | | qualityTestStandardListPage(params) |
| | | .then((res) => { |
| | | const records = res?.data?.records || [] |
| | |
| | | |
| | | const handleSelectionChange = (selection) => { |
| | | selectedRows.value = selection |
| | | |
| | | if (!selection.length) { |
| | | currentStandard.value = null |
| | | detailTableData.value = [] |
| | | return |
| | | } |
| | | |
| | | const nextStandard = selection[selection.length - 1] |
| | | if (currentStandard.value?.id === nextStandard.id) return |
| | | |
| | | currentStandard.value = nextStandard |
| | | loadDetail(nextStandard.id) |
| | | } |
| | | |
| | | // 批量审核:状态 1=批准,2=撤销 |
| | |
| | | |
| | | const submitStandardForm = () => { |
| | | const payload = { ...standardForm.value } |
| | | // processType:字典 product_process_type 的 value |
| | | payload.processType = payload.processId |
| | | const isEdit = standardOperationType.value === 'edit' |
| | | if (isEdit) { |
| | | qualityTestStandardUpdate(payload).then(() => { |
| | |
| | | } |
| | | |
| | | onMounted(() => { |
| | | getProcessList() |
| | | getStandardList() |
| | | }) |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .metric-maintenance { |
| | | padding: 0; |
| | | min-width: 0; |
| | | } |
| | | |
| | | .metric-maintenance-row { |
| | | width: 100%; |
| | | } |
| | |
| | | width: 100%; |
| | | margin-top: 4px; |
| | | } |
| | | </style> |
| | | </style> |