|
|
@@ -203,10 +203,10 @@
|
|
|
<el-table-column label="检验项目" align="center" prop="reportName" min-width="150px">
|
|
|
<template #default="{row}">
|
|
|
<template v-if="!row.recheckList || !row.recheckList?.length">
|
|
|
- <el-row style="justify-content: center;">{{ row.reportName }}</el-row>
|
|
|
+ <el-row style="justify-content: center;">{{ getReportDisplayName(row, row.reportId, row.reportName) }}</el-row>
|
|
|
</template>
|
|
|
<template v-else>
|
|
|
- <el-row style="justify-content: center;" v-for="item in row.recheckList" :key="JSON.stringify(item)">{{ item.reportName }}</el-row>
|
|
|
+ <el-row style="justify-content: center;" v-for="item in row.recheckList" :key="JSON.stringify(item)">{{ getReportDisplayName(row, item.reportId, item.reportName) }}</el-row>
|
|
|
</template>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
@@ -655,6 +655,23 @@ const getReportTypeIcon = (reportType) => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+// 获取检验项目显示名称(电站锅炉内检有部件的项目,名称前加"部件名-")
|
|
|
+const getReportDisplayName = (row: any, reportId: string, reportName: string): string => {
|
|
|
+ // 优先使用子报告自身的 partName,其次使用 row 的 partName
|
|
|
+ let partName = ''
|
|
|
+ if (row?.recheckList && row.recheckList.length) {
|
|
|
+ const item = row.recheckList.find((r: any) => r.reportId === reportId)
|
|
|
+ partName = item?.partName || ''
|
|
|
+ }
|
|
|
+ if (!partName) {
|
|
|
+ partName = row?.partName || ''
|
|
|
+ }
|
|
|
+ if (partName) {
|
|
|
+ return `${partName}-${reportName || ''}`
|
|
|
+ }
|
|
|
+ return reportName || ''
|
|
|
+}
|
|
|
+
|
|
|
watch(() => route.path, async () => {
|
|
|
if (route.path === '/gljy/record-check/boiler') {
|
|
|
await getList()
|