send.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  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. @on-load="onLoad">
  12. <template slot-scope="scope" slot="menu">
  13. <el-button type="text"
  14. size="small"
  15. v-if="permission.work_send_detail"
  16. plain
  17. class="none-border"
  18. @click.stop="handleDetail(scope.row)">详情
  19. </el-button>
  20. <el-button type="text"
  21. size="small"
  22. v-if="permission.work_send_follow"
  23. plain
  24. class="none-border"
  25. @click.stop="handleImage(scope.row,scope.index)">跟踪
  26. </el-button>
  27. </template>
  28. <template slot-scope="{row}"
  29. slot="processDefinitionVersion">
  30. <el-tag>v{{row.processDefinitionVersion}}</el-tag>
  31. </template>
  32. <template slot-scope="{row}"
  33. slot="processIsFinished">
  34. <el-tag>{{row.processIsFinished==='finished' ? '已完成' : '未完成'}}</el-tag>
  35. </template>
  36. </avue-crud>
  37. <el-dialog title="流程图"
  38. :visible.sync="flowBox"
  39. :fullscreen="true">
  40. <iframe
  41. :src=flowUrl
  42. width="100%"
  43. height="700"
  44. title="流程图"
  45. frameBorder="no"
  46. border="0"
  47. marginWidth="0"
  48. marginHeight="0"
  49. scrolling="no"
  50. allowTransparency="yes">
  51. </iframe>
  52. <span slot="footer"
  53. class="dialog-footer">
  54. <el-button @click="flowBox = false">关 闭</el-button>
  55. </span>
  56. </el-dialog>
  57. </basic-container>
  58. </template>
  59. <script>
  60. import {mapGetters} from "vuex";
  61. import {sendList} from "@/api/work/work";
  62. import {flowCategory,flowRoute} from "@/util/flow";
  63. export default {
  64. data() {
  65. return {
  66. form: {},
  67. selectionId: '',
  68. selectionList: [],
  69. page: {
  70. pageSize: 10,
  71. currentPage: 1,
  72. total: 0
  73. },
  74. flowBox: false,
  75. flowUrl: '',
  76. workBox: false,
  77. option: {
  78. tip: false,
  79. border: true,
  80. index: true,
  81. selection: true,
  82. editBtn: false,
  83. addBtn: false,
  84. viewBtn: false,
  85. delBtn: false,
  86. dialogWidth: 300,
  87. dialogHeight: 400,
  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. },
  103. {
  104. label: '流程名称',
  105. prop: 'processDefinitionName',
  106. },
  107. {
  108. label: '当前步骤',
  109. prop: 'taskName',
  110. },
  111. {
  112. label: '流程版本',
  113. prop: 'processDefinitionVersion',
  114. slot: true,
  115. },
  116. {
  117. label: '流程进度',
  118. prop: 'processIsFinished',
  119. slot: true,
  120. },
  121. {
  122. label: '申请时间',
  123. prop: 'createTime',
  124. },
  125. ]
  126. },
  127. data: []
  128. };
  129. },
  130. computed: {
  131. ...mapGetters(["permission", "flowRoutes"]),
  132. ids() {
  133. let ids = [];
  134. this.selectionList.forEach(ele => {
  135. ids.push(ele.id);
  136. });
  137. return ids.join(",");
  138. },
  139. },
  140. methods: {
  141. searchReset() {
  142. this.onLoad(this.page);
  143. },
  144. searchChange(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. onLoad(page, params = {}) {
  158. const values = {
  159. ...params,
  160. category: (params.category) ? flowCategory(params.category) : null
  161. }
  162. sendList(page.currentPage, page.pageSize, values).then(res => {
  163. const data = res.data.data;
  164. this.page.total = data.total;
  165. this.data = data.records;
  166. });
  167. }
  168. }
  169. };
  170. </script>
  171. <style>
  172. .none-border {
  173. border: 0;
  174. background-color: transparent !important;
  175. }
  176. </style>