index.vue 9.0 KB

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