done.vue 4.9 KB

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