Commit 06107e61 by Joey

feat(@gms/gms-plugin-billexpand): 驳回单据审批轨迹显示被驳回流程

parent 948b88d9
......@@ -17,11 +17,11 @@
:inner="true"
:mask="false"
>
<div v-if="!data || !data.steps">暂无数据</div>
<div v-if="data && data.steps" class="workflow-step-wrapper">
<div v-if="!data || data.length == 0">暂无数据</div>
<div v-if="data && data.length" class="workflow-step-wrapper">
<div
class="workflow-step"
v-for="step, k in data.steps"
v-for="step, k in data"
:key="k"
>
<div class="step-head">
......@@ -39,7 +39,7 @@
<use v-else-if="step.result == -2" xlink:href="#icon-a-24_BILLEXPAND_C_RBC_moduanjiedian"></use>
</svg>
</div>
<div :class="`step-line ${step.state === 2 ? 'finish-line' : 'waiting-line'}`" v-if="k != data.steps.length - 1"></div>
<div :class="`step-line ${step.state === 2 ? 'finish-line' : 'waiting-line'}`" v-if="k != data.length - 1"></div>
</div>
<div class="step-main">
<div class="main-body">
......@@ -165,44 +165,58 @@ export default {
bizObjId: this.context.bill.getMasterData().getValue('id'),
},
}).then((res) => {
const formatTrack = (curTrack) => {
if (!curTrack) return []
curTrack.steps.push({
title: "提交申请",
state: 2,
createTime: curTrack.startTime,
completeTime: curTrack.startTime,
comments: null,
result: -1,
actualOwner: curTrack.submitter,
})
// 审批流程结束贴一个结束节点
if (curTrack.procState === 2) {
curTrack.steps.unshift({
state: curTrack.procState,
createTime: curTrack.finishTime,
completeTime: curTrack.finishTime,
result: -2,
})
}
// 否则从当前节点切断,
else {
for (let i = 0; i < curTrack.steps.length - 1; ++i) {
if (curTrack.steps[i].state === 1 && curTrack.steps[i + 1].state === 2) {
curTrack.steps = curTrack.steps.slice(i)
break
}
}
}
return curTrack.steps || []
}
res = res || []
let count = 0
this.data = res[0]
for (let o of res) {
if (o.procState == 1) {
this.data = o
;++count
}
}
if (count > 1) {
this.$Message.error('工作流数据异常')
}
if (!this.data) return
this.data.steps.push({
title: "提交申请",
state: 2,
createTime: this.data.startTime,
completeTime: this.data.startTime,
comments: null,
result: -1,
actualOwner: this.data.submitter,
})
// 审批流程结束贴一个结束节点
if (this.data.procState === 2) {
this.data.steps.unshift({
state: this.data.procState,
createTime: this.data.finishTime,
completeTime: this.data.finishTime,
result: -2,
})
this.data = []
for (let i = res.length - 1; i >= 0; --i) {
const o = res[i]
this.data = this.data.concat(formatTrack(o))
}
// 否则从当前节点切断,
else {
for (let i = 0; i < this.data.steps.length - 1; ++i) {
if (this.data.steps[i].state === 1 && this.data.steps[i + 1].state === 2) {
this.data.steps = this.data.steps.slice(i)
break
}
// 去掉中间的审批结束节点
for (let i = 1; i < this.data.length; ++i) {
if (this.data[i].result == -2) {
this.data.splice(i, 1)
;--i
}
}
})
......
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