|
|
@@ -181,15 +181,20 @@
|
|
|
<template #status="scope">
|
|
|
<span>{{ STATUS_LABEL[scope.row.status] || '-' }}</span>
|
|
|
</template>
|
|
|
+ <template #qualifiedItemNum="scope">
|
|
|
+ <span>{{ formatRecordItemNumDisplay(scope.row.qualifiedItemNum, scope.row.status) }}</span>
|
|
|
+ </template>
|
|
|
<template #unqualifiedItemNum="scope">
|
|
|
<el-button
|
|
|
+ v-if="isNonZeroUnqualifiedCount(scope.row.unqualifiedItemNum, scope.row.status)"
|
|
|
type="primary"
|
|
|
link
|
|
|
size="small"
|
|
|
- @click="openUnqualifiedDialog(scope.row)"
|
|
|
+ @click.stop="openUnqualifiedDialog(scope.row)"
|
|
|
>
|
|
|
- {{ scope.row.unqualifiedItemNum ?? 0 }}
|
|
|
+ {{ Number(scope.row.unqualifiedItemNum) }}
|
|
|
</el-button>
|
|
|
+ <span v-else>{{ formatRecordItemNumDisplay(scope.row.unqualifiedItemNum, scope.row.status) }}</span>
|
|
|
</template>
|
|
|
<template #sign="scope">
|
|
|
<template v-if="scope.row.checkedPersonSign.length">
|
|
|
@@ -679,6 +684,27 @@
|
|
|
const router = useRouter();
|
|
|
const route = useRoute();
|
|
|
|
|
|
+ /**
|
|
|
+ * 合格/不合格项数展示:status=1(待检查)时空或 0 显示「-」;其余状态显示数字(含 0)
|
|
|
+ */
|
|
|
+ function formatRecordItemNumDisplay(v: unknown, status: unknown) {
|
|
|
+ const isPending = Number(status) === 1;
|
|
|
+ const n = v === null || v === undefined || v === '' ? NaN : Number(v);
|
|
|
+ if (isPending) {
|
|
|
+ if (v === null || v === undefined || v === '' || Number.isNaN(n) || n === 0) return '-';
|
|
|
+ return String(n);
|
|
|
+ }
|
|
|
+ if (v === null || v === undefined || v === '') return '0';
|
|
|
+ if (Number.isNaN(n)) return '0';
|
|
|
+ return String(n);
|
|
|
+ }
|
|
|
+
|
|
|
+ /** 不合格项数为-不展示弹框 */
|
|
|
+ function isNonZeroUnqualifiedCount(v: unknown, status: unknown) {
|
|
|
+ if (Number(status) === 1 && !v) return false;
|
|
|
+ return true
|
|
|
+ }
|
|
|
+
|
|
|
const operate = computed(() => (route.query.operate as string) || 'area-check-plan-create');
|
|
|
const currentId = computed(() => Number(route.query.id));
|
|
|
const isCreateMode = computed(() => operate.value === 'area-check-plan-create');
|
|
|
@@ -1056,7 +1082,7 @@
|
|
|
{ label: '检查场所类别', prop: 'checkPlaceCategory', minWidth: '160px' },
|
|
|
{ label: '检查场所', prop: 'checkPlace', minWidth: '160px' },
|
|
|
{ label: '检查项总数', prop: 'checkItemTotal', align: 'center', width: '160px' },
|
|
|
- { label: '合格项数', prop: 'qualifiedItemNum', align: 'center', width: '120px' },
|
|
|
+ { label: '合格项数', prop: 'qualifiedItemNum', slot: 'qualifiedItemNum', align: 'center', width: '120px' },
|
|
|
{ label: '不合格项数', prop: 'unqualifiedItemNum', slot: 'unqualifiedItemNum', align: 'center', width: '180px' },
|
|
|
{ label: '整体检查情况描述', prop: 'overallCheckDesc', minWidth: '180px', showOverflowTooltip: true },
|
|
|
{ label: '被检查人签字', slot: 'sign', align: 'center', width: '200px' },
|