ke_junjie
2025-06-04 84620534eb627e95811b971a4b552b6a177829bf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<template>
  <a-drawer
    title="流程审核"
    placement="right"
    width="1000px"
    :maskClosable="true"
    :destroyOnClose="true"
    :closable="true"
    :visible="visible"
    @close="onClose"
  >
    <a-skeleton :active="true" :loading="loading" :paragraph="true" :title="true" />
    <a-skeleton :active="true" :loading="loading" :paragraph="true" :title="true" />
    <k-form-build v-show="loading == false" ref="kfb" :value="jsonData" :disabled="true"/>
    <a-divider>流程路线</a-divider>
    <a-skeleton :active="true" :loading="loading" :paragraph="true" :title="true" />
    <time v-show="loading == false" v-for="item in stepAuditor" :key="item.stepName">
      <a-timeline-item style="margin-left:100px" :color="setColor(item.status)">
        <p class="title">
          <span >{{ item.stepName }}</span>
          <span style="margin-left:10px">{{ item.auditorTime }}</span>
        </p>
        <p v-if="item.auditorName !== ''">{{ item.auditorName }}</p>
        <p v-if="item.auditorName !== ''">{{ item.reMark }}</p>
      </a-timeline-item>
    </time>
  </a-drawer>
</template>
 
<script>
import 'k-form-design/styles/k-form-design.less'
import { formEntityView } from '@/api/modular/system/formDesignmanage'
import { inputsWorkflow } from '@/api/modular/system/workflowManage'
import { getStepAuditor } from '@/api/modular/system/auditorworkflowManage'
import { Timeline } from 'ant-design-vue'
export default {
  name: 'ViewWorkflow',
  components: {
    [Timeline.Item.name]: Timeline.Item
  },
  props: {
 
  },
  data () {
    return {
      visible: false,
      loading: true,
      executionPointerId: null,
      labelCol: { span: 4 },
      wrapperCol: { span: 14 },
      form: {
        reMark: '',
        resource: true
      },
      jsonData: {},
      jsonValue: {},
      stepAuditor: []
    }
  },
  methods: {
    init(id, executionPointerId, formId) {
      this.visible = true
      this.executionPointerId = executionPointerId
      formEntityView(Object.assign({ id: formId })).then(res => {
        this.jsonData = JSON.parse(res.data.formJson) // res.data.nodesList
        inputsWorkflow(Object.assign({ workflowId: id })).then(res => {
          this.loading = false
          this.$refs.kfb.setData(res.data)
        })
      })
      getStepAuditor(Object.assign({ workflowId: id })).then(res => {
        console.log(res)
        this.stepAuditor = res.data
      })
    },
    setColor(status) {
      if (status === 0) {
        return 'red'
      } else if (status === 1) {
        return 'green'
      } else if (status === 2) {
        return 'orange'
      }
    },
    onClose() {
      this.visible = false
      this.form.reMark = ''
      this.form.resource = true
      this.loading = true
    }
  }
}
</script>
 
<style>
.title{
  font-weight: bolder;
}
</style>