index.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <!--
  2. * @FilePath: index.vue
  3. * @Author: 旭颖
  4. * @Date: 2022-12-13 11:41:05
  5. * @LastEditors: king
  6. * @LastEditTime: 2023-02-08 15:16:23
  7. -->
  8. <template>
  9. <el-drawer
  10. v-model="dialogFormVisible"
  11. :append-to-body="true"
  12. :before-close="close"
  13. class="drawer"
  14. direction="rtl"
  15. size="600"
  16. title="审核进度"
  17. >
  18. <el-timeline>
  19. <el-timeline-item
  20. v-for="(item, index) in progress"
  21. :key="index"
  22. :hide-timestamp="flow_nodes[index].type == 6"
  23. placement="top"
  24. :timestamp="
  25. flow_nodes[index].type == 6 ? '' : '第' + item.node_num + '步'
  26. "
  27. :type="
  28. flow_nodes[index].type == 6
  29. ? ''
  30. : item.check_status == 3 && item.check_status
  31. ? 'danger'
  32. : 'success'
  33. "
  34. >
  35. <el-card v-if="flow_nodes[index].type != 6">
  36. <h4>{{ flow_nodes[index].name }}</h4>
  37. <div v-if="flow_nodes[index].type == 1">
  38. <div class="text">
  39. <div class="label">提交时间</div>
  40. <div>{{ item.check_time }}</div>
  41. </div>
  42. </div>
  43. <div v-if="flow_nodes[index].type == 2">
  44. <div class="name text">
  45. <div class="label">审核人:</div>
  46. <div>
  47. {{ item.check_admin ? item.check_admin.name : '--' }}
  48. </div>
  49. </div>
  50. <div class="text">
  51. <div class="label">审核时间:</div>
  52. <div>{{ item.check_time }}</div>
  53. </div>
  54. <div class="text">
  55. <div class="label">审核状态:</div>
  56. <div>
  57. <el-tag v-if="item.check_status == 2" type="success">
  58. 审核成功
  59. </el-tag>
  60. </div>
  61. <div>
  62. <el-tag v-if="item.check_status == 3" type="danger">
  63. 审核失败
  64. </el-tag>
  65. </div>
  66. <div>
  67. <el-tag v-if="item.check_status == 1" type="info">
  68. 待审核
  69. </el-tag>
  70. </div>
  71. </div>
  72. <div class="text">
  73. <div class="label">审核备注:</div>
  74. <div style="color: red">
  75. {{ item.remark != '' ? item.remark : '--' }}
  76. </div>
  77. </div>
  78. </div>
  79. </el-card>
  80. </el-timeline-item>
  81. </el-timeline>
  82. <template #footer>
  83. <el-button @click="close">取 消</el-button>
  84. </template>
  85. </el-drawer>
  86. </template>
  87. <script>
  88. import { upLoad } from './api/index'
  89. export default defineComponent({
  90. name: 'RoleManagementEdit',
  91. setup() {
  92. const state = reactive({
  93. formRef: null,
  94. title: '',
  95. dialogFormVisible: false,
  96. form: { model_id: '', flow_code: '' },
  97. progress: [],
  98. flow_nodes: [],
  99. })
  100. const showEdit = (row) => {
  101. state.form.model_id = row.id
  102. state.form.flow_code = row.code
  103. fetchData()
  104. state.dialogFormVisible = true
  105. }
  106. //列表数据
  107. const fetchData = async () => {
  108. state.listLoading = true
  109. const { data } = await upLoad(state.form)
  110. console.log(data)
  111. const progress = data.progress
  112. state.progress = progress.reverse()
  113. state.flow_nodes = data.apply.flow_nodes
  114. state.listLoading = false
  115. }
  116. const close = () => {
  117. state.dialogFormVisible = false
  118. }
  119. onMounted(() => {})
  120. return {
  121. ...toRefs(state),
  122. showEdit,
  123. fetchData,
  124. close,
  125. }
  126. },
  127. })
  128. </script>
  129. <style lang="scss" scoped>
  130. .text {
  131. display: flex;
  132. line-height: 28px;
  133. .label {
  134. flex: 0 0 80px;
  135. }
  136. .people {
  137. display: inline-block;
  138. margin-right: 5px;
  139. }
  140. }
  141. </style>