<el-table :data="form.acceptanceMattersList" stripe style="width: 100%">
<el-table-column prop="jointType" label="联合验收项目" align="center">
<template slot-scope="scope">
{{ getDictLabel(jointAcceptanceProject, scope.row.jointType) }}
</template>
</el-table-column>
</el-table>
// 获取字典标签
getDictLabel(dictList, value) {
if (!dictList || !value) return '';
const item = dictList.find(item => item.dictValue === value);
return item ? item.dictLabel : value; // 找不到则返回原值
},
// 字典加载完成后初始化验收事项
if (!this.form.acceptanceMattersList || this.form.acceptanceMattersList.length === 0) {
this.form.acceptanceMattersList = this.getDefaultAcceptanceMatters();
}
getDefaultAcceptanceMatters() {
// 使用字典数据创建默认验收事项
return this.jointAcceptanceProject.map(item => ({
jointType: item.dictValue,
lhysxm: '',
ysyj: '',
cllb: '',
fkbm: ''
}));
},