fix:修改bug

This commit is contained in:
大黑 2025-12-25 10:21:01 +08:00
parent 82499cf1fa
commit f280a779b3
7 changed files with 712 additions and 370 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -134,7 +134,7 @@
<div class="node-user">
{{ node.userName || '--' }}
<span class="node-time">
{{ formatTime(node.time) }}
{{ formatTime(node.operateTime) }}
</span>
</div>
</div>
@ -209,7 +209,9 @@ export default {
data() {
return {
changeTable: [],
progress: [],
progress: [], //
flowNodes: [], //
progressDetailData: {}, //
detailOption: '',
flowStatus: '',
changeTableTotal: 0,
@ -232,6 +234,16 @@ export default {
},
computed: {
progressDetail() {
// 使使
if (this.progressDetailData && Object.keys(this.progressDetailData).length > 0) {
return {
progressTitle: this.progressDetailData.progressTitle || '',
contentName: this.progressDetailData.contentName || '',
templateVersion: this.progressDetailData.templateVersion || '',
explanation: this.progressDetailData.explanation || '',
description: this.progressDetailData.explanation || this.progressDetailData.description || ''
}
}
const defaultDetail = {
approvalNumber: '',
modelName: '',
@ -265,22 +277,92 @@ export default {
nodes.push({
title: '提交申请',
userName: this.detail.username,
time: this.detail.createdTime,
operateTime: this.detail.createdTime,
result: 'INITIATE',
status: 'INITIATE',
opinion: this.initiateNode.opinion || this.initiateNode.remark || this.initiateNode.comment || null
})
}
//
if (this.progress && this.progress.length > 0) {
// 使 flowNodes
if (this.flowNodes && this.flowNodes.length > 0) {
// nodeOrder
const sortedNodes = [...this.flowNodes].sort((a, b) => {
const orderA = a.nodeOrder !== undefined && a.nodeOrder !== null ? Number(a.nodeOrder) : 0
const orderB = b.nodeOrder !== undefined && b.nodeOrder !== null ? Number(b.nodeOrder) : 0
return orderA - orderB
})
// REJECT
const rejectIndex = sortedNodes.findIndex((node) => node.result === 'REJECT')
let processedNodes = sortedNodes
if (rejectIndex !== -1) {
// REJECT
processedNodes = sortedNodes.slice(0, rejectIndex + 1)
} else {
// REJECT result "" APPROVING
const stayIndex = processedNodes.findIndex((node) => node.result === '待审批')
if (stayIndex !== -1) {
processedNodes = processedNodes.map((node, index) => {
if (index === stayIndex) {
return {
...node,
result: 'APPROVING'
}
}
return node
})
}
}
// 线
processedNodes.forEach((node) => {
let result = 'APPROVING'
let status = 'APPROVING'
if (node.result) {
if (node.result === 'REJECT') {
result = 'REJECT'
status = 'REJECT'
} else if (node.result === 'APPROVING') {
result = 'APPROVING'
status = 'APPROVING'
} else if (node.result === 'PASS') {
result = 'PASS'
status = 'PASS'
} else if (node.result === '待审批') {
result = 'STAY'
status = 'STAY'
}
}
// opinions
const opinion = node.opinions && Array.isArray(node.opinions) && node.opinions.length > 0
? node.opinions[0]
: null
// 使 todoUserName使 undoUserName
const userName = node.todoUserName || node.undoUserName || '--'
nodes.push({
title: node.node || '审批节点',
userName: userName,
operateTime: node.approvalTime || '',
result: result,
status: status,
opinion: opinion
})
})
} else if (this.progress && this.progress.length > 0) {
// flowNodes使 progress
this.progress.forEach((stage) => {
if (stage.steps && stage.steps.length > 0) {
stage.steps.forEach((step) => {
nodes.push({
title: stage.title || '审批节点',
userName: step.userName,
time: step.approvalTime || step.handleTime || step.createTime,
operateTime: step.approvalTime || step.handleTime || step.createTime,
result: step.result || step.status,
status: step.result || step.status,
opinion: step.opinion || step.remark || step.comment || null
@ -375,6 +457,9 @@ export default {
return classMap[result] || 'status-default'
},
getApprovalSpet() {
if (!this.detail || !this.detail.flowId) {
return
}
const request = {
...api.GET_PPROVAL_ALL,
params: {
@ -383,15 +468,28 @@ export default {
},
disableSuccessMsg: true
}
this.$request(request).asyncThen((resp) => {
this.$request(request)
.asyncThen((resp) => {
console.log('审批流程数据:', resp)
this.flowStatus = resp.data?.flowStatus
//
this.detailOption = resp.data?.explanation || resp.data?.description || ''
let list = []
const data = resp.data || resp
//
this.flowStatus = data.flowStatus || ''
//
this.progressDetailData = {
explanation: data.explanation || '',
flowStatus: data.flowStatus || '',
progressTitle: data.progressTitle || '',
templateVersion: data.templateVersion || '',
contentName: data.contentName || ''
}
//
this.detailOption = data.explanation || data.description || ''
//
this.flowNodes = data.flowNodes || []
// flowNodes使
if (!this.flowNodes || this.flowNodes.length === 0) {
let list = []
//
if (data.proofreadNodes && Array.isArray(data.proofreadNodes) && data.proofreadNodes.length > 0) {
const steps = data.proofreadNodes
@ -447,7 +545,13 @@ export default {
}
this.progress = list
console.log('处理后的流程数据:', this.progress)
console.log('处理后的流程数据(兼容模式):', this.progress)
}
})
.asyncErrorCatch((err) => {
console.error('获取审批流程数据失败:', err)
this.flowNodes = []
this.progressDetailData = {}
})
},
getApprovalChange() {

View File

@ -1286,6 +1286,12 @@ export default {
// section
if (nodeInfo.isParent) {
const sectionData = data[sectionName] || []
// sectionName "/"
// sectionName
if (sectionName === nodeInfo.label) {
hasMatch = true
} else {
// section
const hasDataInSubsystem = sectionData.some(
(param) => param.subsystemName === nodeInfo.label
)
@ -1294,6 +1300,7 @@ export default {
}
}
}
}
})
return hasMatch
},

View File

@ -1127,7 +1127,6 @@ export default {
return formatted
}
return data.map((node) => formatNode(node))
},
//