Commit 14700e8a authored by chicheng's avatar chicheng

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

parent 43b012ac
......@@ -372,8 +372,12 @@ export default {
// 判断当前是否是第一个审批节点
isFirstApprovalNode() {
const node = this.firstApprovalNode
const currNode = this.findCurrApprovalNode()
if (currNode == null || node == null) {
return false
}
// 判断找到的节点是否为执行中状态
return node && node.statusId === 'executing'
return node.subProcUnitName === currNode.subProcUnitName
},
// 获取第一条审批节点的opinion数据
firstApprovalOpinion() {
......@@ -421,6 +425,20 @@ export default {
return null
},
// 查找当前审批节点
findCurrApprovalNode() {
const data = this.tablePathData
if (!Array.isArray(data) || data.length === 0) {
return null
}
for (let i = 1; i < data.length; i++) {
const node = data[i]
if (node.statusId === 'executing' || node.statusId === 'ready') {
return node
}
}
return null
},
handlePicker() {
this.showPicker = this.flag
},
......@@ -442,7 +460,13 @@ export default {
initDetail() {
apiWantgoodsFindById(this.conditions).then(res => {
res.data.pyear += ''
// 保存 taskId,避免被 res.data 覆盖
const savedTaskId = this.conditions.taskId
this.conditions = { ...this.conditions, ...res.data }
// 如果 res.data 中没有 taskId 或 taskId 为空,则恢复保存的值
if (!this.conditions.taskId && savedTaskId) {
this.conditions.taskId = savedTaskId
}
this.status = res.data.status
this.flowPath()
for (const key in this.conditions) {
......
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