|
|
@@ -81,15 +81,14 @@
|
|
|
</template>
|
|
|
<template #checkItemTotal="scope">
|
|
|
<span>{{
|
|
|
- scope.row.checkItemTotal ? scope.row.checkItemTotal+'项' : '-'
|
|
|
+ scope.row.checkItemTotal ?? 0
|
|
|
}}</span>
|
|
|
</template>
|
|
|
<template #qualifiedItemNum="scope">
|
|
|
- <span>{{ scope.row.qualifiedItemNum ? scope.row.qualifiedItemNum+'项' : '-' }}</span>
|
|
|
+ <span>{{ scope.row.qualifiedItemNum ?? 0 }}</span>
|
|
|
</template>
|
|
|
<template #unqualifiedItemNum="scope">
|
|
|
- <span style="color:#1777ff;" v-if="scope.row.unqualifiedItemNum" @click="openUnqualifiedDialog(scope.row)">{{ scope.row.unqualifiedItemNum+'项'}}</span>
|
|
|
- <span v-else>-</span>
|
|
|
+ <span style="color:#1777ff;cursor: pointer;" @click="openUnqualifiedDialog(scope.row)">{{ scope.row.unqualifiedItemNum ?? 0}}</span>
|
|
|
</template>
|
|
|
<template #action="scope">
|
|
|
<div class="action-container--div" style="justify-content: flex-start">
|
|
|
@@ -244,7 +243,7 @@
|
|
|
<el-cascader
|
|
|
ref="reviewDeptRef"
|
|
|
v-model="sandHiddenDangerFormDataDept.reviewDepartmentId"
|
|
|
- :options="issueDeptTree"
|
|
|
+ :options="deptTree"
|
|
|
:props="cascaderDeptProp"
|
|
|
:show-all-levels="false"
|
|
|
placeholder="请选择复查人员所属部门"
|
|
|
@@ -544,6 +543,7 @@
|
|
|
{ label: '室内外停车场', value: '室内外停车场' },
|
|
|
];
|
|
|
getTableData();
|
|
|
+ loadDeptAndUserOptionsDept();
|
|
|
onIssueDialogOpen();
|
|
|
});
|
|
|
|
|
|
@@ -614,7 +614,8 @@
|
|
|
);
|
|
|
const issueDeptTree = ref<DeptTree[]>([]);
|
|
|
const issueUserList = ref<Array<{ id: number; realname?: string; username?: string }>>([]);
|
|
|
- // 部门树与用户下拉:与 onIssueDialogOpen 中加载的 issueDeptTree 同源(整改/复查/举一反三共用)
|
|
|
+// 复用部门树与用户下拉,用于复查部门/人员 & 举一反三责任部门
|
|
|
+ const deptTree = ref<DeptTree[]>([]);
|
|
|
const cascaderDeptProp = {
|
|
|
checkStrictly: true,
|
|
|
expandTrigger: 'hover' as const,
|
|
|
@@ -625,7 +626,7 @@
|
|
|
const drawLessonsDeptIdsArrayDept = ref<number[]>([]);
|
|
|
const reviewUserListDept = ref<Array<{ id: number; realname?: string; username?: string }>>([]);
|
|
|
|
|
|
- const deptOptions = computed(() => flattenDeptTree(issueDeptTree.value));
|
|
|
+ const deptOptions = computed(() => flattenDeptTree(deptTree.value));
|
|
|
const flattenDeptTree = (nodes: DeptTree[] | undefined): Array<{ id: number; deptName: string }> => {
|
|
|
if (!nodes?.length) return [];
|
|
|
const list: Array<{ id: number; deptName: string }> = [];
|
|
|
@@ -638,6 +639,21 @@
|
|
|
walk(nodes);
|
|
|
return list;
|
|
|
}
|
|
|
+ const loadDeptAndUserOptionsDept = async () => {
|
|
|
+ try {
|
|
|
+ const [deptRes, userRes] = await Promise.all([
|
|
|
+ getAllDepartments(),
|
|
|
+ queryAvailableUserList({ pageNumber: 1, pageSize: 9999, queryParam: {} }),
|
|
|
+ ]);
|
|
|
+ const fullTree = (deptRes as DeptTree[]) ?? [];
|
|
|
+ deptTree.value = Array.isArray(fullTree) && fullTree[0]?.children ? fullTree[0].children : [];
|
|
|
+ reviewUserListDept.value = (userRes as any)?.records ?? [];
|
|
|
+ } catch (e) {
|
|
|
+ console.error('获取部门/用户列表失败:', e);
|
|
|
+ deptTree.value = [];
|
|
|
+ reviewUserListDept.value = [];
|
|
|
+ }
|
|
|
+ };
|
|
|
const openUnqualifiedDialog = (row: { id?: number } & Record<string, unknown>) => {
|
|
|
if (!row.id) return;
|
|
|
currentRecordIdForUnqualified.value = Number(row.id);
|