claim.vue 6.0 KB

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