index.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  1. <template>
  2. <div class="ele-body">
  3. <el-card shadow="never">
  4. <div class="filter-container">
  5. <el-form
  6. label-width="100px"
  7. class="ele-form-search"
  8. @keyup.enter.native="reload"
  9. @submit.native.prevent
  10. >
  11. <el-row :gutter="15">
  12. <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
  13. <el-form-item label="流程名:" prop="name">
  14. <el-input clearable v-model.trim="params.name"></el-input>
  15. </el-form-item>
  16. </el-col>
  17. <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
  18. <el-form-item label="结果:" prop="result">
  19. <!-- <el-select
  20. v-model="params.status"
  21. placeholder="请选择状态"
  22. clearable
  23. >
  24. <el-option
  25. v-for="dict in statusList"
  26. :key="dict.value"
  27. :label="dict.label"
  28. :value="dict.value"
  29. />
  30. </el-select> -->
  31. <DictSelection
  32. dictName="流程实例的结果"
  33. clearable
  34. v-model="params.result"
  35. >
  36. </DictSelection>
  37. </el-form-item>
  38. </el-col>
  39. <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
  40. <el-form-item label="创建时间:" prop="createTime">
  41. <el-date-picker
  42. v-model="params.createTime"
  43. style="width: 100%"
  44. value-format="yyyy-MM-dd HH:mm:ss"
  45. type="daterange"
  46. range-separator="-"
  47. start-placeholder="开始日期"
  48. end-placeholder="结束日期"
  49. :default-time="['00:00:00', '23:59:59']"
  50. />
  51. </el-form-item>
  52. </el-col>
  53. <el-col style="display: flex;justify-content: flex-end" v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
  54. <div class="ele-form-actions">
  55. <el-button
  56. type="primary"
  57. icon="el-icon-search"
  58. class="ele-btn-icon"
  59. @click="reload"
  60. >
  61. 查询
  62. </el-button>
  63. <el-button @click="reset">重置</el-button>
  64. </div>
  65. </el-col>
  66. </el-row>
  67. </el-form>
  68. </div>
  69. <ele-pro-table
  70. ref="table"
  71. :columns="columns"
  72. :datasource="datasource"
  73. cache-key="systemRoleTable5"
  74. >
  75. <template v-slot:result="{ row }">
  76. <el-tag size="medium" :type="getTimelineItemType(getDictValue('流程实例的结果', row.result))"> {{getDictValue('流程实例的结果', row.result)}} </el-tag>
  77. </template>
  78. <template v-slot:durationInMillis="{ row }">
  79. {{getDateTime(row.durationInMillis)}}
  80. </template>
  81. <template v-slot:name="{ row }">
  82. <el-link type="primary" :underline="false" @click="handleAudit(row)">
  83. {{ row.name }}</el-link
  84. >
  85. </template>
  86. <!-- 操作列 -->
  87. <template v-slot:action="{ row }">
  88. <el-button
  89. size="mini"
  90. type="text"
  91. icon="el-icon-edit"
  92. @click="handleAudit(row)"
  93. >详情</el-button
  94. >
  95. </template>
  96. </ele-pro-table>
  97. </el-card>
  98. <detail ref="detailRef"></detail>
  99. </div>
  100. </template>
  101. <script>
  102. import dictMixins from '@/mixins/dictMixins';
  103. import { getDoneTaskPage } from '@/api/bpm/task';
  104. import {getDate} from "@/utils/dateUtils";
  105. import detail from './detailDialog.vue';
  106. // 默认表单数据
  107. const defaultParams = {
  108. status: '',
  109. name: ''
  110. };
  111. export default {
  112. name: 'BpmDoneTask',
  113. components: {detail},
  114. mixins: [dictMixins],
  115. data() {
  116. return {
  117. // 遮罩层
  118. loading: true,
  119. params: { ...defaultParams },
  120. statusList: [],
  121. columns: [
  122. {
  123. columnKey: 'index',
  124. label: '序号',
  125. type: 'index',
  126. width: 55,
  127. align: 'center',
  128. showOverflowTooltip: true,
  129. fixed: 'left'
  130. },
  131. {
  132. prop: 'processInstance.processTypeName',
  133. label: '流程分类',
  134. align: 'center',
  135. showOverflowTooltip: true,
  136. minWidth: 150
  137. },
  138. {
  139. prop: 'processInstance.name',
  140. label: '流程名称',
  141. align: 'center',
  142. showOverflowTooltip: true,
  143. minWidth: 150
  144. },
  145. {
  146. prop: 'name',
  147. slot: 'name',
  148. label: '任务名称',
  149. align: 'center',
  150. showOverflowTooltip: true,
  151. minWidth: 150
  152. },
  153. {
  154. prop: 'businessCode',
  155. label: '单据编码',
  156. align: 'center',
  157. showOverflowTooltip: true,
  158. minWidth: 120
  159. },
  160. {
  161. prop: 'processInstance.startUserNickname',
  162. label: '流程发起人',
  163. align: 'center',
  164. showOverflowTooltip: true,
  165. minWidth: 120
  166. },
  167. {
  168. prop: 'result',
  169. slot: 'result',
  170. label: '结果',
  171. align: 'center',
  172. showOverflowTooltip: true,
  173. minWidth: 100
  174. },
  175. {
  176. prop: 'reason',
  177. label: '审批意见',
  178. align: 'center',
  179. showOverflowTooltip: true,
  180. minWidth: 200
  181. },
  182. {
  183. prop: 'createTime',
  184. label: '创建时间',
  185. align: 'center',
  186. showOverflowTooltip: true,
  187. minWidth: 180
  188. },
  189. {
  190. prop: 'endTime',
  191. label: '审批时间',
  192. align: 'center',
  193. showOverflowTooltip: true,
  194. minWidth: 180
  195. },
  196. {
  197. prop: 'durationInMillis',
  198. slot: 'durationInMillis',
  199. label: '耗时',
  200. align: 'center',
  201. showOverflowTooltip: true,
  202. minWidth: 130
  203. },
  204. // {
  205. // columnKey: 'action',
  206. // label: '操作',
  207. // width: 230,
  208. // align: 'center',
  209. // resizable: false,
  210. // slot: 'action',
  211. // showOverflowTooltip: true,
  212. // fixed: 'right'
  213. // }
  214. ]
  215. };
  216. },
  217. computed: {
  218. // 是否开启响应式布局
  219. styleResponsive() {
  220. return this.$store.state.theme.styleResponsive;
  221. }
  222. },
  223. created() {},
  224. methods: {
  225. /* 表格数据源 */
  226. datasource({ page, limit, where, order }) {
  227. return getDoneTaskPage({
  228. pageNo: page,
  229. pageSize: limit,
  230. ...this.params
  231. });
  232. },
  233. /* 刷新表格 */
  234. reload(where) {
  235. this.$refs.table.reload({ page: 1, where });
  236. },
  237. /* 重置 */
  238. reset() {
  239. this.params = { ...defaultParams };
  240. this.reload();
  241. },
  242. /** 处理审批按钮 */
  243. handleAudit(row) {
  244. this.$refs.detailRef.open(row);
  245. },
  246. getTimelineItemType(result) {
  247. if (result === '通过') {
  248. return 'success';
  249. }
  250. if (result === '不通过') {
  251. return 'danger';
  252. }
  253. if (result === '取消') {
  254. return 'info';
  255. }
  256. if (result === '处理中') {
  257. return 'warning';
  258. }
  259. return '';
  260. },
  261. getDateTime(ms){
  262. return getDate(ms)
  263. }
  264. }
  265. };
  266. </script>