done.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <template>
  2. <basic-container>
  3. <avue-crud :option="option"
  4. :data="data"
  5. ref="crud"
  6. v-model="form"
  7. :page="page"
  8. @search-change="searchChange"
  9. @search-reset="searchReset"
  10. @selection-change="selectionChange"
  11. @current-change="currentChange"
  12. @size-change="sizeChange"
  13. @on-load="onLoad">
  14. <template slot-scope="scope" slot="menu">
  15. <el-button type="text"
  16. size="small"
  17. v-if="permission.work_done_detail"
  18. plain
  19. class="none-border"
  20. @click.stop="handleDetail(scope.row)">详情
  21. </el-button>
  22. <el-button type="text"
  23. size="small"
  24. v-if="permission.work_done_follow"
  25. plain
  26. class="none-border"
  27. @click.stop="handleImage(scope.row,scope.index)">跟踪
  28. </el-button>
  29. </template>
  30. <template slot-scope="{row}"
  31. slot="processDefinitionVersion">
  32. <el-tag>v{{row.processDefinitionVersion}}</el-tag>
  33. </template>
  34. </avue-crud>
  35. <el-dialog title="流程图"
  36. :visible.sync="flowBox"
  37. :fullscreen="true">
  38. <iframe
  39. :src=flowUrl
  40. width="100%"
  41. height="700"
  42. title="流程图"
  43. frameBorder="no"
  44. border="0"
  45. marginWidth="0"
  46. marginHeight="0"
  47. scrolling="no"
  48. allowTransparency="yes">
  49. </iframe>
  50. <span slot="footer"
  51. class="dialog-footer">
  52. <el-button @click="flowBox = false">关 闭</el-button>
  53. </span>
  54. </el-dialog>
  55. </basic-container>
  56. </template>
  57. <script>
  58. import {mapGetters} from "vuex";
  59. import {doneList} from "@/api/work/work";
  60. import {flowCategory, flowRoute} from "@/util/flow";
  61. export default {
  62. data() {
  63. return {
  64. form: {},
  65. selectionId: '',
  66. selectionList: [],
  67. query: {},
  68. page: {
  69. pageSize: 10,
  70. currentPage: 1,
  71. total: 0
  72. },
  73. flowBox: false,
  74. flowUrl: '',
  75. workBox: false,
  76. option: {
  77. tip: false,
  78. border: true,
  79. index: true,
  80. selection: true,
  81. editBtn: false,
  82. addBtn: false,
  83. viewBtn: false,
  84. delBtn: false,
  85. dialogWidth: 300,
  86. dialogHeight: 400,
  87. menuWidth: 150,
  88. column: [
  89. {
  90. label: "流程分类",
  91. type: "select",
  92. row: true,
  93. dicUrl: "/api/blade-system/dict/dictionary?code=flow",
  94. props: {
  95. label: "dictValue",
  96. value: "dictKey"
  97. },
  98. slot: true,
  99. prop: "category",
  100. search: true,
  101. hide: true,
  102. width: 100,
  103. },
  104. {
  105. label: '流程名称',
  106. prop: 'processDefinitionName',
  107. },
  108. {
  109. label: '当前步骤',
  110. prop: 'taskName',
  111. },
  112. {
  113. label: '流程版本',
  114. prop: 'processDefinitionVersion',
  115. slot: true,
  116. width: 80,
  117. },
  118. {
  119. label: '申请时间',
  120. prop: 'createTime',
  121. width: 165,
  122. },
  123. ]
  124. },
  125. data: []
  126. };
  127. },
  128. computed: {
  129. ...mapGetters(["permission", "flowRoutes"]),
  130. ids() {
  131. let ids = [];
  132. this.selectionList.forEach(ele => {
  133. ids.push(ele.id);
  134. });
  135. return ids.join(",");
  136. },
  137. },
  138. methods: {
  139. searchReset() {
  140. this.query = {};
  141. this.onLoad(this.page);
  142. },
  143. searchChange(params) {
  144. this.query = params;
  145. this.onLoad(this.page, params);
  146. },
  147. selectionChange(list) {
  148. this.selectionList = list;
  149. },
  150. handleDetail(row) {
  151. this.$router.push({path: `/work/process/${flowRoute(this.flowRoutes, row.category)}/detail/${row.processInstanceId}/${row.businessId}`});
  152. },
  153. handleImage(row) {
  154. this.flowUrl = `/api/blade-flow/process/diagram-view?processInstanceId=${row.processInstanceId}`;
  155. this.flowBox = true;
  156. },
  157. currentChange(currentPage){
  158. this.page.currentPage = currentPage;
  159. },
  160. sizeChange(pageSize){
  161. this.page.pageSize = pageSize;
  162. },
  163. onLoad(page, params = {}) {
  164. const values = {
  165. ...params,
  166. category: (params.category) ? flowCategory(params.category) : null
  167. }
  168. doneList(page.currentPage, page.pageSize, Object.assign(values, this.query)).then(res => {
  169. const data = res.data.data;
  170. this.page.total = data.total;
  171. this.data = data.records;
  172. });
  173. }
  174. }
  175. };
  176. </script>
  177. <style>
  178. .none-border {
  179. border: 0;
  180. background-color: transparent !important;
  181. }
  182. </style>