todo.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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" />
  21. <el-table-column label="任务名称" align="center" prop="name" />
  22. <el-table-column label="所属流程" align="center" prop="processInstance.name" />
  23. <el-table-column label="流程发起人" align="center" prop="processInstance.startUserNickname" />
  24. <el-table-column label="创建时间" align="center" prop="createTime" width="180">
  25. <template v-slot="scope">
  26. <span>{{ parseTime(scope.row.createTime) }}</span>
  27. </template>
  28. </el-table-column>
  29. <el-table-column label="状态" align="center" prop="version" width="80">
  30. <template v-slot="scope">
  31. <el-tag type="success" v-if="scope.row.suspensionState === 1">激活</el-tag>
  32. <el-tag type="warning" v-if="scope.row.suspensionState === 2">挂起</el-tag>
  33. </template>
  34. </el-table-column>
  35. <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  36. <template v-slot="scope">
  37. <el-button size="mini" type="text" icon="el-icon-edit" @click="handleAudit(scope.row)"
  38. v-hasPermi="['bpm:task:update']">审批</el-button>
  39. </template>
  40. </el-table-column>
  41. </el-table>
  42. <!-- 分页组件 -->
  43. <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
  44. @pagination="getList"/>
  45. </div>
  46. </template>
  47. <script>
  48. import {getTodoTaskPage} from '@/api/bpm/task'
  49. export default {
  50. name: "BpmTodoTask",
  51. components: {
  52. },
  53. data() {
  54. return {
  55. // 遮罩层
  56. loading: true,
  57. // 显示搜索条件
  58. showSearch: true,
  59. // 总条数
  60. total: 0,
  61. // 待办任务列表
  62. list: [],
  63. // 查询参数
  64. queryParams: {
  65. pageNo: 1,
  66. pageSize: 10,
  67. name: null,
  68. createTime: []
  69. },
  70. };
  71. },
  72. created() {
  73. this.getList();
  74. },
  75. methods: {
  76. /** 查询列表 */
  77. getList() {
  78. this.loading = true;
  79. // 处理查询参数
  80. getTodoTaskPage(this.queryParams).then(response => {
  81. this.list = response.data.list;
  82. this.total = response.data.total;
  83. this.loading = false;
  84. });
  85. },
  86. /** 搜索按钮操作 */
  87. handleQuery() {
  88. this.queryParams.pageNo = 1;
  89. this.getList();
  90. },
  91. /** 重置按钮操作 */
  92. resetQuery() {
  93. this.resetForm("queryForm");
  94. this.handleQuery();
  95. },
  96. /** 处理审批按钮 */
  97. handleAudit(row) {
  98. this.$router.push({ name: "BpmProcessInstanceDetail", query: { id: row.processInstance.id}});
  99. },
  100. }
  101. };
  102. </script>