|
|
@@ -106,7 +106,13 @@
|
|
|
<!-- />-->
|
|
|
<!-- </el-form-item>-->
|
|
|
<el-form-item label="审核状态" prop="recheckStatus">
|
|
|
- <el-select v-model="queryParams.recheckStatus" placeholder="请选择审核状态" clearable class="!w-240px">
|
|
|
+ <el-select
|
|
|
+ v-model="queryParams.recheckStatus"
|
|
|
+ placeholder="请选择审核状态"
|
|
|
+ clearable
|
|
|
+ class="!w-240px"
|
|
|
+ @change="handleQuery"
|
|
|
+ >
|
|
|
<el-option label="全部" value="all" />
|
|
|
<el-option
|
|
|
v-for="(item, key) in PressureCheckerRecheckStatusMap"
|
|
|
@@ -171,17 +177,9 @@
|
|
|
</el-radio-group> -->
|
|
|
<el-table v-loading="loading" :data="list" :stripe="true" border>
|
|
|
<el-table-column label="任务单号" align="center" prop="orderNo" min-width="150px" />
|
|
|
- <el-table-column label="记录编号" align="center" prop="subReportNo" min-width="205px">
|
|
|
- <template #default="scope">
|
|
|
- <div class="report-number-cell">
|
|
|
- <span
|
|
|
- v-if="getReportTypeIcon(scope.row.reportType)"
|
|
|
- :class="getReportTypeIconClass(scope.row.reportType)"
|
|
|
- >
|
|
|
- {{ getReportTypeIcon(scope.row.reportType) }}
|
|
|
- </span>
|
|
|
- <span>{{ scope.row.subReportNo || '-' }}</span>
|
|
|
- </div>
|
|
|
+ <el-table-column label="记录编号" align="center" prop="reportNo" min-width="180px">
|
|
|
+ <template #default="{ row }">
|
|
|
+ {{ getRowReportNo(row) }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="设备注册代码" align="center" prop="equipCode" min-width="200px">
|
|
|
@@ -200,14 +198,26 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="单位名称" align="center" prop="unitName" min-width="200px" />
|
|
|
- <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;">{{ 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)">{{ getReportDisplayName(row, item.reportId, item.reportName) }}</el-row>
|
|
|
- </template>
|
|
|
+ <el-table-column label="待校核记录数量" align="center" prop="recheckCount" min-width="120px">
|
|
|
+ <template #default="{ row }">
|
|
|
+ <el-button
|
|
|
+ v-if="(row.recheckCount ?? 0) > 0"
|
|
|
+ link
|
|
|
+ type="primary"
|
|
|
+ @click="handleCheck(row, getFirstPendingReport(row))"
|
|
|
+ >
|
|
|
+ {{ row.recheckCount }}
|
|
|
+ </el-button>
|
|
|
+ <span v-else>0</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="检验项目" align="center" min-width="280px">
|
|
|
+ <template #default="{ row }">
|
|
|
+ <RecheckReportList
|
|
|
+ :row="row"
|
|
|
+ :recheck-status="queryParams.recheckStatus"
|
|
|
+ @check="(item) => handleCheck(row, item)"
|
|
|
+ />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="项目负责人" align="center" prop="manager" min-width="120px">
|
|
|
@@ -229,7 +239,7 @@
|
|
|
<div v-else>-</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="校核人" align="center" prop="dataEntry" min-width="120px">
|
|
|
+ <el-table-column label="校核人" align="center" prop="recheckName" min-width="120px">
|
|
|
<template #default="scope">
|
|
|
{{ scope.row.recheckName || '-' }}
|
|
|
</template>
|
|
|
@@ -239,17 +249,16 @@
|
|
|
{{ scope.row.workDays || '10' }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="状态" align="center" prop="recheckStatus" min-width="120px">
|
|
|
- <template #default="scope">
|
|
|
- <el-tag :type="getStatusTagType(scope.row.recheckStatus)">
|
|
|
- {{ PressureCheckerRecheckStatusMap[scope.row.recheckStatus] || '未知状态' }}
|
|
|
- </el-tag>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <!-- 退回原因 -->
|
|
|
- <el-table-column label="退回原因" align="center" prop="recheckReason" min-width="150px">
|
|
|
- <template #default="scope">
|
|
|
- {{ scope.row.recheckReason || '-' }}
|
|
|
+ <!-- 退回原因(按报告展示) -->
|
|
|
+ <el-table-column label="退回原因" align="center" prop="recheckReason" min-width="220px">
|
|
|
+ <template #default="{ row }">
|
|
|
+ <template v-if="getRejectedReports(row).length">
|
|
|
+ <div v-for="item in getRejectedReports(row)" :key="item.id" class="reject-reason-line">
|
|
|
+ <span class="reject-report-name">[{{ item.reportName }}]</span>
|
|
|
+ <span>{{ item.recheckReason || '-' }}</span>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <span v-else>-</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="提交时间" align="center" prop="submitTime" min-width="155px">
|
|
|
@@ -258,21 +267,21 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<!-- 操作 -->
|
|
|
- <el-table-column label="操作" align="center" min-width="150px" fixed="right">
|
|
|
+ <el-table-column label="操作" align="center" min-width="160px" fixed="right">
|
|
|
<template #default="scope">
|
|
|
<el-button
|
|
|
link
|
|
|
type="primary"
|
|
|
- @click="handleCheck(scope.row)"
|
|
|
- v-if="scope.row.recheckStatus === PressureCheckerRecheckStatus.AUDITING"
|
|
|
+ @click="handleCheck(scope.row, getFirstPendingReport(scope.row))"
|
|
|
+ v-if="hasPendingRecheck(scope.row)"
|
|
|
>
|
|
|
校核
|
|
|
</el-button>
|
|
|
<el-button
|
|
|
link
|
|
|
type="primary"
|
|
|
- @click="handleView(scope.row)"
|
|
|
- v-if="scope.row.recheckStatus !== PressureCheckerRecheckStatus.AUDITING"
|
|
|
+ @click="handleView(scope.row, getFirstReport(scope.row))"
|
|
|
+ v-else
|
|
|
>
|
|
|
详情
|
|
|
</el-button>
|
|
|
@@ -351,6 +360,7 @@
|
|
|
<script setup lang="ts">
|
|
|
import AuditCheckRecord from './AuditCheckRecord.vue'
|
|
|
import ReportRecordDialog from './components/ReportRecordDialog.vue'
|
|
|
+import RecheckReportList from './RecheckReportList.vue'
|
|
|
import { ref, reactive, onMounted, computed } from 'vue'
|
|
|
import { useMessage } from '@/hooks/web/useMessage'
|
|
|
import { BoilerTaskOrderApi } from '@/api/pressure2/boilertaskorder'
|
|
|
@@ -471,17 +481,59 @@ const auditApiParams = ref({})
|
|
|
const reportType = ref(0)
|
|
|
const pageType = ref('check')
|
|
|
const recheckInfo = ref({})
|
|
|
-const handleCheck = async (row: any) => {
|
|
|
- //测试先注释
|
|
|
- //if (!row.reportUrl) return ElMessage.warning('缺少记录文件地址,请联系管理员!')
|
|
|
+
|
|
|
+// 是否存在审核中/退回的报告(用于显示校核按钮)
|
|
|
+const hasPendingRecheck = (row: any): boolean => {
|
|
|
+ if (!row?.reportDOList || !row.reportDOList.length) return false
|
|
|
+ return row.reportDOList.some(
|
|
|
+ (r: any) =>
|
|
|
+ r.recheckStatus === PressureCheckerRecheckStatus.AUDITING ||
|
|
|
+ r.recheckStatus === PressureCheckerRecheckStatus.REJECTED
|
|
|
+ )
|
|
|
+}
|
|
|
+
|
|
|
+// 取第一个审核中/退回的报告(用于点击「校核」按钮默认打开)
|
|
|
+const getFirstPendingReport = (row: any): any => {
|
|
|
+ if (!row?.reportDOList || !row.reportDOList.length) return null
|
|
|
+ return (
|
|
|
+ row.reportDOList.find(
|
|
|
+ (r: any) =>
|
|
|
+ r.recheckStatus === PressureCheckerRecheckStatus.AUDITING ||
|
|
|
+ r.recheckStatus === PressureCheckerRecheckStatus.REJECTED
|
|
|
+ ) || row.reportDOList[0]
|
|
|
+ )
|
|
|
+}
|
|
|
+
|
|
|
+// 取第一个报告(用于点击「详情」按钮默认打开)
|
|
|
+const getFirstReport = (row: any): any => {
|
|
|
+ if (!row?.reportDOList || !row.reportDOList.length) return null
|
|
|
+ return row.reportDOList[0]
|
|
|
+}
|
|
|
+
|
|
|
+// 取所有退回的报告(用于退回原因列展示)
|
|
|
+const getRejectedReports = (row: any): any[] => {
|
|
|
+ if (!row?.reportDOList || !row.reportDOList.length) return []
|
|
|
+ return row.reportDOList.filter(
|
|
|
+ (r: any) => r.recheckStatus === PressureCheckerRecheckStatus.REJECTED
|
|
|
+ )
|
|
|
+}
|
|
|
+
|
|
|
+// 取该行报告编号(同一任务单设备下报告编号相同,取第一个)
|
|
|
+const getRowReportNo = (row: any): string => {
|
|
|
+ if (!row?.reportDOList || !row.reportDOList.length) return row?.reportNo || '-'
|
|
|
+ return row.reportDOList[0]?.reportNo || row?.reportNo || '-'
|
|
|
+}
|
|
|
+
|
|
|
+const handleCheck = async (row: any, item: any) => {
|
|
|
+ if (!item) item = getFirstPendingReport(row)
|
|
|
pageType.value = 'check'
|
|
|
showAuditCheckRecord.value = true
|
|
|
- reportUrl.value = row.reportUrl
|
|
|
- auditId.value = row.reportId
|
|
|
+ reportUrl.value = item?.reportUrl
|
|
|
+ auditId.value = item?.id
|
|
|
equipId.value = row.equipId
|
|
|
idValue.value = row.id
|
|
|
auditApiParams.value = {
|
|
|
- id: row.reportId
|
|
|
+ id: item?.id
|
|
|
}
|
|
|
// 从后端获取同一 orderItemId + 当前校核人 的所有待校核项(跨报告合并),不受分页影响
|
|
|
const relatedItems = await BoilerTaskOrderApi.getRecheckRelatedItems(row.id)
|
|
|
@@ -489,9 +541,7 @@ const handleCheck = async (row: any) => {
|
|
|
...row,
|
|
|
recheckList: relatedItems || []
|
|
|
}
|
|
|
- //console.log(row.reportType, !row.reportType ? 0 : Number(row.reportType))
|
|
|
- reportType.value = !row.reportType ? 0 : Number(row.reportType)
|
|
|
- console.log(equipId.value);
|
|
|
+ reportType.value = !item?.reportType ? 0 : Number(item.reportType)
|
|
|
}
|
|
|
|
|
|
// 审核详情页面关闭回调
|
|
|
@@ -501,30 +551,31 @@ const handleCloseAuditDetail = () => {
|
|
|
getList()
|
|
|
}
|
|
|
/** 查看详情 */
|
|
|
-const handleView = (row: any) => {
|
|
|
- // 根据实际需求实现详情查看功能
|
|
|
+const handleView = (row: any, item: any) => {
|
|
|
+ if (!item) item = getFirstReport(row)
|
|
|
pageType.value = 'detail'
|
|
|
showAuditCheckRecord.value = true
|
|
|
- reportUrl.value = row.reportUrl
|
|
|
- auditId.value = row.reportId
|
|
|
+ reportUrl.value = item?.reportUrl
|
|
|
+ auditId.value = item?.id
|
|
|
equipId.value = row.equipId
|
|
|
idValue.value = row.id
|
|
|
auditApiParams.value = {
|
|
|
- id: row.reportId
|
|
|
+ id: item?.id
|
|
|
}
|
|
|
- reportType.value = row.reportType
|
|
|
- // message.info('详情查看功能待实现')
|
|
|
+ reportType.value = !item?.reportType ? 0 : Number(item.reportType)
|
|
|
}
|
|
|
|
|
|
/** 流转记录对话框状态 */
|
|
|
const showRecordDialog = ref(false)
|
|
|
const selectedRecordItem = ref<any>(null)
|
|
|
|
|
|
-// 显示流转记录
|
|
|
+// 显示流转记录(查看该行所有报告的流转记录)
|
|
|
const handleShowRecord = (row: any) => {
|
|
|
+ const reportIds = (row?.reportDOList || []).map((r: any) => r.id).filter(Boolean)
|
|
|
selectedRecordItem.value = {
|
|
|
...row,
|
|
|
- id: row.reportId || row.id
|
|
|
+ id: reportIds[0] || row.id,
|
|
|
+ reportIds
|
|
|
}
|
|
|
showRecordDialog.value = true
|
|
|
}
|
|
|
@@ -655,23 +706,6 @@ 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()
|
|
|
@@ -698,38 +732,13 @@ onMounted(() => {
|
|
|
display: none !important;
|
|
|
}
|
|
|
|
|
|
-.report-number-cell {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- gap: 8px;
|
|
|
- justify-content: center;
|
|
|
-
|
|
|
- .report-type-icon {
|
|
|
- display: inline-flex;
|
|
|
- align-items: center;
|
|
|
- justify-content: center;
|
|
|
- width: 20px;
|
|
|
- height: 20px;
|
|
|
- background-color: var(--el-color-primary);
|
|
|
- color: white;
|
|
|
- border-radius: 3px;
|
|
|
- font-size: 12px;
|
|
|
- font-weight: bold;
|
|
|
- flex-shrink: 0;
|
|
|
-
|
|
|
- &.main {
|
|
|
- background-color: var(--el-color-primary); // 主报告使用系统primary颜色
|
|
|
- }
|
|
|
- &.sub {
|
|
|
- background-color: var(--el-color-primary); // 主报告使用系统primary颜色
|
|
|
- }
|
|
|
-
|
|
|
- &.single {
|
|
|
- background-color: #e6a23c; // 独审报告使用橙色
|
|
|
- }
|
|
|
- &.subcontract {
|
|
|
- background-color: #afadf6; // 分包项目使用蓝色
|
|
|
- }
|
|
|
+.reject-reason-line {
|
|
|
+ line-height: 1.6;
|
|
|
+ text-align: left;
|
|
|
+
|
|
|
+ .reject-report-name {
|
|
|
+ color: #909399;
|
|
|
+ margin-right: 4px;
|
|
|
}
|
|
|
}
|
|
|
</style>
|