claim.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  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_claim_sign"
  16. plain
  17. class="none-border"
  18. @click.stop="handleClaim(scope.row)">签收
  19. </el-button>
  20. <el-button type="text"
  21. size="small"
  22. v-if="permission.work_claim_detail"
  23. plain
  24. class="none-border"
  25. @click.stop="handleDetail(scope.row)">详情
  26. </el-button>
  27. <el-button type="text"
  28. size="small"
  29. v-if="permission.work_claim_follow"
  30. plain
  31. class="none-border"
  32. @click.stop="handleImage(scope.row,scope.index)">跟踪
  33. </el-button>
  34. </template>
  35. <template slot-scope="{row}"
  36. slot="processDefinitionVersion">
  37. <el-tag>v{{row.processDefinitionVersion}}</el-tag>
  38. </template>
  39. </avue-crud>
  40. <el-dialog title="流程图"
  41. :visible.sync="flowBox"
  42. fullscreen=true>
  43. <iframe
  44. :src=flowUrl
  45. width="100%"
  46. height="700"
  47. title="流程图"
  48. frameBorder="no"
  49. border="0"
  50. marginWidth="0"
  51. marginHeight="0"
  52. scrolling="no"
  53. allowTransparency="yes">
  54. </iframe>
  55. <span slot="footer"
  56. class="dialog-footer">
  57. <el-button @click="flowBox = false">关 闭</el-button>
  58. </span>
  59. </el-dialog>
  60. </basic-container>
  61. </template>
  62. <script>
  63. import {mapGetters} from "vuex";
  64. import {claimList} from "@/api/work/work";
  65. import {getFlowRoute} from "@/util/func";
  66. export default {
  67. data() {
  68. return {
  69. form: {},
  70. selectionId: '',
  71. selectionList: [],
  72. page: {
  73. pageSize: 10,
  74. currentPage: 1,
  75. total: 0
  76. },
  77. flowBox: false,
  78. flowUrl: '',
  79. workBox: false,
  80. option: {
  81. tip: false,
  82. border: true,
  83. index: true,
  84. selection: true,
  85. editBtn: false,
  86. addBtn: false,
  87. viewBtn: false,
  88. delBtn: false,
  89. dialogWidth: 300,
  90. dialogHeight: 400,
  91. column: [
  92. {
  93. label: "流程分类",
  94. type: "select",
  95. row: true,
  96. dicUrl: "/api/blade-system/dict/dictionary?code=flow",
  97. props: {
  98. label: "dictValue",
  99. value: "dictKey"
  100. },
  101. slot: true,
  102. prop: "category",
  103. search: true,
  104. hide: true,
  105. },
  106. {
  107. label: '流程名称',
  108. prop: 'processDefinitionName',
  109. },
  110. {
  111. label: '当前步骤',
  112. prop: 'taskName',
  113. },
  114. {
  115. label: '流程版本',
  116. prop: 'processDefinitionVersion',
  117. slot: true,
  118. },
  119. {
  120. label: '申请时间',
  121. prop: 'createTime',
  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.onLoad(this.page);
  141. },
  142. searchChange(params) {
  143. this.onLoad(this.page, params);
  144. },
  145. selectionChange(list) {
  146. this.selectionList = list;
  147. },
  148. handleClaim(row) {
  149. },
  150. handleDetail(row) {
  151. this.$router.push({ path: `/work/process/${getFlowRoute(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) ? `flow_${params.category}` : null
  161. }
  162. claimList(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>