更新工序相关逻辑,改用部件类型字典 `product_process_type`,并调整界面显示和数据格式化以兼容新字段名
| | |
| | | import { |
| | | qualityTestStandardListPage |
| | | } from '@/api/qualityManagement/metricMaintenance.js' |
| | | import { productProcessListPage } from '@/api/basicData/productProcess.js' |
| | | import { |
| | | qualityTestStandardBindingList, |
| | | qualityTestStandardBindingAdd, |
| | |
| | | } from '@/api/qualityManagement/qualityTestStandardBinding.js' |
| | | |
| | | const { proxy } = getCurrentInstance() |
| | | |
| | | // 部件类型字典:用于列表回显 |
| | | const { product_process_type } = proxy.useDict('product_process_type') |
| | | |
| | | // 左侧标准列表:整行内容居中(配合样式) |
| | | const rowClassNameCenter = () => 'row-center' |
| | |
| | | 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' }, |
| | |
| | | } |
| | | }, |
| | | { |
| | | 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 |
| | | } |
| | | }, |
| | | { |
| | |
| | | |
| | | onMounted(() => { |
| | | getStandardList() |
| | | getProcessList() |
| | | }) |
| | | </script> |
| | | |
| | |
| | | <el-option label="出厂检验" value="2" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="部件" prop="processId"> |
| | | <el-select v-model="form.processId" placeholder="请选择部件" style="width: 100%"> |
| | | <el-form-item label="部件类型" prop="processId"> |
| | | <el-select v-model="form.processId" placeholder="请选择部件类型" style="width: 100%"> |
| | | <el-option |
| | | v-for="item in processOptions" |
| | | :key="item.value" |
| | |
| | | } |
| | | }, |
| | | { |
| | | label: '工序', |
| | | label: '部件类型', |
| | | prop: 'processId', |
| | | align: 'center', |
| | | dataType: 'tag', |
| | |
| | | <el-form :model="form" label-width="140px" label-position="top" :rules="rules" ref="formRef"> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="部件:" prop="process"> |
| | | <el-select v-model="form.process" placeholder="请选择部件" clearable :disabled="processQuantityDisabled" style="width: 100%"> |
| | | <el-form-item label="部件类型:" prop="process"> |
| | | <el-select v-model="form.process" placeholder="请选择部件类型" clearable :disabled="processQuantityDisabled" style="width: 100%"> |
| | | <el-option v-for="item in processList" :key="item.id" :label="item.name" :value="item.id"/> |
| | | </el-select> |
| | | </el-form-item> |
| | |
| | | <div class="app-container"> |
| | | <div class="search_form"> |
| | | <div> |
| | | <span class="search_title">工序:</span> |
| | | <span class="search_title">部件类型:</span> |
| | | <el-input |
| | | v-model="searchForm.process" |
| | | style="width: 240px" |
| | | placeholder="请输入工序搜索" |
| | | placeholder="请输入部件类型搜索" |
| | | @change="handleQuery" |
| | | clearable |
| | | :prefix-icon="Search" |
| | |
| | | width: 120 |
| | | }, |
| | | { |
| | | label: "工序", |
| | | label: "部件类型", |
| | | prop: "process", |
| | | width: 230 |
| | | width: 230, |
| | | formatData: (params) => { |
| | | const dictItems = product_process_type?.value || [] |
| | | const hit = dictItems.find(i => String(i.value) === String(params)) |
| | | return hit?.label || params |
| | | } |
| | | }, |
| | | { |
| | | label: "检验员", |
| | |
| | | const inspectionFormDia = ref() |
| | | const { proxy } = getCurrentInstance() |
| | | const userStore = useUserStore() |
| | | // 部件类型字典(value -> label) |
| | | const { product_process_type } = proxy.useDict('product_process_type') |
| | | const changeDaterange = (value) => { |
| | | searchForm.value.entryDateStart = undefined; |
| | | searchForm.value.entryDateEnd = undefined; |