index.vue 8.2 KB

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