done.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <template>
  2. <div class="app-container">
  3. <doc-alert title="工作流" url="https://doc.iocoder.cn/bpm" />
  4. <!-- 搜索工作栏 -->
  5. <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
  6. <el-form-item label="流程名" prop="name">
  7. <el-input v-model="queryParams.name" placeholder="请输入流程名" clearable @keyup.enter.native="handleQuery"/>
  8. </el-form-item>
  9. <el-form-item label="创建时间" prop="createTime">
  10. <el-date-picker v-model="queryParams.createTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" type="daterange"
  11. range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" />
  12. </el-form-item>
  13. <el-form-item>
  14. <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
  15. <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
  16. </el-form-item>
  17. </el-form>
  18. <!-- 列表 -->
  19. <el-table v-loading="loading" :data="list">
  20. <el-table-column label="任务编号" align="center" prop="id" width="320" fixed />
  21. <el-table-column label="任务名称" align="center" prop="name" width="200" />
  22. <el-table-column label="所属流程" align="center" prop="processInstance.name" width="200" />
  23. <el-table-column label="流程发起人" align="center" prop="processInstance.startUserNickname" width="120" />
  24. <el-table-column label="结果" align="center" prop="result">
  25. <template v-slot="scope">
  26. <dict-tag :type="DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT" :value="scope.row.result"/>
  27. </template>
  28. </el-table-column>
  29. <el-table-column label="审批意见" align="center" prop="reason" width="200" />
  30. <el-table-column label="创建时间" align="center" prop="createTime" width="180">
  31. <template v-slot="scope">
  32. <span>{{ parseTime(scope.row.createTime) }}</span>
  33. </template>
  34. </el-table-column>
  35. <el-table-column label="审批时间" align="center" prop="endTime" width="180">
  36. <template v-slot="scope">
  37. <span>{{ parseTime(scope.row.endTime) }}</span>
  38. </template>
  39. </el-table-column>
  40. <el-table-column label="耗时" align="center" prop="durationInMillis" width="180">
  41. <template v-slot="scope">
  42. <span>{{ getDateStar(scope.row.durationInMillis) }}</span>
  43. </template>
  44. </el-table-column>
  45. <el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
  46. <template v-slot="scope">
  47. <el-button size="mini" type="text" icon="el-icon-edit" @click="handleAudit(scope.row)"
  48. v-hasPermi="['bpm:task:query']">详情</el-button>
  49. </template>
  50. </el-table-column>
  51. </el-table>
  52. <!-- 分页组件 -->
  53. <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
  54. @pagination="getList"/>
  55. </div>
  56. </template>
  57. <script>
  58. import {getDoneTaskPage} from '@/api/bpm/task'
  59. import {getDate} from "@/utils/dateUtils";
  60. export default {
  61. name: "BpmDoneTask",
  62. components: {
  63. },
  64. data() {
  65. return {
  66. // 遮罩层
  67. loading: true,
  68. // 显示搜索条件
  69. showSearch: true,
  70. // 总条数
  71. total: 0,
  72. // 已办任务列表
  73. list: [],
  74. // 查询参数
  75. queryParams: {
  76. pageNo: 1,
  77. pageSize: 10,
  78. name: null,
  79. createTime: []
  80. },
  81. };
  82. },
  83. created() {
  84. this.getList();
  85. },
  86. methods: {
  87. /** 查询列表 */
  88. getList() {
  89. this.loading = true;
  90. getDoneTaskPage(this.queryParams).then(response => {
  91. this.list = response.data.list;
  92. this.total = response.data.total;
  93. this.loading = false;
  94. });
  95. },
  96. /** 搜索按钮操作 */
  97. handleQuery() {
  98. this.queryParams.pageNo = 1;
  99. this.getList();
  100. },
  101. /** 重置按钮操作 */
  102. resetQuery() {
  103. this.resetForm("queryForm");
  104. this.handleQuery();
  105. },
  106. getDateStar(ms) {
  107. return getDate(ms);
  108. },
  109. /** 处理审批按钮 */
  110. handleAudit(row) {
  111. this.$router.push({ name: "BpmProcessInstanceDetail", query: { id: row.processInstance.id}});
  112. },
  113. }
  114. };
  115. </script>