schangxiang@126.com
2024-08-16 65bd2dc1d4c1fb136af853c7ede93a338431be29
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<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" />
    <a-skeleton :active="true" :loading="loading" :paragraph="true" :title="true" />
    <k-form-build v-show="loading == false" ref="kfb" :value="jsonData" :disabled="true"/>
    <a-form-model v-show="loading == false" :model="form" :label-col="labelCol" :wrapper-col="wrapperCol">
      <a-form-model-item label="处理">
        <a-radio-group v-model="form.resource">
          <a-radio :value="true" :checked="true">
            同意
          </a-radio>
          <a-radio :value="false">
            不同意
          </a-radio>
        </a-radio-group>
      </a-form-model-item>
      <a-form-model-item label="备注">
        <a-textarea v-model="form.reMark" />
      </a-form-model-item>
    </a-form-model>
    <div
      :style="{
        position: 'absolute',
        right: 0,
        bottom: 0,
        width: '100%',
        borderTop: '1px solid #e9e9e9',
        padding: '10px 16px',
        background: '#fff',
        textAlign: 'right',
        zIndex: 1,
      }"
    >
      <a-button :style="{ marginRight: '8px' }" @click="onClose">
        取消
      </a-button>
      <a-button type="primary" @click="submit()">
        提交
      </a-button>
    </div>
    <time v-show="loading == false" v-for="item in stepAuditor" :key="item.auditorName">
      <a-timeline-item :color="setColor(item.status)">
        <p>{{ item.auditorTime }}</p>
        <p>{{ item.auditorName }}</p>
        <p>{{ 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, auditorWorkflow } from '@/api/modular/system/auditorworkflowManage'
import { Timeline } from 'ant-design-vue'
export default {
  name: 'AuditorOpera',
  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 => {
        this.stepAuditor = res.data
      })
    },
    setColor(status) {
      if (status === 0) {
        return 'red'
      } else if (status === 1) {
        return 'green'
      } else if (status === 2) {
        return 'orange'
      }
    },
    submit() {
      var data = {
        executionPointerId: this.executionPointerId,
        status: this.form.resource === true ? 1 : 0,
        Remark: this.form.reMark
      }
      auditorWorkflow(Object.assign(data)).then(res => {
        console.log(res)
      })
    },
    onClose() {
      this.visible = false
      this.form.reMark = ''
      this.form.resource = true
      this.loading = true
    }
  }
}
</script>
 
<style>
 
</style>