Commit 14700e8a authored by chicheng's avatar chicheng

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

parent 43b012ac
...@@ -372,8 +372,12 @@ export default { ...@@ -372,8 +372,12 @@ export default {
// 判断当前是否是第一个审批节点 // 判断当前是否是第一个审批节点
isFirstApprovalNode() { isFirstApprovalNode() {
const node = this.firstApprovalNode 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数据 // 获取第一条审批节点的opinion数据
firstApprovalOpinion() { firstApprovalOpinion() {
...@@ -421,6 +425,20 @@ export default { ...@@ -421,6 +425,20 @@ export default {
return null 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() { handlePicker() {
this.showPicker = this.flag this.showPicker = this.flag
}, },
...@@ -442,7 +460,13 @@ export default { ...@@ -442,7 +460,13 @@ export default {
initDetail() { initDetail() {
apiWantgoodsFindById(this.conditions).then(res => { apiWantgoodsFindById(this.conditions).then(res => {
res.data.pyear += '' res.data.pyear += ''
// 保存 taskId,避免被 res.data 覆盖
const savedTaskId = this.conditions.taskId
this.conditions = { ...this.conditions, ...res.data } 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.status = res.data.status
this.flowPath() this.flowPath()
for (const key in this.conditions) { 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