From 7f54923acf8a6c86a7d276d0a2f01bb6faba6039 Mon Sep 17 00:00:00 2001 From: wuzilong <704541015@qq.com> Date: Thu, 12 Nov 2026 19:23:25 +0800 Subject: [PATCH] feat(web-admin): add maintain-cert action on document reminder list Co-authored-by: Cursor --- .../views/pl/inventory/document-reminder.vue | 70 ++++++++++++++++++- 1 file changed, 68 insertions(+), 2 deletions(-) diff --git a/web-admin/src/views/pl/inventory/document-reminder.vue b/web-admin/src/views/pl/inventory/document-reminder.vue index a49c8c42b..64c4ddd12 100644 --- a/web-admin/src/views/pl/inventory/document-reminder.vue +++ b/web-admin/src/views/pl/inventory/document-reminder.vue @@ -219,6 +219,18 @@ min-width="160" show-overflow-tooltip /> + + +
@@ -238,8 +250,21 @@ import ListQuickSearchInput from '@/components/business/list-quick-search-input/ import ColumnHeaderFilter from '@/components/business/column-header-filter/index.vue' import ListToolbarEndActions from '@/components/business/list-toolbar-end-actions/index.vue' import ListExportDropdown from '@/components/business/list-export-dropdown/index.vue' -import { CircleCheck, Filter } from '@element-plus/icons-vue' -import { inventoryApi, type DocumentReminder } from '@/api/pl' +import { CircleCheck, Filter, EditPen } from '@element-plus/icons-vue' +import { + inventoryApi, + vehicleApi, + personnelApi, + type DocumentReminder, + type VehicleDetail, + type PersonnelDetail +} from '@/api/pl' +import { useRouter } from 'vue-router' +import { pickBxData } from '@/utils/http/bx' +import { + resolveDocumentReminderEditPath, + DOCUMENT_REMINDER_JUMP_UNSUPPORTED +} from '@/utils/pl-document-reminder-jump' import { usePersistedListColumns } from '@/composables/usePersistedListColumns' import { useServerColumnFilters } from '@/composables/useServerColumnFilters' import { useColumnSort } from '@/composables/useColumnSort' @@ -330,6 +355,9 @@ const { tableHeight, recalc: recalcTableHeight } = useListTableViewportHeight({ tableRef: docReminderTableRef }) +const router = useRouter() +const maintainLoadingId = ref(null) + const loading = ref(false) const resolveLoading = ref(false) const reminderList = ref([]) @@ -445,6 +473,44 @@ function handleToolbarResolve() { handleResolve(selectedRow.value) } +async function handleMaintainCert(row: DocumentReminder) { + const ownerId = String(row.ownerId || '').trim() + const ownerType = String(row.ownerType || '').trim() + if (!ownerId || !ownerType) { + ElMessage.warning('缺少主体信息,无法跳转维护') + return + } + maintainLoadingId.value = row.id + try { + let path: string | null = null + if (ownerType === 'vehicle') { + const res = await vehicleApi.get(ownerId) + const detail = pickBxData(res) || (res as any)?.data || res + const vehicleType = String((detail as VehicleDetail)?.vehicleType || '') + path = resolveDocumentReminderEditPath({ ownerType, vehicleType }) + } else if (ownerType === 'personnel') { + const res = await personnelApi.get(ownerId) + const detail = pickBxData(res) || (res as any)?.data || res + const personnelAffiliation = String( + (detail as PersonnelDetail)?.personnelAffiliation || '' + ) + path = resolveDocumentReminderEditPath({ ownerType, personnelAffiliation }) + } else { + ElMessage.warning(DOCUMENT_REMINDER_JUMP_UNSUPPORTED) + return + } + if (!path) { + ElMessage.warning(DOCUMENT_REMINDER_JUMP_UNSUPPORTED) + return + } + await router.push({ path, query: { editId: ownerId } }) + } catch { + ElMessage.error('无法打开主体档案,请确认数据存在且有权限') + } finally { + maintainLoadingId.value = null + } +} + onMounted(() => { fetchData() nextTick(() => recalcTableHeight())