FlowHisTableCcpm.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <!--文件上传组件-->
  2. <template>
  3. <div>
  4. <!--审批流程-->
  5. <el-divider v-if="showDivider" content-position="left"><i class="el-icon-document"></i> {{dividerName}}</el-divider>
  6. <el-steps :active="3" simple style="margin-top: 10px;margin-bottom: 10px;font-weight: bold;">
  7. <el-step v-for="item in flowChart" :title="item.taskName" ></el-step>
  8. </el-steps>
  9. <vxe-table
  10. border="inner"
  11. show-footer
  12. show-overflow="title"
  13. ref="flowHisTable"
  14. class="vxe-table-element"
  15. :data="histoicFlowList"
  16. :loading="loading"
  17. >
  18. <vxe-table-column min-width="80" align="center" field="taskName" title="审批环节" >
  19. <template #default="scope">
  20. <span v-if="commonJS.isNotEmpty(scope.row.durationTime)" style="color:#409EFF">{{scope.row.taskName}}</span>
  21. <span v-else-if="commonJS.isEmpty(scope.row.durationTime) && commonJS.isNotEmpty(scope.row.beginDate)" style="color:#F56C6C">{{scope.row.taskName}}</span>
  22. <span v-else >{{scope.row.taskName}}</span>
  23. </template>
  24. </vxe-table-column>
  25. <vxe-table-column min-width="80" align="center" field="roleName" title="审批角色" ></vxe-table-column>
  26. <vxe-table-column min-width="80" align="center" field="assigneeName" title="审批人" ></vxe-table-column>
  27. <vxe-table-column min-width="80" align="center" field="beginDate" title="开始时间" ></vxe-table-column>
  28. <vxe-table-column min-width="80" align="center" field="endDate" title="结束时间" ></vxe-table-column>
  29. <vxe-table-column min-width="80" align="center" field="comment" title="提交意见" ></vxe-table-column>
  30. <vxe-table-column min-width="80" align="center" field="durationTime" title="任务历时" ></vxe-table-column>
  31. </vxe-table>
  32. </div>
  33. </template>
  34. <script>
  35. export default {
  36. data () {
  37. return {
  38. dividerName: '',
  39. loading: false,
  40. histoicFlowList: [],
  41. flowChart: [],
  42. showDivider: true
  43. }
  44. },
  45. watch: {
  46. },
  47. created () {
  48. },
  49. components: {
  50. },
  51. mounted () {
  52. },
  53. methods: {
  54. /**
  55. * dividerName: 组件中divider的名称赋值
  56. * showDivider: 组件中divider是否展示
  57. * 注:值为空时,默认值为true 展示
  58. * showDivider=false时 Divider隐藏
  59. **/
  60. setDividerName (dividerName, showDivider) {
  61. this.showDivider = true
  62. if (this.commonJS.isNotEmpty(showDivider)) {
  63. if (showDivider === false) {
  64. this.showDivider = false
  65. }
  66. }
  67. this.dividerName = '审批流程'
  68. if (this.commonJS.isNotEmpty(dividerName)) {
  69. this.dividerName = dividerName
  70. }
  71. },
  72. /**
  73. * 组件初始化
  74. * @param flowChart 流程流向图
  75. * @param histoicFlowList 流程历史
  76. * @param dividerName 组件中divider的名称 默认为'审批流程'
  77. * @param showDivider 组件中divider是否展示 默认值为true 展示
  78. */
  79. setFlowHis (flowChart, histoicFlowList, dividerName, showDivider) {
  80. this.histoicFlowList = []
  81. if (this.commonJS.isNotEmpty(histoicFlowList)) {
  82. this.histoicFlowList = histoicFlowList
  83. }
  84. this.flowChart = []
  85. if (this.commonJS.isNotEmpty(flowChart)) {
  86. this.flowChart = flowChart
  87. }
  88. this.dividerName = '审批流程'
  89. if (this.commonJS.isNotEmpty(dividerName)) {
  90. this.dividerName = dividerName
  91. }
  92. this.showDivider = true
  93. if (this.commonJS.isNotEmpty(showDivider)) {
  94. if (showDivider === false) {
  95. this.showDivider = false
  96. }
  97. }
  98. },
  99. /**
  100. * 关闭时清除组件中的数据
  101. */
  102. clearFlowHis () {
  103. this.histoicFlowList = []
  104. this.flowChart = []
  105. },
  106. // 开启/关闭页面的加载中状态
  107. changeLoading (loading) {
  108. this.loading = false
  109. if (this.commonJS.isNotEmpty(loading)) {
  110. this.loading = loading
  111. }
  112. }
  113. }
  114. }
  115. </script>
  116. <style scoped>
  117. .el-divider__text {
  118. font-size: 16px;
  119. font-weight: bold;
  120. }
  121. </style>