Commit 6856999f authored by chicheng's avatar chicheng

要货审批通用页面调整(考虑分流要货)

parent 97b9b88f
......@@ -365,17 +365,20 @@ export default {
isReadonly() {
return false
},
// 查找第一个审批节点(排除发起人节点和分流审批节点)
firstApprovalNode() {
return this.findFirstApprovalNode()
},
// 判断当前是否是第一个审批节点
isFirstApprovalNode() {
if (this.tablePathData.length > 1 && this.tablePathData[1].statusId === 'executing') {
return true
}
return false
const node = this.firstApprovalNode
// 判断找到的节点是否为执行中状态
return node && node.statusId === 'executing'
},
// 获取第一条审批节点的opinion数据
firstApprovalOpinion() {
if (this.tablePathData.length > 1) {
return this.tablePathData[1].opinion || ''
}
return ''
const node = this.firstApprovalNode
return node ? (node.opinion || '') : ''
}
},
created() {
......@@ -388,6 +391,36 @@ export default {
}
},
methods: {
/**
* 查找第一个审批节点
* 排除规则:
* 1. 排除第一个节点(发起人节点,索引0)
* 2. 如果第二个节点的 subProcUnitId === 'shunt',也排除(分流审批)
* @returns {Object|null} 第一个审批节点,如果不存在则返回 null
*/
findFirstApprovalNode() {
const data = this.tablePathData
if (!data || data.length === 0) {
return null
}
// 从索引1开始查找(排除第一个节点,发起人节点)
let startIndex = 1
// 如果第二个节点是分流审批(subProcUnitId === 'shunt'),也排除
if (data.length > 1 && data[1].subProcUnitId === 'shunt') {
startIndex = 2
}
// 从 startIndex 开始查找第一个审批节点
for (let i = startIndex; i < data.length; i++) {
const node = data[i]
// 返回找到的第一个节点
return node
}
return null
},
handlePicker() {
this.showPicker = this.flag
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment