claim.vue 6.3 KB

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