send.vue 6.0 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_send_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_send_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. <template slot-scope="{row}"
  37. slot="processIsFinished">
  38. <el-tag>{{row.processIsFinished==='finished' ? '已完成' : '未完成'}}</el-tag>
  39. </template>
  40. </avue-crud>
  41. <el-dialog title="流程图"
  42. append-to-body
  43. :visible.sync="flowBox"
  44. :fullscreen="true">
  45. <iframe
  46. :src=flowUrl
  47. width="100%"
  48. height="700"
  49. title="流程图"
  50. frameBorder="no"
  51. border="0"
  52. marginWidth="0"
  53. marginHeight="0"
  54. scrolling="no"
  55. allowTransparency="yes">
  56. </iframe>
  57. <span slot="footer"
  58. class="dialog-footer">
  59. <el-button @click="flowBox = false">关 闭</el-button>
  60. </span>
  61. </el-dialog>
  62. </basic-container>
  63. </template>
  64. <script>
  65. import {mapGetters} from "vuex";
  66. import {sendList} from "@/api/work/work";
  67. import {flowCategory,flowRoute} from "@/util/flow";
  68. export default {
  69. data() {
  70. return {
  71. form: {},
  72. selectionId: '',
  73. selectionList: [],
  74. query: {},
  75. loading: true,
  76. page: {
  77. pageSize: 10,
  78. currentPage: 1,
  79. total: 0
  80. },
  81. flowBox: false,
  82. flowUrl: '',
  83. workBox: false,
  84. option: {
  85. height: 'auto',
  86. calcHeight: 30,
  87. tip: false,
  88. searchShow: true,
  89. searchMenuSpan: 12,
  90. border: true,
  91. index: true,
  92. selection: true,
  93. editBtn: false,
  94. addBtn: false,
  95. viewBtn: false,
  96. delBtn: false,
  97. dialogWidth: 900,
  98. menuWidth: 150,
  99. dialogClickModal: false,
  100. column: [
  101. {
  102. label: "流程分类",
  103. type: "select",
  104. row: true,
  105. dicUrl: "/api/blade-system/dict/dictionary?code=flow",
  106. props: {
  107. label: "dictValue",
  108. value: "dictKey"
  109. },
  110. dataType: "number",
  111. slot: true,
  112. prop: "category",
  113. search: true,
  114. hide: true,
  115. width: 100,
  116. },
  117. {
  118. label: '流程名称',
  119. prop: 'processDefinitionName',
  120. search: true,
  121. },
  122. {
  123. label: '当前步骤',
  124. prop: 'taskName',
  125. },
  126. {
  127. label: '流程版本',
  128. prop: 'processDefinitionVersion',
  129. slot: true,
  130. width: 80,
  131. },
  132. {
  133. label: '流程进度',
  134. prop: 'processIsFinished',
  135. slot: true,
  136. width: 80,
  137. },
  138. {
  139. label: '申请时间',
  140. prop: 'createTime',
  141. width: 165,
  142. },
  143. ]
  144. },
  145. data: []
  146. };
  147. },
  148. computed: {
  149. ...mapGetters(["permission", "flowRoutes"]),
  150. ids() {
  151. let ids = [];
  152. this.selectionList.forEach(ele => {
  153. ids.push(ele.id);
  154. });
  155. return ids.join(",");
  156. },
  157. },
  158. methods: {
  159. searchReset() {
  160. this.query = {};
  161. this.onLoad(this.page);
  162. },
  163. searchChange(params, done) {
  164. this.query = params;
  165. this.page.currentPage = 1;
  166. this.onLoad(this.page, params);
  167. done();
  168. },
  169. selectionChange(list) {
  170. this.selectionList = list;
  171. },
  172. selectionClear() {
  173. this.selectionList = [];
  174. this.$refs.crud.toggleSelection();
  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. sendList(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>