240 检查项目设置-》检查部位:服务范围字段下拉选项取值错误

This commit is contained in:
Ranyunqiao
2026-03-19 10:11:02 +08:00
parent 0a8428a4ca
commit 6ed41eb513

View File

@@ -534,19 +534,19 @@
{{ item.number || '999999' }} {{ item.number || '999999' }}
</template> </template>
</td> </td>
<td> <td>
<template v-if="item.editing"> <template v-if="item.editing">
<el-select v-model="item.checkType" placeholder="选择检查类型" style="width: 100%"> <el-select v-model="item.serviceScope" placeholder="选择服务范围" style="width: 100%">
<el-option <el-option
v-for="opt in checkTypeOptionsForMethodPart" v-for="opt in serviceScopeDicts"
:key="opt.value" :key="opt.dictValue"
:label="opt.label" :label="opt.dictLabel"
:value="opt.value" :value="opt.dictValue"
/> />
</el-select> </el-select>
</template> </template>
<template v-else> <template v-else>
{{ getCheckTypeLabelForMethodPart(item.checkType) || '' }} {{ getServiceScopeLabel(item.serviceScope) || '' }}
</template> </template>
</td> </td>
<td> <td>
@@ -667,6 +667,8 @@ const checkTypeOptions = ref([]);
const inspectionTypeDicts = ref([]); const inspectionTypeDicts = ref([]);
// 完整的服务范围字典数据 // 完整的服务范围字典数据
const serviceScopeDicts = ref([]); const serviceScopeDicts = ref([]);
// 服务范围下拉选项
const serviceScopeOptions = ref([]);
const checkMethods = ref([]); const checkMethods = ref([]);
// 根据字典值获取检查类型标签 // 根据字典值获取检查类型标签
@@ -926,6 +928,11 @@ onMounted(async () => {
inspectionTypeDicts.value = []; inspectionTypeDicts.value = [];
} }
// 获取服务范围字典
const scopeRes = await getDicts('scope_of_services');
serviceScopeDicts.value = scopeRes?.data || [];
// 从检查类型维护页面获取检查类型数据,用于检查方法和检查部位的下拉选项 // 从检查类型维护页面获取检查类型数据,用于检查方法和检查部位的下拉选项
await loadCheckTypeOptionsForMethodPart(); await loadCheckTypeOptionsForMethodPart();