done.vue 5.6 KB

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