|
|
|
|
@ -200,14 +200,13 @@
@@ -200,14 +200,13 @@
|
|
|
|
|
<div class="flow-section"> |
|
|
|
|
<div class="section-title">审核流程</div> |
|
|
|
|
<div v-loading="flowLoading" class="flow-steps"> |
|
|
|
|
<el-steps v-if="flowNodes.length" :active="flowActiveIndex" align-center finish-status="success"> |
|
|
|
|
<el-step v-for="(node, index) in flowNodes" :key="index"> |
|
|
|
|
<template slot="title">{{ node.taskName || '—' }}</template> |
|
|
|
|
<el-steps v-if="flowSteps.length" :active="flowActiveIndex" align-center finish-status="success"> |
|
|
|
|
<el-step v-for="(step, index) in flowSteps" :key="index"> |
|
|
|
|
<template slot="title">{{ step.title }}</template> |
|
|
|
|
<template slot="description"> |
|
|
|
|
<div class="step-desc"> |
|
|
|
|
<span v-if="node.assigneeName">办理人:{{ node.assigneeName }}</span> |
|
|
|
|
<span v-else-if="node.candidate">待办理</span> |
|
|
|
|
<span>{{ formatTime(node.createTime) }}</span> |
|
|
|
|
<span>{{ step.meta }}</span> |
|
|
|
|
<span v-if="step.time">{{ formatTime(step.time) }}</span> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
</el-step> |
|
|
|
|
@ -286,7 +285,34 @@ export default {
@@ -286,7 +285,34 @@ export default {
|
|
|
|
|
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) }, |
|
|
|
|
flowActiveIndex() { return this.flowNodes.filter(node => node.finishTime).length } |
|
|
|
|
// 审核流程步骤。flowRecord 返回的是「最新在前」的用户任务,且每个节点同时带 |
|
|
|
|
// createTime(进入该节点的时间,等于上一环节办结时间)和 finishTime(本环节实际审核时间), |
|
|
|
|
// 页面必须用 finishTime。这里统一整理成「左→右 = 上报 → 各审批环节 → 结束」的正序步骤; |
|
|
|
|
// 未办结的节点不显示时间,避免把上一环节的时间显示成本环节的审核时间。 |
|
|
|
|
// el-steps 的 active 语义是「前 N 个已完成」,所以正序后待办节点之后的步骤才会显示为未完成。 |
|
|
|
|
flowSteps() { |
|
|
|
|
const report = this.detail || {} |
|
|
|
|
const tasks = Array.isArray(this.flowNodes) ? this.flowNodes.slice().reverse() : [] |
|
|
|
|
const steps = tasks.map(node => ({ |
|
|
|
|
title: node.taskName || '—', |
|
|
|
|
meta: node.finishTime ? `办理人:${node.assigneeName || '—'}` : '待办理', |
|
|
|
|
time: node.finishTime || '', |
|
|
|
|
finished: Boolean(node.finishTime) |
|
|
|
|
})) |
|
|
|
|
// 流程记录只含审批环节,不含发起环节,用隐患记录的上报人/上报时间补齐最左侧节点 |
|
|
|
|
if (report.reporterName || report.createTime) { |
|
|
|
|
steps.unshift({ title: '隐患上报', meta: `上报人:${report.reporterName || '—'}`, time: report.createTime || '', finished: true }) |
|
|
|
|
} |
|
|
|
|
// 所有环节都已办结时补一个结束节点,让流程有明确的最终节点 |
|
|
|
|
if (tasks.length && tasks.every(node => node.finishTime)) { |
|
|
|
|
steps.push({ title: '流程结束', meta: '已结束', time: '', finished: true }) |
|
|
|
|
} |
|
|
|
|
return steps |
|
|
|
|
}, |
|
|
|
|
flowActiveIndex() { |
|
|
|
|
const pendingIndex = this.flowSteps.findIndex(step => !step.finished) |
|
|
|
|
return pendingIndex === -1 ? this.flowSteps.length : pendingIndex |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
created() { this.getUnits().finally(() => this.getList()) }, |
|
|
|
|
methods: { |
|
|
|
|
|