diff --git a/src/views/hazard/audit/index.vue b/src/views/hazard/audit/index.vue
index 4562650..00a540e 100644
--- a/src/views/hazard/audit/index.vue
+++ b/src/views/hazard/audit/index.vue
@@ -31,21 +31,47 @@
:closable="false"
show-icon
class="route-alert"
- style="grid-column: 1 / -1;"
/>
-
-
-
+
+
+
+
+
+
+
+ 加载中…
+
+
+ {{ item.taskName || '—' }}
+
+ 办理人:{{ item.assigneeName }}
+ 候选办理:{{ item.candidate }}
+ 接收时间:{{ formatTime(item.createTime) }}
+ 处理时间:{{ formatTime(item.finishTime) }}
+ 耗时:{{ item.duration }}
+
+
+
+
+ 暂无流转记录
+
+
+
@@ -64,6 +90,7 @@ import {
updateHazardReport,
uploadHazardAttachment
} from '@/api/hazard/audit'
+import { flowRecord } from '@/api/flowable/finished'
export default {
name: 'HazardAudit',
@@ -77,7 +104,9 @@ export default {
report: {},
taskId: '',
attachments: [],
- estimatedPoints: null
+ estimatedPoints: null,
+ flowRecordList: [],
+ flowRecordLoading: false
}
},
computed: {
@@ -111,6 +140,8 @@ export default {
this.taskId = ''
this.attachments = []
this.estimatedPoints = null
+ this.flowRecordList = []
+ this.flowRecordLoading = false
},
async loadPage() {
this.loading = true
@@ -129,6 +160,7 @@ export default {
this.$set(this.report, 'canApprove', true)
}
await this.resolveCurrentTask()
+ this.loadFlowRecord()
this.loaded = true
} catch (error) {
this.loadError = '隐患详情或附件加载失败,请稍后重试。'
@@ -172,6 +204,26 @@ export default {
visit(data)
return tasks
},
+ loadFlowRecord() {
+ const procInsId = this.report.flowInstanceId
+ if (!procInsId) {
+ this.flowRecordList = []
+ return
+ }
+ this.flowRecordLoading = true
+ // 仅传流程实例 ID:携带 deployId 时后端会因“未配置流程表单”返回 500。
+ flowRecord({ procInsId }).then(response => {
+ const data = response.data || {}
+ this.flowRecordList = Array.isArray(data.flowList) ? data.flowList : []
+ }).catch(() => {
+ this.flowRecordList = []
+ }).finally(() => {
+ this.flowRecordLoading = false
+ })
+ },
+ formatTime(value) {
+ return value ? String(value).replace('T', ' ').slice(0, 19) : '—'
+ },
handleAttachmentUpload(payload) {
uploadHazardAttachment(payload.file, payload.attachmentType).then(response => {
const data = response.data
@@ -241,16 +293,23 @@ export default {
.hazard-audit-page { min-height: calc(100vh - 52px); padding: 16px 20px 40px; background: #f0f2f5; }
.page-header { margin-bottom: 14px; padding: 14px 18px; border-radius: 8px; background: #fff; }
.route-alert { margin-bottom: 14px; }
-.audit-content { display: grid; grid-template-columns: minmax(330px, 1.05fr) minmax(540px, 1.9fr) minmax(280px, .9fr); align-items: start; gap: 14px; min-height: 280px; }
+.audit-content { min-height: 280px; }
+.audit-grid { display: grid; grid-template-columns: minmax(330px, 1.05fr) minmax(540px, 1.9fr) minmax(280px, .9fr); align-items: start; gap: 14px; }
+.audit-side { display: flex; flex-direction: column; gap: 14px; }
+.card-header { font-weight: 600; }
+.flow-node { margin: 0 0 6px; font-weight: 600; color: #303133; }
+.flow-meta { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 12px; color: #909399; }
+.flow-comment { margin-top: 6px; font-size: 12px; color: #606266; word-break: break-word; }
+.flow-record-empty { font-size: 12px; color: #909399; }
::v-deep .audit-card { margin: 0; border: 0; border-radius: 8px; }
::v-deep .audit-card > .el-card__header { padding: 16px; border-bottom-color: #ebeef5; }
::v-deep .audit-card > .el-card__body { padding: 16px; }
@media (max-width: 1450px) {
- .audit-content { grid-template-columns: minmax(300px, 1fr) minmax(500px, 1.6fr); }
- .audit-content > :last-child { grid-column: 1 / -1; }
+ .audit-grid { grid-template-columns: minmax(300px, 1fr) minmax(500px, 1.6fr); }
+ .audit-grid > :last-child { grid-column: 1 / -1; }
}
@media (max-width: 980px) {
- .audit-content { grid-template-columns: 1fr; }
- .audit-content > :last-child { grid-column: auto; }
+ .audit-grid { grid-template-columns: 1fr; }
+ .audit-grid > :last-child { grid-column: auto; }
}
diff --git a/src/views/hazard/ledger/index.vue b/src/views/hazard/ledger/index.vue
index 31ea39f..c951af9 100644
--- a/src/views/hazard/ledger/index.vue
+++ b/src/views/hazard/ledger/index.vue
@@ -174,6 +174,24 @@
暂无附件
+
+
审核流程
+
+
+
+ {{ node.taskName || '—' }}
+
+
+ 办理人:{{ node.assigneeName }}
+ 待办理
+ {{ formatTime(node.createTime) }}
+
+
+
+
+
暂无流程信息
+
+
@@ -232,24 +250,27 @@
/* global MyConfig */
import { getMyFactoryDepartment, listFactoryDepartments } from '@/api/system/dept'
import { listHazardLedger, getHazardLedgerDetail, listHazardLedgerAttachments, retryHazardSync, getHazardImportAction, downloadHazardImportTemplate } from '@/api/hazard/ledger'
+import { flowRecord } from '@/api/flowable/finished'
import { getToken } from '@/utils/auth'
export default {
name: 'HazardLedger',
- data() { return { loading: false, detailLoading: false, detailVisible: false, ledgerList: [], total: 0, unitOptions: [], currentFactory: null, attachments: [], detail: null, importUpload: { open: false, mode: 'excel', isUploading: false, headers: { Authorization: 'Bearer ' + getToken() }, action: getHazardImportAction('excel') }, queryParams: { pageNum: 1, pageSize: 10, status: undefined, unitId: undefined, hazardName: undefined }, statusOptions: [{ label: '待提交', value: 'draft' }, { label: '审核中', value: 'reviewing' }, { label: '整改中', value: 'rectifying' }, { label: '已通过', value: 'approved' }, { label: '已驳回', value: 'rejected' }], basicFields: [{ label: '单位', key: 'unitName' }, { label: '所属部门', key: 'departmentName', fallback: 'factoryDeptName' }, { label: '上报人', key: 'reporterName' }, { label: '隐患分类', key: 'hazardCategoryName', fallback: 'hazardCategory' }, { label: '隐患类型', key: 'hazardTypeName', fallback: 'hazardType' }, { label: '隐患来源', key: 'sourceTypeName', fallback: 'sourceType' }, { label: '专业', key: 'majorName', fallback: 'major' }, { label: '风险分析单元', key: 'riskUnit' }, { label: '风险分析对象', key: 'riskTarget' }, { label: '发现时间', key: 'discoverTime', time: true }, { label: '创建时间', key: 'createTime', time: true }, { label: '更新人', key: 'updateBy' }], flowFields: [{ label: '治理类型', key: 'governanceTypeName', fallback: 'governanceType' }, { label: '整改负责人', key: 'chargePersonName' }, { label: '限定完成时间', key: 'limitedCompleteTime', time: true }, { label: '实际完成时间', key: 'actualCompleteTime', time: true }, { label: '奖励积分', key: 'pointsAwarded', suffix: ' 分' }, { label: '积分状态', key: 'pointsStatusName', fallback: 'pointsStatus' }, { label: '平台同步', key: 'pushStatusName', fallback: 'pushStatus' }, { label: '同步时间', key: 'pushTime', time: true }, { label: '第三方记录', key: 'thirdPartyId' }, { label: '流程状态', key: 'flowStatus' }, { label: '审核人', key: 'auditUserNameName', fallback: 'auditUserName' }, { label: '审核时间', key: 'auditTime', time: true }], textFields: [{ label: '隐患描述', key: 'description' }, { label: '原因分析', key: 'causeAnalysis' }, { label: '整改方案', key: 'rectificationPlan' }, { label: '防范措施', key: 'preventiveMeasures' }, { label: '审核意见', key: 'auditRemark' }, { label: '备注', key: 'remark' }] } },
+ data() { return { loading: false, detailLoading: false, detailVisible: false, ledgerList: [], total: 0, unitOptions: [], currentFactory: null, attachments: [], detail: null, flowNodes: [], flowLoading: false, importUpload: { open: false, mode: 'excel', isUploading: false, headers: { Authorization: 'Bearer ' + getToken() }, action: getHazardImportAction('excel') }, queryParams: { pageNum: 1, pageSize: 10, status: undefined, unitId: undefined, hazardName: undefined }, statusOptions: [{ label: '待提交', value: 'draft' }, { label: '审核中', value: 'reviewing' }, { label: '整改中', value: 'rectifying' }, { label: '已通过', value: 'approved' }, { label: '已驳回', value: 'rejected' }], basicFields: [{ label: '单位', key: 'unitName' }, { label: '所属部门', key: 'departmentName', fallback: 'factoryDeptName' }, { label: '上报人', key: 'reporterName' }, { label: '隐患分类', key: 'hazardCategoryName', fallback: 'hazardCategory' }, { label: '隐患类型', key: 'hazardTypeName', fallback: 'hazardType' }, { label: '隐患来源', key: 'sourceTypeName', fallback: 'sourceType' }, { label: '专业', key: 'majorName', fallback: 'major' }, { label: '风险分析单元', key: 'riskUnit' }, { label: '风险分析对象', key: 'riskTarget' }, { label: '发现时间', key: 'discoverTime', time: true }, { label: '创建时间', key: 'createTime', time: true }, { label: '更新人', key: 'updateBy' }], flowFields: [{ label: '治理类型', key: 'governanceTypeName', fallback: 'governanceType' }, { label: '整改负责人', key: 'chargePersonName' }, { label: '限定完成时间', key: 'limitedCompleteTime', time: true }, { label: '实际完成时间', key: 'actualCompleteTime', time: true }, { label: '奖励积分', key: 'pointsAwarded', suffix: ' 分' }, { label: '积分状态', key: 'pointsStatusName', fallback: 'pointsStatus' }, { label: '平台同步', key: 'pushStatusName', fallback: 'pushStatus' }, { label: '同步时间', key: 'pushTime', time: true }, { label: '第三方记录', key: 'thirdPartyId' }, { label: '流程状态', key: 'flowStatus' }, { label: '审核人', key: 'auditUserNameName', fallback: 'auditUserName' }, { label: '审核时间', key: 'auditTime', time: true }], textFields: [{ label: '隐患描述', key: 'description' }, { label: '原因分析', key: 'causeAnalysis' }, { label: '整改方案', key: 'rectificationPlan' }, { label: '防范措施', key: 'preventiveMeasures' }, { label: '审核意见', key: 'auditRemark' }, { label: '备注', key: 'remark' }] } },
computed: {
isSuperAdmin() { return (this.$store.getters.roles || []).indexOf('admin') !== -1 },
summary() { return this.ledgerList.reduce((result, row) => { const status = this.statusKey(row); if (status === 'draft') result.draft++; else if (status === 'reviewing') result.reviewing++; else if (status === 'rectifying') result.rectifying++; else if (status === 'approved') result.approved++; else if (status === 'rejected') result.rejected++; return result }, { draft: 0, reviewing: 0, rectifying: 0, approved: 0, rejected: 0 }) },
imageAttachments() { return this.attachments.filter(item => this.isImageAttachment(item)) },
otherAttachments() { return this.attachments.filter(item => !this.isImageAttachment(item)) },
- previewUrls() { return this.imageAttachments.map(item => this.attachmentUrl(item)).filter(Boolean) }
+ previewUrls() { return this.imageAttachments.map(item => this.attachmentUrl(item)).filter(Boolean) },
+ flowActiveIndex() { return this.flowNodes.filter(node => node.finishTime).length }
},
created() { this.getUnits().finally(() => this.getList()) },
methods: {
getList() { this.loading = true; listHazardLedger(this.queryParams).then(response => { const page = response.data || response; this.ledgerList = page.list || page.rows || []; this.total = Number(page.total || page.totalCount || this.ledgerList.length) }).catch(() => { this.ledgerList = []; this.total = 0; this.$modal.msgError('隐患台账加载失败,请检查后端服务和登录状态') }).finally(() => { this.loading = false }) },
getUnits() { const request = this.isSuperAdmin ? listFactoryDepartments() : getMyFactoryDepartment(); return request.then(response => { const data = response.data || response; if (this.isSuperAdmin) { this.unitOptions = Array.isArray(data) ? data : (data && (data.list || data.rows)) || []; return } this.currentFactory = data || null; if (this.currentFactory) { this.queryParams.unitId = this.factoryId(this.currentFactory) } }).catch(() => { this.unitOptions = []; this.currentFactory = null }) }, factoryId(item) { const value = item && (item.deptId !== undefined ? item.deptId : item.id); return value === undefined || value === null ? '' : String(value) }, factoryName(item) { return (item && (item.deptName || item.label || item.name)) || '' },
handleQuery() { this.queryParams.pageNum = 1; this.getList() }, resetQuery() { this.$refs.queryForm.resetFields(); this.queryParams.pageNum = 1; this.getList() },
- openDetail(row) { this.detailVisible = true; this.detail = null; this.attachments = []; this.detailLoading = true; Promise.all([getHazardLedgerDetail(row.id), listHazardLedgerAttachments(row.id)]).then(results => { this.detail = results[0].data || results[0]; const data = results[1].data || results[1]; this.attachments = Array.isArray(data) ? data : [] }).catch(() => { this.$modal.msgError('隐患详情加载失败') }).finally(() => { this.detailLoading = false }) },
+ openDetail(row) { this.detailVisible = true; this.detail = null; this.attachments = []; this.flowNodes = []; this.detailLoading = true; this.loadFlowNodes(row.flowInstanceId); Promise.all([getHazardLedgerDetail(row.id), listHazardLedgerAttachments(row.id)]).then(results => { this.detail = results[0].data || results[0]; const data = results[1].data || results[1]; this.attachments = Array.isArray(data) ? data : [] }).catch(() => { this.$modal.msgError('隐患详情加载失败') }).finally(() => { this.detailLoading = false }) },
+ loadFlowNodes(procInsId) { if (!procInsId) { this.flowNodes = []; return } this.flowLoading = true; flowRecord({ procInsId: String(procInsId) }).then(response => { const data = response.data || {}; this.flowNodes = Array.isArray(data.flowList) ? data.flowList : [] }).catch(() => { this.flowNodes = [] }).finally(() => { this.flowLoading = false }) },
goAudit(row) { const query = { id: String(row.id) }; if (row.canApprove === true || String(row.canApprove) === 'true') query.canApprove = '1'; if (row.flowInstanceId) query.flowInstanceId = String(row.flowInstanceId); this.detailVisible = false; this.$router.push({ path: '/hazard/audit/detail', query }) },
handleRetrySync(row) { this.$confirm('确认重试将该隐患同步到生产运营平台吗?', '重试同步', { type: 'warning' }).then(() => retryHazardSync(row.id)).then(() => { this.$modal.msgSuccess('同步重试成功'); this.getList() }).catch(error => { if (error !== 'cancel') this.$modal.msgError(error.message || '同步重试失败') }) },
handleImport() { this.importUpload.mode = 'excel'; this.importUpload.action = getHazardImportAction('excel'); this.importUpload.isUploading = false; this.importUpload.open = true },
@@ -381,10 +402,28 @@ export default {
.detail-section,
.text-section,
-.attachment-section {
+.attachment-section,
+.flow-section {
margin-top: 16px;
}
+.flow-steps {
+ min-height: 44px;
+ padding: 6px 4px;
+ border: 1px solid #ebeef5;
+ border-radius: 6px;
+ background: #fbfbfd;
+}
+
+.flow-steps .step-desc {
+ display: flex;
+ flex-direction: column;
+ gap: 2px;
+ font-size: 12px;
+ color: #909399;
+ line-height: 1.5;
+}
+
.section-title {
margin-bottom: 8px;
color: #5a5a72;