todo.vue 6.1 KB

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